diff --git a/dist/README.md b/dist/README.md index d40c2964fc9..c284eb29c1c 100644 --- a/dist/README.md +++ b/dist/README.md @@ -46,9 +46,9 @@ The main plotly.js bundles weight in at: | 8.4 MB | 3.5 MB | 1 MB | 8.7 MB | #### CDN links -> https://cdn.plot.ly/plotly-2.16.4.js +> https://cdn.plot.ly/plotly-2.16.5.js -> https://cdn.plot.ly/plotly-2.16.4.min.js +> https://cdn.plot.ly/plotly-2.16.5.min.js #### npm packages @@ -94,9 +94,9 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`. | 2.8 MB | 1004.6 kB | 326.8 kB | #### CDN links -> https://cdn.plot.ly/plotly-basic-2.16.4.js +> https://cdn.plot.ly/plotly-basic-2.16.5.js -> https://cdn.plot.ly/plotly-basic-2.16.4.min.js +> https://cdn.plot.ly/plotly-basic-2.16.5.min.js #### npm packages @@ -117,9 +117,9 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, ` | 3.4 MB | 1.2 MB | 400.1 kB | #### CDN links -> https://cdn.plot.ly/plotly-cartesian-2.16.4.js +> https://cdn.plot.ly/plotly-cartesian-2.16.5.js -> https://cdn.plot.ly/plotly-cartesian-2.16.4.min.js +> https://cdn.plot.ly/plotly-cartesian-2.16.5.min.js #### npm packages @@ -140,9 +140,9 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca | 3.1 MB | 1.1 MB | 369.7 kB | #### CDN links -> https://cdn.plot.ly/plotly-geo-2.16.4.js +> https://cdn.plot.ly/plotly-geo-2.16.5.js -> https://cdn.plot.ly/plotly-geo-2.16.4.min.js +> https://cdn.plot.ly/plotly-geo-2.16.5.min.js #### npm packages @@ -163,9 +163,9 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`, | 3.9 MB | 1.6 MB | 490.6 kB | #### CDN links -> https://cdn.plot.ly/plotly-gl3d-2.16.4.js +> https://cdn.plot.ly/plotly-gl3d-2.16.5.js -> https://cdn.plot.ly/plotly-gl3d-2.16.4.min.js +> https://cdn.plot.ly/plotly-gl3d-2.16.5.min.js #### npm packages @@ -183,12 +183,12 @@ The `gl2d` partial bundle contains trace modules `heatmapgl`, `parcoords`, `poin | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 4.5 MB | 1.8 MB | 583 kB | +| 4.5 MB | 1.8 MB | 583.1 kB | #### CDN links -> https://cdn.plot.ly/plotly-gl2d-2.16.4.js +> https://cdn.plot.ly/plotly-gl2d-2.16.5.js -> https://cdn.plot.ly/plotly-gl2d-2.16.4.min.js +> https://cdn.plot.ly/plotly-gl2d-2.16.5.min.js #### npm packages @@ -206,12 +206,12 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym | Raw size | Minified size | Minified + gzip size | |------|-----------------|------------------------| -| 4.4 MB | 1.8 MB | 524.8 kB | +| 4.4 MB | 1.8 MB | 524.9 kB | #### CDN links -> https://cdn.plot.ly/plotly-mapbox-2.16.4.js +> https://cdn.plot.ly/plotly-mapbox-2.16.5.js -> https://cdn.plot.ly/plotly-mapbox-2.16.4.min.js +> https://cdn.plot.ly/plotly-mapbox-2.16.5.min.js #### npm packages @@ -232,9 +232,9 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne | 3 MB | 1.1 MB | 359.6 kB | #### CDN links -> https://cdn.plot.ly/plotly-finance-2.16.4.js +> https://cdn.plot.ly/plotly-finance-2.16.5.js -> https://cdn.plot.ly/plotly-finance-2.16.4.min.js +> https://cdn.plot.ly/plotly-finance-2.16.5.min.js #### npm packages @@ -255,9 +255,9 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca | 8.8 MB | 3.9 MB | 1.1 MB | #### CDN links -> https://cdn.plot.ly/plotly-strict-2.16.4.js +> https://cdn.plot.ly/plotly-strict-2.16.5.js -> https://cdn.plot.ly/plotly-strict-2.16.4.min.js +> https://cdn.plot.ly/plotly-strict-2.16.5.min.js #### npm packages diff --git a/dist/plotly-basic.js b/dist/plotly-basic.js index 68e3b09eaa6..ffc7a848f77 100644 --- a/dist/plotly-basic.js +++ b/dist/plotly-basic.js @@ -1,5 +1,5 @@ /** -* plotly.js (basic) v2.16.4 +* plotly.js (basic) v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -41987,6 +41987,8 @@ function setActive(gd, sliderGroup, sliderOpts, index, doCallback, doTransition) } function attachGripEvents(item, gd, sliderGroup) { + if(gd._context.staticPlot) return; + var node = sliderGroup.node(); var $gd = d3.select(gd); @@ -85415,7 +85417,7 @@ function getSortFunc(opts, d2c) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.16.4'; +exports.version = '2.16.5'; },{}]},{},[8])(8) }); diff --git a/dist/plotly-basic.min.js b/dist/plotly-basic.min.js index 4d819a3ef28..da549b46317 100644 --- a/dist/plotly-basic.min.js +++ b/dist/plotly-basic.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (basic - minified) v2.16.4 +* plotly.js (basic - minified) v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -21,4 +21,4 @@ object-assign * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":59,"./lib/epsilon":60,"./lib/geojson":61,"./lib/intersecter":62,"./lib/segment-chainer":64,"./lib/segment-selector":65}],59:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],60:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],61:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),v=!p&&t.pointBetween(l,c,u);if(d)return v?s(n,l):s(e,u),n;h&&(p||(v?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,v=p.after?p.after.ev:null;function m(){if(h){var e=u(d,h);if(e)return e}return!!v&&u(d,v)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!v&&v.seg);var g,y=m();if(y){var x;if(e)(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(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=v?v.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)g=v?d.primary===v.primary?v.seg.otherFill.above:v.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:g,below:g};r&&r.status(d.seg,!!h&&h.seg,!!v&&v.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":66,timers:67}],68:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=H.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=H.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=H.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=H.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=H.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=H.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=H.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:N(t[4]),format:a?"name":"hex8"};if(t=H.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=H.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:N(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=H.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(p=t.r,h=t.g,v=t.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(v,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*O(t,360),r=O(r,100),n=O(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,v;return i=D(i),{ok:f,format:t.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}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=D(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(z(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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,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(v,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function N(e){return P(e)/255}var F,E,j,H=(E="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(e){return!!H.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],69:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(v>>5&15)-1,(31&v)+l);return i.year=m.getFullYear(),i.month=1+m.getMonth(),i.day=m.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var v=h&1<<12-p?30:29;if(s>13;!m||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":83,"object-assign":55}],72:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":83,"object-assign":55}],73:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":83,"object-assign":55}],74:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":83,"object-assign":55}],75:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":83,"object-assign":55}],76:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":83,"object-assign":55}],77:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":83,"object-assign":55}],78:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":83,"object-assign":55}],80:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":83,"object-assign":55}],81:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":83,"object-assign":55}],82:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":83,"object-assign":55}],83:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":55}],84:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=y(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){y("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=y(e,i)?n:r,l=0;l-1){p=1,h=v;for(var S=this.daysInMonth(d,p);h>S;S=this.daysInMonth(d,p))p++,h-=S}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":83,"object-assign":55}],85:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],86:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":220,"../../plot_api/plot_template":280,"../../plots/cartesian/constants":298,"../../plots/font_attributes":319,"./arrow_paths":85}],87:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,v=p-d,m=3*e.startarrowsize*e.arrowwidth||0,g=m+d,y=m-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:v}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,g),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=l?g+l:g,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,g),ppadminus:Math.max(f,v,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":244,"../../plots/cartesian/axes":291,"./draw":92}],88:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var G=!1,W=["x","y"],J=0;J1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(G=!0):G=!0),X=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===de;"x"===te?(Q=t[te],X=he?ae._offset+ae._length*Q:X=T.l+T.w*Q):(Q=1-t[te],X=he?ae._offset+ae._length*Q:X=T.t+T.h*Q),$=t.showarrow?.5:Q}if(t.showarrow){fe.head=X;var ve=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var me=s.getRefType(ne);"domain"===me?("y"===te&&(ve=1-ve),fe.tail=ae._offset+ae._length*ve):"paper"===me?"y"===te?(ve=1-ve,fe.tail=T.t+T.h*ve):fe.tail=T.l+T.w*ve:fe.tail=ae._offset+ae.r2p(ve),K=ee}else fe.tail=X+ve,K=ee+ve;fe.text=fe.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,ge-1)),"pixel"===ne){var ye=-Math.max(fe.tail-3,fe.text),xe=Math.min(fe.tail+3,fe.text)-ge;ye>0?(fe.tail+=ye,fe.text+=ye):xe>0&&(fe.tail-=xe,fe.text-=xe)}fe.tail+=ue,fe.head+=ue}else K=ee=se*U($,ce),fe.text=X+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(G)N.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,B?D:null,e);else{var we=j+_e-v.top,Te=j+be-v.left;Z.call(d.positionText,Te,we).call(u.setClipUrl,B?D:null,e)}Y.select("rect").call(u.setRect,j,j,k,z),H.call(u.setRect,F/2,F/2,E-F,V-F),N.call(u.setTranslate,Math.round(O.x.text-E/2),Math.round(O.y.text-V/2)),I.attr({transform:"rotate("+C+","+O.x.text+","+O.y.text+")"});var Me,ke=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=O.x.head,f=O.y.head,d=O.x.tail+r,p=O.y.tail+n,v=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(C,v,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),D=+H.attr("width"),R=+H.attr("height"),z=v-.5*D,F=z+D,E=b-.5*R,j=E+R,B=[[z,E,z,j],[z,j,F,j],[F,j,F,E],[F,E,z,E]].map(k);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var Y=t.arrowwidth,V=t.arrowcolor,U=t.arrowside,Z=P.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),q=Z.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",Y+"px").call(c.stroke,c.rgb(V));if(m(q,U,t),M.annotationPosition&&q.node().parentNode&&!i){var G=s,W=f;if(t.standoff){var J=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));G+=t.standoff*(d-s)/J,W+=t.standoff*(p-f)/J}var X,K,Q=Z.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(p-W),transform:l(G,W)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:Q.node(),gd:e,prepFn:function(){var e=u.getTranslate(N);X=e.x,K=e.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,K),a=n[0]+e,i=n[1]+r;N.call(u.setTranslate,a,i),L("x",y(g,e,"x",T,t)),L("y",y(x,r,"y",T,t)),t.axref===t.xref&&L("ax",y(g,e,"ax",T,t)),t.ayref===t.yref&&L("ay",y(x,r,"ay",T,t)),Z.attr("transform",l(e,r)),I.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),R)h.init({element:N.node(),gd:e,prepFn:function(){Me=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",y(g,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",y(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(g)a=y(g,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=y(x,r,"y",T,t);else{var u=t._ysize/T.h,f=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),g&&x||(n=h.getCursor(g?.5:a,x?.5:o,t.xanchor,t.yanchor))}I.attr({transform:l(e,r)+Me}),p(N,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){p(N),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*m+r.standoff,_=v.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.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 R();if(b){if(b*b>w*w+T*T)return void R();var M=b*Math.cos(f),k=b*Math.sin(f);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),D="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":322,"../annotations/draw":92}],99:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).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()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var ce=Math.pow(10,Math.floor(Math.log(se)/Math.LN10));oe*=ce*c.roundUp(se/ce,[2,5,10]),(Math.abs(U.start)/U.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+P/N.h,re+K-P/N.h]:[re+C/N.w,re+K-C/N.w],ae.setScale(),e.attr("transform",u(Math.round(N.l),Math.round(N.t)));var ue,fe=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(N.l),-Math.round(N.t))),de=ae.ticklabelposition,pe=ae.title.font.size,he=e.select("."+k.cbaxis),ve=0,me=0;function ge(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:z._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),v.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===H&&(e=C+N.l+N.w*I,t=P+N.t+N.h*(1-re-K)+3+.75*pe),"bottom"===H&&(e=C+N.l+N.w*I,t=P+N.t+N.h*(1-re)-3-.25*pe),"right"===H&&(t=P+N.t+N.h*R+3+.75*pe,e=C+N.l+N.w*re),ge(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,s=e.select("."+k.cbtitle),f=s.select("text"),d=[-A/2,A/2],h=s.select(".h"+ae._id+"title-math-group").node(),v=15.6;if(f.node()&&(v=parseInt(f.node().style.fontSize,10)*w),h?(i=p.bBox(h),me=i.width,(ve=i.height)>v&&(d[1]-=(ve-v)/2)):f.node()&&!f.classed(k.jsPlaceholder)&&(i=p.bBox(f.node()),me=i.width,ve=i.height),o){if(ve){if(ve+=5,"top"===H)ae.domain[1]-=ve/N.h,d[1]*=-1;else{ae.domain[0]+=ve/N.h;var g=m.lineCount(f);d[1]+=(1-g)*v}s.attr("transform",u(d[0],d[1])),ae.setScale()}}else me&&("right"===H&&(ae.domain[0]+=(me+pe/2)/N.w),s.attr("transform",u(d[0],d[1])),ae.setScale())}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",o?u(0,Math.round(N.h*(1-ae.domain[1]))):u(Math.round(N.w*ae.domain[0]),0)),he.attr("transform",o?u(0,Math.round(-N.t)):u(Math.round(-N.l),0));var y=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(q);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var x=B.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var l=[0===i?B[0]:(q[i]+q[i-1])/2,i===q.length-1?B[1]:(q[i]+q[i+1])/2].map(ae.c2p).map(Math.round);o&&(l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,x[0],x[1]));var s=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(l)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(l)-n.min(l),2));if(t._fillgradient)p.gradient(s,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=V(e).replace("e-","");s.attr("fill",a(u).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(E.color&&E.width?G:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){var t=Q,r=Math.round(ae.c2p(e))+E.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+W).call(p.lineGroupStyle,E.width,Y(e),E.dash)})),he.selectAll("g."+ae._id+"tick,path").remove();var _=Q+W+(A||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(ae),M=l.getTickSigns(ae)[2];return l.drawTicks(r,ae,{vals:"inside"===ae.ticks?l.clipEnds(ae,T):T,layer:he,path:l.makeTickPath(ae,_,M),transFn:l.makeTransTickFn(ae)}),l.drawLabels(r,ae,{vals:T,layer:he,transFn:l.makeTransTickLabelFn(ae),labelFns:l.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,l=ae._offset+ae._length/2;if("right"===H)a=l,e=N.l+N.w*i+10+pe*(ae.showticklabels?1:.5);else if(e=l,"bottom"===H&&(a=N.t+N.h*i+10+(-1===de.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===H){var s=j.text.split("
").length;a=N.t+N.h*i+10-W-w*pe*s}ge((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:H,offsetTop:o?0:N.t,offsetLeft:o?N.l:0,maxShift:o?z.width:z.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,l=W+A/2;-1===de.indexOf("inside")&&(n=p.bBox(he.node()),l+=o?n.width:n.height),ue=fe.select("text");var c=0,f=o&&"top"===H,v=!o&&"right"===H,m=0;if(ue.node()&&!ue.classed(k.jsPlaceholder)){var y,x=fe.select(".h"+ae._id+"title-math-group").node();x&&(o&&ie||!o&&!ie)?(c=(n=p.bBox(x)).width,y=n.height):(c=(n=p.bBox(fe.node())).right-N.l-(o?Q:ne),y=n.bottom-N.t-(o?ne:Q),o||"top"!==H||(l+=n.height,m=n.height)),v&&(ue.attr("transform",u(c/2+pe/2,0)),c*=2),l=Math.max(l,o?c:y)}var b=2*(o?C:P)+l+L+A/2,w=0;!o&&j.text&&"bottom"===O&&R<=0&&(b+=w=b/2,m+=w),z._hColorbarMoveTitle=w,z._hColorbarMoveCBTitle=m;var F=L+A;e.select("."+k.cbbg).attr("x",(o?Q:ne)-F/2-(o?C:0)).attr("y",(o?ne:Q)-(o?X:P+m-w)).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(X+F,2)).call(h.fill,S).call(h.stroke,t.bordercolor).style("stroke-width",L);var E=v?Math.max(c-10,0):0;if(e.selectAll("."+k.cboutline).attr("x",(o?Q:ne+C)+E).attr("y",(o?ne+P-X:Q)+(f?ve:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(X-(o?2*P+ve:2*C+E),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(N.l-(o?$*b:0),N.t-(o?0:(1-ee)*b-m))),!o&&(L||a(S).getAlpha()&&!a.equals(z.paper_bgcolor,S))){var B=he.selectAll("text"),Y=B[0].length,V=e.select("."+k.cbbg).node(),U=p.bBox(V),Z=p.getTranslate(e);B.each((function(e,t){var r=Y-1;if(0===t||t===r){var n,a=p.bBox(this),i=p.getTranslate(this);if(t===r){var o=a.right+i.x;(n=U.right+Z.x+ne-L-2+I-o)>0&&(n=0)}else if(0===t){var l=a.left+i.x;(n=U.left+Z.x+ne+L+2-l)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var q={},G=T[D],J=M[D],K=T[O],te=M[O],re=b-W;o?("pixels"===d?(q.y=R,q.t=X*K,q.b=X*te):(q.t=q.b=0,q.yt=R+s*K,q.yb=R-s*te),"pixels"===_?(q.x=I,q.l=b*G,q.r=b*J):(q.l=re*G,q.r=re*J,q.xl=I-g*G,q.xr=I+g*J)):("pixels"===d?(q.x=I,q.l=X*G,q.r=X*J):(q.l=q.r=0,q.xl=I+s*G,q.xr=I-s*J),"pixels"===_?(q.y=1-R,q.t=b*K,q.b=b*te):(q.t=re*K,q.b=re*te,q.yt=R-g*K,q.yb=R+g*te)),i.autoMargin(r,t._id,q)}],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l="v"===t.orientation,c=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align((l?t._uFrac:t._vFrac)+r/c.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=s.align((l?t._vFrac:1-t._uFrac)-o/c.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var f=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,f)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":219,"../../lib":244,"../../lib/extend":238,"../../lib/setcursor":264,"../../lib/svg_text_utils":267,"../../plots/cartesian/axes":291,"../../plots/cartesian/axis_defaults":293,"../../plots/cartesian/layout_attributes":304,"../../plots/cartesian/position_defaults":307,"../../plots/plots":325,"../../registry":327,"../color":103,"../colorscale/helpers":114,"../dragelement":122,"../drawing":125,"../titles":212,"./constants":105,"@plotly/d3":11,tinycolor2:68}],108:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":244}],109:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":104,"./defaults":106,"./draw":107,"./has_colorbar":108}],110:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",v=i+"max",m=i+"mid",g=(l(d+p),l(d+h),l(d+v),{});g[h]=g[v]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":260,"../../lib/sort_object_keys":265,"../colorbar/attributes":104,"./scales.js":118}],111:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,v=f.mid,m=function(){return a.aggNums(Math.min,null,s)},g=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=m():d&&(p=u._colorAx&&n(p)?Math.min(p,m()):m()),void 0===h?h=g():d&&(h=u._colorAx&&n(h)?Math.max(h,g()):g()),d&&void 0!==v&&(h-v>v-p?p=v-(h-v):h-v=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":244,"./helpers":114,"fast-isnumeric":17}],112:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],120:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":244}],121:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],122:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,v,m=e.gd,g=1,y=m._context.doubleClickDelay,x=e.element;m._mouseDownTime||(m._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(g=Math.max(g-1,1)),m._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!v){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}m._dragging=!1,m._dragged=!1}else m._dragged=!1}},s.coverSlip=u},{"../../lib":244,"../../plots/cartesian/constants":298,"./align":119,"./cursor":120,"./unhover":123,"has-hover":48,"has-passive-events":49,"mouse-event-offset":53}],123:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":236,"../../lib/events":237,"../../lib/throttle":268,"../fx/constants":137}],124:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],125:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,v=e("../../constants/interactions").DESELECTDIM,m=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),y=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};function b(e,t,r){var n=t.fillpattern,a=n&&x.getPatternAttr(n.shape,0,"");if(a){var i=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),l=n.fgopacity,s=x.getPatternAttr(n.size,0,8),u=x.getPatternAttr(n.solidity,0,.3),f=t.uid;x.pattern(e,"point",r,f,a,s,u,void 0,n.fillmode,i,o,l)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e,t){var r=n.select(e.node());b(e,((r.data()[0]||[])[0]||{}).trace||{},t)},x.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&b(r,e[0].trace,t)}))};var _=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,x.symbolBackOffs[r]=t.backoff||0,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function T(e,t,r,n){var a=e%100;return x.symbolFuncs[a](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var M={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=i("~f"),L={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=L[i],d=new Array(u),p=0;p=100;var f=re(e,r),d=Z(e,r);t.attr("d",T(u,s,f,d))}var p,h,v,m=!1;if(e.so)v=l.outlierwidth,h=l.outliercolor,p=o.outliercolor;else{var g=(l||{}).width;v=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,m=!0),p="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,p).style({"stroke-width":(v||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:v)+"px");var y=o.gradient,b=e.mgt;b?m=!0:b=y&&y.type,a.isArrayOrTypedArray(b)&&(b=b[0],L[b]||(b=0));var _=o.pattern,w=_&&x.getPatternAttr(_.shape,e.i,"");if(b&&"none"!==b){var M=e.mgc;M?m=!0:M=y.color;var k=r.uid;m&&(k+="-"+e.i),x.gradient(t,i,k,b,[[0,M],[1,p]],"fill")}else if(w){var A=x.getPatternAttr(_.bgcolor,e.i,null),S=x.getPatternAttr(_.fgcolor,e.i,null),D=_.fgopacity,O=x.getPatternAttr(_.size,e.i,8),C=x.getPatternAttr(_.solidity,e.i,.3),P=e.mcc||a.isArrayOrTypedArray(_.shape)||a.isArrayOrTypedArray(_.bgcolor)||a.isArrayOrTypedArray(_.size)||a.isArrayOrTypedArray(_.solidity),I=r.uid;P&&(I+="-"+e.i),x.pattern(t,"point",i,I,w,O,C,e.mcc,_.fillmode,A,S,D)}else c.fill(t,p);v&&c.stroke(t,h)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=m.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:v*t});var h=i.color,m=o.color,g=l.color;(m||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?m||t:g||t});var y=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,v))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);e.attr("d",T(x.symbolNumber(i),o,re(n,t),Z(n,t))),n.mrc2=o})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};y(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var v=e.tp||t.textposition,m=O(e,t),g=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,m,g).text(c).call(d.convertToTspans,r).call(D,v,m,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=O(e,t);c.fill(a,i);var u=s.traceIs(t,"bar-like");D(a,o,l,e.mrc2||e.mrc,u)}))}};var C,P;function I(e,t,r){return r&&(e=j(e)),t?z(e[1]):R(e[0])}function R(e){var t=n.round(e,2);return C=t,t}function z(e){var t=n.round(e,2);return P=t,t}function N(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],l=r[1]-t[1],s=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+l*l,.25),u=(c*c*a-s*s*o)*n,f=(c*c*i-s*s*l)*n,d=3*c*(s+c),p=3*s*(s+c);return[[R(t[0]+(d&&u/d)),z(t[1]+(d&&f/d))],[R(t[0]-(p&&u/p)),z(t[1]-(p&&f/p))]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=c||b>=f&&b<=c)&&(_<=d&&_>=u||_>=d&&_<=u)&&(e=[b,_])}return e}x.steps=function(e){var t=F[e]||E;return function(e){for(var r="M"+R(e[0][0])+","+z(e[0][1]),n=e.length,a=1;a=1e4&&(x.savedBBoxes={},H=0),r&&(x.savedBBoxes[r]=m),H++,a.extendFlat({},m)},x.setClipUrl=function(e,t,r){e.attr("clip-path",Y(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var V=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(V,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var U=/translate\([^)]*\)\s*$/;function Z(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(U);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))},x.getMarkerStandoff=Z;var q,G,W,J,X,K,Q=Math.atan2,$=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*$(e)-n*ee(e),r*ee(e)+n*$(e)]}function re(e,t){var r,n,a=e.ma;void 0===a&&(a=t.marker.angle||0);var i=t.marker.angleref;if("previous"===i||"north"===i){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var s=t._xA,c=t._yA;if(!s||!c)return 90;r=s.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,f=e.lonlat[0],d=e.lonlat[1],p=t._geo.project([f,d+1e-5]),h=t._geo.project([f+1e-5,d]),v=Q(h[1]-n,h[0]-r),m=Q(p[1]-n,p[0]-r);if("north"===i)u=a/180*Math.PI;else if("previous"===i){var g=f/180*Math.PI,y=d/180*Math.PI,x=q/180*Math.PI,b=G/180*Math.PI,_=x-g,w=$(b)*ee(_),T=ee(b)*$(y)-$(b)*ee(y)*$(_);u=-Q(w,T)-Math.PI,q=f,G=d}var M=te(v,[$(u),0]),k=te(m,[ee(u),0]);a=Q(M[1]+k[1],M[0]+k[0])/Math.PI*180,"previous"!==i||K===t.uid&&e.i===X+1||(a=null)}if("previous"===i&&!t._geo)if(K===t.uid&&e.i===X+1&&o(r)&&o(n)){var A=r-W,L=n-J,S=t.line&&t.line.shape||"",D=S.slice(S.length-1);"h"===D&&(L=0),"v"===D&&(A=0),a+=Q(L,A)/Math.PI*180+90}else a=null}return W=r,J=n,X=e.i,K=t.uid,a}x.getMarkerAngle=re},{"../../components/fx/helpers":139,"../../constants/alignment":219,"../../constants/interactions":223,"../../constants/xmlns_namespaces":225,"../../lib":244,"../../lib/svg_text_utils":267,"../../registry":327,"../../traces/scatter/make_bubble_size_func":384,"../../traces/scatter/subtypes":392,"../color":103,"../colorscale":115,"./symbol_defs":126,"@plotly/d3":11,"fast-isnumeric":17,tinycolor2:68}],126:[function(e,t,r){"use strict";var n,a,i,o,l=e("parse-svg-path"),s=e("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,d=Math.cos,p=Math.sin;function h(e){return null===e}function v(e,t,r){if(!(e&&e%360!=0||t))return r;if(i===e&&o===t&&n===r)return a;function s(e,r){var n=d(e),a=p(e),i=r[0],o=r[1]+(t||0);return[i*n-o*a,i*a+o*n]}i=e,o=t,n=r;for(var c=e/180*f,u=0,h=0,v=l(r),m="",g=0;g0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var v=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var m=n.select(this).selectAll("g.errorbar").data(t,f);if(m.exit().remove(),t.length){p.visible||m.selectAll("path.xerror").remove(),h.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(m,r.layerClipId,e),m.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!v||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.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=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var m=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-m)+"v"+2*m+"m0,-"+m+"H"+r.xs,r.noXS||(i+="m0,-"+m+"v"+2*m),!d.size()?d=t.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":392,"../drawing":125,"@plotly/d3":11,"fast-isnumeric":17}],133:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":103,"@plotly/d3":11}],134:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":238,"../../plots/font_attributes":319,"./layout_attributes":144}],135:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||oe<0||oe>w[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,Y="xval"in t?g.flat(s,t.xval):g.p2c(_,ie),V="yval"in t?g.flat(s,t.yval):g.p2c(w,oe),!a(Y[0])||!a(V[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(Z=0;Zee&&(te.splice(0,ee),ce=te[0].distance),y&&0!==E&&0===te.length){$.distance=E,$.index=!1;var f=G._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=E}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(d=de(v),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>d.spikeDistance)&&(ne.vLinePoint=d))}var m=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(m.length){var x=m[0];a(x.x0)&&a(x.y0)&&(d=de(x),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>d.spikeDistance)&&(ne.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)Oe(te[Ae]);te=Le,me()}var Ce=e._hoverdata,Pe=[],Ie=H(e),Re=B(e);for(U=0;U1||te.length>1)||"closest"===C&&ae&&te.length>1,Ge=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),We=P(te,{gd:e,hovermode:C,rotateLabels:qe,bgColor:Ge,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function v(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(m.push.apply(m,g),p.splice(o+1,1),c=0,l=m.length-1;l>=0;l--)c+=m[l].dp;for(i=c/m.length,l=m.length-1;l>=0;l--)m[l].dp-=i;n=!1}else o++}p.forEach(v)}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}}}(We,qe?"xa":"ya",u),R(We,qe,u._invScaleX,u._invScaleY));if(l&&l.tagName){var Je=m.getComponentMethod("annotations","hasClickToShow")(e,Pe);f(n.select(l),Je?"pointer":"")}if(!l||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:Y,yvals:V})}(e,t,r,i,l)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=H(a),o=B(a),l=P(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),v=e.trace;if(m.traceIs(v,"gl3d")){var g=a._fullLayout[v.scene]._scene.container,y=g.offsetLeft,x=g.offsetTop;u+=y,f+=y,d+=x,h+=x}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function P(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,v=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var T=t.fontFamily||y.HOVERFONT,M=t.fontSize||y.HOVERFONTSIZE,k=e[0],S=k.xa,D=k.ya,C=i.charAt(0),P=C+"Label",R=k[P];if(void 0===R&&"multicategory"===S.type)for(var z=0;za.width-b?(m=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+y.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+y.width/2)+"v"+x+(2*L+y.height)+"H-"+(L+y.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,O,C;"right"===D.side?(_="start",O=1,C="",m=S._offset+S._length):(_="end",O=-1,C="-",m=S._offset),g=D._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+y.height/2)+"h"+C+(2*L+y.width)+"V-"+(L+y.height/2)+"H"+C+A+"V-"+A+"Z");var P,I=y.height/2,z=F-y.top-I,N="clip"+a._uid+"commonlabel"+D._id;if(m=0?le:se+fe=0?se:xe+fe=0?ie:oe+de=0?oe:be+de=0,"top"!==e.idealAlign&&Z||!q?Z?(P+=N/2,e.anchor="start"):e.anchor="middle":(P-=N/2,e.anchor="end");else if(e.pos=P,Z=C+z/2+G<=E,q=C-z/2-G>=0,"left"!==e.idealAlign&&Z||!q)if(Z)C+=z/2,e.anchor="start";else{e.anchor="middle";var W=G/2,J=C+W-E,X=C-W;J>0&&(C-=J),X<0&&(C+=-X)}else C-=z/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(C,P)+(c?s(_):""))})),_e}function I(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=E(r,e.nameLength),""}))}return[s,l]}function R(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(e.txwidth+L),h=0,v=e.offset,m="middle"===l;m&&(f-=e.tx2width/2,p+=e.txwidth/2+L),t&&(v*=-k,h=e.offset*M),r.select("path").attr("d",m?"M-"+i(e.bx/2+e.tx2width/2)+","+o(v-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+v)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(v-A)+"Z");var g=h+f,y=v+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),g=m?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),g=m?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(g),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(v+e.ty0-e.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(v-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:v.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:v.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=v.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+v.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=v.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+v.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function N(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var m,g,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(m=c.pointerX,g=c.pointerY):(m=n._offset+y.x,g=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,M=a.spikecolor||_,k=v.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=m),-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:g,y2:g,"stroke-width":T,stroke:M,"stroke-dasharray":d.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:g,r:T,fill:M}).classed("spikeline",!0)}if(f){var S,D,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,D=c.pointerY):(S=n._offset+O.x,D=a._offset+O.y);var C,P,I=i.readability(O.color,h)<1.5?p.contrast(h):O.color,R=n.spikemode,z=n.spikethickness,N=n.spikecolor||I,F=v.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(C=F,P=D),-1!==R.indexOf("across")){var E=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(E=Math.min(E,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,P=s.t+(1-E)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z,stroke:N,"stroke-dasharray":d.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?z:-z),r:z,fill:N}).classed("spikeline",!0)}}}function F(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function H(e){return e.offsetTop+e.clientTop}function B(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),f=c[0],d=c[1],p=u[0],h=u[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},{"../../lib":244,"../../lib/events":237,"../../lib/override_cursor":255,"../../lib/svg_text_utils":267,"../../plots/cartesian/axes":291,"../../registry":327,"../color":103,"../dragelement":122,"../drawing":125,"../legend/defaults":155,"../legend/draw":156,"./constants":137,"./helpers":139,"@plotly/d3":11,"fast-isnumeric":17,tinycolor2:68}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var l=t.legend;function s(e){o.font[e]||(o.font[e]=l?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),l?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":244,"../color":103,"./helpers":139}],142:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":244,"./layout_attributes":144}],143:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":244,"../dragelement":122,"./attributes":134,"./calc":135,"./click":136,"./constants":137,"./defaults":138,"./helpers":139,"./hover":140,"./layout_attributes":144,"./layout_defaults":145,"./layout_global_defaults":146,"@plotly/d3":11}],144:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":319,"./constants":137}],145:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":244,"./hoverlabel_defaults":141,"./hovermode_defaults":142,"./layout_attributes":144}],146:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":244,"./hoverlabel_defaults":141,"./layout_attributes":144}],147:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===M("pattern")&&(d=!0);m._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,T=d?.3:.1;v&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),m._domains={x:u("x",M,w,x,y),y:u("y",M,T,b,g,_)}}else delete t.grid}function M(e,t){return n.coerce(r,m,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,v=r.rows,m=r.columns,g="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(v);var b=1;for(n=0;n1);if(!1===_&&(t.legend=void 0),(!1!==_||f.uirevision)&&(p("uirevision",t.uirevision),!1!==_)){p("bgcolor",t.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,T,M,k=a.coerceFont(p,"font",t.font),A="h"===p("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(T=1.1,M="bottom"):(T=-.1,M="top")):(w=1.02,T=1,M="auto"),p("traceorder",x),c.isGrouped(t.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",T),p("yanchor",M),p("valign"),a.noneOrAll(f,d,["x","y"]),p("title.text")){p("title.side",A?"left":"top");var L=a.extendFlat({},k,{size:a.bigFont(k.size)});a.coerceFont(p,"title.font",L)}}}},{"../../lib":244,"../../plot_api/plot_template":280,"../../plots/attributes":287,"../../plots/layout_attributes":323,"../../registry":327,"./attributes":153,"./helpers":159}],156:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),v=h.LINE_SPACING,m=h.FROM_TL,g=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r){var n=e[0],a=n.width,i=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===i?t._maxWidth*o:r+(o||a)}function w(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function T(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var v=a.ensureSingle(e,"text","legendtext");v.attr("text-anchor","start").call(c.font,i).text(d?M(n,h):n);var m=r.itemwidth+2*p.itemGap;f.positionText(v,m,0),d?v.call(f.makeEditable,{gd:t,text:n}).call(A,e,t,r).on("edit",(function(n){this.text(M(n,h)).call(A,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):A(v,e,t,r)}function M(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(t,r,e,o,n.event)}})))}function A(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*v;if(o){var m=c.bBox(o);u=m.height,d=m.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(g),x=g.node();if(u=h*y,d=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(g,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,d-=r.itemwidth),f.positionText(g,b,-h*((y-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function L(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=y(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&y(e.calcdata,t)}var v=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var M=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),D=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),O=a.ensureSingle(M,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));O.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(M,"g","scrollbox"),P=t.title;if(t._titleWidth=0,t._titleHeight=0,P.text){var I=a.ensureSingle(C,"text","legendtitletext");I.attr("text-anchor","start").call(c.font,P.font).text(P.text),A(I,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var R=a.ensureSingle(M,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(l);z.enter().append("g").attr("class","groups"),z.exit().remove();var N=z.selectAll("g.traces").data(a.identity);N.enter().append("g").attr("class","traces"),N.exit().remove(),N.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==v.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(T,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u="fraction"===a.entrywidthmode,f=a.borderwidth,d=2*f,h=p.itemGap,v=a.itemwidth+2*h,m=2*(f+h),g=S(a),y=a.y<0||0===a.y&&"top"===g,x=a.y>1||1===a.y&&"bottom"===g,w=a.tracegroupgap,T={};a._maxHeight=Math.max(y||x?i.height/2:o.h,30);var M=0;a._width=0,a._height=0;var k=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,f+k[0],f+k[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),M=v+a._width,a._width+=h+v+d,a._height+=m,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=L(a),D=a.x<0||0===a.x&&"right"===A,O=a.x>1||1===a.x&&"left"===A,C=x||y,P=i.width/2;a._maxWidth=Math.max(D?C&&"left"===A?o.l+o.w:P:O?C&&"right"===A?o.r+o.w:P:o.w,2*v);var I=0,R=0;r.each((function(e){var t=_(e,a,v);I=Math.max(I,t),R+=t})),M=null;var z=0;if(s){var N=0,F=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,a,v),i=r[0].height;c.setTranslate(this,k[0],k[1]+f+h+i/2+t),t+=i,e=Math.max(e,n),T[r[0].trace.legendgroup]=e}));var r=e+h;F>0&&r+f+F>a._maxWidth?(z=Math.max(z,F),F=0,E+=N+w,N=t):N=Math.max(N,t),c.setTranslate(this,F,E),F+=r})),a._width=Math.max(z,F)+f,a._height=E+N+m}else{var j=r.size(),H=R+d+(j-1)*h=a._maxWidth&&(z=Math.max(z,U),Y=0,V+=B,a._height+=B,B=0),c.setTranslate(this,k[0]+f+Y,k[1]+f+V+t/2+h),U=Y+r+h,Y+=n,B=Math.max(B,t)})),H?(a._width=Y+d,a._height=B+m):(a._width=Math.max(z,U)+d,a._height+=B+m)}}a._width=Math.ceil(Math.max(a._width+k[0],a._titleWidth+2*(f+p.titlePad))),a._height=Math.ceil(Math.max(a._height+k[1],a._titleHeight+2*(f+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var Z=e._context.edits,q=Z.legendText||Z.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,i=e[0].trace.legendgroup,o=_(e,a,v);s&&""!==i&&(o=T[i]);var f=q?v:M||o;l||u||(f+=h/2),c.setRect(t,0,-r/2,f,r)}))}(e,z,N,t)},function(){var l,u,v,y,x=f._size,b=t.borderwidth;if(!h){if(function(e){var t=e._fullLayout.legend,r=L(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*m[r],r:t._width*g[r],b:t._effHeight*g[n],t:t._effHeight*m[n]})}(e))return;var _=x.l+x.w*t.x-m[L(t)]*t._width,T=x.t+x.h*(1-t.y)-m[S(t)]*t._effHeight;if(f.margin.autoexpand){var k=_,A=T;_=a.constrain(_,0,f.width-t._width),T=a.constrain(T,0,f.height-t._effHeight),_!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==A&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(M,_,T)}if(R.on(".drag",null),M.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;h&&(P=t._height),O.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),D.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,d,e),c.setRect(R,0,0,0,0),delete t._scrollY}else{var I,z,N,F=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),E=t._effHeight-F-2*p.scrollBarMargin,j=t._height-t._effHeight,H=E/j,B=Math.min(t._scrollY||0,j);O.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),D.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,d,e),U(B,F,H),M.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/E*j,0,j),F,H),0!==B&&B!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;I="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,N=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,j)}(N,I,z),F,H))}));R.call(Y);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(I=e.changedTouches[0].clientY,N=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,j)}(N,I,z),F,H))}));C.call(V)}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(R,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),D.select("rect").attr("y",b+r)}e._context.edits.legendPosition&&(M.classed("cursor-move",!0),s.init({element:M.node(),gd:e,prepFn:function(){var e=c.getTranslate(M);v=e.x,y=e.y},moveFn:function(e,r){var n=v+e,a=y+r;c.setTranslate(M,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&w(e,M,a,t,n)}}))}],e)}(e,t)}},{"../../constants/alignment":219,"../../lib":244,"../../lib/events":237,"../../lib/svg_text_utils":267,"../../plots/plots":325,"../../registry":327,"../color":103,"../dragelement":122,"../drawing":125,"./constants":154,"./get_legend_data":157,"./handle_click":158,"./helpers":159,"./style":161,"@plotly/d3":11}],157:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function v(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return y?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),v=h.mid;void 0===v&&(v=(h.max+h.min)/2),p=l.tryColorscale(f,"")(v)}var g=p||i.mc||f.color,y=f.pattern,x=y&&l.getPatternAttr(y.shape,0,"");if(x){var b=l.getPatternAttr(y.bgcolor,0,null),_=l.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,M=m(y.size,8,10),k=m(y.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,y.fillmode,b,_,T)}else a.call(s.fill,g);o&&s.stroke(a,i.mlc||d.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var v=i.minExtend(o,{trace:h});f(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,v=d.reversescale;if(p){if(!r){var m=p.length;u=0===o?p[v?m-1:0][1]:1===o?p[v?0:m-1][1]:p[Math.floor((m-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(v,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=v(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,m=o.anyFill,g=o.anyLine,y=e[0],b=y.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!m?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(s)l.fillGroupStyle(e,t);else{var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}})),f||d){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(y,{trace:a})]}var D=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",k+(d?"l"+x+",0.0001":"h"+x)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=v(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,m=!d&&!c&&!s&&u.hasText(h);function g(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||m||f){var b={},w={};if(d){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",i.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:g("line.width",x,[0,10],5)}),m&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(d?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(m?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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":244,"../../registry":327,"../../traces/pie/helpers":359,"../../traces/pie/style_one":365,"../../traces/scatter/subtypes":392,"../color":103,"../colorscale/helpers":114,"../drawing":125,"./constants":154,"@plotly/d3":11}],162:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":164}],163:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,v=(1+h)/2,m=(1-h)/2;for(a=0;a1?(P=["toggleHover"],I=["resetViews"]):g?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],I=["resetGeo"]):m?(P=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],I=["resetViewMapbox"]):b?P=["hoverClosestGl2d"]:y?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):P=["toggleHover"];v&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var v=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(e=0;M--){var k=r.append("path").attr(m).style("opacity",M?.1:g).call(o.stroke,x).call(o.fill,y).call(l.dashLine,M?"solid":_,M?4+b:b);if(h(k,e,i),w){var A=s(e.layout,"selections",i);k.style({cursor:"move"});var L={element:k.node(),plotinfo:p,gd:e,editHelpers:A,isActiveSelection:!0},S=n(c,e);a(S,k,L)}else k.style("pointer-events",M?"all":"none");T[M]=k}var D=T[0];T[1].node().addEventListener("click",(function(){return function(e,t){if(!d(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void v(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=v,f(e)}}(e,D)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;l.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function v(e){d(e)&&(e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,f(e)))}t.exports={draw:f,drawOne:p,activateLastSelection:function(e){if(!d(e))return;var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=v,f(e)}}},{"../../plot_api/plot_template":280,"../color":103,"../drawing":125,"../shapes/display_outlines":197,"../shapes/draw_newshape/helpers":202,"../shapes/handle_outline":204,"../shapes/helpers":205}],187:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":238,"../../drawing/attributes":124}],188:[function(e,t,r){"use strict";t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],189:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers").selectMode,a=e("../../shapes/handle_outline").clearOutline,i=e("../../shapes/draw_newshape/helpers"),o=i.readPaths,l=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var i=r.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,f=t.plotinfo,d=f.xaxis,p=f.yaxis,h=t.isActiveSelection,v=t.dragmode,m=(c.layout||{}).selections||[];if(!n(v)&&void 0!==h){var g=c._fullLayout._activeSelectionIndex;if(g-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(g)){q(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=K(_))){for(o&&o.remove(),m=0;m=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,l=p(r),s=v(r);if(l||s){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&a._fullLayout._outlining)l&&(c=T(f,e)),c&&i.call("_guiRelayout",a,{shapes:c}),s&&!B(e)&&(u=M(f,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&k(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function W(e){return e._id}function J(e,t,r,n){if(!e.calcdata)return[];var a,i,o,l=[],s=t.map(W),c=r.map(W);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function Q(e,t,r){var n,a;for(n=0;n-1&&t;if(!i&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ce(te);ue([O(e,ne,"x"),O(e,pe,"y")])($,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&fe(e,$),d._reselect=!1}if(!i&&d._deselect){var ve=d._deselect;(function(e,t,r){for(var n=0;n=0)M._fullLayout._deactivateShape(M);else if(!x){var r=k.clickmode;D.done(ke).then((function(){if(D.clear(ke),2===e){for(be.remove(),K=0;K-1&&Y(t,M,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&fe(M,void 0);s.click(M,t)})).catch(A.error)}},n.doneFn=function(){Me.remove(),D.done(ke).then((function(){D.clear(ke),!L&&X&&n.selectionDefs&&(X.subtract=xe,n.selectionDefs.push(X),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,W)),(L||x)&&G(n,L),n.doneFnCompleted&&n.doneFnCompleted(Ae),b&&fe(M,ie)})).catch(A.error)}},clearOutline:x,clearSelectionsCache:G,selectOnClick:Y}},{"../../lib":244,"../../lib/clear_gl_canvases":232,"../../lib/polygon":256,"../../lib/throttle":268,"../../plot_api/subroutines":281,"../../plots/cartesian/axis_ids":295,"../../registry":327,"../color":103,"../dragelement/helpers":121,"../drawing":125,"../fx":143,"../fx/helpers":139,"../shapes/constants":195,"../shapes/display_outlines":197,"../shapes/draw_newshape/helpers":202,"../shapes/draw_newshape/newshapes":203,"../shapes/handle_outline":204,"../shapes/helpers":205,"./constants":184,"./draw":186,"./draw_newselection/newselections":189,"./helpers":190,"point-in-polygon/nested":57,polybooljs:58}],193:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":220,"../../lib/extend":238,"../../plot_api/plot_template":280,"../../traces/scatter/attributes":367,"../annotations/attributes":86,"../drawing/attributes":124}],194:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,v=d>0?d+c:c;return{ppad:c,ppadplus:u?h:v,ppadminus:u?v:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o1&&(2!==e.length||"Z"!==e[1][0])&&(0===S&&(e[0][0]="M"),t[L]=e,T(),M())}}()}}function E(e,r){!function(e,r){if(t.length)for(var n=0;nx?(M=f,S="y0",k=x,D="y1"):(M=x,S="y1",k=f,D="y0");J(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===I?X:K,W.altKey=n.altKey},doneFn:function(){if(y(e))return;p(t),$(l),_(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(y(e))return;$(l)}};function J(r){if(y(e))I=null;else if(N)I="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=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),I=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?E("xanchor",r.xanchor=Z(b+n)):(o=function(e){return Z(V(e)+n)},j&&"date"===j.type&&(o=v.encodeDate(o))),z?E("yanchor",r.yanchor=q(T+a)):(s=function(e){return q(U(e)+a)},B&&"date"===B.type&&(s=v.encodeDate(s))),E("path",r.path=w(P,o,s))}else R?E("xanchor",r.xanchor=Z(b+n)):(E("x0",r.x0=Z(c+n)),E("x1",r.x1=Z(g+n))),z?E("yanchor",r.yanchor=q(T+a)):(E("y0",r.y0=q(f+a)),E("y1",r.y1=q(x+a)));t.attr("d",m(e,r)),Q(l,r)}function K(n,a){if(F){var i=function(e){return e},o=i,s=i;R?E("xanchor",r.xanchor=Z(b+n)):(o=function(e){return Z(V(e)+n)},j&&"date"===j.type&&(o=v.encodeDate(o))),z?E("yanchor",r.yanchor=q(T+a)):(s=function(e){return q(U(e)+a)},B&&"date"===B.type&&(s=v.encodeDate(s))),E("path",r.path=w(P,o,s))}else if(N){if("resize-over-start-point"===I){var u=c+n,d=z?f-a:f+a;E("x0",r.x0=R?u:Z(u)),E("y0",r.y0=z?d:q(d))}else if("resize-over-end-point"===I){var p=g+n,h=z?x-a:x+a;E("x1",r.x1=R?p:Z(p)),E("y1",r.y1=z?h:q(h))}}else{var y=function(e){return-1!==I.indexOf(e)},_=y("n"),H=y("s"),Y=y("w"),G=y("e"),W=_?M+a:M,J=H?k+a:k,X=Y?A+n:A,K=G?L+n:L;z&&(_&&(W=M-a),H&&(J=k-a)),(!z&&J-W>10||z&&W-J>10)&&(E(S,r[S]=z?W:q(W)),E(D,r[D]=z?J:q(J))),K-X>10&&(E(O,r[O]=R?X:Z(X)),E(C,r[C]=R?K:Z(K)))}t.attr("d",m(e,r)),Q(l,r)}function Q(e,t){(R||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:v.extractPathCoords(t.path,h.paramIsX))),o=U(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:v.extractPathCoords(t.path,h.paramIsY)));if(i=v.roundPositionForSharpStrokeRendering(i,1),o=v.roundPositionForSharpStrokeRendering(o,1),R&&z){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(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(W),G.node().onmousemove=J}(e,R,s,t,r,I):!0===s.editable&&R.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!x(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,g(e)}}(e,R)}))}}function _(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){x(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,g(e)))}t.exports={draw:g,drawOne:b,eraseActiveShape:function(e){if(!x(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&sp&&(e="X"),e}));return i>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),u+h}))}(t,l,c);if("pixel"===t.xsizemode){var b=l(t.xanchor);u=b+t.x0,f=b+t.x1}else u=l(t.x0),f=l(t.x1);if("pixel"===t.ysizemode){var _=c(t.yanchor);d=_-t.y0,p=_-t.y1}else d=c(t.y0),p=c(t.y1);if("line"===h)return"M"+u+","+d+"L"+f+","+p;if("rect"===h)return"M"+u+","+d+"H"+f+"V"+p+"H"+u+"Z";var w=(u+f)/2,T=(d+p)/2,M=Math.abs(w-u),k=Math.abs(T-d),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}},{"../../lib":244,"../../plots/cartesian/axes":291,"./constants":195}],206:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":302,"./attributes":193,"./calc_autorange":194,"./defaults":196,"./draw":198,"./draw_newshape/defaults":201}],207:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":238,"../../plot_api/edit_types":273,"../../plot_api/plot_template":280,"../../plots/animation_attributes":285,"../../plots/font_attributes":319,"../../plots/pad_attributes":324,"./constants":208}],208:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],209:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function D(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function O(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(k,t,e,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 C(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,m(t))}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,g);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var g={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(g[0],g[1]))}}}return N.call(F),I&&(S?N.on(".opacity",null):(k=0,A=!0,N.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)}))),N.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),N.classed("js-placeholder",A),T}}},{"../../constants/alignment":219,"../../constants/interactions":223,"../../lib":244,"../../lib/svg_text_utils":267,"../../plots/plots":325,"../../registry":327,"../color":103,"../drawing":125,"@plotly/d3":11,"fast-isnumeric":17}],213:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":238,"../../plot_api/edit_types":273,"../../plot_api/plot_template":280,"../../plots/font_attributes":319,"../../plots/pad_attributes":324,"../color/attributes":102}],214:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],215:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":244,"../../plots/array_container_defaults":286,"./attributes":213,"./constants":214}],216:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function v(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),m(e,n,a,i,t),l||g(e,n,a,i,t))}function m(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.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)),g(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function g(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,m=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?m=g.headerHeight+f.gapButtonHeader:h=g.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(m=-f.gapButtonHeader+f.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+m+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(v(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(v(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(g.openWidth,g.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(g.openHeight,g.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=m+g;S+A>c&&(S=c-A);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=D.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=g>T,C=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,I=h+v,R=m;I+C>s&&(I=s-C);var z=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:I,y:R,width:C,height:P}),this._vbarYMin=R+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,F=u-.5,E=O?f+C+.5:f+.5,j=d-.5,H=M?p+A+.5:p+.5,B=o._topdefs.selectAll("#"+N).data(M||O?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",N).append("rect"),M||O?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(E)-Math.floor(F),height:Math.ceil(H)-Math.floor(j)}),this.container.call(i.setClipUrl,N,this.gd),this.bg.attr({x:h,y:m,width:v,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||O){var Y=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(Y);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":244,"../color":103,"../drawing":125,"@plotly/d3":11}],219:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],220:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"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",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],221:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],222:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],223:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],224:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],225:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],226:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],228:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],229:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,v=s([r,n]);function m(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}v?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":251}],230:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),g=e.charAt(0);!c||"G"!==g&&"g"!==g||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:y);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),D=Number(T[11]||0);if(c){if(2===M.length)return u;var O;M=Number(M);try{var C=m.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),O=C.newDate(M,C.toMonthIndex(M,k,P),A)}else O=C.newDate(M,Number(k),A)}catch(e){return u}return O?(O.toJD()-v)*f+L*d+S*p+D*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var I=new Date(Date.UTC(2e3,k,A,L,S));return I.setUTCFullYear(M),I.getUTCMonth()!==k||I.getUTCDate()!==A?u:I.getTime()+D*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,M=3*d,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+v,S=Math.floor(s(e,f));try{i=m.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function O(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return D[r("%q")(a)]})),_(n))try{e=m.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+O(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return O(t,e,n,a)};var P=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+v,i=m.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-v)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&m.getComponentMethod("calendars","getCal")(t),u=0;u1||v<0||v>1?null:{x:e+s*v,y:t+f*v}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,v=d*d+p*p,m=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,v,e-a,t-i),s(d,p,v,r-a,n-i));return Math.sqrt(m)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":251}],242:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],243:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],244:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var v=e("./coerce");f.valObjectMeta=v.valObjectMeta,f.coerce=v.coerce,f.coerce2=v.coerce2,f.coerceFont=v.coerceFont,f.coercePattern=v.coercePattern,f.coerceHoverinfo=v.coerceHoverinfo,f.coerceSelectionMarkerOpacity=v.coerceSelectionMarkerOpacity,f.validate=v.validate;var m=e("./dates");f.dateTime2ms=m.dateTime2ms,f.isDateTime=m.isDateTime,f.ms2DateTime=m.ms2DateTime,f.ms2DateTimeLocal=m.ms2DateTimeLocal,f.cleanDate=m.cleanDate,f.isJSDate=m.isJSDate,f.formatDate=m.formatDate,f.incrementMonth=m.incrementMonth,f.dateTick0=m.dateTick0,f.dfltRange=m.dfltRange,f.findExactDates=m.findExactDates,f.MIN_MS=m.MIN_MS,f.MAX_MS=m.MAX_MS;var g=e("./search");f.findBin=g.findBin,f.sorterAsc=g.sorterAsc,f.sorterDes=g.sorterDes,f.distinctVals=g.distinctVals,f.roundUp=g.roundUp,f.sort=g.sort,f.findIndexOfMin=g.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var y=e("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var x=e("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=e("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");f.log=M.log,f.warn=M.warn,f.error=M.error;var k=e("./regex");f.counterRegex=k.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?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},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return R.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return E.apply(z,arguments)};var N={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return E.apply(N,arguments)};var F=/^[:|\|]/;function E(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,v="xother_"===l||"yother_"===l,m="xother"===l||"yother"===l||p||v||h,g=l;if((p||h)&&(g=g.substring(1)),(v||h)&&(g=g.substring(0,g.length-1)),m){if(void 0===(c=t[g]))return""}else for(d=3;d=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 j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(e,t){e.attr("transform",f.getTextTransform(t)),e.style("display",t.scale?null:"none")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var H=f.getFirefoxVersion(),B=null!==H&&H<86;f.getPositionFromD3Event=function(){return B?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":224,"./anchor_utils":228,"./angles":229,"./array":230,"./clean_number":231,"./clear_responsive":233,"./coerce":234,"./dates":235,"./dom":236,"./extend":238,"./filter_unique":239,"./filter_visible":240,"./geometry2d":241,"./identity":242,"./increment":243,"./is_plain_object":245,"./keyed_container":246,"./localize":247,"./loggers":248,"./make_trace_groups":249,"./matrix":250,"./mod":251,"./nested_property":252,"./noop":253,"./notifier":254,"./preserve_drawing_buffer":257,"./push_unique":258,"./regex":260,"./relative_attr":261,"./relink_private":262,"./search":263,"./sort_object_keys":265,"./stats":266,"./throttle":268,"./to_log_range":269,"@plotly/d3":11,"d3-format":13,"d3-time-format":14,"fast-isnumeric":17}],245:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],246:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":278,"./notifier":254}],249:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":11}],250:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],252:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,v=r.length,m=r[0][0],g=r[0][1],y=0;for(u=1;uMath.max(f,m)||c>Math.max(d,g)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":224,"./matrix":250}],257:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-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":17,"is-mobile":51}],258:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":230,"fast-isnumeric":17}],267:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,v){var A=e.text(),L=!e.attr("data-notex")&&t&&t._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(s),O=n.select(e.node().parentNode);if(!O.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s,d=parseInt((MathJax.version||"").split(".")[0]);if(2!==d&&3!==d)return void a.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+a.randstr({},64),i=(s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(i):MathJax.typeset([i])},h=function(){var t=s.select(2===d?".MathJax_SVG":".MathJax"),i=!t.empty()&&s.select("svg").node();if(i){var o,l=i.getBoundingClientRect();o=2===d?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,l)}else a.log("There was an error in the tex syntax.",e),r();s.remove()};2===d?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:f},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,h,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})):3===d&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),h(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(L[2],o,(function(n,a,o){O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var s=O.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild);var c=o.width,u=o.height;l.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=e.node().style.fill||"black",d=l.select("g");d.attr({fill:f,stroke:f});var p=d.node().getBoundingClientRect(),h=p.width,m=p.height;(h>c||m>u)&&(l.style("overflow","hidden"),h=(p=l.node().getBoundingClientRect()).width,m=p.height);var g=+e.attr("x"),y=+e.attr("y"),x=-(r||e.node().getBoundingClientRect().height)/4;if("y"===C[0])s.attr({transform:"rotate("+[-90,g,y]+")"+i(-h/2,x-m/2)});else if("l"===C[0])y=x-m/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))g=0,y=x;else{var b=e.attr("text-anchor");g-=h*("middle"===b?.5:"end"===b?1:0),y=y+x-m/2}l.attr({x:g,y:y}),v&&v.call(e,s),t(s)}))}))):P(),e}function P(){O.empty()||(C=e.attr("class")+"-math",O.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(m," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(g),O=0;O|>|>)/g;var f=[["$","$"],["\\(","\\)"]];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"},v=["http:","https:","mailto:","",void 0,":"],m=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//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 M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],l="",s=0,c=0;ca?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(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function D(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==v.indexOf(a)&&-1!==v.indexOf(i)?t:""}function O(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.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 e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(m," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],269:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":17}],270:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],271:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],272:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(e);for(t=0;t3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!v&&(d(m,g),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),D=S||[],O=u(g,f).get(),C=[],P=-1,I=D.length;for(x=0;xD.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?C.push(_):k?("add"===M&&(M={}),D.splice(_,0,M),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===P&&(P=_);else for(b=0;b=0;x--)D.splice(C[x],1),O&&O.splice(C[x],1);if(D.length?S||t.set(D):t.set(null),v)return!1;if(d(m,g),h!==a){var R;if(-1===P)R=L;else{for(I=Math.max(D.length,I),R=[],x=0;x=P);x++)R.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=O(r,e.data.length-1),t)for(var v=0;v-1&&-1===r.indexOf("grouptitlefont")?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=G(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag,d.reselect),c.add(e,B,[e,a.undoit],B,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.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[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[];for(var n in t){var a=p.getFromId(e,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)t[i]||r.push(i)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Z=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function G(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=F(s._preGUI,c),h=Object.keys(t),v=p.list(e),m=o.extendDeepAll({},t),g={};for(H(t),h=Object.keys(t),n=0;n0&&"string"!=typeof I.parts[z];)z--;var E=I.parts[z],j=I.parts[z-1]+"."+E,B=I.parts.slice(0,z).join("."),Y=l(e.layout,B).get(),V=l(s,B).get(),G=I.get();if(void 0!==R){A[P]=R,L[P]="reverse"===E?R:N(G);var J=f.getLayoutValObject(s,I.parts);if(J&&J.impliedEdits&&null!==R)for(var X in J.impliedEdits)S(o.relativeAttr(P,X),J.impliedEdits[X]);if(-1!==["width","height"].indexOf(P))if(R){S("autosize",null);var K="height"===P?"width":"height";S(K,s[K])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",R?null:s.width),S("height",R?null:s.height);else if(j.match(U))C(j),l(s,B+"._inputRange").set(null);else if(j.match(Z)){C(j),l(s,B+"._inputRange").set(null);var Q=l(s,B).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(q)&&l(s,B+"._inputDomain").set(null);if("type"===E){D=Y;var $="linear"===V.type&&"log"===R,ee="log"===V.type&&"linear"===R;if($||ee){if(D&&D.range)if(V.autorange)$&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var te=D.range[0],re=D.range[1];$?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete s[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,R,S),u.getComponentMethod("images","convertCoords")(e,V,R,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(E.match(M)){var ne=l(s,P).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=J||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(R)?L[P]=null:b.isRemoveVal(R)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),g[r]||(g[r]={});var se=g[r][n];se||(se=g[r][n]={}),se[oe]=R,delete t[P]}else"reverse"===E?(Y.range?Y.range.reverse():(S(B+".autorange",!0),Y.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):("dragmode"===P&&(!1===R&&!1!==G||!1!==R&&!1===G)||s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===R||"select"===R)&&"lasso"!==G&&"select"!==G||s._has("gl2d")?k.plot=!0:J?T.update(k,J):k.calc=!0,I.set(R))}}for(r in g){b.applyContainerArrayChanges(e,d(i,r),g[r],k,d)||(k.plot=!0)}for(var ce in O){var ue=(D=p.getFromId(e,ce))&&D._constraintGroup;if(ue)for(var fe in k.calc=!0,ue)O[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:O,undoit:L,redoit:A,eventData:m}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=G(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),Y(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&V(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag,d.reselect),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function X(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{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 $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,v,m=0;function g(e){return Array.isArray(a)?m>=a.length?e.transitionOpts=a[m]:e.transitionOpts=a[0]:e.transitionOpts=a,m++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:g(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(v);y=k}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var v=t[n].name,m=(u[v]||h[v]||{}).name,g=t[n].name,y=u[m]||h[m];m&&g&&"number"==typeof g&&y&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[m]||h[m]).name+'" with a frame whose name of type "number" also equates to "'+m+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&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[v]={name:v},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!y(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function y(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return g(a,t,l)},r.getLayoutValObject=function(e,t){return g(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":244,"../plots/attributes":287}],281:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),v=h.enforce,m=h.clean,g=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,v,m=e._fullLayout,g=m._size,x=g.p,_=d.list(e,"",!0);if(m._paperdiv.style({width:e._context.responsive&&m.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":m.width+"px",height:e._context.responsive&&m.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":m.height+"px"}).selectAll(".main-svg").call(c.setSize,m.width,m.height),e._context.setBackground(e,m.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!m._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:g.l+g.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(m.paper_bgcolor)&&1===s.opacity(m.plot_bgcolor)&&m.paper_bgcolor===m.plot_bgcolor;for(a in m._plots)if((l=m._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var D=l.xaxis.domain,O=l.yaxis.domain,C=l.plotgroup;if(y(D,O,L)){var P=C.node(),I=l.bg=o.ensureSingle(C,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([D,O]),S||(k.push(a),A.push(a))}var R,z,N,F,E,j,H,B,Y,V,U,Z,q,G=m._bgLayer.selectAll(".bg").data(k);for(G.enter().append("rect").classed("bg",!0),G.exit().remove(),G.each((function(e){m._plots[e].bg=n.select(this)})),t=0;tT?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 e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=v(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&m(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(g)}},{"../lib":244,"../plots/attributes":287,"../plots/plots":325,"./plot_config":278,"./plot_schema":279,"./plot_template":280}],283:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function v(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!v("width")&&null!==t.width||!v("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!v("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var m={};function g(e,r){return o.coerce(t,m,f,e,r)}var y=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},d);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function D(){return new Promise((function(e,t){var r=s(M,y,_),n=M._fullLayout.width,f=M._fullLayout.height;function d(){a.purge(M),document.body.removeChild(M)}if("full-json"===y){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(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(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(D).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":244,"../plots/plots":325,"../snapshot/helpers":331,"../snapshot/svgtoimg":333,"../snapshot/tosvg":335,"../version":400,"./plot_api":277,"fast-isnumeric":17}],284:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,g.concat(x.length)));var k,A,L,S,D,O=x.length,C=Array.isArray(M);if(C&&(O=Math.min(O,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,g.concat(A,x[A].length)));var P=x[A].length;for(k=0;k<(C?Math.min(P,M[A].length):P);k++)L=C?M[A][k]:M,S=y[A][k],D=x[A][k],n.validate(S,L)?D!==S&&D!==+S&&a.push(h("dynamic",i,g.concat(A,k),S,D)):a.push(h("value",i,g.concat(A,k),S))}else a.push(h("array",i,g.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(v);for(var m=v._fullData,g=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,v=e[r+"period0"],m=i(v,d)||0,g=[],y=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,d);for(;M<=k;)M=o(M,c,d);T=o(M,-c,d)}else{for(M=m+(w=Math.round((k-m)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}g[_]=p?T:h?M:(T+M)/2,y[_]=T,x[_]=M}return{vals:g,starts:y,ends:x}}},{"../../constants/numerical":224,"../../lib":244,"fast-isnumeric":17}],289:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],290:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=v(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,m=f[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>D?M/T>O&&(_=x,w=b,O=M/T):M/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=M/S));if(d===m){var C=d-1,P=d+1;if(A)if(0===d)a=[0,1];else{var I=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=d/(1-Math.min(.5,I/S));a=d>0?[0,R]:[R,0]}else a=L?[Math.max(0,C),Math.max(1,P)]:[C,P]}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-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-O*l(_),w.val+O*s(w)];return g&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),D=k(r.vpadminus||r.vpad);if(!T){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=P;n--)C(n);return{min:h,max:v,opts:r}},concatExtremes:v};function v(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":125,"../../constants/numerical":224,"../../lib":244,"../../registry":327,"./axis_ids":295,"@plotly/d3":11,"fast-isnumeric":17}],291:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),v=e("../../constants/numerical"),m=v.ONEMAXYEAR,g=v.ONEAVGYEAR,y=v.ONEMINYEAR,x=v.ONEMAXQUARTER,b=v.ONEAVGQUARTER,_=v.ONEMINQUARTER,w=v.ONEMAXMONTH,T=v.ONEAVGMONTH,M=v.ONEMINMONTH,k=v.ONEWEEK,A=v.ONEDAY,L=A/2,S=v.ONEHOUR,D=v.ONEMIN,O=v.ONESEC,C=v.MINUS_SIGN,P=v.BADNUM,I={K:"zeroline"},R={K:"gridline",L:"path"},z={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},F={K:"tick",L:"text"},E={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j=e("../../constants/alignment"),H=j.MID_SHIFT,B=j.CAP_SHIFT,Y=j.LINE_SPACING,V=j.OPPOSITE_SIDE,U=t.exports={};U.setConvert=e("./set_convert");var Z=e("./axis_autotype"),q=e("./axis_ids"),G=q.idSort,W=q.isLinked;U.id2name=q.id2name,U.name2id=q.name2id,U.cleanId=q.cleanId,U.list=q.list,U.listIds=q.listIds,U.getFromId=q.getFromId,U.getFromTrace=q.getFromTrace;var J=e("./autorange");U.getAutoRange=J.getAutoRange,U.findExtremes=J.findExtremes;function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}U.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},U.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},U.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==U.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=U.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},U.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:U.getFromId(t,r).cleanPos)(e)},U.redrawComponents=function(e,t){t=t||U.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;ur&&f2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},U.saveRangeInitial=function(e,t){for(var r=U.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=U.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=U.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=U.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,g,c,i)),m=y,0;m<=u;)m=U.tickIncrement(m,g,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(m,0,i),size:g,_dataSpan:u-c}},U.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,i=t.dtick&&a(t._tmin);if(i){var o=U.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var s=l.simpleMap(t.range,t.r2l);n=[s[0],.8*s[0]+.2*s[1]]}if(e.range=l.simpleMap(n,t.l2r),e._isMinor=!0,U.prepTicks(e,r),i){var c=a(t.dtick),u=a(e.dtick),f=c?t.dtick:+t.dtick.substring(1),d=u?e.dtick:+e.dtick.substring(1);c&&u?ee(f,d)?f===2*k&&d===2*A&&(e.dtick=k):f===2*k&&d===3*A?e.dtick=k:f!==k||(t._input.minor||{}).nticks?te(f/d,2.5)?e.dtick=f/2:e.dtick=f:e.dtick=A:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ee(f,d)?f>=12&&2===d&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ee(f,d)||(e.dtick=te(f/d,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},U.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,U.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=U.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dtick=(I?0:1);R--){var z=!R;R?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var N=R?e:l.extendFlat({},e,e.minor);if(z?U.prepMinorTicks(N,e,t):U.prepTicks(N,t),"array"!==N.tickmode){var F=X(u),E=F[0],j=F[1],H=a(N.dtick),B="log"===i&&!(H||"L"===N.dtick.charAt(0)),Y=U.tickFirst(N,t);if(R){if(e._tmin=Y,Y=j:G<=j;G=U.tickIncrement(G,W,f,o)){if(R&&V++,N.rangebreaks&&!f){if(G=p)break}if(O.length>h||G===q)break;q=G;var J={value:G};R?(B&&G!==(0|G)&&(J.simpleLabel=!0),s>1&&V%s&&(J.skipLabel=!0),O.push(J)):(J.minor=!0,C.push(J))}}else R?(O=[],v=ne(e)):(C=[],D=ne(e))}if(I&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=O.map((function(e){return e.value})),Q=[],$=0;$0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=m?u:g:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=M?d=u>=M&&u<=w?u:T:r===k&&f>=k?d=k: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(t.rangebreaks&&d>0){for(var h=0,v=0;v<84;v++){var D=(v+.5)/84;t.maskBreaks(a*(1-D)+D*p)!==P&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>k&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(O,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),oe=1;"auto"===e.tickmode&&(oe=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=O.length-1;r>-1;r--)if(O[r].drop)O.splice(r,1);else{O[r].value=Pe(O[r].value,e);var se=e.c2p(O[r].value);(ie?le>se-oe:lep||uep&&(ce.periodX=p),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=D&&i<=16||t>=S)e._tickround="M";else if(t>=O&&i<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ve(e.exponentformat)&&!me(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}U.autoTicks=function(e,t,r){var n;function i(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var o=2*t;if(o>g)t/=g,n=i(10),e.dtick="M"+12*fe(t,n,ae);else if(o>T)t/=T,e.dtick="M"+fe(t,1,ie);else if(o>A){if(e.dtick=fe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:le),!r){var s=U.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(s)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else o>S?e.dtick=fe(t,S,ie):o>D?e.dtick=fe(t,D,oe):o>O?e.dtick=fe(t,O,oe):(n=i(10),e.dtick=fe(t,n,ae))}else if("log"===e.type){e.tick0=0;var u=l.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=i(10),e.dtick="L"+fe(t,n,ae)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Ce(e)?(e.tick0=0,n=1,e.dtick=fe(t,n,ue)):(e.tick0=0,n=i(10),e.dtick=fe(t,n,ae));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},U.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ce:se,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},U.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=ge(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||ve(p)&&me(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":C)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":C)+d:(t.text=ge(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,v):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):Ce(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=ge(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=ge(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,v):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=ge(t.x,e,a,n)}(e,o,0,c,v),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var m=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[m(o.x-.5),m(o.x+e.dtick-.5)]}return o},U.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return U.hoverLabelText(e,n,r)+" - "+U.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=U.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var he=["f","p","n","\u03bc","m","","k","M","G","T"];function ve(e){return"SI"===e||"B"===e}function me(e){return e>14||e<-15}function ge(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=U.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};de(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ve(s)&&(e+=he[c/3+5]));return i?C+e:e}function ye(e,t){if(e){var r=Object.keys(E).reduce((function(e,r){return-1!==t.indexOf(r)&&E[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function xe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var m=r.right-(t._offset+t._length);m>0&&(n.xr=1,n.r=m);var g=t._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[v]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=we(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[v]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[v]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ae&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ye(n,t.automargin),ye(a,t.automargin)),i.autoMargin(e,ke(t),n),i.autoMargin(e,Ae(t),a),i.autoMargin(e,Le(t),l)})),r.skipTitle||ae&&"bottom"===t.side||re.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+we(t);else{var l=Ie(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,v=U.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?v-r:v+r):(p=t._offset+t._length/2,f="right"===t.side?v+r:v-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var m=t._selections[t._id+"tick"];if(h={selection:m,side:t.side},m&&m.node()&&m.node().parentNode){var g=d.getTranslate(m.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(re)}}function ie(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=Me(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},U.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],a=e.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},U.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},U.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},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=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*B,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-B));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(be(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(be(t)))}},U.makeTickPath=function(e,t,r,n){n||(n={});var a=n.minor;if(a&&!e.minor)return"";var i=void 0!==n.len?n.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*r)+"v"+i*r:"M"+(t+l*r)+",0h"+i*r},U.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,v=d?e.ticklen:0;if(f?v*=-1:u&&(v=0),d&&(p+=v,r)){var m=l.deg2rad(r);p=v*Math.cos(m)+1,h=v*Math.sin(m)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var g,y,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!f&&"bottom"===M||f&&"top"===M)?1:-1,f&&(b*=-1),g=h*b,y=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=H:x=-90===A&&"bottom"===M?B:90===A&&"top"===M?H:.5,T=H/2*(A/90)),w.xFn=function(e){return e.dx+g+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===k){if(b=(_=!f&&"left"===M||f&&"right"===M)?1:-1,f&&(b*=-1),g=p,y=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?B:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*B*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*H},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},U.drawTicks=function(e,t,r){r=r||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,_e);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return d.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Re(t,[N]),o.attr("transform",r.transFn)},U.drawGrid=function(e,t,r){r=r||{};var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?r.vals.filter((function(e){return e.minor})):[],l=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],s=r.counterAxis;if(s&&U.shouldShowZeroLine(e,t,s))for(var c="array"===t.tickmode,u=0;u=0;g--){var y=g?v:m;if(y){var x=y.selectAll("path."+a).data(g?l:o,_e);x.exit().remove(),x.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return d.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}Re(t,[R,z])},U.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=U.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return G(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Re(t,[I])},U.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,v=r.secondary?0:t.tickangle,m=(t._prevTickAngles||{})[f],g=r.layer.selectAll("g."+f).data(t.showticklabels?p:[],_e),y=[];function x(e,i){e.each((function(e){var o=n.select(this),l=o.select(".text-math-group"),u=h.anchorFn(e,i),f=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=c.lineCount(o),v=Y*e.fontSize,m=h.heightFn(e,a(i)?+i:0,(p-1)*v);if(m&&(f+=s(0,m)),l.empty()){var g=o.select("text");g.attr({transform:f,"text-anchor":u}),g.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var y=d.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr("transform",f+s(y,0))}}))}g.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(d.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?y.push(e._promises.pop().then((function(){x(r,v)}))):x(r,v)})),Re(t,[F]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),s=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=l.simpleMap(t.range,t.r2l);s=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var f=Math.min(s,c),p=Math.max(s,c),h=t.side,v=1/0,m=-1/0;for(var y in g.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=d.bBox(r.node()),l=0;o?(i.right>p||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(g,m+1?m:v);var b=null;t._selections&&(t._selections[f]=g);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===m?(b=90,_.push((function(){x(g,m)}))):_.push((function(){if(x(g,v),p.length&&"x"===u&&!a(v)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=Me(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"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),m=f("left"),y=f("right"),_=f("bottom")||m||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var m="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,m)?"category":function(e,t){for(var r=e.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=m;break}var f=a("pattern",u);if(f===m)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case m:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":327,"./constants":298}],296:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function m(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rI&&FC&&(C=F);d/=(C-O)/(2*P),O=s.l2r(O),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){P&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),P=!1)}function Z(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function q(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,v=0;v=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ge||Ue(),me)o.indexOf("select")>-1&&L(r,a,X,K,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ge){var l=v?I:P,c="s"===v||"w"===g?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",m="middle";if(l.fixedrange)return;v?(m="n"===v?"top":"bottom","right"===l.side&&(h="right")):"e"===g&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:m}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,De.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),De.attr("d",Z(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,De.attr("d",Z(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;uv[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":244,"fast-isnumeric":17}],308:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,l=n(e);r("tickprefix")&&r("showtickprefix",l),r("ticksuffix",o)&&r("showticksuffix",l)}},{"./show_dflt":311}],309:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":219}],310:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,v=p.BADNUM,m=p.LOG_CLIP,g=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*m*Math.abs(n-a))}return v}function D(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===v){if(!l(t))return v;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function O(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function P(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return v}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=I(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:I(e)}function N(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var E=function(t){return l(t)?N(t,e._m,e._b):v},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var H="y"===p;E=function(t){if(!l(t))return v;var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?N(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:f,e.l2c="log"===e.type?A:f,e.l2p=E,e.p2l=j,e.c2p="log"===e.type?function(e,t){return E(S(e,t))}:E,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=O,e.d2p=e.r2p=function(t,r,n){return e.l2p(D(t,0,n))},e.p2d=e.p2r=function(e,t,r){return O(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,v,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=f,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function m(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),v=i.simpleMap(t.xr1,a.r2l),m=h[1]-h[0],g=v[1]-v[0];p[0]=(h[0]*(1-r)+r*v[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*g/m),a.range[0]=a.l2r(h[0]*(1-r)+r*v[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*v[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,M=f?p[0]:0,k=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,D=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,D).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":125,"../../lib":244,"../../registry":327,"./axes":291,"@plotly/d3":11}],316:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.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=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(d,s,f,n),b.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),H=!(!s._has||!s._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||H;B&&!Y?n._bgLayer.remove():Y&&!B&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,v=!t.height&&Math.abs(r.height-a)>1;(v||h)&&(h&&(r.width=n),v&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:x,size:r.l+m},r:{val:_,size:r.r+m},b:{val:T,size:r.b+m},t:{val:w,size:r.t+m}},v[t]=1}else delete h[t],delete v[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),O(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,v=t._pushmargin,m=t._pushmarginIds,g=t.minreducedwidth,y=t.minreducedheight;if(!1!==t.margin.autoexpand){for(var x in v)m[x]||delete v[x];for(var _ in v.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},v){var w=v[_].l||{},T=v[_].b||{},M=w.val,k=w.size,A=T.val,L=T.size;for(var S in v){if(o(k)&&v[S].r){var D=v[S].r.val,C=v[S].r.size;if(D>M){var P=(k*D+(C-r)*M)/(D-M),I=(C*(1-M)+(k-r)*(1-D))/(D-M);P+I>c+f&&(c=P,f=I)}}if(o(L)&&v[S].t){var R=v[S].t.val,z=v[S].t.size;if(R>A){var N=(L*R+(z-n)*A)/(R-A),F=(z*(1-A)+(L-n)*(1-R))/(R-A);N+F>h+d&&(h=N,d=F)}}}}}var E=u.constrain(r-i.l-i.r,2,g),j=u.constrain(n-i.t-i.b,2,y),H=Math.max(0,r-E),B=Math.max(0,n-j);if(H){var Y=(c+f)/H;Y>1&&(c/=Y,f/=Y)}if(B){var V=(h+d)/B;V>1&&(h/=V,d/=V)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(m).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(R(o,c,f),a=0;a0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":103,"../components/drawing":125,"../constants/xmlns_namespaces":225,"../lib":244,"@plotly/d3":11}],336:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function R(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[f+"a"],N=e[d+"a"];v=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(m,F,e),!1!==e.index&&m[e.index].p!==c){M||(D=function(e){return Math.min(k(e),e.p-y.bargroupwidth/2)},O=function(e){return Math.max(A(e),e.p+y.bargroupwidth/2)});var E=m[e.index],j=g.base?E.b+E.s:E.s;e[d+"0"]=e[d+"1"]=N.c2p(E[d],!0),e[d+"LabelVal"]=j;var H=y.extents[y.extents.round(E.p)];e[f+"0"]=z.c2p(x?D(E):H[0],!0),e[f+"1"]=z.c2p(x?O(E):H[1],!0);var B=void 0!==E.orig_p;return e[f+"LabelVal"]=B?E.orig_p:E.p,e.labelLabel=s(z,e[f+"LabelVal"],g[f+"hoverformat"]),e.valueLabel=s(N,e[d+"LabelVal"],g[d+"hoverformat"]),e.baseLabel=s(N,E.b,g[d+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(E)+function(e){return C(k(e),A(e),w)}(E))/2,e[f+"Spike"]=z.c2p(E.p,!0),o(E,g,e),e.hovertemplate=g.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=f(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":103,"../../components/fx":143,"../../constants/numerical":224,"../../lib":244,"../../plots/cartesian/axes":291,"../../registry":327,"./helpers":343}],345:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":303,"../scatter/marker_colorbar":385,"./arrays_to_calcdata":336,"./attributes":337,"./calc":338,"./cross_trace_calc":340,"./defaults":341,"./event_data":342,"./hover":344,"./layout_attributes":346,"./layout_defaults":347,"./plot":348,"./select":349,"./style":351}],346:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],347:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function D(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,v=a.height,m=Math.abs(t-e),g=Math.abs(n-r),y=m>2*_&&g>2*_?_:0;m-=2*y,g-=2*y;var x=L(s);"auto"!==s||h<=m&&v<=g||!(h>m||v>g)||(h>g||v>m)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};E=Z(E,j,z),j=Z(j,E,z),H=Z(H,B,!z),B=Z(B,H,!z)}var q=k(i.ensureSingle(P,"path"),C,m,g);if(q.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-E)*(B-H))||Y&&e._context.staticPlot?"M0,0Z":"M"+E+","+H+"V"+B+"H"+j+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&N){var G=s.makePointStyleFns(f);s.singlePointStyle(c,q,f,G,e)}!function(e,t,r,n,a,l,c,f,p,m,g){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,I="h"===P.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="histogram"===o.type,h="waterfall"===o.type,v="funnel"===o.type,m="h"===o.orientation;m?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,d.c2l(e),!0).text}var y=t[r],x={};x.label=y.p,x.labelLabel=x[s+"Label"]=(_=y.p,u(c,c.c2l(_),!0).text);var _;var w=i.castOption(o,y.i,"text");(0===w||w)&&(x.text=w);x.value=y.s,x.valueLabel=x[f+"Label"]=g(y.s);var T={};b(T,o,y.i),(p||void 0===T.x)&&(T.x=m?x.value:x.label);(p||void 0===T.y)&&(T.y=m?x.label:x.value);(p||void 0===T.xLabel)&&(T.xLabel=m?x.valueLabel:x.labelLabel);(p||void 0===T.yLabel)&&(T.yLabel=m?x.labelLabel:x.valueLabel);h&&(x.delta=+y.rawS||y.s,x.deltaLabel=g(x.delta),x.final=y.v,x.finalLabel=g(x.final),x.initial=x.final-x.delta,x.initialLabel=g(x.initial));v&&(x.value=y.s,x.valueLabel=g(x.value),x.percentInitial=y.begR,x.percentInitialLabel=i.formatPercent(y.begR),x.percentPrevious=y.difR,x.percentPreviousLabel=i.formatPercent(y.difR),x.percentTotal=y.sumR,x.percenTotalLabel=i.formatPercent(y.sumR));var M=i.castOption(o,y.i,"customdata");M&&(x.customdata=M);return i.texttemplateString(l,x,e._d3locale,T,x,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),v=[],m=function(e){return-1!==h.indexOf(e)};m("label")&&v.push((g=e[t].p,u(o?n:r,g,!0).text));var g;m("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&v.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;m("initial")&&v.push(c(b)),m("delta")&&v.push(c(y)),m("final")&&v.push(c(x))}if(s){m("value")&&v.push(c(p.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),v.push(f)),m("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),v.push(f)),m("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),v.push(f))}return v.join("
")}(t,r,n,a):v.getValue(l.text,r);return v.coerceString(y,o)}(O,n,a,T,A);w=function(e,t){var r=v.getValue(e.textposition,t);return v.coerceEnumerated(x,r)}(P,a);var z="stack"===m.mode||"relative"===m.mode,N=n[a],F=!z||N._outmost;if(!R||"none"===w||(N.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var E=O.font,j=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,E,j),B=h.getOutsideTextFont(P,a,E),Y=r.datum();I?"log"===T.type&&Y.s0<=0&&(l=T.range[0]=Z*(J/q):J>=q*(W/Z);Z>0&&q>0&&(X||K||Q)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){G=i.ensureUniformFontSize(e,"outside"===w?B:H);var $=(V=C(r,R,G)).attr("transform");if(V.attr("transform",""),U=s.bBox(V.node()),Z=U.width,q=U.height,V.attr("transform",$),Z<=0||q<=0)return void V.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var v=L(c),m=S(a,v),g=(l?m.x:m.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*g):(w=n+A*o,k=-A*g);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:v}}(l,c,f,p,U,{isHorizontal:I,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=D(l,c,f,p,U,{isHorizontal:I,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=G.size,d("histogram"===P.type?"bar":P.type,ee,O),N.transform=ee;var ne=k(V,O,m,g);i.setTransormAndDisplay(ne,ee)}(e,t,P,r,p,E,j,H,B,m,g),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,m)},toMoveInsideBar:D}},{"../../components/color":103,"../../components/drawing":125,"../../components/fx/helpers":139,"../../lib":244,"../../lib/svg_text_utils":267,"../../plots/cartesian/axes":291,"../../registry":327,"./attributes":337,"./constants":339,"./helpers":343,"./style":351,"./uniform_text":353,"@plotly/d3":11,"fast-isnumeric":17}],349:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:v,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,m(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":103,"../../components/drawing":125,"../../lib":244,"../../registry":327,"./attributes":337,"./helpers":343,"./uniform_text":353,"@plotly/d3":11}],352:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":103,"../../components/colorscale/defaults":113,"../../components/colorscale/helpers":114,"../../lib":244}],353:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o=0})),("funnelarea"===t.type?g:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=m),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var v=c("textposition");l(e,t,n,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(v)||"auto"===v||"outside"===v)&&c("automargin"),("inside"===v||"auto"===v||Array.isArray(v))&&c("insidetextorientation")}o(t,n,c);var m=c("hole");if(c("title.text")){var g=c("title.position",m?"middle center":"top center");m||"middle center"!==g||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":244,"../../plots/domain":318,"../bar/defaults":341,"./attributes":354,"fast-isnumeric":17}],358:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":139}],359:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:f.hovertemplate||-1!==d.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,e.pts)||e.color,borderColor:m.castOption(_.bordercolor,e.pts),fontFamily:m.castOption(w.family,e.pts),fontSize:m.castOption(w.size,e.pts),fontColor:m.castOption(w.color,e.pts),nameLength:m.castOption(_.namelength,e.pts),textAlign:m.castOption(_.align,e.pts),hovertemplate:m.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=m.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=m.castOption(e._input.textfont.color,t.pts));var a=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,i=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;m-=2)g(Math.PI*m,"tan");for(m=4;m>=-4;m-=2)g(Math.PI*(m+1),"tan")}if(f||p){for(m=4;m>=-4;m-=2)g(Math.PI*(m+1.5),"rad");for(m=4;m>=-4;m-=2)g(Math.PI*(m+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;v.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(i)),(h||d)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(i));for(var x=0,b=0,_=0;_=1)break}return v[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*v);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*v);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function D(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function O(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.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+=e.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-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n1?(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")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:m.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:m.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=m.getFirstFilled(a.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function N(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._context.staticPlot,i=e._fullLayout,d=i._size;h("pie",i),_(t,e),I(t,d);var v=s.makeTraceGroups(i._pielayer,t,"trace").each((function(t){var h=n.select(this),v=t[0],g=v.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=m.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.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))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var y=n.select(this).selectAll("g.slice").data(t);y.enter().append("g").classed("slice",!0),y.exit().remove();var _=[[[],[]],[[],[]]],T=!1;y.each((function(a,o){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=g.index,_[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var c=v.cx,u=v.cy,d=n.select(this),h=d.selectAll("path.surface").data([a]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),d.call(x,e,t),g.pull){var y=+m.castOption(g.pull,a.pts)||0;y>0&&(c+=y*a.pxmid[0],u+=y*a.pxmid[1])}a.cxFinal=c,a.cyFinal=u;var M=g.hole;if(a.v===v.vTotal){var k="M"+(c+a.px0[0])+","+(u+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";M?h.attr("d","M"+(c+M*a.px0[0])+","+(u+M*a.px0[1])+C(a.px0,a.pxmid,!1,M)+C(a.pxmid,a.px0,!1,M)+"Z"+k):h.attr("d",k)}else{var A=C(a.px0,a.px1,!0,1);if(M){var L=1-M;h.attr("d","M"+(c+M*a.px1[0])+","+(u+M*a.px1[1])+C(a.px1,a.px0,!1,M)+"l"+L*a.px0[0]+","+L*a.px0[1]+A+"Z")}else h.attr("d","M"+c+","+u+"l"+a.px0[0]+","+a.px0[1]+A+"Z")}z(e,a,v);var S=m.castOption(g.textposition,a.pts),O=d.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);O.enter().append("g").classed("slicetext",!0),O.exit().remove(),O.each((function(){var r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=m.castOption(e.outsidetextfont.color,t.pts)||m.castOption(e.textfont.color,t.pts)||r.color,a=m.castOption(e.outsidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,i=m.castOption(e.outsidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(g,a,i.font):b(g,a,i.font));r.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,e);var h,y=l.bBox(r.node());if("outside"===S)h=D(y,a);else if(h=w(y,a,v),"auto"===S&&h.scale<1){var x=s.ensureUniformFontSize(e,g.outsidetextfont);r.call(l.font,x),h=D(y=l.bBox(r.node()),a)}var _=h.textPosAngle,M=void 0===_?a.pxmid:R(v.r,_);if(h.targetX=c+M[0]*h.rCenter+(h.x||0),h.targetY=u+M[1]*h.rCenter+(h.y||0),N(h,y),h.outside){var k=h.targetY;a.yLabelMin=k-y.height/2,a.yLabelMid=k,a.yLabelMax=k+y.height/2,a.labelExtraX=0,a.labelExtraY=0,T=!0}h.fontSize=d.size,p(g.type,h,i),t[o].transform=h,s.setTransormAndDisplay(r,h)}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*v.r+","+n*v.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var M=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(M.enter().append("g").classed("titletext",!0),M.exit().remove(),M.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.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,e),t="middle center"===g.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(v):O(v,d),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),T&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,h;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-h;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(m.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-g)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?v:g,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(y,g),T&&g.automargin){var k=l.bBox(h.node()),A=g.domain,L=d.w*(A.x[1]-A.x[0]),S=d.h*(A.y[1]-A.y[0]),C=(.5*L-v.r)/d.w,P=(.5*S-v.r)/d.h;a.autoMargin(e,"pie."+g.uid+".automargin",{xl:A.x[0]-C,xr:A.x[1]+C,yb:A.y[0]-P,yt:A.y[1]+P,l:Math.max(v.cx-v.r-k.left,0),r:Math.max(k.right-(v.cx+v.r),0),b:Math.max(k.bottom-(v.cy+v.r),0),t:Math.max(v.cy-v.r-k.top,0),pad:5})}}))}));setTimeout((function(){v.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:N}},{"../../components/color":103,"../../components/drawing":125,"../../components/fx":143,"../../lib":244,"../../lib/svg_text_utils":267,"../../plots/plots":325,"../bar/constants":339,"../bar/uniform_text":353,"./event_data":358,"./helpers":359,"@plotly/d3":11}],364:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":353,"./style_one":365,"@plotly/d3":11}],365:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":103,"./helpers":359}],366:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&O[g].gap;)g--;for(x=O[g].s,v=O.length-1;v>g;v--)O[v].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],374:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),v=e("./fillcolor_defaults"),m=e("../../lib").coercePattern;t.exports=function(e,t,r,g){function y(r,a){return n.coerce(e,t,i,r,a)}var x=s(e,t,g,y);if(x||(t.visible=!1),t.visible){c(e,t,g,y),y("xhoverformat"),y("yhoverformat");var b=u(e,t,g,y),_=!b&&x=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&v<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-v);return iG!=(j=R[P][1])>=G&&(N=R[P-1][0],F=R[P][0],j-E&&(z=N+(F-N)*(G-E)/(j-E),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:U,y0:G,y1:G,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":103,"../../components/fx":143,"../../lib":244,"../../registry":327,"./get_trace_color":377}],379:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":303,"./arrays_to_calcdata":366,"./attributes":367,"./calc":368,"./cross_trace_calc":372,"./cross_trace_defaults":373,"./defaults":374,"./format_labels":376,"./hover":378,"./marker_colorbar":385,"./plot":388,"./select":389,"./style":391,"./subtypes":392}],380:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){s||(s={});var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},{"../../components/colorscale/defaults":113,"../../components/colorscale/helpers":114,"../../lib":244}],381:[function(e,t,r){"use strict";var n=e("../../components/drawing"),a=e("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,c=e("../../lib"),u=c.segmentsIntersect,f=c.constrain,d=e("./constants");t.exports=function(e,t){var r,a,o,p,h,v,m,g,y,x,b,_,w,T,M,k,A,L,S=t.trace||{},D=t.xaxis,O=t.yaxis,C="log"===D.type,P="log"===O.type,I=D._length,R=O._length,z=t.backoff,N=S.marker,F=t.connectGaps,E=t.baseTolerance,j=t.shape,H="linear"===j,B=S.fill&&"none"!==S.fill,Y=[],V=d.minTolerance,U=e.length,Z=new Array(U),q=0;function G(r){var n=e[r];if(!n)return!1;var a=t.linearized?D.l2p(n.x):D.c2p(n.x),o=t.linearized?O.l2p(n.y):O.c2p(n.y);if(a===i){if(C&&(a=D.c2p(n.x,!0)),a===i)return!1;P&&o===i&&(a*=Math.abs(D._m*R*(D._m>0?l:s)/(O._m*I*(O._m>0?l:s)))),a*=1e3}if(o===i){if(P&&(o=O.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function W(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&coe||e[1]se)return[f(e[0],ie,oe),f(e[1],le,se)]}function fe(e,t){return e[0]===t[0]&&(e[0]===ie||e[0]===oe)||(e[1]===t[1]&&(e[1]===le||e[1]===se)||void 0)}function de(e,t,r){return function(n,a){var i=ue(n),o=ue(a),l=[];if(i&&o&&fe(i,o))return l;i&&l.push(i),o&&l.push(o);var s=2*c.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);s&&((i&&o?s>0==i[e]>o[e]?i:o:i||o)[e]+=s);return l}}function pe(e){var t=e[0],r=e[1],n=t===Z[q-1][0],a=r===Z[q-1][1];if(!n||!a)if(q>1){var i=t===Z[q-2][0],o=r===Z[q-2][1];n&&(t===ie||t===oe)&&i?o?q--:Z[q-1]=e:a&&(r===le||r===se)&&o?i?q--:Z[q-1]=e:Z[q++]=e}else Z[q++]=e}function he(e){Z[q-1][0]!==e[0]&&Z[q-1][1]!==e[1]&&pe([$,ee]),pe(e),te=null,$=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ce[a],o=u(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,e)oe?oe:0,Q=t[1]se?se:0,K||Q){if(q)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),Z[q++]=n[1])}else re=ne(Z[q-1],t)[0],Z[q++]=re;else Z[q++]=[K||t[0],Q||t[1]];var a=Z[q-1];K&&Q&&(a[0]!==K||a[1]!==Q)?(te&&($!==K&&ee!==Q?pe($&&ee?(i=te,l=(o=t)[0]-i[0],s=(o[1]-i[1])/l,(i[1]*o[0]-o[1]*i[0])/l>0?[s>0?ie:oe,se]:[s>0?oe:ie,le]):[$||K,ee||Q]):$&&ee&&pe([$,ee])),pe([K,Q])):$-K&&ee-Q&&pe([K||$,Q||ee]),te=t,$=K,ee=Q}else te&&he(ne(te,t)[0]),Z[q++]=t;var i,o,l,s}for(r=0;rJ(v,ge))break;o=v,(w=y[0]*g[0]+y[1]*g[1])>b?(b=w,p=v,m=!1):w<_&&(_=w,h=v,m=!0)}if(m?(me(p),o!==h&&me(h)):(h!==a&&me(h),o!==p&&me(p)),me(o),r>=e.length||!v)break;me(v),a=v}}else me(p)}te&&pe([$||te[0],ee||te[1]]),Y.push(Z.slice(0,q))}var ye=j.slice(j.length-1);if(z&&"h"!==ye&&"v"!==ye){for(var xe=!1,be=-1,_e=[],we=0;we=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":17}],385:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],386:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),c.noAngle||(s("marker.angle"),c.noAngleRef||s("marker.angleref"),c.noStandOff||s("marker.standoff")),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":103,"../../components/colorscale/defaults":113,"../../components/colorscale/helpers":114,"./subtypes":392}],387:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":224,"../../lib":244}],388:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,v){var m;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),v=Math.ceil(h.length/p),m=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return g?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,v),!0===_.visible){var S,D;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 C,P,I="",R=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",D=z._nextFill,R=z._polygons);var N,F,E,j,H,B,Y,V="",U="",Z=[],q=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(D&&D.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(N=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):N=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},E=function(e){return F(e.reverse())},Z=u(f,{xaxis:x,yaxis:b,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(Z.length),m=0;m1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",C),s.singleLineStyle(f,a)}}}}}var G=k.selectAll(".js-line").data(Z);y(G.exit()).style("opacity",0).remove(),G.each(q(!1)),G.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(q(!0)),s.setClipUrl(G,r.layerClipId,e),Z.length?(S?(S.datum(f),j&&B&&(O?("y"===O?j[1]=B[1]=b.c2p(0,!0):"x"===O&&(j[0]=B[0]=x.c2p(0,!0)),y(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle,e)):y(S).attr("d",V+"Z").call(s.singleFillStyle,e))):D&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?y(D).attr("d",V+"Z"+I+"Z").call(s.singleFillStyle,e):y(D).attr("d",V+"L"+I.substr(1)+"Z").call(s.singleFillStyle,e),_._polygons=_._polygons.concat(R)):(J(D),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(S?J(S):D&&J(D),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,v=te;if(f||d){var m=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?m=w?K:X:_&&!w&&(m=Q),f&&(h=m),d&&(v=m)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);g&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(v,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(L,W,e)}function J(e){y(e).attr("d","M0,0Z")}function X(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,v=!!i&&i.duration>0,m=f(e,t,r);((u=a.selectAll("g.trace").data(m,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),v)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,m,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,m,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":125,"../../lib":244,"../../lib/polygon":256,"../../registry":327,"./line_points":381,"./link_traces":383,"./subtypes":392,"@plotly/d3":11}],389:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;ra&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),x={},b={},_=0;h?(m=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(m=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(m);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],61:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),v=!p&&t.pointBetween(l,c,u);if(d)return v?s(n,l):s(e,u),n;h&&(p||(v?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,v=p.after?p.after.ev:null;function m(){if(h){var e=u(d,h);if(e)return e}return!!v&&u(d,v)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!v&&v.seg);var g,y=m();if(y){var x;if(e)(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(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=v?v.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)g=v?d.primary===v.primary?v.seg.otherFill.above:v.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:g,below:g};r&&r.status(d.seg,!!h&&h.seg,!!v&&v.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":66,timers:67}],68:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=H.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=H.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=H.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=H.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=H.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=H.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=H.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:N(t[4]),format:a?"name":"hex8"};if(t=H.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=H.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:N(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=H.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(p=t.r,h=t.g,v=t.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(v,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*O(t,360),r=O(r,100),n=O(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,v;return i=D(i),{ok:f,format:t.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}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=D(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(z(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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,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(v,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function N(e){return P(e)/255}var F,E,j,H=(E="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(e){return!!H.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],69:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(v>>5&15)-1,(31&v)+l);return i.year=m.getFullYear(),i.month=1+m.getMonth(),i.day=m.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var v=h&1<<12-p?30:29;if(s>13;!m||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":83,"object-assign":55}],72:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":83,"object-assign":55}],73:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":83,"object-assign":55}],74:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":83,"object-assign":55}],75:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":83,"object-assign":55}],76:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":83,"object-assign":55}],77:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":83,"object-assign":55}],78:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":83,"object-assign":55}],80:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":83,"object-assign":55}],81:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":83,"object-assign":55}],82:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":83,"object-assign":55}],83:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":55}],84:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=y(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){y("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=y(e,i)?n:r,l=0;l-1){p=1,h=v;for(var S=this.daysInMonth(d,p);h>S;S=this.daysInMonth(d,p))p++,h-=S}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":83,"object-assign":55}],85:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],86:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":220,"../../plot_api/plot_template":280,"../../plots/cartesian/constants":298,"../../plots/font_attributes":319,"./arrow_paths":85}],87:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,v=p-d,m=3*e.startarrowsize*e.arrowwidth||0,g=m+d,y=m-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:v}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,g),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=l?g+l:g,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,g),ppadminus:Math.max(f,v,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":244,"../../plots/cartesian/axes":291,"./draw":92}],88:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var G=!1,W=["x","y"],J=0;J1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(G=!0):G=!0),X=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===de;"x"===te?(Q=t[te],X=he?ae._offset+ae._length*Q:X=T.l+T.w*Q):(Q=1-t[te],X=he?ae._offset+ae._length*Q:X=T.t+T.h*Q),$=t.showarrow?.5:Q}if(t.showarrow){fe.head=X;var ve=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var me=s.getRefType(ne);"domain"===me?("y"===te&&(ve=1-ve),fe.tail=ae._offset+ae._length*ve):"paper"===me?"y"===te?(ve=1-ve,fe.tail=T.t+T.h*ve):fe.tail=T.l+T.w*ve:fe.tail=ae._offset+ae.r2p(ve),K=ee}else fe.tail=X+ve,K=ee+ve;fe.text=fe.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,ge-1)),"pixel"===ne){var ye=-Math.max(fe.tail-3,fe.text),xe=Math.min(fe.tail+3,fe.text)-ge;ye>0?(fe.tail+=ye,fe.text+=ye):xe>0&&(fe.tail-=xe,fe.text-=xe)}fe.tail+=ue,fe.head+=ue}else K=ee=se*U($,ce),fe.text=X+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(G)N.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,B?D:null,e);else{var we=j+_e-v.top,Te=j+be-v.left;Z.call(d.positionText,Te,we).call(u.setClipUrl,B?D:null,e)}Y.select("rect").call(u.setRect,j,j,k,z),H.call(u.setRect,F/2,F/2,E-F,V-F),N.call(u.setTranslate,Math.round(O.x.text-E/2),Math.round(O.y.text-V/2)),I.attr({transform:"rotate("+C+","+O.x.text+","+O.y.text+")"});var Me,ke=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=O.x.head,f=O.y.head,d=O.x.tail+r,p=O.y.tail+n,v=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(C,v,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),D=+H.attr("width"),R=+H.attr("height"),z=v-.5*D,F=z+D,E=b-.5*R,j=E+R,B=[[z,E,z,j],[z,j,F,j],[F,j,F,E],[F,E,z,E]].map(k);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var Y=t.arrowwidth,V=t.arrowcolor,U=t.arrowside,Z=P.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),q=Z.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",Y+"px").call(c.stroke,c.rgb(V));if(m(q,U,t),M.annotationPosition&&q.node().parentNode&&!i){var G=s,W=f;if(t.standoff){var J=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));G+=t.standoff*(d-s)/J,W+=t.standoff*(p-f)/J}var X,K,Q=Z.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(p-W),transform:l(G,W)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:Q.node(),gd:e,prepFn:function(){var e=u.getTranslate(N);X=e.x,K=e.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,K),a=n[0]+e,i=n[1]+r;N.call(u.setTranslate,a,i),L("x",y(g,e,"x",T,t)),L("y",y(x,r,"y",T,t)),t.axref===t.xref&&L("ax",y(g,e,"ax",T,t)),t.ayref===t.yref&&L("ay",y(x,r,"ay",T,t)),Z.attr("transform",l(e,r)),I.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),R)h.init({element:N.node(),gd:e,prepFn:function(){Me=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",y(g,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",y(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(g)a=y(g,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=y(x,r,"y",T,t);else{var u=t._ysize/T.h,f=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),g&&x||(n=h.getCursor(g?.5:a,x?.5:o,t.xanchor,t.yanchor))}I.attr({transform:l(e,r)+Me}),p(N,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",q(n))},doneFn:function(){p(N),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*m+r.standoff,_=v.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.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 R();if(b){if(b*b>w*w+T*T)return void R();var M=b*Math.cos(f),k=b*Math.sin(f);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),D="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":322,"../annotations/draw":92}],99:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).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()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var ce=Math.pow(10,Math.floor(Math.log(se)/Math.LN10));oe*=ce*c.roundUp(se/ce,[2,5,10]),(Math.abs(U.start)/U.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+P/N.h,re+K-P/N.h]:[re+C/N.w,re+K-C/N.w],ae.setScale(),e.attr("transform",u(Math.round(N.l),Math.round(N.t)));var ue,fe=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(N.l),-Math.round(N.t))),de=ae.ticklabelposition,pe=ae.title.font.size,he=e.select("."+k.cbaxis),ve=0,me=0;function ge(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:z._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),v.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===H&&(e=C+N.l+N.w*I,t=P+N.t+N.h*(1-re-K)+3+.75*pe),"bottom"===H&&(e=C+N.l+N.w*I,t=P+N.t+N.h*(1-re)-3-.25*pe),"right"===H&&(t=P+N.t+N.h*R+3+.75*pe,e=C+N.l+N.w*re),ge(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,s=e.select("."+k.cbtitle),f=s.select("text"),d=[-A/2,A/2],h=s.select(".h"+ae._id+"title-math-group").node(),v=15.6;if(f.node()&&(v=parseInt(f.node().style.fontSize,10)*w),h?(i=p.bBox(h),me=i.width,(ve=i.height)>v&&(d[1]-=(ve-v)/2)):f.node()&&!f.classed(k.jsPlaceholder)&&(i=p.bBox(f.node()),me=i.width,ve=i.height),o){if(ve){if(ve+=5,"top"===H)ae.domain[1]-=ve/N.h,d[1]*=-1;else{ae.domain[0]+=ve/N.h;var g=m.lineCount(f);d[1]+=(1-g)*v}s.attr("transform",u(d[0],d[1])),ae.setScale()}}else me&&("right"===H&&(ae.domain[0]+=(me+pe/2)/N.w),s.attr("transform",u(d[0],d[1])),ae.setScale())}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",o?u(0,Math.round(N.h*(1-ae.domain[1]))):u(Math.round(N.w*ae.domain[0]),0)),he.attr("transform",o?u(0,Math.round(-N.t)):u(Math.round(-N.l),0));var y=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(q);y.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),y.exit().remove();var x=B.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var l=[0===i?B[0]:(q[i]+q[i-1])/2,i===q.length-1?B[1]:(q[i]+q[i+1])/2].map(ae.c2p).map(Math.round);o&&(l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,x[0],x[1]));var s=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(l)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(l)-n.min(l),2));if(t._fillgradient)p.gradient(s,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=V(e).replace("e-","");s.attr("fill",a(u).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(E.color&&E.width?G:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){var t=Q,r=Math.round(ae.c2p(e))+E.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+W).call(p.lineGroupStyle,E.width,Y(e),E.dash)})),he.selectAll("g."+ae._id+"tick,path").remove();var _=Q+W+(A||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(ae),M=l.getTickSigns(ae)[2];return l.drawTicks(r,ae,{vals:"inside"===ae.ticks?l.clipEnds(ae,T):T,layer:he,path:l.makeTickPath(ae,_,M),transFn:l.makeTransTickFn(ae)}),l.drawLabels(r,ae,{vals:T,layer:he,transFn:l.makeTransTickLabelFn(ae),labelFns:l.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,l=ae._offset+ae._length/2;if("right"===H)a=l,e=N.l+N.w*i+10+pe*(ae.showticklabels?1:.5);else if(e=l,"bottom"===H&&(a=N.t+N.h*i+10+(-1===de.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===H){var s=j.text.split("
").length;a=N.t+N.h*i+10-W-w*pe*s}ge((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:H,offsetTop:o?0:N.t,offsetLeft:o?N.l:0,maxShift:o?z.width:z.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,l=W+A/2;-1===de.indexOf("inside")&&(n=p.bBox(he.node()),l+=o?n.width:n.height),ue=fe.select("text");var c=0,f=o&&"top"===H,v=!o&&"right"===H,m=0;if(ue.node()&&!ue.classed(k.jsPlaceholder)){var y,x=fe.select(".h"+ae._id+"title-math-group").node();x&&(o&&ie||!o&&!ie)?(c=(n=p.bBox(x)).width,y=n.height):(c=(n=p.bBox(fe.node())).right-N.l-(o?Q:ne),y=n.bottom-N.t-(o?ne:Q),o||"top"!==H||(l+=n.height,m=n.height)),v&&(ue.attr("transform",u(c/2+pe/2,0)),c*=2),l=Math.max(l,o?c:y)}var b=2*(o?C:P)+l+L+A/2,w=0;!o&&j.text&&"bottom"===O&&R<=0&&(b+=w=b/2,m+=w),z._hColorbarMoveTitle=w,z._hColorbarMoveCBTitle=m;var F=L+A;e.select("."+k.cbbg).attr("x",(o?Q:ne)-F/2-(o?C:0)).attr("y",(o?ne:Q)-(o?X:P+m-w)).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(X+F,2)).call(h.fill,S).call(h.stroke,t.bordercolor).style("stroke-width",L);var E=v?Math.max(c-10,0):0;if(e.selectAll("."+k.cboutline).attr("x",(o?Q:ne+C)+E).attr("y",(o?ne+P-X:Q)+(f?ve:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(X-(o?2*P+ve:2*C+E),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(N.l-(o?$*b:0),N.t-(o?0:(1-ee)*b-m))),!o&&(L||a(S).getAlpha()&&!a.equals(z.paper_bgcolor,S))){var B=he.selectAll("text"),Y=B[0].length,V=e.select("."+k.cbbg).node(),U=p.bBox(V),Z=p.getTranslate(e);B.each((function(e,t){var r=Y-1;if(0===t||t===r){var n,a=p.bBox(this),i=p.getTranslate(this);if(t===r){var o=a.right+i.x;(n=U.right+Z.x+ne-L-2+I-o)>0&&(n=0)}else if(0===t){var l=a.left+i.x;(n=U.left+Z.x+ne+L+2-l)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var q={},G=T[D],J=M[D],K=T[O],te=M[O],re=b-W;o?("pixels"===d?(q.y=R,q.t=X*K,q.b=X*te):(q.t=q.b=0,q.yt=R+s*K,q.yb=R-s*te),"pixels"===_?(q.x=I,q.l=b*G,q.r=b*J):(q.l=re*G,q.r=re*J,q.xl=I-g*G,q.xr=I+g*J)):("pixels"===d?(q.x=I,q.l=X*G,q.r=X*J):(q.l=q.r=0,q.xl=I+s*G,q.xr=I-s*J),"pixels"===_?(q.y=1-R,q.t=b*K,q.b=b*te):(q.t=re*K,q.b=re*te,q.yt=R-g*K,q.yb=R+g*te)),i.autoMargin(r,t._id,q)}],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l="v"===t.orientation,c=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align((l?t._uFrac:t._vFrac)+r/c.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=s.align((l?t._vFrac:1-t._uFrac)-o/c.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var f=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,f)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":219,"../../lib":244,"../../lib/extend":238,"../../lib/setcursor":264,"../../lib/svg_text_utils":267,"../../plots/cartesian/axes":291,"../../plots/cartesian/axis_defaults":293,"../../plots/cartesian/layout_attributes":304,"../../plots/cartesian/position_defaults":307,"../../plots/plots":325,"../../registry":327,"../color":103,"../colorscale/helpers":114,"../dragelement":122,"../drawing":125,"../titles":212,"./constants":105,"@plotly/d3":11,tinycolor2:68}],108:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":244}],109:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":104,"./defaults":106,"./draw":107,"./has_colorbar":108}],110:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",v=i+"max",m=i+"mid",g=(l(d+p),l(d+h),l(d+v),{});g[h]=g[v]=void 0;var y={};y[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[v]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":260,"../../lib/sort_object_keys":265,"../colorbar/attributes":104,"./scales.js":118}],111:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,v=f.mid,m=function(){return a.aggNums(Math.min,null,s)},g=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=m():d&&(p=u._colorAx&&n(p)?Math.min(p,m()):m()),void 0===h?h=g():d&&(h=u._colorAx&&n(h)?Math.max(h,g()):g()),d&&void 0!==v&&(h-v>v-p?p=v-(h-v):h-v=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":244,"./helpers":114,"fast-isnumeric":17}],112:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],120:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":244}],121:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],122:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,v,m=e.gd,g=1,y=m._context.doubleClickDelay,x=e.element;m._mouseDownTime||(m._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)y&&(g=Math.max(g-1,1)),m._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!v){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}m._dragging=!1,m._dragged=!1}else m._dragged=!1}},s.coverSlip=u},{"../../lib":244,"../../plots/cartesian/constants":298,"./align":119,"./cursor":120,"./unhover":123,"has-hover":48,"has-passive-events":49,"mouse-event-offset":53}],123:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":236,"../../lib/events":237,"../../lib/throttle":268,"../fx/constants":137}],124:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],125:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,v=e("../../constants/interactions").DESELECTDIM,m=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),y=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};function b(e,t,r){var n=t.fillpattern,a=n&&x.getPatternAttr(n.shape,0,"");if(a){var i=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),l=n.fgopacity,s=x.getPatternAttr(n.size,0,8),u=x.getPatternAttr(n.solidity,0,.3),f=t.uid;x.pattern(e,"point",r,f,a,s,u,void 0,n.fillmode,i,o,l)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e,t){var r=n.select(e.node());b(e,((r.data()[0]||[])[0]||{}).trace||{},t)},x.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&b(r,e[0].trace,t)}))};var _=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,x.symbolBackOffs[r]=t.backoff||0,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function T(e,t,r,n){var a=e%100;return x.symbolFuncs[a](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var M={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=i("~f"),L={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=L[i],d=new Array(u),p=0;p=100;var f=re(e,r),d=Z(e,r);t.attr("d",T(u,s,f,d))}var p,h,v,m=!1;if(e.so)v=l.outlierwidth,h=l.outliercolor,p=o.outliercolor;else{var g=(l||{}).width;v=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,m=!0),p="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,p).style({"stroke-width":(v||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:v)+"px");var y=o.gradient,b=e.mgt;b?m=!0:b=y&&y.type,a.isArrayOrTypedArray(b)&&(b=b[0],L[b]||(b=0));var _=o.pattern,w=_&&x.getPatternAttr(_.shape,e.i,"");if(b&&"none"!==b){var M=e.mgc;M?m=!0:M=y.color;var k=r.uid;m&&(k+="-"+e.i),x.gradient(t,i,k,b,[[0,M],[1,p]],"fill")}else if(w){var A=x.getPatternAttr(_.bgcolor,e.i,null),S=x.getPatternAttr(_.fgcolor,e.i,null),D=_.fgopacity,O=x.getPatternAttr(_.size,e.i,8),C=x.getPatternAttr(_.solidity,e.i,.3),P=e.mcc||a.isArrayOrTypedArray(_.shape)||a.isArrayOrTypedArray(_.bgcolor)||a.isArrayOrTypedArray(_.size)||a.isArrayOrTypedArray(_.solidity),I=r.uid;P&&(I+="-"+e.i),x.pattern(t,"point",i,I,w,O,C,e.mcc,_.fillmode,A,S,D)}else c.fill(t,p);v&&c.stroke(t,h)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=m.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:v*t});var h=i.color,m=o.color,g=l.color;(m||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?m||t:g||t});var y=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,v))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);e.attr("d",T(x.symbolNumber(i),o,re(n,t),Z(n,t))),n.mrc2=o})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};y(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var v=e.tp||t.textposition,m=O(e,t),g=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,m,g).text(c).call(d.convertToTspans,r).call(D,v,m,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=O(e,t);c.fill(a,i);var u=s.traceIs(t,"bar-like");D(a,o,l,e.mrc2||e.mrc,u)}))}};var C,P;function I(e,t,r){return r&&(e=j(e)),t?z(e[1]):R(e[0])}function R(e){var t=n.round(e,2);return C=t,t}function z(e){var t=n.round(e,2);return P=t,t}function N(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],l=r[1]-t[1],s=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+l*l,.25),u=(c*c*a-s*s*o)*n,f=(c*c*i-s*s*l)*n,d=3*c*(s+c),p=3*s*(s+c);return[[R(t[0]+(d&&u/d)),z(t[1]+(d&&f/d))],[R(t[0]-(p&&u/p)),z(t[1]-(p&&f/p))]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=c||b>=f&&b<=c)&&(_<=d&&_>=u||_>=d&&_<=u)&&(e=[b,_])}return e}x.steps=function(e){var t=F[e]||E;return function(e){for(var r="M"+R(e[0][0])+","+z(e[0][1]),n=e.length,a=1;a=1e4&&(x.savedBBoxes={},H=0),r&&(x.savedBBoxes[r]=m),H++,a.extendFlat({},m)},x.setClipUrl=function(e,t,r){e.attr("clip-path",Y(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var V=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(V,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var U=/translate\([^)]*\)\s*$/;function Z(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(U);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))},x.getMarkerStandoff=Z;var q,G,W,J,X,K,Q=Math.atan2,$=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*$(e)-n*ee(e),r*ee(e)+n*$(e)]}function re(e,t){var r,n,a=e.ma;void 0===a&&(a=t.marker.angle||0);var i=t.marker.angleref;if("previous"===i||"north"===i){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var s=t._xA,c=t._yA;if(!s||!c)return 90;r=s.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,f=e.lonlat[0],d=e.lonlat[1],p=t._geo.project([f,d+1e-5]),h=t._geo.project([f+1e-5,d]),v=Q(h[1]-n,h[0]-r),m=Q(p[1]-n,p[0]-r);if("north"===i)u=a/180*Math.PI;else if("previous"===i){var g=f/180*Math.PI,y=d/180*Math.PI,x=q/180*Math.PI,b=G/180*Math.PI,_=x-g,w=$(b)*ee(_),T=ee(b)*$(y)-$(b)*ee(y)*$(_);u=-Q(w,T)-Math.PI,q=f,G=d}var M=te(v,[$(u),0]),k=te(m,[ee(u),0]);a=Q(M[1]+k[1],M[0]+k[0])/Math.PI*180,"previous"!==i||K===t.uid&&e.i===X+1||(a=null)}if("previous"===i&&!t._geo)if(K===t.uid&&e.i===X+1&&o(r)&&o(n)){var A=r-W,L=n-J,S=t.line&&t.line.shape||"",D=S.slice(S.length-1);"h"===D&&(L=0),"v"===D&&(A=0),a+=Q(L,A)/Math.PI*180+90}else a=null}return W=r,J=n,X=e.i,K=t.uid,a}x.getMarkerAngle=re},{"../../components/fx/helpers":139,"../../constants/alignment":219,"../../constants/interactions":223,"../../constants/xmlns_namespaces":225,"../../lib":244,"../../lib/svg_text_utils":267,"../../registry":327,"../../traces/scatter/make_bubble_size_func":384,"../../traces/scatter/subtypes":392,"../color":103,"../colorscale":115,"./symbol_defs":126,"@plotly/d3":11,"fast-isnumeric":17,tinycolor2:68}],126:[function(e,t,r){"use strict";var n,a,i,o,l=e("parse-svg-path"),s=e("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,d=Math.cos,p=Math.sin;function h(e){return null===e}function v(e,t,r){if(!(e&&e%360!=0||t))return r;if(i===e&&o===t&&n===r)return a;function s(e,r){var n=d(e),a=p(e),i=r[0],o=r[1]+(t||0);return[i*n-o*a,i*a+o*n]}i=e,o=t,n=r;for(var c=e/180*f,u=0,h=0,v=l(r),m="",g=0;g0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var v=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var m=n.select(this).selectAll("g.errorbar").data(t,f);if(m.exit().remove(),t.length){p.visible||m.selectAll("path.xerror").remove(),h.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(m,r.layerClipId,e),m.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!v||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.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=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var m=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-m)+"v"+2*m+"m0,-"+m+"H"+r.xs,r.noXS||(i+="m0,-"+m+"v"+2*m),!d.size()?d=t.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":392,"../drawing":125,"@plotly/d3":11,"fast-isnumeric":17}],133:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":103,"@plotly/d3":11}],134:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":238,"../../plots/font_attributes":319,"./layout_attributes":144}],135:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||oe<0||oe>w[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,Y="xval"in t?g.flat(s,t.xval):g.p2c(_,ie),V="yval"in t?g.flat(s,t.yval):g.p2c(w,oe),!a(Y[0])||!a(V[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(Z=0;Zee&&(te.splice(0,ee),ce=te[0].distance),y&&0!==E&&0===te.length){$.distance=E,$.index=!1;var f=G._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=E}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var v=h[0];a(v.x0)&&a(v.y0)&&(d=de(v),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>d.spikeDistance)&&(ne.vLinePoint=d))}var m=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(m.length){var x=m[0];a(x.x0)&&a(x.y0)&&(d=de(x),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>d.spikeDistance)&&(ne.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)Oe(te[Ae]);te=Le,me()}var Ce=e._hoverdata,Pe=[],Ie=H(e),Re=B(e);for(U=0;U1||te.length>1)||"closest"===C&&ae&&te.length>1,Ge=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),We=P(te,{gd:e,hovermode:C,rotateLabels:qe,bgColor:Ge,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function v(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(m.push.apply(m,g),p.splice(o+1,1),c=0,l=m.length-1;l>=0;l--)c+=m[l].dp;for(i=c/m.length,l=m.length-1;l>=0;l--)m[l].dp-=i;n=!1}else o++}p.forEach(v)}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}}}(We,qe?"xa":"ya",u),R(We,qe,u._invScaleX,u._invScaleY));if(l&&l.tagName){var Je=m.getComponentMethod("annotations","hasClickToShow")(e,Pe);f(n.select(l),Je?"pointer":"")}if(!l||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:Y,yvals:V})}(e,t,r,i,l)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=H(a),o=B(a),l=P(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),v=e.trace;if(m.traceIs(v,"gl3d")){var g=a._fullLayout[v.scene]._scene.container,y=g.offsetLeft,x=g.offsetTop;u+=y,f+=y,d+=x,h+=x}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function P(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,v=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var T=t.fontFamily||y.HOVERFONT,M=t.fontSize||y.HOVERFONTSIZE,k=e[0],S=k.xa,D=k.ya,C=i.charAt(0),P=C+"Label",R=k[P];if(void 0===R&&"multicategory"===S.type)for(var z=0;za.width-b?(m=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+y.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+y.width/2)+"v"+x+(2*L+y.height)+"H-"+(L+y.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,O,C;"right"===D.side?(_="start",O=1,C="",m=S._offset+S._length):(_="end",O=-1,C="-",m=S._offset),g=D._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+y.height/2)+"h"+C+(2*L+y.width)+"V-"+(L+y.height/2)+"H"+C+A+"V-"+A+"Z");var P,I=y.height/2,z=F-y.top-I,N="clip"+a._uid+"commonlabel"+D._id;if(m=0?le:se+fe=0?se:xe+fe=0?ie:oe+de=0?oe:be+de=0,"top"!==e.idealAlign&&Z||!q?Z?(P+=N/2,e.anchor="start"):e.anchor="middle":(P-=N/2,e.anchor="end");else if(e.pos=P,Z=C+z/2+G<=E,q=C-z/2-G>=0,"left"!==e.idealAlign&&Z||!q)if(Z)C+=z/2,e.anchor="start";else{e.anchor="middle";var W=G/2,J=C+W-E,X=C-W;J>0&&(C-=J),X<0&&(C+=-X)}else C-=z/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(C,P)+(c?s(_):""))})),_e}function I(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=E(r,e.nameLength),""}))}return[s,l]}function R(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(e.txwidth+L),h=0,v=e.offset,m="middle"===l;m&&(f-=e.tx2width/2,p+=e.txwidth/2+L),t&&(v*=-k,h=e.offset*M),r.select("path").attr("d",m?"M-"+i(e.bx/2+e.tx2width/2)+","+o(v-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+v)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(v-A)+"Z");var g=h+f,y=v+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),g=m?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),g=m?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(g),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(v+e.ty0-e.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(v-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:v.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:v.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=v.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+v.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=v.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+v.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function N(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var m,g,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(m=c.pointerX,g=c.pointerY):(m=n._offset+y.x,g=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,M=a.spikecolor||_,k=v.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=m),-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:g,y2:g,"stroke-width":T,stroke:M,"stroke-dasharray":d.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:g,r:T,fill:M}).classed("spikeline",!0)}if(f){var S,D,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,D=c.pointerY):(S=n._offset+O.x,D=a._offset+O.y);var C,P,I=i.readability(O.color,h)<1.5?p.contrast(h):O.color,R=n.spikemode,z=n.spikethickness,N=n.spikecolor||I,F=v.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(C=F,P=D),-1!==R.indexOf("across")){var E=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(E=Math.min(E,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,P=s.t+(1-E)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z,stroke:N,"stroke-dasharray":d.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?z:-z),r:z,fill:N}).classed("spikeline",!0)}}}function F(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function H(e){return e.offsetTop+e.clientTop}function B(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),f=c[0],d=c[1],p=u[0],h=u[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},{"../../lib":244,"../../lib/events":237,"../../lib/override_cursor":255,"../../lib/svg_text_utils":267,"../../plots/cartesian/axes":291,"../../registry":327,"../color":103,"../dragelement":122,"../drawing":125,"../legend/defaults":155,"../legend/draw":156,"./constants":137,"./helpers":139,"@plotly/d3":11,"fast-isnumeric":17,tinycolor2:68}],141:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var l=t.legend;function s(e){o.font[e]||(o.font[e]=l?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),l?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":244,"../color":103,"./helpers":139}],142:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":244,"./layout_attributes":144}],143:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":244,"../dragelement":122,"./attributes":134,"./calc":135,"./click":136,"./constants":137,"./defaults":138,"./helpers":139,"./hover":140,"./layout_attributes":144,"./layout_defaults":145,"./layout_global_defaults":146,"@plotly/d3":11}],144:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":319,"./constants":137}],145:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":244,"./hoverlabel_defaults":141,"./hovermode_defaults":142,"./layout_attributes":144}],146:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":244,"./hoverlabel_defaults":141,"./layout_attributes":144}],147:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===M("pattern")&&(d=!0);m._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,T=d?.3:.1;v&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),m._domains={x:u("x",M,w,x,y),y:u("y",M,T,b,g,_)}}else delete t.grid}function M(e,t){return n.coerce(r,m,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,v=r.rows,m=r.columns,g="independent"===r.pattern,y=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(v);var b=1;for(n=0;n1);if(!1===_&&(t.legend=void 0),(!1!==_||f.uirevision)&&(p("uirevision",t.uirevision),!1!==_)){p("bgcolor",t.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,T,M,k=a.coerceFont(p,"font",t.font),A="h"===p("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(T=1.1,M="bottom"):(T=-.1,M="top")):(w=1.02,T=1,M="auto"),p("traceorder",x),c.isGrouped(t.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",T),p("yanchor",M),p("valign"),a.noneOrAll(f,d,["x","y"]),p("title.text")){p("title.side",A?"left":"top");var L=a.extendFlat({},k,{size:a.bigFont(k.size)});a.coerceFont(p,"title.font",L)}}}},{"../../lib":244,"../../plot_api/plot_template":280,"../../plots/attributes":287,"../../plots/layout_attributes":323,"../../registry":327,"./attributes":153,"./helpers":159}],156:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),v=h.LINE_SPACING,m=h.FROM_TL,g=h.FROM_BR,y=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r){var n=e[0],a=n.width,i=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===i?t._maxWidth*o:r+(o||a)}function w(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function T(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var v=a.ensureSingle(e,"text","legendtext");v.attr("text-anchor","start").call(c.font,i).text(d?M(n,h):n);var m=r.itemwidth+2*p.itemGap;f.positionText(v,m,0),d?v.call(f.makeEditable,{gd:t,text:n}).call(A,e,t,r).on("edit",(function(n){this.text(M(n,h)).call(A,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):A(v,e,t,r)}function M(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(t,r,e,o,n.event)}})))}function A(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*v;if(o){var m=c.bBox(o);u=m.height,d=m.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(g),x=g.node();if(u=h*y,d=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(g,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,d-=r.itemwidth),f.positionText(g,b,-h*((y-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function L(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=y(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&y(e.calcdata,t)}var v=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var M=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),D=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),O=a.ensureSingle(M,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));O.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(M,"g","scrollbox"),P=t.title;if(t._titleWidth=0,t._titleHeight=0,P.text){var I=a.ensureSingle(C,"text","legendtitletext");I.attr("text-anchor","start").call(c.font,P.font).text(P.text),A(I,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var R=a.ensureSingle(M,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(l);z.enter().append("g").attr("class","groups"),z.exit().remove();var N=z.selectAll("g.traces").data(a.identity);N.enter().append("g").attr("class","traces"),N.exit().remove(),N.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==v.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(T,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u="fraction"===a.entrywidthmode,f=a.borderwidth,d=2*f,h=p.itemGap,v=a.itemwidth+2*h,m=2*(f+h),g=S(a),y=a.y<0||0===a.y&&"top"===g,x=a.y>1||1===a.y&&"bottom"===g,w=a.tracegroupgap,T={};a._maxHeight=Math.max(y||x?i.height/2:o.h,30);var M=0;a._width=0,a._height=0;var k=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,f+k[0],f+k[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),M=v+a._width,a._width+=h+v+d,a._height+=m,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=L(a),D=a.x<0||0===a.x&&"right"===A,O=a.x>1||1===a.x&&"left"===A,C=x||y,P=i.width/2;a._maxWidth=Math.max(D?C&&"left"===A?o.l+o.w:P:O?C&&"right"===A?o.r+o.w:P:o.w,2*v);var I=0,R=0;r.each((function(e){var t=_(e,a,v);I=Math.max(I,t),R+=t})),M=null;var z=0;if(s){var N=0,F=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,a,v),i=r[0].height;c.setTranslate(this,k[0],k[1]+f+h+i/2+t),t+=i,e=Math.max(e,n),T[r[0].trace.legendgroup]=e}));var r=e+h;F>0&&r+f+F>a._maxWidth?(z=Math.max(z,F),F=0,E+=N+w,N=t):N=Math.max(N,t),c.setTranslate(this,F,E),F+=r})),a._width=Math.max(z,F)+f,a._height=E+N+m}else{var j=r.size(),H=R+d+(j-1)*h=a._maxWidth&&(z=Math.max(z,U),Y=0,V+=B,a._height+=B,B=0),c.setTranslate(this,k[0]+f+Y,k[1]+f+V+t/2+h),U=Y+r+h,Y+=n,B=Math.max(B,t)})),H?(a._width=Y+d,a._height=B+m):(a._width=Math.max(z,U)+d,a._height+=B+m)}}a._width=Math.ceil(Math.max(a._width+k[0],a._titleWidth+2*(f+p.titlePad))),a._height=Math.ceil(Math.max(a._height+k[1],a._titleHeight+2*(f+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var Z=e._context.edits,q=Z.legendText||Z.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,i=e[0].trace.legendgroup,o=_(e,a,v);s&&""!==i&&(o=T[i]);var f=q?v:M||o;l||u||(f+=h/2),c.setRect(t,0,-r/2,f,r)}))}(e,z,N,t)},function(){var l,u,v,y,x=f._size,b=t.borderwidth;if(!h){if(function(e){var t=e._fullLayout.legend,r=L(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*m[r],r:t._width*g[r],b:t._effHeight*g[n],t:t._effHeight*m[n]})}(e))return;var _=x.l+x.w*t.x-m[L(t)]*t._width,T=x.t+x.h*(1-t.y)-m[S(t)]*t._effHeight;if(f.margin.autoexpand){var k=_,A=T;_=a.constrain(_,0,f.width-t._width),T=a.constrain(T,0,f.height-t._effHeight),_!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==A&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(M,_,T)}if(R.on(".drag",null),M.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;h&&(P=t._height),O.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),D.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,d,e),c.setRect(R,0,0,0,0),delete t._scrollY}else{var I,z,N,F=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),E=t._effHeight-F-2*p.scrollBarMargin,j=t._height-t._effHeight,H=E/j,B=Math.min(t._scrollY||0,j);O.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),D.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,d,e),U(B,F,H),M.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/E*j,0,j),F,H),0!==B&&B!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;I="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,N=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,j)}(N,I,z),F,H))}));R.call(Y);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(I=e.changedTouches[0].clientY,N=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,j)}(N,I,z),F,H))}));C.call(V)}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(R,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),D.select("rect").attr("y",b+r)}e._context.edits.legendPosition&&(M.classed("cursor-move",!0),s.init({element:M.node(),gd:e,prepFn:function(){var e=c.getTranslate(M);v=e.x,y=e.y},moveFn:function(e,r){var n=v+e,a=y+r;c.setTranslate(M,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&w(e,M,a,t,n)}}))}],e)}(e,t)}},{"../../constants/alignment":219,"../../lib":244,"../../lib/events":237,"../../lib/svg_text_utils":267,"../../plots/plots":325,"../../registry":327,"../color":103,"../dragelement":122,"../drawing":125,"./constants":154,"./get_legend_data":157,"./handle_click":158,"./helpers":159,"./style":161,"@plotly/d3":11}],157:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function v(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return y?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),v=h.mid;void 0===v&&(v=(h.max+h.min)/2),p=l.tryColorscale(f,"")(v)}var g=p||i.mc||f.color,y=f.pattern,x=y&&l.getPatternAttr(y.shape,0,"");if(x){var b=l.getPatternAttr(y.bgcolor,0,null),_=l.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,M=m(y.size,8,10),k=m(y.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,y.fillmode,b,_,T)}else a.call(s.fill,g);o&&s.stroke(a,i.mlc||d.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var v=i.minExtend(o,{trace:h});f(c,v,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,v=d.reversescale;if(p){if(!r){var m=p.length;u=0===o?p[v?m-1:0][1]:1===o?p[v?0:m-1][1]:p[Math.floor((m-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(v,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=v(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,m=o.anyFill,g=o.anyLine,y=e[0],b=y.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!m?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(s)l.fillGroupStyle(e,t);else{var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}})),f||d){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(y,{trace:a})]}var D=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",k+(d?"l"+x+",0.0001":"h"+x)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=v(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,m=!d&&!c&&!s&&u.hasText(h);function g(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||m||f){var b={},w={};if(d){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",i.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:g("line.width",x,[0,10],5)}),m&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(d?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(m?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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":244,"../../registry":327,"../../traces/pie/helpers":359,"../../traces/pie/style_one":365,"../../traces/scatter/subtypes":392,"../color":103,"../colorscale/helpers":114,"../drawing":125,"./constants":154,"@plotly/d3":11}],162:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":164}],163:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,v=(1+h)/2,m=(1-h)/2;for(a=0;a1?(P=["toggleHover"],I=["resetViews"]):g?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],I=["resetGeo"]):m?(P=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],I=["resetViewMapbox"]):b?P=["hoverClosestGl2d"]:y?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):P=["toggleHover"];v&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var v=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(e=0;M--){var k=r.append("path").attr(m).style("opacity",M?.1:g).call(o.stroke,x).call(o.fill,y).call(l.dashLine,M?"solid":_,M?4+b:b);if(h(k,e,i),w){var A=s(e.layout,"selections",i);k.style({cursor:"move"});var L={element:k.node(),plotinfo:p,gd:e,editHelpers:A,isActiveSelection:!0},S=n(c,e);a(S,k,L)}else k.style("pointer-events",M?"all":"none");T[M]=k}var D=T[0];T[1].node().addEventListener("click",(function(){return function(e,t){if(!d(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void v(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=v,f(e)}}(e,D)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;l.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function v(e){d(e)&&(e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,f(e)))}t.exports={draw:f,drawOne:p,activateLastSelection:function(e){if(!d(e))return;var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=v,f(e)}}},{"../../plot_api/plot_template":280,"../color":103,"../drawing":125,"../shapes/display_outlines":197,"../shapes/draw_newshape/helpers":202,"../shapes/handle_outline":204,"../shapes/helpers":205}],187:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":238,"../../drawing/attributes":124}],188:[function(e,t,r){"use strict";t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],189:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers").selectMode,a=e("../../shapes/handle_outline").clearOutline,i=e("../../shapes/draw_newshape/helpers"),o=i.readPaths,l=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var i=r.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,f=t.plotinfo,d=f.xaxis,p=f.yaxis,h=t.isActiveSelection,v=t.dragmode,m=(c.layout||{}).selections||[];if(!n(v)&&void 0!==h){var g=c._fullLayout._activeSelectionIndex;if(g-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(g)){q(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=K(_))){for(o&&o.remove(),m=0;m=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,l=p(r),s=v(r);if(l||s){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&a._fullLayout._outlining)l&&(c=T(f,e)),c&&i.call("_guiRelayout",a,{shapes:c}),s&&!B(e)&&(u=M(f,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&k(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function W(e){return e._id}function J(e,t,r,n){if(!e.calcdata)return[];var a,i,o,l=[],s=t.map(W),c=r.map(W);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function Q(e,t,r){var n,a;for(n=0;n-1&&t;if(!i&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ce(te);ue([O(e,ne,"x"),O(e,pe,"y")])($,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&fe(e,$),d._reselect=!1}if(!i&&d._deselect){var ve=d._deselect;(function(e,t,r){for(var n=0;n=0)M._fullLayout._deactivateShape(M);else if(!x){var r=k.clickmode;D.done(ke).then((function(){if(D.clear(ke),2===e){for(be.remove(),K=0;K-1&&Y(t,M,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&fe(M,void 0);s.click(M,t)})).catch(A.error)}},n.doneFn=function(){Me.remove(),D.done(ke).then((function(){D.clear(ke),!L&&X&&n.selectionDefs&&(X.subtract=xe,n.selectionDefs.push(X),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,W)),(L||x)&&G(n,L),n.doneFnCompleted&&n.doneFnCompleted(Ae),b&&fe(M,ie)})).catch(A.error)}},clearOutline:x,clearSelectionsCache:G,selectOnClick:Y}},{"../../lib":244,"../../lib/clear_gl_canvases":232,"../../lib/polygon":256,"../../lib/throttle":268,"../../plot_api/subroutines":281,"../../plots/cartesian/axis_ids":295,"../../registry":327,"../color":103,"../dragelement/helpers":121,"../drawing":125,"../fx":143,"../fx/helpers":139,"../shapes/constants":195,"../shapes/display_outlines":197,"../shapes/draw_newshape/helpers":202,"../shapes/draw_newshape/newshapes":203,"../shapes/handle_outline":204,"../shapes/helpers":205,"./constants":184,"./draw":186,"./draw_newselection/newselections":189,"./helpers":190,"point-in-polygon/nested":57,polybooljs:58}],193:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":220,"../../lib/extend":238,"../../plot_api/plot_template":280,"../../traces/scatter/attributes":367,"../annotations/attributes":86,"../drawing/attributes":124}],194:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,v=d>0?d+c:c;return{ppad:c,ppadplus:u?h:v,ppadminus:u?v:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o1&&(2!==e.length||"Z"!==e[1][0])&&(0===S&&(e[0][0]="M"),t[L]=e,T(),M())}}()}}function E(e,r){!function(e,r){if(t.length)for(var n=0;nx?(M=f,S="y0",k=x,D="y1"):(M=x,S="y1",k=f,D="y0");J(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===I?X:K,W.altKey=n.altKey},doneFn:function(){if(y(e))return;p(t),$(l),_(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(y(e))return;$(l)}};function J(r){if(y(e))I=null;else if(N)I="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=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!F&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),I=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?E("xanchor",r.xanchor=Z(b+n)):(o=function(e){return Z(V(e)+n)},j&&"date"===j.type&&(o=v.encodeDate(o))),z?E("yanchor",r.yanchor=q(T+a)):(s=function(e){return q(U(e)+a)},B&&"date"===B.type&&(s=v.encodeDate(s))),E("path",r.path=w(P,o,s))}else R?E("xanchor",r.xanchor=Z(b+n)):(E("x0",r.x0=Z(c+n)),E("x1",r.x1=Z(g+n))),z?E("yanchor",r.yanchor=q(T+a)):(E("y0",r.y0=q(f+a)),E("y1",r.y1=q(x+a)));t.attr("d",m(e,r)),Q(l,r)}function K(n,a){if(F){var i=function(e){return e},o=i,s=i;R?E("xanchor",r.xanchor=Z(b+n)):(o=function(e){return Z(V(e)+n)},j&&"date"===j.type&&(o=v.encodeDate(o))),z?E("yanchor",r.yanchor=q(T+a)):(s=function(e){return q(U(e)+a)},B&&"date"===B.type&&(s=v.encodeDate(s))),E("path",r.path=w(P,o,s))}else if(N){if("resize-over-start-point"===I){var u=c+n,d=z?f-a:f+a;E("x0",r.x0=R?u:Z(u)),E("y0",r.y0=z?d:q(d))}else if("resize-over-end-point"===I){var p=g+n,h=z?x-a:x+a;E("x1",r.x1=R?p:Z(p)),E("y1",r.y1=z?h:q(h))}}else{var y=function(e){return-1!==I.indexOf(e)},_=y("n"),H=y("s"),Y=y("w"),G=y("e"),W=_?M+a:M,J=H?k+a:k,X=Y?A+n:A,K=G?L+n:L;z&&(_&&(W=M-a),H&&(J=k-a)),(!z&&J-W>10||z&&W-J>10)&&(E(S,r[S]=z?W:q(W)),E(D,r[D]=z?J:q(J))),K-X>10&&(E(O,r[O]=R?X:Z(X)),E(C,r[C]=R?K:Z(K)))}t.attr("d",m(e,r)),Q(l,r)}function Q(e,t){(R||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:v.extractPathCoords(t.path,h.paramIsX))),o=U(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:v.extractPathCoords(t.path,h.paramIsY)));if(i=v.roundPositionForSharpStrokeRendering(i,1),o=v.roundPositionForSharpStrokeRendering(o,1),R&&z){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(R){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(W),G.node().onmousemove=J}(e,R,s,t,r,I):!0===s.editable&&R.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!x(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,g(e)}}(e,R)}))}}function _(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){x(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,g(e)))}t.exports={draw:g,drawOne:b,eraseActiveShape:function(e){if(!x(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&sp&&(e="X"),e}));return i>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),u+h}))}(t,l,c);if("pixel"===t.xsizemode){var b=l(t.xanchor);u=b+t.x0,f=b+t.x1}else u=l(t.x0),f=l(t.x1);if("pixel"===t.ysizemode){var _=c(t.yanchor);d=_-t.y0,p=_-t.y1}else d=c(t.y0),p=c(t.y1);if("line"===h)return"M"+u+","+d+"L"+f+","+p;if("rect"===h)return"M"+u+","+d+"H"+f+"V"+p+"H"+u+"Z";var w=(u+f)/2,T=(d+p)/2,M=Math.abs(w-u),k=Math.abs(T-d),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}},{"../../lib":244,"../../plots/cartesian/axes":291,"./constants":195}],206:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":302,"./attributes":193,"./calc_autorange":194,"./defaults":196,"./draw":198,"./draw_newshape/defaults":201}],207:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":238,"../../plot_api/edit_types":273,"../../plot_api/plot_template":280,"../../plots/animation_attributes":285,"../../plots/font_attributes":319,"../../plots/pad_attributes":324,"./constants":208}],208:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],209:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function D(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function O(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(k,t,e,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 C(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,m(t))}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,g);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var g={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(g[0],g[1]))}}}return N.call(F),I&&(S?N.on(".opacity",null):(k=0,A=!0,N.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)}))),N.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),N.classed("js-placeholder",A),T}}},{"../../constants/alignment":219,"../../constants/interactions":223,"../../lib":244,"../../lib/svg_text_utils":267,"../../plots/plots":325,"../../registry":327,"../color":103,"../drawing":125,"@plotly/d3":11,"fast-isnumeric":17}],213:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":238,"../../plot_api/edit_types":273,"../../plot_api/plot_template":280,"../../plots/font_attributes":319,"../../plots/pad_attributes":324,"../color/attributes":102}],214:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],215:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":244,"../../plots/array_container_defaults":286,"./attributes":213,"./constants":214}],216:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function v(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),m(e,n,a,i,t),l||g(e,n,a,i,t))}function m(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.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)),g(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function g(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,m=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?m=g.headerHeight+f.gapButtonHeader:h=g.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(m=-f.gapButtonHeader+f.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+m+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(v(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(v(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(g.openWidth,g.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(g.openHeight,g.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=m+g;S+A>c&&(S=c-A);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=D.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=g>T,C=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,I=h+v,R=m;I+C>s&&(I=s-C);var z=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:I,y:R,width:C,height:P}),this._vbarYMin=R+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var N=this.id,F=u-.5,E=O?f+C+.5:f+.5,j=d-.5,H=M?p+A+.5:p+.5,B=o._topdefs.selectAll("#"+N).data(M||O?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",N).append("rect"),M||O?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(E)-Math.floor(F),height:Math.ceil(H)-Math.floor(j)}),this.container.call(i.setClipUrl,N,this.gd),this.bg.attr({x:h,y:m,width:v,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||O){var Y=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(Y);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":244,"../color":103,"../drawing":125,"@plotly/d3":11}],219:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],220:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"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",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],221:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],222:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],223:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],224:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],225:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],226:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],228:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],229:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,v=s([r,n]);function m(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}v?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":251}],230:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),g=e.charAt(0);!c||"G"!==g&&"g"!==g||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:y);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),D=Number(T[11]||0);if(c){if(2===M.length)return u;var O;M=Number(M);try{var C=m.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),O=C.newDate(M,C.toMonthIndex(M,k,P),A)}else O=C.newDate(M,Number(k),A)}catch(e){return u}return O?(O.toJD()-v)*f+L*d+S*p+D*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var I=new Date(Date.UTC(2e3,k,A,L,S));return I.setUTCFullYear(M),I.getUTCMonth()!==k||I.getUTCDate()!==A?u:I.getTime()+D*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,M=3*d,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+v,S=Math.floor(s(e,f));try{i=m.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function O(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return D[r("%q")(a)]})),_(n))try{e=m.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+O(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return O(t,e,n,a)};var P=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+v,i=m.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-v)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&m.getComponentMethod("calendars","getCal")(t),u=0;u1||v<0||v>1?null:{x:e+s*v,y:t+f*v}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,v=d*d+p*p,m=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,v,e-a,t-i),s(d,p,v,r-a,n-i));return Math.sqrt(m)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":251}],242:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],243:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],244:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var v=e("./coerce");f.valObjectMeta=v.valObjectMeta,f.coerce=v.coerce,f.coerce2=v.coerce2,f.coerceFont=v.coerceFont,f.coercePattern=v.coercePattern,f.coerceHoverinfo=v.coerceHoverinfo,f.coerceSelectionMarkerOpacity=v.coerceSelectionMarkerOpacity,f.validate=v.validate;var m=e("./dates");f.dateTime2ms=m.dateTime2ms,f.isDateTime=m.isDateTime,f.ms2DateTime=m.ms2DateTime,f.ms2DateTimeLocal=m.ms2DateTimeLocal,f.cleanDate=m.cleanDate,f.isJSDate=m.isJSDate,f.formatDate=m.formatDate,f.incrementMonth=m.incrementMonth,f.dateTick0=m.dateTick0,f.dfltRange=m.dfltRange,f.findExactDates=m.findExactDates,f.MIN_MS=m.MIN_MS,f.MAX_MS=m.MAX_MS;var g=e("./search");f.findBin=g.findBin,f.sorterAsc=g.sorterAsc,f.sorterDes=g.sorterDes,f.distinctVals=g.distinctVals,f.roundUp=g.roundUp,f.sort=g.sort,f.findIndexOfMin=g.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var y=e("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var x=e("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=e("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");f.log=M.log,f.warn=M.warn,f.error=M.error;var k=e("./regex");f.counterRegex=k.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?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},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return R.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return E.apply(z,arguments)};var N={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return E.apply(N,arguments)};var F=/^[:|\|]/;function E(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,v="xother_"===l||"yother_"===l,m="xother"===l||"yother"===l||p||v||h,g=l;if((p||h)&&(g=g.substring(1)),(v||h)&&(g=g.substring(0,g.length-1)),m){if(void 0===(c=t[g]))return""}else for(d=3;d=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 j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(e,t){e.attr("transform",f.getTextTransform(t)),e.style("display",t.scale?null:"none")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var H=f.getFirefoxVersion(),B=null!==H&&H<86;f.getPositionFromD3Event=function(){return B?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":224,"./anchor_utils":228,"./angles":229,"./array":230,"./clean_number":231,"./clear_responsive":233,"./coerce":234,"./dates":235,"./dom":236,"./extend":238,"./filter_unique":239,"./filter_visible":240,"./geometry2d":241,"./identity":242,"./increment":243,"./is_plain_object":245,"./keyed_container":246,"./localize":247,"./loggers":248,"./make_trace_groups":249,"./matrix":250,"./mod":251,"./nested_property":252,"./noop":253,"./notifier":254,"./preserve_drawing_buffer":257,"./push_unique":258,"./regex":260,"./relative_attr":261,"./relink_private":262,"./search":263,"./sort_object_keys":265,"./stats":266,"./throttle":268,"./to_log_range":269,"@plotly/d3":11,"d3-format":13,"d3-time-format":14,"fast-isnumeric":17}],245:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],246:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":278,"./notifier":254}],249:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":11}],250:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],252:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,v=r.length,m=r[0][0],g=r[0][1],y=0;for(u=1;uMath.max(f,m)||c>Math.max(d,g)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":224,"./matrix":250}],257:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-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":17,"is-mobile":51}],258:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":230,"fast-isnumeric":17}],267:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,v){var A=e.text(),L=!e.attr("data-notex")&&t&&t._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(s),O=n.select(e.node().parentNode);if(!O.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s,d=parseInt((MathJax.version||"").split(".")[0]);if(2!==d&&3!==d)return void a.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+a.randstr({},64),i=(s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(i):MathJax.typeset([i])},h=function(){var t=s.select(2===d?".MathJax_SVG":".MathJax"),i=!t.empty()&&s.select("svg").node();if(i){var o,l=i.getBoundingClientRect();o=2===d?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,l)}else a.log("There was an error in the tex syntax.",e),r();s.remove()};2===d?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:f},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,h,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})):3===d&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),h(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(L[2],o,(function(n,a,o){O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var s=O.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild);var c=o.width,u=o.height;l.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=e.node().style.fill||"black",d=l.select("g");d.attr({fill:f,stroke:f});var p=d.node().getBoundingClientRect(),h=p.width,m=p.height;(h>c||m>u)&&(l.style("overflow","hidden"),h=(p=l.node().getBoundingClientRect()).width,m=p.height);var g=+e.attr("x"),y=+e.attr("y"),x=-(r||e.node().getBoundingClientRect().height)/4;if("y"===C[0])s.attr({transform:"rotate("+[-90,g,y]+")"+i(-h/2,x-m/2)});else if("l"===C[0])y=x-m/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))g=0,y=x;else{var b=e.attr("text-anchor");g-=h*("middle"===b?.5:"end"===b?1:0),y=y+x-m/2}l.attr({x:g,y:y}),v&&v.call(e,s),t(s)}))}))):P(),e}function P(){O.empty()||(C=e.attr("class")+"-math",O.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(m," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(g),O=0;O|>|>)/g;var f=[["$","$"],["\\(","\\)"]];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"},v=["http:","https:","mailto:","",void 0,":"],m=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//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 M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],l="",s=0,c=0;ca?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(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function D(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==v.indexOf(a)&&-1!==v.indexOf(i)?t:""}function O(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.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 e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(m," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],269:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":17}],270:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],271:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],272:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(e);for(t=0;t3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!v&&(d(m,g),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),D=S||[],O=u(g,f).get(),C=[],P=-1,I=D.length;for(x=0;xD.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?C.push(_):k?("add"===M&&(M={}),D.splice(_,0,M),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===P&&(P=_);else for(b=0;b=0;x--)D.splice(C[x],1),O&&O.splice(C[x],1);if(D.length?S||t.set(D):t.set(null),v)return!1;if(d(m,g),h!==a){var R;if(-1===P)R=L;else{for(I=Math.max(D.length,I),R=[],x=0;x=P);x++)R.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=O(r,e.data.length-1),t)for(var v=0;v-1&&-1===r.indexOf("grouptitlefont")?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=G(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag,d.reselect),c.add(e,B,[e,a.undoit],B,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.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[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[];for(var n in t){var a=p.getFromId(e,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)t[i]||r.push(i)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Z=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function G(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=F(s._preGUI,c),h=Object.keys(t),v=p.list(e),m=o.extendDeepAll({},t),g={};for(H(t),h=Object.keys(t),n=0;n0&&"string"!=typeof I.parts[z];)z--;var E=I.parts[z],j=I.parts[z-1]+"."+E,B=I.parts.slice(0,z).join("."),Y=l(e.layout,B).get(),V=l(s,B).get(),G=I.get();if(void 0!==R){A[P]=R,L[P]="reverse"===E?R:N(G);var J=f.getLayoutValObject(s,I.parts);if(J&&J.impliedEdits&&null!==R)for(var X in J.impliedEdits)S(o.relativeAttr(P,X),J.impliedEdits[X]);if(-1!==["width","height"].indexOf(P))if(R){S("autosize",null);var K="height"===P?"width":"height";S(K,s[K])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",R?null:s.width),S("height",R?null:s.height);else if(j.match(U))C(j),l(s,B+"._inputRange").set(null);else if(j.match(Z)){C(j),l(s,B+"._inputRange").set(null);var Q=l(s,B).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(q)&&l(s,B+"._inputDomain").set(null);if("type"===E){D=Y;var $="linear"===V.type&&"log"===R,ee="log"===V.type&&"linear"===R;if($||ee){if(D&&D.range)if(V.autorange)$&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var te=D.range[0],re=D.range[1];$?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete s[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,R,S),u.getComponentMethod("images","convertCoords")(e,V,R,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(E.match(M)){var ne=l(s,P).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=J||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(R)?L[P]=null:b.isRemoveVal(R)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),g[r]||(g[r]={});var se=g[r][n];se||(se=g[r][n]={}),se[oe]=R,delete t[P]}else"reverse"===E?(Y.range?Y.range.reverse():(S(B+".autorange",!0),Y.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):("dragmode"===P&&(!1===R&&!1!==G||!1!==R&&!1===G)||s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===R||"select"===R)&&"lasso"!==G&&"select"!==G||s._has("gl2d")?k.plot=!0:J?T.update(k,J):k.calc=!0,I.set(R))}}for(r in g){b.applyContainerArrayChanges(e,d(i,r),g[r],k,d)||(k.plot=!0)}for(var ce in O){var ue=(D=p.getFromId(e,ce))&&D._constraintGroup;if(ue)for(var fe in k.calc=!0,ue)O[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:O,undoit:L,redoit:A,eventData:m}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=G(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),Y(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&V(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag,d.reselect),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function X(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{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 $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,v,m=0;function g(e){return Array.isArray(a)?m>=a.length?e.transitionOpts=a[m]:e.transitionOpts=a[0]:e.transitionOpts=a,m++,e}var y=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))y.push({type:"object",data:g(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(v);y=k}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var v=t[n].name,m=(u[v]||h[v]||{}).name,g=t[n].name,y=u[m]||h[m];m&&g&&"number"==typeof g&&y&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[m]||h[m]).name+'" with a frame whose name of type "number" also equates to "'+m+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&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[v]={name:v},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!y(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function y(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return g(a,t,l)},r.getLayoutValObject=function(e,t){return g(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":244,"../plots/attributes":287}],281:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),v=h.enforce,m=h.clean,g=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,v,m=e._fullLayout,g=m._size,x=g.p,_=d.list(e,"",!0);if(m._paperdiv.style({width:e._context.responsive&&m.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":m.width+"px",height:e._context.responsive&&m.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":m.height+"px"}).selectAll(".main-svg").call(c.setSize,m.width,m.height),e._context.setBackground(e,m.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!m._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:g.l+g.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(m.paper_bgcolor)&&1===s.opacity(m.plot_bgcolor)&&m.paper_bgcolor===m.plot_bgcolor;for(a in m._plots)if((l=m._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var D=l.xaxis.domain,O=l.yaxis.domain,C=l.plotgroup;if(y(D,O,L)){var P=C.node(),I=l.bg=o.ensureSingle(C,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([D,O]),S||(k.push(a),A.push(a))}var R,z,N,F,E,j,H,B,Y,V,U,Z,q,G=m._bgLayer.selectAll(".bg").data(k);for(G.enter().append("rect").classed("bg",!0),G.exit().remove(),G.each((function(e){m._plots[e].bg=n.select(this)})),t=0;tT?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 e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=v(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&m(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(g)}},{"../lib":244,"../plots/attributes":287,"../plots/plots":325,"./plot_config":278,"./plot_schema":279,"./plot_template":280}],283:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function v(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!v("width")&&null!==t.width||!v("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!v("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var m={};function g(e,r){return o.coerce(t,m,f,e,r)}var y=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},d);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function D(){return new Promise((function(e,t){var r=s(M,y,_),n=M._fullLayout.width,f=M._fullLayout.height;function d(){a.purge(M),document.body.removeChild(M)}if("full-json"===y){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(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(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(D).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":244,"../plots/plots":325,"../snapshot/helpers":331,"../snapshot/svgtoimg":333,"../snapshot/tosvg":335,"../version":400,"./plot_api":277,"fast-isnumeric":17}],284:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,g.concat(x.length)));var k,A,L,S,D,O=x.length,C=Array.isArray(M);if(C&&(O=Math.min(O,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,g.concat(A,x[A].length)));var P=x[A].length;for(k=0;k<(C?Math.min(P,M[A].length):P);k++)L=C?M[A][k]:M,S=y[A][k],D=x[A][k],n.validate(S,L)?D!==S&&D!==+S&&a.push(h("dynamic",i,g.concat(A,k),S,D)):a.push(h("value",i,g.concat(A,k),S))}else a.push(h("array",i,g.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(v);for(var m=v._fullData,g=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,v=e[r+"period0"],m=i(v,d)||0,g=[],y=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,d);for(;M<=k;)M=o(M,c,d);T=o(M,-c,d)}else{for(M=m+(w=Math.round((k-m)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}g[_]=p?T:h?M:(T+M)/2,y[_]=T,x[_]=M}return{vals:g,starts:y,ends:x}}},{"../../constants/numerical":224,"../../lib":244,"fast-isnumeric":17}],289:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],290:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=v(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,m=f[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>D?M/T>O&&(_=x,w=b,O=M/T):M/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=M/S));if(d===m){var C=d-1,P=d+1;if(A)if(0===d)a=[0,1];else{var I=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=d/(1-Math.min(.5,I/S));a=d>0?[0,R]:[R,0]}else a=L?[Math.max(0,C),Math.max(1,P)]:[C,P]}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-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-O*l(_),w.val+O*s(w)];return g&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),D=k(r.vpadminus||r.vpad);if(!T){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=P;n--)C(n);return{min:h,max:v,opts:r}},concatExtremes:v};function v(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":125,"../../constants/numerical":224,"../../lib":244,"../../registry":327,"./axis_ids":295,"@plotly/d3":11,"fast-isnumeric":17}],291:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),v=e("../../constants/numerical"),m=v.ONEMAXYEAR,g=v.ONEAVGYEAR,y=v.ONEMINYEAR,x=v.ONEMAXQUARTER,b=v.ONEAVGQUARTER,_=v.ONEMINQUARTER,w=v.ONEMAXMONTH,T=v.ONEAVGMONTH,M=v.ONEMINMONTH,k=v.ONEWEEK,A=v.ONEDAY,L=A/2,S=v.ONEHOUR,D=v.ONEMIN,O=v.ONESEC,C=v.MINUS_SIGN,P=v.BADNUM,I={K:"zeroline"},R={K:"gridline",L:"path"},z={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},F={K:"tick",L:"text"},E={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j=e("../../constants/alignment"),H=j.MID_SHIFT,B=j.CAP_SHIFT,Y=j.LINE_SPACING,V=j.OPPOSITE_SIDE,U=t.exports={};U.setConvert=e("./set_convert");var Z=e("./axis_autotype"),q=e("./axis_ids"),G=q.idSort,W=q.isLinked;U.id2name=q.id2name,U.name2id=q.name2id,U.cleanId=q.cleanId,U.list=q.list,U.listIds=q.listIds,U.getFromId=q.getFromId,U.getFromTrace=q.getFromTrace;var J=e("./autorange");U.getAutoRange=J.getAutoRange,U.findExtremes=J.findExtremes;function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}U.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},U.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},U.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==U.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=U.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},U.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:U.getFromId(t,r).cleanPos)(e)},U.redrawComponents=function(e,t){t=t||U.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;ur&&f2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},U.saveRangeInitial=function(e,t){for(var r=U.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=U.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=U.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=U.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,g,c,i)),m=y,0;m<=u;)m=U.tickIncrement(m,g,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(m,0,i),size:g,_dataSpan:u-c}},U.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,i=t.dtick&&a(t._tmin);if(i){var o=U.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var s=l.simpleMap(t.range,t.r2l);n=[s[0],.8*s[0]+.2*s[1]]}if(e.range=l.simpleMap(n,t.l2r),e._isMinor=!0,U.prepTicks(e,r),i){var c=a(t.dtick),u=a(e.dtick),f=c?t.dtick:+t.dtick.substring(1),d=u?e.dtick:+e.dtick.substring(1);c&&u?ee(f,d)?f===2*k&&d===2*A&&(e.dtick=k):f===2*k&&d===3*A?e.dtick=k:f!==k||(t._input.minor||{}).nticks?te(f/d,2.5)?e.dtick=f/2:e.dtick=f:e.dtick=A:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ee(f,d)?f>=12&&2===d&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ee(f,d)||(e.dtick=te(f/d,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},U.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,U.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=U.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dtick=(I?0:1);R--){var z=!R;R?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var N=R?e:l.extendFlat({},e,e.minor);if(z?U.prepMinorTicks(N,e,t):U.prepTicks(N,t),"array"!==N.tickmode){var F=X(u),E=F[0],j=F[1],H=a(N.dtick),B="log"===i&&!(H||"L"===N.dtick.charAt(0)),Y=U.tickFirst(N,t);if(R){if(e._tmin=Y,Y=j:G<=j;G=U.tickIncrement(G,W,f,o)){if(R&&V++,N.rangebreaks&&!f){if(G=p)break}if(O.length>h||G===q)break;q=G;var J={value:G};R?(B&&G!==(0|G)&&(J.simpleLabel=!0),s>1&&V%s&&(J.skipLabel=!0),O.push(J)):(J.minor=!0,C.push(J))}}else R?(O=[],v=ne(e)):(C=[],D=ne(e))}if(I&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=O.map((function(e){return e.value})),Q=[],$=0;$0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=m?u:g:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=M?d=u>=M&&u<=w?u:T:r===k&&f>=k?d=k: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(t.rangebreaks&&d>0){for(var h=0,v=0;v<84;v++){var D=(v+.5)/84;t.maskBreaks(a*(1-D)+D*p)!==P&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>k&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(O,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),oe=1;"auto"===e.tickmode&&(oe=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=O.length-1;r>-1;r--)if(O[r].drop)O.splice(r,1);else{O[r].value=Pe(O[r].value,e);var se=e.c2p(O[r].value);(ie?le>se-oe:lep||uep&&(ce.periodX=p),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=D&&i<=16||t>=S)e._tickround="M";else if(t>=O&&i<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ve(e.exponentformat)&&!me(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}U.autoTicks=function(e,t,r){var n;function i(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var o=2*t;if(o>g)t/=g,n=i(10),e.dtick="M"+12*fe(t,n,ae);else if(o>T)t/=T,e.dtick="M"+fe(t,1,ie);else if(o>A){if(e.dtick=fe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:le),!r){var s=U.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(s)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else o>S?e.dtick=fe(t,S,ie):o>D?e.dtick=fe(t,D,oe):o>O?e.dtick=fe(t,O,oe):(n=i(10),e.dtick=fe(t,n,ae))}else if("log"===e.type){e.tick0=0;var u=l.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=i(10),e.dtick="L"+fe(t,n,ae)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Ce(e)?(e.tick0=0,n=1,e.dtick=fe(t,n,ue)):(e.tick0=0,n=i(10),e.dtick=fe(t,n,ae));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},U.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ce:se,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},U.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=ge(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||ve(p)&&me(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":C)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":C)+d:(t.text=ge(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,v):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):Ce(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=ge(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=ge(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,v):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=ge(t.x,e,a,n)}(e,o,0,c,v),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var m=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[m(o.x-.5),m(o.x+e.dtick-.5)]}return o},U.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return U.hoverLabelText(e,n,r)+" - "+U.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=U.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var he=["f","p","n","\u03bc","m","","k","M","G","T"];function ve(e){return"SI"===e||"B"===e}function me(e){return e>14||e<-15}function ge(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=U.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};de(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ve(s)&&(e+=he[c/3+5]));return i?C+e:e}function ye(e,t){if(e){var r=Object.keys(E).reduce((function(e,r){return-1!==t.indexOf(r)&&E[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function xe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var m=r.right-(t._offset+t._length);m>0&&(n.xr=1,n.r=m);var g=t._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[v]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=we(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[v]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[v]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ae&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ye(n,t.automargin),ye(a,t.automargin)),i.autoMargin(e,ke(t),n),i.autoMargin(e,Ae(t),a),i.autoMargin(e,Le(t),l)})),r.skipTitle||ae&&"bottom"===t.side||re.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+we(t);else{var l=Ie(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,v=U.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?v-r:v+r):(p=t._offset+t._length/2,f="right"===t.side?v+r:v-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var m=t._selections[t._id+"tick"];if(h={selection:m,side:t.side},m&&m.node()&&m.node().parentNode){var g=d.getTranslate(m.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(re)}}function ie(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=Me(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},U.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],a=e.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},U.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},U.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},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=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*B,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-B));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(be(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(be(t)))}},U.makeTickPath=function(e,t,r,n){n||(n={});var a=n.minor;if(a&&!e.minor)return"";var i=void 0!==n.len?n.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*r)+"v"+i*r:"M"+(t+l*r)+",0h"+i*r},U.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,v=d?e.ticklen:0;if(f?v*=-1:u&&(v=0),d&&(p+=v,r)){var m=l.deg2rad(r);p=v*Math.cos(m)+1,h=v*Math.sin(m)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var g,y,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!f&&"bottom"===M||f&&"top"===M)?1:-1,f&&(b*=-1),g=h*b,y=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=H:x=-90===A&&"bottom"===M?B:90===A&&"top"===M?H:.5,T=H/2*(A/90)),w.xFn=function(e){return e.dx+g+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===k){if(b=(_=!f&&"left"===M||f&&"right"===M)?1:-1,f&&(b*=-1),g=p,y=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?B:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*B*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*H},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},U.drawTicks=function(e,t,r){r=r||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,_e);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return d.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Re(t,[N]),o.attr("transform",r.transFn)},U.drawGrid=function(e,t,r){r=r||{};var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?r.vals.filter((function(e){return e.minor})):[],l=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],s=r.counterAxis;if(s&&U.shouldShowZeroLine(e,t,s))for(var c="array"===t.tickmode,u=0;u=0;g--){var y=g?v:m;if(y){var x=y.selectAll("path."+a).data(g?l:o,_e);x.exit().remove(),x.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return d.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}Re(t,[R,z])},U.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=U.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return G(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Re(t,[I])},U.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,v=r.secondary?0:t.tickangle,m=(t._prevTickAngles||{})[f],g=r.layer.selectAll("g."+f).data(t.showticklabels?p:[],_e),y=[];function x(e,i){e.each((function(e){var o=n.select(this),l=o.select(".text-math-group"),u=h.anchorFn(e,i),f=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=c.lineCount(o),v=Y*e.fontSize,m=h.heightFn(e,a(i)?+i:0,(p-1)*v);if(m&&(f+=s(0,m)),l.empty()){var g=o.select("text");g.attr({transform:f,"text-anchor":u}),g.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var y=d.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr("transform",f+s(y,0))}}))}g.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(d.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?y.push(e._promises.pop().then((function(){x(r,v)}))):x(r,v)})),Re(t,[F]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),s=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=l.simpleMap(t.range,t.r2l);s=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var f=Math.min(s,c),p=Math.max(s,c),h=t.side,v=1/0,m=-1/0;for(var y in g.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=d.bBox(r.node()),l=0;o?(i.right>p||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(g,m+1?m:v);var b=null;t._selections&&(t._selections[f]=g);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===m?(b=90,_.push((function(){x(g,m)}))):_.push((function(){if(x(g,v),p.length&&"x"===u&&!a(v)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=Me(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"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),m=f("left"),y=f("right"),_=f("bottom")||m||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var m="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,m)?"category":function(e,t){for(var r=e.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=m;break}var f=a("pattern",u);if(f===m)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case m:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":327,"./constants":298}],296:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function m(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rI&&FC&&(C=F);d/=(C-O)/(2*P),O=s.l2r(O),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){P&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),P=!1)}function Z(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function q(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,v=0;v=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ge||Ue(),me)o.indexOf("select")>-1&&L(r,a,X,K,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ge){var l=v?I:P,c="s"===v||"w"===g?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",m="middle";if(l.fixedrange)return;v?(m="n"===v?"top":"bottom","right"===l.side&&(h="right")):"e"===g&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:m}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,De.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),De.attr("d",Z(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,De.attr("d",Z(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;uv[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":244,"fast-isnumeric":17}],308:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,l=n(e);r("tickprefix")&&r("showtickprefix",l),r("ticksuffix",o)&&r("showticksuffix",l)}},{"./show_dflt":311}],309:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":219}],310:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,v=p.BADNUM,m=p.LOG_CLIP,g=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*m*Math.abs(n-a))}return v}function D(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===v){if(!l(t))return v;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function O(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function P(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return v}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=I(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:I(e)}function N(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var E=function(t){return l(t)?N(t,e._m,e._b):v},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var H="y"===p;E=function(t){if(!l(t))return v;var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?N(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:f,e.l2c="log"===e.type?A:f,e.l2p=E,e.p2l=j,e.c2p="log"===e.type?function(e,t){return E(S(e,t))}:E,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=O,e.d2p=e.r2p=function(t,r,n){return e.l2p(D(t,0,n))},e.p2d=e.p2r=function(e,t,r){return O(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,v,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=f,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function m(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),v=i.simpleMap(t.xr1,a.r2l),m=h[1]-h[0],g=v[1]-v[0];p[0]=(h[0]*(1-r)+r*v[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*g/m),a.range[0]=a.l2r(h[0]*(1-r)+r*v[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*v[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=y[1]-y[0],_=x[1]-x[0];p[1]=(y[1]*(1-r)+r*x[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(y[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,M=f?p[0]:0,k=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,D=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,D).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":125,"../../lib":244,"../../registry":327,"./axes":291,"@plotly/d3":11}],316:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.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=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(d,s,f,n),b.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),H=!(!s._has||!s._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||H;B&&!Y?n._bgLayer.remove():Y&&!B&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,v=!t.height&&Math.abs(r.height-a)>1;(v||h)&&(h&&(r.width=n),v&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:x,size:r.l+m},r:{val:_,size:r.r+m},b:{val:T,size:r.b+m},t:{val:w,size:r.t+m}},v[t]=1}else delete h[t],delete v[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),O(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,v=t._pushmargin,m=t._pushmarginIds,g=t.minreducedwidth,y=t.minreducedheight;if(!1!==t.margin.autoexpand){for(var x in v)m[x]||delete v[x];for(var _ in v.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},v){var w=v[_].l||{},T=v[_].b||{},M=w.val,k=w.size,A=T.val,L=T.size;for(var S in v){if(o(k)&&v[S].r){var D=v[S].r.val,C=v[S].r.size;if(D>M){var P=(k*D+(C-r)*M)/(D-M),I=(C*(1-M)+(k-r)*(1-D))/(D-M);P+I>c+f&&(c=P,f=I)}}if(o(L)&&v[S].t){var R=v[S].t.val,z=v[S].t.size;if(R>A){var N=(L*R+(z-n)*A)/(R-A),F=(z*(1-A)+(L-n)*(1-R))/(R-A);N+F>h+d&&(h=N,d=F)}}}}}var E=u.constrain(r-i.l-i.r,2,g),j=u.constrain(n-i.t-i.b,2,y),H=Math.max(0,r-E),B=Math.max(0,n-j);if(H){var Y=(c+f)/H;Y>1&&(c/=Y,f/=Y)}if(B){var V=(h+d)/B;V>1&&(h/=V,d/=V)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(m).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(R(o,c,f),a=0;a0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":103,"../components/drawing":125,"../constants/xmlns_namespaces":225,"../lib":244,"@plotly/d3":11}],336:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function R(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[f+"a"],N=e[d+"a"];v=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(m,F,e),!1!==e.index&&m[e.index].p!==c){M||(D=function(e){return Math.min(k(e),e.p-y.bargroupwidth/2)},O=function(e){return Math.max(A(e),e.p+y.bargroupwidth/2)});var E=m[e.index],j=g.base?E.b+E.s:E.s;e[d+"0"]=e[d+"1"]=N.c2p(E[d],!0),e[d+"LabelVal"]=j;var H=y.extents[y.extents.round(E.p)];e[f+"0"]=z.c2p(x?D(E):H[0],!0),e[f+"1"]=z.c2p(x?O(E):H[1],!0);var B=void 0!==E.orig_p;return e[f+"LabelVal"]=B?E.orig_p:E.p,e.labelLabel=s(z,e[f+"LabelVal"],g[f+"hoverformat"]),e.valueLabel=s(N,e[d+"LabelVal"],g[d+"hoverformat"]),e.baseLabel=s(N,E.b,g[d+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(E)+function(e){return C(k(e),A(e),w)}(E))/2,e[f+"Spike"]=z.c2p(E.p,!0),o(E,g,e),e.hovertemplate=g.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=f(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":103,"../../components/fx":143,"../../constants/numerical":224,"../../lib":244,"../../plots/cartesian/axes":291,"../../registry":327,"./helpers":343}],345:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":303,"../scatter/marker_colorbar":385,"./arrays_to_calcdata":336,"./attributes":337,"./calc":338,"./cross_trace_calc":340,"./defaults":341,"./event_data":342,"./hover":344,"./layout_attributes":346,"./layout_defaults":347,"./plot":348,"./select":349,"./style":351}],346:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],347:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function D(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,v=a.height,m=Math.abs(t-e),g=Math.abs(n-r),y=m>2*_&&g>2*_?_:0;m-=2*y,g-=2*y;var x=L(s);"auto"!==s||h<=m&&v<=g||!(h>m||v>g)||(h>g||v>m)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};E=Z(E,j,z),j=Z(j,E,z),H=Z(H,B,!z),B=Z(B,H,!z)}var q=k(i.ensureSingle(P,"path"),C,m,g);if(q.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-E)*(B-H))||Y&&e._context.staticPlot?"M0,0Z":"M"+E+","+H+"V"+B+"H"+j+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&N){var G=s.makePointStyleFns(f);s.singlePointStyle(c,q,f,G,e)}!function(e,t,r,n,a,l,c,f,p,m,g){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,I="h"===P.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="histogram"===o.type,h="waterfall"===o.type,v="funnel"===o.type,m="h"===o.orientation;m?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,d.c2l(e),!0).text}var y=t[r],x={};x.label=y.p,x.labelLabel=x[s+"Label"]=(_=y.p,u(c,c.c2l(_),!0).text);var _;var w=i.castOption(o,y.i,"text");(0===w||w)&&(x.text=w);x.value=y.s,x.valueLabel=x[f+"Label"]=g(y.s);var T={};b(T,o,y.i),(p||void 0===T.x)&&(T.x=m?x.value:x.label);(p||void 0===T.y)&&(T.y=m?x.label:x.value);(p||void 0===T.xLabel)&&(T.xLabel=m?x.valueLabel:x.labelLabel);(p||void 0===T.yLabel)&&(T.yLabel=m?x.labelLabel:x.valueLabel);h&&(x.delta=+y.rawS||y.s,x.deltaLabel=g(x.delta),x.final=y.v,x.finalLabel=g(x.final),x.initial=x.final-x.delta,x.initialLabel=g(x.initial));v&&(x.value=y.s,x.valueLabel=g(x.value),x.percentInitial=y.begR,x.percentInitialLabel=i.formatPercent(y.begR),x.percentPrevious=y.difR,x.percentPreviousLabel=i.formatPercent(y.difR),x.percentTotal=y.sumR,x.percenTotalLabel=i.formatPercent(y.sumR));var M=i.castOption(o,y.i,"customdata");M&&(x.customdata=M);return i.texttemplateString(l,x,e._d3locale,T,x,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),v=[],m=function(e){return-1!==h.indexOf(e)};m("label")&&v.push((g=e[t].p,u(o?n:r,g,!0).text));var g;m("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&v.push(f);if(l){var y=+p.rawS||p.s,x=p.v,b=x-y;m("initial")&&v.push(c(b)),m("delta")&&v.push(c(y)),m("final")&&v.push(c(x))}if(s){m("value")&&v.push(c(p.s));var _=0;m("percent initial")&&_++,m("percent previous")&&_++,m("percent total")&&_++;var w=_>1;m("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),v.push(f)),m("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),v.push(f)),m("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),v.push(f))}return v.join("
")}(t,r,n,a):v.getValue(l.text,r);return v.coerceString(y,o)}(O,n,a,T,A);w=function(e,t){var r=v.getValue(e.textposition,t);return v.coerceEnumerated(x,r)}(P,a);var z="stack"===m.mode||"relative"===m.mode,N=n[a],F=!z||N._outmost;if(!R||"none"===w||(N.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var E=O.font,j=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,E,j),B=h.getOutsideTextFont(P,a,E),Y=r.datum();I?"log"===T.type&&Y.s0<=0&&(l=T.range[0]=Z*(J/q):J>=q*(W/Z);Z>0&&q>0&&(X||K||Q)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){G=i.ensureUniformFontSize(e,"outside"===w?B:H);var $=(V=C(r,R,G)).attr("transform");if(V.attr("transform",""),U=s.bBox(V.node()),Z=U.width,q=U.height,V.attr("transform",$),Z<=0||q<=0)return void V.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var v=L(c),m=S(a,v),g=(l?m.x:m.y)/2,y=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*g):(w=n+A*o,k=-A*g);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:v}}(l,c,f,p,U,{isHorizontal:I,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=D(l,c,f,p,U,{isHorizontal:I,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=G.size,d("histogram"===P.type?"bar":P.type,ee,O),N.transform=ee;var ne=k(V,O,m,g);i.setTransormAndDisplay(ne,ee)}(e,t,P,r,p,E,j,H,B,m,g),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,f.xcalendar,f.ycalendar)}));var H=!1===f.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,m)},toMoveInsideBar:D}},{"../../components/color":103,"../../components/drawing":125,"../../components/fx/helpers":139,"../../lib":244,"../../lib/svg_text_utils":267,"../../plots/cartesian/axes":291,"../../registry":327,"./attributes":337,"./constants":339,"./helpers":343,"./style":351,"./uniform_text":353,"@plotly/d3":11,"fast-isnumeric":17}],349:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:v,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,m(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":103,"../../components/drawing":125,"../../lib":244,"../../registry":327,"./attributes":337,"./helpers":343,"./uniform_text":353,"@plotly/d3":11}],352:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":103,"../../components/colorscale/defaults":113,"../../components/colorscale/helpers":114,"../../lib":244}],353:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o=0})),("funnelarea"===t.type?g:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=m),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var v=c("textposition");l(e,t,n,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(v)||"auto"===v||"outside"===v)&&c("automargin"),("inside"===v||"auto"===v||Array.isArray(v))&&c("insidetextorientation")}o(t,n,c);var m=c("hole");if(c("title.text")){var g=c("title.position",m?"middle center":"top center");m||"middle center"!==g||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":244,"../../plots/domain":318,"../bar/defaults":341,"./attributes":354,"fast-isnumeric":17}],358:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":139}],359:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:f.hovertemplate||-1!==d.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,e.pts)||e.color,borderColor:m.castOption(_.bordercolor,e.pts),fontFamily:m.castOption(w.family,e.pts),fontSize:m.castOption(w.size,e.pts),fontColor:m.castOption(w.color,e.pts),nameLength:m.castOption(_.namelength,e.pts),textAlign:m.castOption(_.align,e.pts),hovertemplate:m.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=m.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=m.castOption(e._input.textfont.color,t.pts));var a=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,i=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;m-=2)g(Math.PI*m,"tan");for(m=4;m>=-4;m-=2)g(Math.PI*(m+1),"tan")}if(f||p){for(m=4;m>=-4;m-=2)g(Math.PI*(m+1.5),"rad");for(m=4;m>=-4;m-=2)g(Math.PI*(m+.5),"rad")}}if(l||h||f){var y=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/y,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;v.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(i)),(h||d)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,v.push(i));for(var x=0,b=0,_=0;_=1)break}return v[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*v);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*v);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function D(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function O(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.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+=e.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-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n1?(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")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:m.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:m.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=m.getFirstFilled(a.text,t.pts);(y(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function N(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._context.staticPlot,i=e._fullLayout,d=i._size;h("pie",i),_(t,e),I(t,d);var v=s.makeTraceGroups(i._pielayer,t,"trace").each((function(t){var h=n.select(this),v=t[0],g=v.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=m.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.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))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var y=n.select(this).selectAll("g.slice").data(t);y.enter().append("g").classed("slice",!0),y.exit().remove();var _=[[[],[]],[[],[]]],T=!1;y.each((function(a,o){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=g.index,_[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var c=v.cx,u=v.cy,d=n.select(this),h=d.selectAll("path.surface").data([a]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),d.call(x,e,t),g.pull){var y=+m.castOption(g.pull,a.pts)||0;y>0&&(c+=y*a.pxmid[0],u+=y*a.pxmid[1])}a.cxFinal=c,a.cyFinal=u;var M=g.hole;if(a.v===v.vTotal){var k="M"+(c+a.px0[0])+","+(u+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";M?h.attr("d","M"+(c+M*a.px0[0])+","+(u+M*a.px0[1])+C(a.px0,a.pxmid,!1,M)+C(a.pxmid,a.px0,!1,M)+"Z"+k):h.attr("d",k)}else{var A=C(a.px0,a.px1,!0,1);if(M){var L=1-M;h.attr("d","M"+(c+M*a.px1[0])+","+(u+M*a.px1[1])+C(a.px1,a.px0,!1,M)+"l"+L*a.px0[0]+","+L*a.px0[1]+A+"Z")}else h.attr("d","M"+c+","+u+"l"+a.px0[0]+","+a.px0[1]+A+"Z")}z(e,a,v);var S=m.castOption(g.textposition,a.pts),O=d.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);O.enter().append("g").classed("slicetext",!0),O.exit().remove(),O.each((function(){var r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=m.castOption(e.outsidetextfont.color,t.pts)||m.castOption(e.textfont.color,t.pts)||r.color,a=m.castOption(e.outsidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,i=m.castOption(e.outsidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(g,a,i.font):b(g,a,i.font));r.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,e);var h,y=l.bBox(r.node());if("outside"===S)h=D(y,a);else if(h=w(y,a,v),"auto"===S&&h.scale<1){var x=s.ensureUniformFontSize(e,g.outsidetextfont);r.call(l.font,x),h=D(y=l.bBox(r.node()),a)}var _=h.textPosAngle,M=void 0===_?a.pxmid:R(v.r,_);if(h.targetX=c+M[0]*h.rCenter+(h.x||0),h.targetY=u+M[1]*h.rCenter+(h.y||0),N(h,y),h.outside){var k=h.targetY;a.yLabelMin=k-y.height/2,a.yLabelMid=k,a.yLabelMax=k+y.height/2,a.labelExtraX=0,a.labelExtraY=0,T=!0}h.fontSize=d.size,p(g.type,h,i),t[o].transform=h,s.setTransormAndDisplay(r,h)}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*v.r+","+n*v.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var M=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(M.enter().append("g").classed("titletext",!0),M.exit().remove(),M.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.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,e),t="middle center"===g.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(v):O(v,d),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),T&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,h;function v(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function y(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,v=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),y=p-h;if(y*s>0&&(e.labelExtraY=y),Array.isArray(t.pull))for(c=0;c=(m.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=y):(v+e.labelExtraY-g)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?v:g,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(y,g),T&&g.automargin){var k=l.bBox(h.node()),A=g.domain,L=d.w*(A.x[1]-A.x[0]),S=d.h*(A.y[1]-A.y[0]),C=(.5*L-v.r)/d.w,P=(.5*S-v.r)/d.h;a.autoMargin(e,"pie."+g.uid+".automargin",{xl:A.x[0]-C,xr:A.x[1]+C,yb:A.y[0]-P,yt:A.y[1]+P,l:Math.max(v.cx-v.r-k.left,0),r:Math.max(k.right-(v.cx+v.r),0),b:Math.max(k.bottom-(v.cy+v.r),0),t:Math.max(v.cy-v.r-k.top,0),pad:5})}}))}));setTimeout((function(){v.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:N}},{"../../components/color":103,"../../components/drawing":125,"../../components/fx":143,"../../lib":244,"../../lib/svg_text_utils":267,"../../plots/plots":325,"../bar/constants":339,"../bar/uniform_text":353,"./event_data":358,"./helpers":359,"@plotly/d3":11}],364:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":353,"./style_one":365,"@plotly/d3":11}],365:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":103,"./helpers":359}],366:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&O[g].gap;)g--;for(x=O[g].s,v=O.length-1;v>g;v--)O[v].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],374:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),v=e("./fillcolor_defaults"),m=e("../../lib").coercePattern;t.exports=function(e,t,r,g){function y(r,a){return n.coerce(e,t,i,r,a)}var x=s(e,t,g,y);if(x||(t.visible=!1),t.visible){c(e,t,g,y),y("xhoverformat"),y("yhoverformat");var b=u(e,t,g,y),_=!b&&x=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&v<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-v);return iG!=(j=R[P][1])>=G&&(N=R[P-1][0],F=R[P][0],j-E&&(z=N+(F-N)*(G-E)/(j-E),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:U,y0:G,y1:G,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":103,"../../components/fx":143,"../../lib":244,"../../registry":327,"./get_trace_color":377}],379:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":303,"./arrays_to_calcdata":366,"./attributes":367,"./calc":368,"./cross_trace_calc":372,"./cross_trace_defaults":373,"./defaults":374,"./format_labels":376,"./hover":378,"./marker_colorbar":385,"./plot":388,"./select":389,"./style":391,"./subtypes":392}],380:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){s||(s={});var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},{"../../components/colorscale/defaults":113,"../../components/colorscale/helpers":114,"../../lib":244}],381:[function(e,t,r){"use strict";var n=e("../../components/drawing"),a=e("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,c=e("../../lib"),u=c.segmentsIntersect,f=c.constrain,d=e("./constants");t.exports=function(e,t){var r,a,o,p,h,v,m,g,y,x,b,_,w,T,M,k,A,L,S=t.trace||{},D=t.xaxis,O=t.yaxis,C="log"===D.type,P="log"===O.type,I=D._length,R=O._length,z=t.backoff,N=S.marker,F=t.connectGaps,E=t.baseTolerance,j=t.shape,H="linear"===j,B=S.fill&&"none"!==S.fill,Y=[],V=d.minTolerance,U=e.length,Z=new Array(U),q=0;function G(r){var n=e[r];if(!n)return!1;var a=t.linearized?D.l2p(n.x):D.c2p(n.x),o=t.linearized?O.l2p(n.y):O.c2p(n.y);if(a===i){if(C&&(a=D.c2p(n.x,!0)),a===i)return!1;P&&o===i&&(a*=Math.abs(D._m*R*(D._m>0?l:s)/(O._m*I*(O._m>0?l:s)))),a*=1e3}if(o===i){if(P&&(o=O.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function W(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&coe||e[1]se)return[f(e[0],ie,oe),f(e[1],le,se)]}function fe(e,t){return e[0]===t[0]&&(e[0]===ie||e[0]===oe)||(e[1]===t[1]&&(e[1]===le||e[1]===se)||void 0)}function de(e,t,r){return function(n,a){var i=ue(n),o=ue(a),l=[];if(i&&o&&fe(i,o))return l;i&&l.push(i),o&&l.push(o);var s=2*c.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);s&&((i&&o?s>0==i[e]>o[e]?i:o:i||o)[e]+=s);return l}}function pe(e){var t=e[0],r=e[1],n=t===Z[q-1][0],a=r===Z[q-1][1];if(!n||!a)if(q>1){var i=t===Z[q-2][0],o=r===Z[q-2][1];n&&(t===ie||t===oe)&&i?o?q--:Z[q-1]=e:a&&(r===le||r===se)&&o?i?q--:Z[q-1]=e:Z[q++]=e}else Z[q++]=e}function he(e){Z[q-1][0]!==e[0]&&Z[q-1][1]!==e[1]&&pe([$,ee]),pe(e),te=null,$=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ce[a],o=u(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,e)oe?oe:0,Q=t[1]se?se:0,K||Q){if(q)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),Z[q++]=n[1])}else re=ne(Z[q-1],t)[0],Z[q++]=re;else Z[q++]=[K||t[0],Q||t[1]];var a=Z[q-1];K&&Q&&(a[0]!==K||a[1]!==Q)?(te&&($!==K&&ee!==Q?pe($&&ee?(i=te,l=(o=t)[0]-i[0],s=(o[1]-i[1])/l,(i[1]*o[0]-o[1]*i[0])/l>0?[s>0?ie:oe,se]:[s>0?oe:ie,le]):[$||K,ee||Q]):$&&ee&&pe([$,ee])),pe([K,Q])):$-K&&ee-Q&&pe([K||$,Q||ee]),te=t,$=K,ee=Q}else te&&he(ne(te,t)[0]),Z[q++]=t;var i,o,l,s}for(r=0;rJ(v,ge))break;o=v,(w=y[0]*g[0]+y[1]*g[1])>b?(b=w,p=v,m=!1):w<_&&(_=w,h=v,m=!0)}if(m?(me(p),o!==h&&me(h)):(h!==a&&me(h),o!==p&&me(p)),me(o),r>=e.length||!v)break;me(v),a=v}}else me(p)}te&&pe([$||te[0],ee||te[1]]),Y.push(Z.slice(0,q))}var ye=j.slice(j.length-1);if(z&&"h"!==ye&&"v"!==ye){for(var xe=!1,be=-1,_e=[],we=0;we=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":17}],385:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],386:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),c.noAngle||(s("marker.angle"),c.noAngleRef||s("marker.angleref"),c.noStandOff||s("marker.standoff")),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":103,"../../components/colorscale/defaults":113,"../../components/colorscale/helpers":114,"./subtypes":392}],387:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":224,"../../lib":244}],388:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,v){var m;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),v=Math.ceil(h.length/p),m=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return g?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,v),!0===_.visible){var S,D;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 C,P,I="",R=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",D=z._nextFill,R=z._polygons);var N,F,E,j,H,B,Y,V="",U="",Z=[],q=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(D&&D.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(N=s.steps(w.shape),F=s.steps(w.shape.split("").reverse().join(""))):N=F="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},E=function(e){return F(e.reverse())},Z=u(f,{xaxis:x,yaxis:b,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(Z.length),m=0;m1){var r=n.select(this);if(r.datum(f),e)y(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=y(r);a.attr("d",C),s.singleLineStyle(f,a)}}}}}var G=k.selectAll(".js-line").data(Z);y(G.exit()).style("opacity",0).remove(),G.each(q(!1)),G.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(q(!0)),s.setClipUrl(G,r.layerClipId,e),Z.length?(S?(S.datum(f),j&&B&&(O?("y"===O?j[1]=B[1]=b.c2p(0,!0):"x"===O&&(j[0]=B[0]=x.c2p(0,!0)),y(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle,e)):y(S).attr("d",V+"Z").call(s.singleFillStyle,e))):D&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?y(D).attr("d",V+"Z"+I+"Z").call(s.singleFillStyle,e):y(D).attr("d",V+"L"+I.substr(1)+"Z").call(s.singleFillStyle,e),_._polygons=_._polygons.concat(R)):(J(D),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(S?J(S):D&&J(D),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,v=te;if(f||d){var m=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?m=w?K:X:_&&!w&&(m=Q),f&&(h=m),d&&(v=m)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);g&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(v,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(L,W,e)}function J(e){y(e).attr("d","M0,0Z")}function X(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,v=!!i&&i.duration>0,m=f(e,t,r);((u=a.selectAll("g.trace").data(m,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),v)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,m,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,m,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":125,"../../lib":244,"../../lib/polygon":256,"../../registry":327,"./line_points":381,"./link_traces":383,"./subtypes":392,"@plotly/d3":11}],389:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;ra&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),x={},b={},_=0;h?(m=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(m=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(m);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],79:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(d)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function y(){if(h){var e=u(d,h);if(e)return e}return!!m&&u(d,m)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!m&&m.seg);var g,v=y();if(v){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(v.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=m?m.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)g=m?d.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:g,below:g};r&&r.status(d.seg,!!h&&h.seg,!!m&&m.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},i.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));case 5:case 10:case 11:case 12:case 7:default:return null}},i.prototype.scan_ifd=function(e,t,r){var i=this.read_uint16(t);t+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var h=[],m=d,y=0;y0&&(this.ifds_to_read.push({id:l,offset:h[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:e,tag:l,format:s,count:c,entry_offset:t+this.start,data_length:f,data_offset:d+this.start,value:h,is_subifd_link:p}))return void(this.aborted=!0);t+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(e){return-1}}},{}],86:[function(e,t,r){"use strict";var n=e("./common").readUInt16BE,a=e("./common").readUInt32BE;function i(e,t){if(e.length<4+t)return null;var r=a(e,t);return e.length>4&15,a=15&e[4],i=e[5]>>4&15,o=n(e,6),s=8,c=0;ct.width||e.width===t.width&&e.height>t.height?e:t})),a=r.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t})),n.width>a.height||n.width===a.height&&n.height>a.width?n:a),l=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(l=0===e.value?r[l]:t[l=t[l=r[l]]]),"irot"===e.type)for(var n=0;n1&&(d.variants=f.variants),f.orientation&&(d.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=e.length){var p=i(e,f.exif_location.offset),h=e.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),m=l.get_orientation(h);m>0&&(d.orientation=m)}return d}}}}}}},{"../common":84,"../exif_utils":85,"../miaf_utils":86}],88:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("BM");t.exports=function(e){if(!(e.length<26)&&a(e,0,o))return{width:i(e,18),height:i(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":84}],89:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("GIF87a"),l=n("GIF89a");t.exports=function(e){if(!(e.length<10)&&(a(e,0,o)||a(e,0,l)))return{width:i(e,6),height:i(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":84}],90:[function(e,t,r){"use strict";var n=e("../common").readUInt16LE;t.exports=function(e){var t=n(e,0),r=n(e,2),a=n(e,4);if(0===t&&1===r&&a){for(var i=[],o={width:0,height:0},l=0;lo.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:i,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":84}],91:[function(e,t,r){"use strict";var n=e("../common").readUInt16BE,a=e("../common").str2arr,i=e("../common").sliceEq,o=e("../exif_utils"),l=a("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var r,a,s=e[t++];255===s;)s=e[t++];if(208<=s&&s<=217||1===s)r=0;else{if(!(192<=s&&s<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===s||218===s)return;if(225===s&&r>=10&&i(e,t,l)&&(a=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=s&&s<=207&&196!==s&&200!==s&&204!==s){if(e.length-t0&&(c.orientation=a),c}t+=r}}},{"../common":84,"../exif_utils":85}],92:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),l=n("IHDR");t.exports=function(e){if(!(e.length<24)&&a(e,0,o)&&a(e,12,l))return{width:i(e,16),height:i(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":84}],93:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("8BPS\0\x01");t.exports=function(e){if(!(e.length<22)&&a(e,0,o))return{width:i(e,18),height:i(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":84}],94:[function(e,t,r){"use strict";function n(e){return"number"==typeof e&&isFinite(e)&&e>0}var a=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,l=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(e){return c.test(e)?e.match(c)[0]:"px"}t.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function d(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||u(e,t+8):"VP8L"===p&&h>=9?r=r||f(e,t+8):"VP8X"===p&&h>=10?r=r||d(e,t+8):"EXIF"===p&&(n=l.get_orientation(e.slice(t+8,t+8+h)),t=1/0),t+=8+h}else t++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":84,"../exif_utils":85}],97:[function(e,t,r){"use strict";t.exports={avif:e("./parse_sync/avif"),bmp:e("./parse_sync/bmp"),gif:e("./parse_sync/gif"),ico:e("./parse_sync/ico"),jpeg:e("./parse_sync/jpeg"),png:e("./parse_sync/png"),psd:e("./parse_sync/psd"),svg:e("./parse_sync/svg"),tiff:e("./parse_sync/tiff"),webp:e("./parse_sync/webp")}},{"./parse_sync/avif":87,"./parse_sync/bmp":88,"./parse_sync/gif":89,"./parse_sync/ico":90,"./parse_sync/jpeg":91,"./parse_sync/png":92,"./parse_sync/psd":93,"./parse_sync/svg":94,"./parse_sync/tiff":95,"./parse_sync/webp":96}],98:[function(e,t,r){"use strict";var n=e("./lib/parsers_sync");t.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r1)for(var r=1;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,a,o,l;if("string"==typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";l='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(i(t,"type"))}return l+=". Received type ".concat(typeof r)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],103:[function(e,t,r){(function(r){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var a=e("./_stream_readable"),i=e("./_stream_writable");e("inherits")(c,a);for(var o=n(i.prototype),l=0;l0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)o.endEmitted?w(e,new _):L(e,o,t,!0);else if(o.ended)w(e,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?L(e,o,t,!1):C(e,o)):L(e,o,t,!1)}else n||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(D,e))}function D(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,z(e)}function C(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(E,e,t))}function E(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){c("readable nexttick read 0"),e.read(0)}function I(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),z(e),t.flowing&&!t.reading&&e.read(0)}function z(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(j,t,e))}function j(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):O(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,a=t.needReadable;return c("need readable",a),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(e){w(this,new b("_read()"))},k.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,c("pipe count=%d opts=%j",a.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?s:y;function l(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",l),n.removeListener("end",s),n.removeListener("end",y),n.removeListener("data",d),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function s(){c("onend"),e.end()}a.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",l);var u=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,z(e))}}(n);e.on("drain",u);var f=!1;function d(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==B(a.pipes,e))&&!f&&(c("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function p(t){c("onerror",t),y(),e.removeListener("error",p),0===i(e,"error")&&w(e,t)}function h(){e.removeListener("finish",m),y()}function m(){c("onfinish"),e.removeListener("close",h),y()}function y(){c("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",m),e.emit("pipe",n),a.flowing||(c("pipe resume"),n.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,c("on readable",a.length,a.reading),a.length?O(this):a.reading||r.nextTick(R,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(P,this),n},k.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(P,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(I,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){(c("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,n){var a=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,a,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":102,"./_stream_duplex":103,"./internal/streams/destroy":110,"./internal/streams/state":114,"./internal/streams/stream":115,_process:99,buffer:28,inherits:67,"util-deprecate":123}],108:[function(e,t,r){(function(r){(function(){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=e("./end-of-stream"),o=Symbol("lastResolve"),l=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function h(e){var t=e[o];if(null!==t){var r=e[d].read();null!==r&&(e[u]=null,e[o]=null,e[l]=null,t(p(r,!1)))}}function m(e){r.nextTick(h,e)}var y=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((a(n={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[s]?n(e[s]):t(p(void 0,!0))}))}));var n,a=this[u];if(a)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[f](r,n)}),n)}}(a,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(p(i,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),y);t.exports=function(e){var t,r=Object.create(g,(a(t={},d,{value:e,writable:!0}),a(t,o,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,f,{value:function(e,t){var n=r[d].read();n?(r[u]=null,r[o]=null,r[l]=null,e(p(n,!1))):(r[o]=e,r[l]=t)},writable:!0}),t));return r[u]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[u]=null,r[o]=null,r[l]=null,t(e)),void(r[s]=e)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[l]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":111,_process:99}],109:[function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,a=o.allocUnsafe(e>>>0),i=this.head,l=0;i;)t=i.data,r=a,n=l,o.prototype.copy.call(t,r,n),l+=i.data.length,i=i.next;return a}},{key:"consume",value:function(e,t){var r;return ea.length?a.length:e;if(i===a.length?n+=a:n+=a.slice(0,e),0==(e-=i)){i===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,i),0==(e-=i)){i===a.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(i));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return l(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&o.forEach(c),i||(o.forEach(c),a(n))}))}));return t.reduce(u)}},{"../../../errors":102,"./end-of-stream":111}],114:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,a){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(a?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},{"../../../errors":102}],115:[function(e,t,r){t.exports=e("events").EventEmitter},{events:27}],116:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=c,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function l(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(e.lastNeed=a-1),a;if(--n=0)return a>0&&(e.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":100}],117:[function(e,t,r){(function(r,n){(function(){var r=e("assert"),a=e("debug")("stream-parser");t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");a("extending Parser into stream"),e._bytes=o,e._skipBytes=l,t&&(e._passthrough=s);t?e._transform=u:e._write=c};function i(e){a("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||i(this),a("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function l(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function s(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function c(e,t,r){this._parserInit||i(this),a("write(%o bytes)",e.length),"function"==typeof t&&(r=t),d(this,e,null,r)}function u(e,t,r){this._parserInit||i(this),a("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),d(this,e,t,r)}function f(e,t,r,i){if(e._parserBytesLeft-=t.length,a("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return i;var o=e._parserCallback;if(o&&0===e._parserState&&e._parserBuffers.length>1&&(t=n.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),o){var l=[];t&&l.push(t),r&&l.push(r);var s=o.length>l.length;s&&l.push(p(i));var c=o.apply(e,l);if(!s||i===c)return i}}var d=p((function e(t,r,n,a){return t._parserBytesLeft<=0?a(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return f(t,r,n,a)}:function(){var i=r.slice(0,t._parserBytesLeft);return f(t,i,n,(function(o){return o?a(o):r.length>i.length?function(){return e(t,r.slice(i.length),n,a)}:void 0}))}}));function p(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:99,assert:21,buffer:28,debug:118}],118:[function(e,t,r){(function(n){(function(){function a(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(r=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),!t)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var a=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(a++,"%c"===e&&(i=a))})),e.splice(i,0,n)},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=a,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(a())}).call(this)}).call(this,e("_process"))},{"./debug":119,_process:99}],119:[function(e,t,r){var n;function a(e){function t(){if(t.enabled){var e=t,a=+new Date,i=a-(n||a);e.diff=i,e.prev=n,e.curr=a,n=a;for(var o=new Array(arguments.length),l=0;l0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===s&&!1===isNaN(e))return t.long?l(r=e,o,"day")||l(r,i,"hour")||l(r,a,"minute")||l(r,n,"second")||r+" ms":function(e){if(e>=o)return Math.round(e/o)+"d";if(e>=i)return Math.round(e/i)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],121:[function(e,t,r){(function(t,n){(function(){var a=e("process/browser.js").nextTick,i=Function.prototype.apply,o=Array.prototype.slice,l={},s=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":99,timers:121}],122:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:E(t[1]),g:E(t[2]),b:E(t[3]),a:z(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:E(t[1]),g:E(t[2]),b:E(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:E(t[1]+""+t[1]),g:E(t[2]+""+t[2]),b:E(t[3]+""+t[3]),a:z(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:E(t[1]+""+t[1]),g:E(t[2]+""+t[2]),b:E(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*D(p,255),g:255*D(h,255),b:255*D(m,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*D(t,360),r=D(r,100),n=D(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=D(e,360),t=D(t,100),r=D(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=O(i),{ok:f,format:t.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}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=D(e,255),t=D(t,255),r=D(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=O(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[P(i(e).toString(16)),P(i(t).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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*D(this._r,255))+"%",g:i(100*D(this._g,255))+"%",b:i(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%)":"rgba("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function O(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function D(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function E(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function I(t){return e.round(255*parseFloat(t)).toString(16)}function z(e){return E(e)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],123:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],124:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!y||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":138,"object-assign":73}],127:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":138,"object-assign":73}],128:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":138,"object-assign":73}],129:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":138,"object-assign":73}],130:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":138,"object-assign":73}],131:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":138,"object-assign":73}],132:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":138,"object-assign":73}],133:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":138,"object-assign":73}],135:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":138,"object-assign":73}],136:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":138,"object-assign":73}],137:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":138,"object-assign":73}],138:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":73}],139:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=v(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){v("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=v(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(d,p);h>S;S=this.daysInMonth(d,p))p++,h-=S}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":138,"object-assign":73}],140:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],141:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":275,"../../plot_api/plot_template":335,"../../plots/cartesian/constants":353,"../../plots/font_attributes":374,"./arrow_paths":140}],142:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,m=p-d,y=3*e.startarrowsize*e.arrowwidth||0,g=y+d,v=y-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,g),ppadminus:Math.max(f,v)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=l?g+l:g,v=l?v-l:v,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,g),ppadminus:Math.max(f,m,v)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":299,"../../plots/cartesian/axes":346,"./draw":147}],143:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var G=!1,W=["x","y"],J=0;J1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(G=!0):G=!0),X=ae._offset+ae.r2p(t[te]),Q=.5}else{var he="domain"===de;"x"===te?($=t[te],X=he?ae._offset+ae._length*$:X=T.l+T.w*$):($=1-t[te],X=he?ae._offset+ae._length*$:X=T.t+T.h*$),Q=t.showarrow?.5:$}if(t.showarrow){fe.head=X;var me=t["a"+te];if(ee=oe*q(.5,t.xanchor)-le*q(.5,t.yanchor),ne===re){var ye=s.getRefType(ne);"domain"===ye?("y"===te&&(me=1-me),fe.tail=ae._offset+ae._length*me):"paper"===ye?"y"===te?(me=1-me,fe.tail=T.t+T.h*me):fe.tail=T.l+T.w*me:fe.tail=ae._offset+ae.r2p(me),K=ee}else fe.tail=X+me,K=ee+me;fe.text=fe.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,ge-1)),"pixel"===ne){var ve=-Math.max(fe.tail-3,fe.text),xe=Math.min(fe.tail+3,fe.text)-ge;ve>0?(fe.tail+=ve,fe.text+=ve):xe>0&&(fe.tail-=xe,fe.text-=xe)}fe.tail+=ue,fe.head+=ue}else K=ee=se*q(Q,ce),fe.text=X+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(G)z.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(I-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,H?O:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;V.call(d.positionText,Te,we).call(u.setClipUrl,H?O:null,e)}U.select("rect").call(u.setRect,j,j,k,I),B.call(u.setRect,N/2,N/2,F-N,Y-N),z.call(u.setTranslate,Math.round(D.x.text-F/2),Math.round(D.y.text-Y/2)),P.attr({transform:"rotate("+C+","+D.x.text+","+D.y.text+")"});var Me,ke=function(r,n){E.selectAll(".annotation-arrow-g").remove();var s=D.x.head,f=D.y.head,d=D.x.tail+r,p=D.y.tail+n,m=D.x.text+r,b=D.y.text+n,_=o.rotationXYMatrix(C,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),O=+B.attr("width"),R=+B.attr("height"),I=m-.5*O,N=I+O,F=b-.5*R,j=F+R,H=[[I,F,I,j],[I,j,N,j],[N,j,N,F],[N,F,I,F]].map(k);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var U=t.arrowwidth,Y=t.arrowcolor,q=t.arrowside,V=E.append("g").style({opacity:c.opacity(Y)}).classed("annotation-arrow-g",!0),Z=V.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",U+"px").call(c.stroke,c.rgb(Y));if(y(Z,q,t),M.annotationPosition&&Z.node().parentNode&&!i){var G=s,W=f;if(t.standoff){var J=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));G+=t.standoff*(d-s)/J,W+=t.standoff*(p-f)/J}var X,K,$=V.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(p-W),transform:l(G,W)}).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:e,prepFn:function(){var e=u.getTranslate(z);X=e.x,K=e.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,K),a=n[0]+e,i=n[1]+r;z.call(u.setTranslate,a,i),L("x",v(g,e,"x",T,t)),L("y",v(x,r,"y",T,t)),t.axref===t.xref&&L("ax",v(g,e,"ax",T,t)),t.ayref===t.yref&&L("ay",v(x,r,"ay",T,t)),V.attr("transform",l(e,r)),P.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),R)h.init({element:z.node(),gd:e,prepFn:function(){Me=P.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",v(g,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",v(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(g)a=v(g,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=v(x,r,"y",T,t);else{var u=t._ysize/T.h,f=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),g&&x||(n=h.getCursor(g?.5:a,x?.5:o,t.xanchor,t.yanchor))}P.attr({transform:l(e,r)+Me}),p(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",Z(n))},doneFn:function(){p(z),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*y+r.standoff,_=m.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.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 R();if(b){if(b*b>w*w+T*T)return void R();var M=b*Math.cos(f),k=b*Math.sin(f);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),O="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":377,"../annotations/draw":147}],154:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).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()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var ce=Math.pow(10,Math.floor(Math.log(se)/Math.LN10));oe*=ce*c.roundUp(se/ce,[2,5,10]),(Math.abs(q.start)/q.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+E/z.h,re+K-E/z.h]:[re+C/z.w,re+K-C/z.w],ae.setScale(),e.attr("transform",u(Math.round(z.l),Math.round(z.t)));var ue,fe=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(z.l),-Math.round(z.t))),de=ae.ticklabelposition,pe=ae.title.font.size,he=e.select("."+k.cbaxis),me=0,ye=0;function ge(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:I._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===B&&(e=C+z.l+z.w*P,t=E+z.t+z.h*(1-re-K)+3+.75*pe),"bottom"===B&&(e=C+z.l+z.w*P,t=E+z.t+z.h*(1-re)-3-.25*pe),"right"===B&&(t=E+z.t+z.h*R+3+.75*pe,e=C+z.l+z.w*re),ge(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,s=e.select("."+k.cbtitle),f=s.select("text"),d=[-A/2,A/2],h=s.select(".h"+ae._id+"title-math-group").node(),m=15.6;if(f.node()&&(m=parseInt(f.node().style.fontSize,10)*w),h?(i=p.bBox(h),ye=i.width,(me=i.height)>m&&(d[1]-=(me-m)/2)):f.node()&&!f.classed(k.jsPlaceholder)&&(i=p.bBox(f.node()),ye=i.width,me=i.height),o){if(me){if(me+=5,"top"===B)ae.domain[1]-=me/z.h,d[1]*=-1;else{ae.domain[0]+=me/z.h;var g=y.lineCount(f);d[1]+=(1-g)*m}s.attr("transform",u(d[0],d[1])),ae.setScale()}}else ye&&("right"===B&&(ae.domain[0]+=(ye+pe/2)/z.w),s.attr("transform",u(d[0],d[1])),ae.setScale())}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",o?u(0,Math.round(z.h*(1-ae.domain[1]))):u(Math.round(z.w*ae.domain[0]),0)),he.attr("transform",o?u(0,Math.round(-z.t)):u(Math.round(-z.l),0));var v=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(Z);v.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),v.exit().remove();var x=H.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var l=[0===i?H[0]:(Z[i]+Z[i-1])/2,i===Z.length-1?H[1]:(Z[i]+Z[i+1])/2].map(ae.c2p).map(Math.round);o&&(l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,x[0],x[1]));var s=n.select(this).attr(o?"x":"y",$).attr(o?"y":"x",n.min(l)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(l)-n.min(l),2));if(t._fillgradient)p.gradient(s,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=Y(e).replace("e-","");s.attr("fill",a(u).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(F.color&&F.width?G:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){var t=$,r=Math.round(ae.c2p(e))+F.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+W).call(p.lineGroupStyle,F.width,U(e),F.dash)})),he.selectAll("g."+ae._id+"tick,path").remove();var _=$+W+(A||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(ae),M=l.getTickSigns(ae)[2];return l.drawTicks(r,ae,{vals:"inside"===ae.ticks?l.clipEnds(ae,T):T,layer:he,path:l.makeTickPath(ae,_,M),transFn:l.makeTransTickFn(ae)}),l.drawLabels(r,ae,{vals:T,layer:he,transFn:l.makeTransTickLabelFn(ae),labelFns:l.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,l=ae._offset+ae._length/2;if("right"===B)a=l,e=z.l+z.w*i+10+pe*(ae.showticklabels?1:.5);else if(e=l,"bottom"===B&&(a=z.t+z.h*i+10+(-1===de.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===B){var s=j.text.split("
").length;a=z.t+z.h*i+10-W-w*pe*s}ge((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:B,offsetTop:o?0:z.t,offsetLeft:o?z.l:0,maxShift:o?I.width:I.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,l=W+A/2;-1===de.indexOf("inside")&&(n=p.bBox(he.node()),l+=o?n.width:n.height),ue=fe.select("text");var c=0,f=o&&"top"===B,m=!o&&"right"===B,y=0;if(ue.node()&&!ue.classed(k.jsPlaceholder)){var v,x=fe.select(".h"+ae._id+"title-math-group").node();x&&(o&&ie||!o&&!ie)?(c=(n=p.bBox(x)).width,v=n.height):(c=(n=p.bBox(fe.node())).right-z.l-(o?$:ne),v=n.bottom-z.t-(o?ne:$),o||"top"!==B||(l+=n.height,y=n.height)),m&&(ue.attr("transform",u(c/2+pe/2,0)),c*=2),l=Math.max(l,o?c:v)}var b=2*(o?C:E)+l+L+A/2,w=0;!o&&j.text&&"bottom"===D&&R<=0&&(b+=w=b/2,y+=w),I._hColorbarMoveTitle=w,I._hColorbarMoveCBTitle=y;var N=L+A;e.select("."+k.cbbg).attr("x",(o?$:ne)-N/2-(o?C:0)).attr("y",(o?ne:$)-(o?X:E+y-w)).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(X+N,2)).call(h.fill,S).call(h.stroke,t.bordercolor).style("stroke-width",L);var F=m?Math.max(c-10,0):0;if(e.selectAll("."+k.cboutline).attr("x",(o?$:ne+C)+F).attr("y",(o?ne+E-X:$)+(f?me:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(X-(o?2*E+me:2*C+F),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(z.l-(o?Q*b:0),z.t-(o?0:(1-ee)*b-y))),!o&&(L||a(S).getAlpha()&&!a.equals(I.paper_bgcolor,S))){var H=he.selectAll("text"),U=H[0].length,Y=e.select("."+k.cbbg).node(),q=p.bBox(Y),V=p.getTranslate(e);H.each((function(e,t){var r=U-1;if(0===t||t===r){var n,a=p.bBox(this),i=p.getTranslate(this);if(t===r){var o=a.right+i.x;(n=q.right+V.x+ne-L-2+P-o)>0&&(n=0)}else if(0===t){var l=a.left+i.x;(n=q.left+V.x+ne+L+2-l)<0&&(n=0)}n&&(U<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var Z={},G=T[O],J=M[O],K=T[D],te=M[D],re=b-W;o?("pixels"===d?(Z.y=R,Z.t=X*K,Z.b=X*te):(Z.t=Z.b=0,Z.yt=R+s*K,Z.yb=R-s*te),"pixels"===_?(Z.x=P,Z.l=b*G,Z.r=b*J):(Z.l=re*G,Z.r=re*J,Z.xl=P-g*G,Z.xr=P+g*J)):("pixels"===d?(Z.x=P,Z.l=X*G,Z.r=X*J):(Z.l=Z.r=0,Z.xl=P+s*G,Z.xr=P-s*J),"pixels"===_?(Z.y=1-R,Z.t=b*K,Z.b=b*te):(Z.t=re*K,Z.b=re*te,Z.yt=R-g*K,Z.yb=R+g*te)),i.autoMargin(r,t._id,Z)}],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l="v"===t.orientation,c=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align((l?t._uFrac:t._vFrac)+r/c.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=s.align((l?t._vFrac:1-t._uFrac)-o/c.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var f=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,f)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":274,"../../lib":299,"../../lib/extend":293,"../../lib/setcursor":319,"../../lib/svg_text_utils":322,"../../plots/cartesian/axes":346,"../../plots/cartesian/axis_defaults":348,"../../plots/cartesian/layout_attributes":359,"../../plots/cartesian/position_defaults":362,"../../plots/plots":380,"../../registry":387,"../color":158,"../colorscale/helpers":169,"../dragelement":177,"../drawing":180,"../titles":267,"./constants":160,"@plotly/d3":20,tinycolor2:122}],163:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":299}],164:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":159,"./defaults":161,"./draw":162,"./has_colorbar":163}],165:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",y=i+"mid",g=(l(d+p),l(d+h),l(d+m),{});g[h]=g[m]=void 0;var v={};v[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":315,"../../lib/sort_object_keys":320,"../colorbar/attributes":159,"./scales.js":173}],166:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,m=f.mid,y=function(){return a.aggNums(Math.min,null,s)},g=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=y():d&&(p=u._colorAx&&n(p)?Math.min(p,y()):y()),void 0===h?h=g():d&&(h=u._colorAx&&n(h)?Math.max(h,g()):g()),d&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":299,"./helpers":169,"fast-isnumeric":33}],167:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],175:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":299}],176:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],177:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,m,y=e.gd,g=1,v=y._context.doubleClickDelay,x=e.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)v&&(g=Math.max(g-1,1)),y._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},s.coverSlip=u},{"../../lib":299,"../../plots/cartesian/constants":353,"./align":174,"./cursor":175,"./unhover":178,"has-hover":64,"has-passive-events":65,"mouse-event-offset":71}],178:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":291,"../../lib/events":292,"../../lib/throttle":323,"../fx/constants":192}],179:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],180:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};function b(e,t,r){var n=t.fillpattern,a=n&&x.getPatternAttr(n.shape,0,"");if(a){var i=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),l=n.fgopacity,s=x.getPatternAttr(n.size,0,8),u=x.getPatternAttr(n.solidity,0,.3),f=t.uid;x.pattern(e,"point",r,f,a,s,u,void 0,n.fillmode,i,o,l)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e,t){var r=n.select(e.node());b(e,((r.data()[0]||[])[0]||{}).trace||{},t)},x.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&b(r,e[0].trace,t)}))};var _=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,x.symbolBackOffs[r]=t.backoff||0,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function T(e,t,r,n){var a=e%100;return x.symbolFuncs[a](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var M={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=i("~f"),L={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=L[i],d=new Array(u),p=0;p=100;var f=re(e,r),d=V(e,r);t.attr("d",T(u,s,f,d))}var p,h,m,y=!1;if(e.so)m=l.outlierwidth,h=l.outliercolor,p=o.outliercolor;else{var g=(l||{}).width;m=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,y=!0),p="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,p).style({"stroke-width":(m||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:m)+"px");var v=o.gradient,b=e.mgt;b?y=!0:b=v&&v.type,a.isArrayOrTypedArray(b)&&(b=b[0],L[b]||(b=0));var _=o.pattern,w=_&&x.getPatternAttr(_.shape,e.i,"");if(b&&"none"!==b){var M=e.mgc;M?y=!0:M=v.color;var k=r.uid;y&&(k+="-"+e.i),x.gradient(t,i,k,b,[[0,M],[1,p]],"fill")}else if(w){var A=x.getPatternAttr(_.bgcolor,e.i,null),S=x.getPatternAttr(_.fgcolor,e.i,null),O=_.fgopacity,D=x.getPatternAttr(_.size,e.i,8),C=x.getPatternAttr(_.solidity,e.i,.3),E=e.mcc||a.isArrayOrTypedArray(_.shape)||a.isArrayOrTypedArray(_.bgcolor)||a.isArrayOrTypedArray(_.size)||a.isArrayOrTypedArray(_.solidity),P=r.uid;E&&(P+="-"+e.i),x.pattern(t,"point",i,P,w,D,C,e.mcc,_.fillmode,A,S,O)}else c.fill(t,p);m&&c.stroke(t,h)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=y.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:m*t});var h=i.color,y=o.color,g=l.color;(y||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?y||t:g||t});var v=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);e.attr("d",T(x.symbolNumber(i),o,re(n,t),V(n,t))),n.mrc2=o})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};v(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var m=e.tp||t.textposition,y=D(e,t),g=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,y,g).text(c).call(d.convertToTspans,r).call(O,m,y,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=D(e,t);c.fill(a,i);var u=s.traceIs(t,"bar-like");O(a,o,l,e.mrc2||e.mrc,u)}))}};var C,E;function P(e,t,r){return r&&(e=j(e)),t?I(e[1]):R(e[0])}function R(e){var t=n.round(e,2);return C=t,t}function I(e){var t=n.round(e,2);return E=t,t}function z(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],l=r[1]-t[1],s=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+l*l,.25),u=(c*c*a-s*s*o)*n,f=(c*c*i-s*s*l)*n,d=3*c*(s+c),p=3*s*(s+c);return[[R(t[0]+(d&&u/d)),I(t[1]+(d&&f/d))],[R(t[0]-(p&&u/p)),I(t[1]-(p&&f/p))]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=c||b>=f&&b<=c)&&(_<=d&&_>=u||_>=d&&_<=u)&&(e=[b,_])}return e}x.steps=function(e){var t=N[e]||F;return function(e){for(var r="M"+R(e[0][0])+","+I(e[0][1]),n=e.length,a=1;a=1e4&&(x.savedBBoxes={},B=0),r&&(x.savedBBoxes[r]=y),B++,a.extendFlat({},y)},x.setClipUrl=function(e,t,r){e.attr("clip-path",U(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var Y=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(Y,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var q=/translate\([^)]*\)\s*$/;function V(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(q);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))},x.getMarkerStandoff=V;var Z,G,W,J,X,K,$=Math.atan2,Q=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*Q(e)-n*ee(e),r*ee(e)+n*Q(e)]}function re(e,t){var r,n,a=e.ma;void 0===a&&(a=t.marker.angle||0);var i=t.marker.angleref;if("previous"===i||"north"===i){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var s=t._xA,c=t._yA;if(!s||!c)return 90;r=s.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,f=e.lonlat[0],d=e.lonlat[1],p=t._geo.project([f,d+1e-5]),h=t._geo.project([f+1e-5,d]),m=$(h[1]-n,h[0]-r),y=$(p[1]-n,p[0]-r);if("north"===i)u=a/180*Math.PI;else if("previous"===i){var g=f/180*Math.PI,v=d/180*Math.PI,x=Z/180*Math.PI,b=G/180*Math.PI,_=x-g,w=Q(b)*ee(_),T=ee(b)*Q(v)-Q(b)*ee(v)*Q(_);u=-$(w,T)-Math.PI,Z=f,G=d}var M=te(m,[Q(u),0]),k=te(y,[ee(u),0]);a=$(M[1]+k[1],M[0]+k[0])/Math.PI*180,"previous"!==i||K===t.uid&&e.i===X+1||(a=null)}if("previous"===i&&!t._geo)if(K===t.uid&&e.i===X+1&&o(r)&&o(n)){var A=r-W,L=n-J,S=t.line&&t.line.shape||"",O=S.slice(S.length-1);"h"===O&&(L=0),"v"===O&&(A=0),a+=$(L,A)/Math.PI*180+90}else a=null}return W=r,J=n,X=e.i,K=t.uid,a}x.getMarkerAngle=re},{"../../components/fx/helpers":194,"../../constants/alignment":274,"../../constants/interactions":278,"../../constants/xmlns_namespaces":280,"../../lib":299,"../../lib/svg_text_utils":322,"../../registry":387,"../../traces/scatter/make_bubble_size_func":526,"../../traces/scatter/subtypes":534,"../color":158,"../colorscale":170,"./symbol_defs":181,"@plotly/d3":20,"fast-isnumeric":33,tinycolor2:122}],181:[function(e,t,r){"use strict";var n,a,i,o,l=e("parse-svg-path"),s=e("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,d=Math.cos,p=Math.sin;function h(e){return null===e}function m(e,t,r){if(!(e&&e%360!=0||t))return r;if(i===e&&o===t&&n===r)return a;function s(e,r){var n=d(e),a=p(e),i=r[0],o=r[1]+(t||0);return[i*n-o*a,i*a+o*n]}i=e,o=t,n=r;for(var c=e/180*f,u=0,h=0,m=l(r),y="",g=0;g0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var m=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,f);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),h.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.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=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!d.size()?d=t.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":534,"../drawing":180,"@plotly/d3":20,"fast-isnumeric":33}],188:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":158,"@plotly/d3":20}],189:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":293,"../../plots/font_attributes":374,"./layout_attributes":199}],190:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||oe<0||oe>w[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,U="xval"in t?g.flat(s,t.xval):g.p2c(_,ie),Y="yval"in t?g.flat(s,t.yval):g.p2c(w,oe),!a(U[0])||!a(Y[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(V=0;Vee&&(te.splice(0,ee),ce=te[0].distance),v&&0!==F&&0===te.length){Q.distance=F,Q.index=!1;var f=G._module.hoverPoints(Q,K,$,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=F}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var m=h[0];a(m.x0)&&a(m.y0)&&(d=de(m),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>d.spikeDistance)&&(ne.vLinePoint=d))}var y=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(d=de(x),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>d.spikeDistance)&&(ne.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)De(te[Ae]);te=Le,ye()}var Ce=e._hoverdata,Ee=[],Pe=B(e),Re=H(e);for(q=0;q1||te.length>1)||"closest"===C&&ae&&te.length>1,Ge=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),We=E(te,{gd:e,hovermode:C,rotateLabels:Ze,bgColor:Ge,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(y.push.apply(y,g),p.splice(o+1,1),c=0,l=y.length-1;l>=0;l--)c+=y[l].dp;for(i=c/y.length,l=y.length-1;l>=0;l--)y[l].dp-=i;n=!1}else o++}p.forEach(m)}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}}}(We,Ze?"xa":"ya",u),R(We,Ze,u._invScaleX,u._invScaleY));if(l&&l.tagName){var Je=y.getComponentMethod("annotations","hasClickToShow")(e,Ee);f(n.select(l),Je?"pointer":"")}if(!l||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:U,yvals:Y})}(e,t,r,i,l)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=B(a),o=H(a),l=E(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,x=g.offsetTop;u+=v,f+=v,d+=x,h+=x}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function E(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var T=t.fontFamily||v.HOVERFONT,M=t.fontSize||v.HOVERFONTSIZE,k=e[0],S=k.xa,O=k.ya,C=i.charAt(0),E=C+"Label",R=k[E];if(void 0===R&&"multicategory"===S.type)for(var I=0;Ia.width-b?(y=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+v.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+v.width/2)+"v"+x+(2*L+v.height)+"H-"+(L+v.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,D,C;"right"===O.side?(_="start",D=1,C="",y=S._offset+S._length):(_="end",D=-1,C="-",y=S._offset),g=O._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+v.height/2)+"h"+C+(2*L+v.width)+"V-"+(L+v.height/2)+"H"+C+A+"V-"+A+"Z");var E,P=v.height/2,I=N-v.top-P,z="clip"+a._uid+"commonlabel"+O._id;if(y=0?le:se+fe=0?se:xe+fe=0?ie:oe+de=0?oe:be+de=0,"top"!==e.idealAlign&&V||!Z?V?(E+=z/2,e.anchor="start"):e.anchor="middle":(E-=z/2,e.anchor="end");else if(e.pos=E,V=C+I/2+G<=F,Z=C-I/2-G>=0,"left"!==e.idealAlign&&V||!Z)if(V)C+=I/2,e.anchor="start";else{e.anchor="middle";var W=G/2,J=C+W-F,X=C-W;J>0&&(C-=J),X<0&&(C+=-X)}else C-=I/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(C,E)+(c?s(_):""))})),_e}function P(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=F(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=F(r,e.nameLength),""}))}return[s,l]}function R(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(e.txwidth+L),h=0,m=e.offset,y="middle"===l;y&&(f-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",y?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var g=h+f,v=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),g=y?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),g=y?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(g),o(v)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function I(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function z(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var y,g,v=t.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=c.pointerX,g=c.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var x,b,_=i.readability(v.color,h)<1.5?p.contrast(h):v.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=y),-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:g,y2:g,"stroke-width":T,stroke:M,"stroke-dasharray":d.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:g,r:T,fill:M}).classed("spikeline",!0)}if(f){var S,O,D=t.vLinePoint;n=D&&D.xa,a=D&&D.ya,"cursor"===n.spikesnap?(S=c.pointerX,O=c.pointerY):(S=n._offset+D.x,O=a._offset+D.y);var C,E,P=i.readability(D.color,h)<1.5?p.contrast(h):D.color,R=n.spikemode,I=n.spikethickness,z=n.spikecolor||P,N=m.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(C=N,E=O),-1!==R.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,E=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:E,"stroke-width":I,stroke:z,"stroke-dasharray":d.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:E,"stroke-width":I+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?I:-I),r:I,fill:z}).classed("spikeline",!0)}}}function N(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function F(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}function U(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),f=c[0],d=c[1],p=u[0],h=u[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},{"../../lib":299,"../../lib/events":292,"../../lib/override_cursor":310,"../../lib/svg_text_utils":322,"../../plots/cartesian/axes":346,"../../registry":387,"../color":158,"../dragelement":177,"../drawing":180,"../legend/defaults":210,"../legend/draw":211,"./constants":192,"./helpers":194,"@plotly/d3":20,"fast-isnumeric":33,tinycolor2:122}],196:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var l=t.legend;function s(e){o.font[e]||(o.font[e]=l?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),l?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":299,"../color":158,"./helpers":194}],197:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":299,"./layout_attributes":199}],198:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":299,"../dragelement":177,"./attributes":189,"./calc":190,"./click":191,"./constants":192,"./defaults":193,"./helpers":194,"./hover":195,"./layout_attributes":199,"./layout_defaults":200,"./layout_global_defaults":201,"@plotly/d3":20}],199:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":374,"./constants":192}],200:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":299,"./hoverlabel_defaults":196,"./hovermode_defaults":197,"./layout_attributes":199}],201:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":299,"./hoverlabel_defaults":196,"./layout_attributes":199}],202:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===M("pattern")&&(d=!0);y._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,T=d?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),y._domains={x:u("x",M,w,x,v),y:u("y",M,T,b,g,_)}}else delete t.grid}function M(e,t){return n.coerce(r,y,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1===_&&(t.legend=void 0),(!1!==_||f.uirevision)&&(p("uirevision",t.uirevision),!1!==_)){p("bgcolor",t.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,T,M,k=a.coerceFont(p,"font",t.font),A="h"===p("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(T=1.1,M="bottom"):(T=-.1,M="top")):(w=1.02,T=1,M="auto"),p("traceorder",x),c.isGrouped(t.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",T),p("yanchor",M),p("valign"),a.noneOrAll(f,d,["x","y"]),p("title.text")){p("title.side",A?"left":"top");var L=a.extendFlat({},k,{size:a.bigFont(k.size)});a.coerceFont(p,"title.font",L)}}}},{"../../lib":299,"../../plot_api/plot_template":335,"../../plots/attributes":342,"../../plots/layout_attributes":378,"../../registry":387,"./attributes":208,"./helpers":214}],211:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,y=h.FROM_TL,g=h.FROM_BR,v=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r){var n=e[0],a=n.width,i=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===i?t._maxWidth*o:r+(o||a)}function w(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function T(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(d?M(n,h):n);var y=r.itemwidth+2*p.itemGap;f.positionText(m,y,0),d?m.call(f.makeEditable,{gd:t,text:n}).call(A,e,t,r).on("edit",(function(n){this.text(M(n,h)).call(A,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):A(m,e,t,r)}function M(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(t,r,e,o,n.event)}})))}function A(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*m;if(o){var y=c.bBox(o);u=y.height,d=y.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),v=f.lineCount(g),x=g.node();if(u=h*v,d=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(g,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,d-=r.itemwidth),f.positionText(g,b,-h*((v-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function L(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=v(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&v(e.calcdata,t)}var m=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var M=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),O=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),D=a.ensureSingle(M,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));D.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(M,"g","scrollbox"),E=t.title;if(t._titleWidth=0,t._titleHeight=0,E.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").call(c.font,E.font).text(E.text),A(P,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var R=a.ensureSingle(M,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),I=C.selectAll("g.groups").data(l);I.enter().append("g").attr("class","groups"),I.exit().remove();var z=I.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(T,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u="fraction"===a.entrywidthmode,f=a.borderwidth,d=2*f,h=p.itemGap,m=a.itemwidth+2*h,y=2*(f+h),g=S(a),v=a.y<0||0===a.y&&"top"===g,x=a.y>1||1===a.y&&"bottom"===g,w=a.tracegroupgap,T={};a._maxHeight=Math.max(v||x?i.height/2:o.h,30);var M=0;a._width=0,a._height=0;var k=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,f+k[0],f+k[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),M=m+a._width,a._width+=h+m+d,a._height+=y,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=L(a),O=a.x<0||0===a.x&&"right"===A,D=a.x>1||1===a.x&&"left"===A,C=x||v,E=i.width/2;a._maxWidth=Math.max(O?C&&"left"===A?o.l+o.w:E:D?C&&"right"===A?o.r+o.w:E:o.w,2*m);var P=0,R=0;r.each((function(e){var t=_(e,a,m);P=Math.max(P,t),R+=t})),M=null;var I=0;if(s){var z=0,N=0,F=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,a,m),i=r[0].height;c.setTranslate(this,k[0],k[1]+f+h+i/2+t),t+=i,e=Math.max(e,n),T[r[0].trace.legendgroup]=e}));var r=e+h;N>0&&r+f+N>a._maxWidth?(I=Math.max(I,N),N=0,F+=z+w,z=t):z=Math.max(z,t),c.setTranslate(this,N,F),N+=r})),a._width=Math.max(I,N)+f,a._height=F+z+y}else{var j=r.size(),B=R+d+(j-1)*h=a._maxWidth&&(I=Math.max(I,q),U=0,Y+=H,a._height+=H,H=0),c.setTranslate(this,k[0]+f+U,k[1]+f+Y+t/2+h),q=U+r+h,U+=n,H=Math.max(H,t)})),B?(a._width=U+d,a._height=H+y):(a._width=Math.max(I,q)+d,a._height+=H+y)}}a._width=Math.ceil(Math.max(a._width+k[0],a._titleWidth+2*(f+p.titlePad))),a._height=Math.ceil(Math.max(a._height+k[1],a._titleHeight+2*(f+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var V=e._context.edits,Z=V.legendText||V.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,i=e[0].trace.legendgroup,o=_(e,a,m);s&&""!==i&&(o=T[i]);var f=Z?m:M||o;l||u||(f+=h/2),c.setRect(t,0,-r/2,f,r)}))}(e,I,z,t)},function(){var l,u,m,v,x=f._size,b=t.borderwidth;if(!h){if(function(e){var t=e._fullLayout.legend,r=L(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*y[r],r:t._width*g[r],b:t._effHeight*g[n],t:t._effHeight*y[n]})}(e))return;var _=x.l+x.w*t.x-y[L(t)]*t._width,T=x.t+x.h*(1-t.y)-y[S(t)]*t._effHeight;if(f.margin.autoexpand){var k=_,A=T;_=a.constrain(_,0,f.width-t._width),T=a.constrain(T,0,f.height-t._effHeight),_!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==A&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(M,_,T)}if(R.on(".drag",null),M.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var E=t._effHeight;h&&(E=t._height),D.attr({width:t._width-b,height:E-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),O.select("rect").attr({width:t._width-2*b,height:E-2*b,x:b,y:b}),c.setClipUrl(C,d,e),c.setRect(R,0,0,0,0),delete t._scrollY}else{var P,I,z,N=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-N-2*p.scrollBarMargin,j=t._height-t._effHeight,B=F/j,H=Math.min(t._scrollY||0,j);D.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),O.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,d,e),q(H,N,B),M.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*j,0,j),N,B),0!==H&&H!==j&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;P="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,z=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(I="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,j)}(z,P,I),N,B))}));R.call(U);var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(P=e.changedTouches[0].clientY,z=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(I=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,j)}(z,P,I),N,B))}));C.call(Y)}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(R,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),O.select("rect").attr("y",b+r)}e._context.edits.legendPosition&&(M.classed("cursor-move",!0),s.init({element:M.node(),gd:e,prepFn:function(){var e=c.getTranslate(M);m=e.x,v=e.y},moveFn:function(e,r){var n=m+e,a=v+r;c.setTranslate(M,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&w(e,M,a,t,n)}}))}],e)}(e,t)}},{"../../constants/alignment":274,"../../lib":299,"../../lib/events":292,"../../lib/svg_text_utils":322,"../../plots/plots":380,"../../registry":387,"../color":158,"../dragelement":177,"../drawing":180,"./constants":209,"./get_legend_data":212,"./handle_click":213,"./helpers":214,"./style":216,"@plotly/d3":20}],212:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return v?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(f,"")(m)}var g=p||i.mc||f.color,v=f.pattern,x=v&&l.getPatternAttr(v.shape,0,"");if(x){var b=l.getPatternAttr(v.bgcolor,0,null),_=l.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,M=y(v.size,8,10),k=y(v.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,v.fillmode,b,_,T)}else a.call(s.fill,g);o&&s.stroke(a,i.mlc||d.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});f(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,m=d.reversescale;if(p){if(!r){var y=p.length;u=0===o?p[m?y-1:0][1]:1===o?p[m?0:y-1][1]:p[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,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,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=e[0],b=v.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(s)l.fillGroupStyle(e,t);else{var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}})),f||d){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(v,{trace:a})]}var O=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);O.enter().append("path").classed("js-line",!0),O.exit().remove(),O.attr("d",k+(d?"l"+x+",0.0001":"h"+x)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,y=!d&&!c&&!s&&u.hasText(h);function g(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||y||f){var b={},w={};if(d){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",i.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:g("line.width",x,[0,10],5)}),y&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(d?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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":299,"../../registry":387,"../../traces/pie/helpers":501,"../../traces/pie/style_one":507,"../../traces/scatter/subtypes":534,"../color":158,"../colorscale/helpers":169,"../drawing":180,"./constants":209,"@plotly/d3":20}],217:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":219}],218:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,y=(1-h)/2;for(a=0;a1?(E=["toggleHover"],P=["resetViews"]):g?(C=["zoomInGeo","zoomOutGeo"],E=["hoverClosestGeo"],P=["resetGeo"]):y?(E=["hoverClosest3d"],P=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],E=["toggleHover"],P=["resetViewMapbox"]):b?E=["hoverClosestGl2d"]:v?E=["hoverClosestPie"]:k?(E=["hoverClosestCartesian","hoverCompareCartesian"],P=["resetViewSankey"]):E=["toggleHover"];m&&(E=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=N[r+1];else if(e=n.pmax)t=N[r+1];else if(e=0;M--){var k=r.append("path").attr(y).style("opacity",M?.1:g).call(o.stroke,x).call(o.fill,v).call(l.dashLine,M?"solid":_,M?4+b:b);if(h(k,e,i),w){var A=s(e.layout,"selections",i);k.style({cursor:"move"});var L={element:k.node(),plotinfo:p,gd:e,editHelpers:A,isActiveSelection:!0},S=n(c,e);a(S,k,L)}else k.style("pointer-events",M?"all":"none");T[M]=k}var O=T[0];T[1].node().addEventListener("click",(function(){return function(e,t){if(!d(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void m(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=m,f(e)}}(e,O)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;l.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function m(e){d(e)&&(e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,f(e)))}t.exports={draw:f,drawOne:p,activateLastSelection:function(e){if(!d(e))return;var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=m,f(e)}}},{"../../plot_api/plot_template":335,"../color":158,"../drawing":180,"../shapes/display_outlines":252,"../shapes/draw_newshape/helpers":257,"../shapes/handle_outline":259,"../shapes/helpers":260}],242:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":293,"../../drawing/attributes":179}],243:[function(e,t,r){"use strict";t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],244:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers").selectMode,a=e("../../shapes/handle_outline").clearOutline,i=e("../../shapes/draw_newshape/helpers"),o=i.readPaths,l=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var i=r.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,f=t.plotinfo,d=f.xaxis,p=f.yaxis,h=t.isActiveSelection,m=t.dragmode,y=(c.layout||{}).selections||[];if(!n(m)&&void 0!==h){var g=c._fullLayout._activeSelectionIndex;if(g-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(g)){Z(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=K(_))){for(o&&o.remove(),y=0;y=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,l=p(r),s=m(r);if(l||s){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&a._fullLayout._outlining)l&&(c=T(f,e)),c&&i.call("_guiRelayout",a,{shapes:c}),s&&!H(e)&&(u=M(f,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&k(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function W(e){return e._id}function J(e,t,r,n){if(!e.calcdata)return[];var a,i,o,l=[],s=t.map(W),c=r.map(W);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function $(e,t,r){var n,a;for(n=0;n-1&&t;if(!i&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ce(te);ue([D(e,ne,"x"),D(e,pe,"y")])(Q,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&fe(e,Q),d._reselect=!1}if(!i&&d._deselect){var me=d._deselect;(function(e,t,r){for(var n=0;n=0)M._fullLayout._deactivateShape(M);else if(!x){var r=k.clickmode;O.done(ke).then((function(){if(O.clear(ke),2===e){for(be.remove(),K=0;K-1&&U(t,M,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&fe(M,void 0);s.click(M,t)})).catch(A.error)}},n.doneFn=function(){Me.remove(),O.done(ke).then((function(){O.clear(ke),!L&&X&&n.selectionDefs&&(X.subtract=xe,n.selectionDefs.push(X),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,W)),(L||x)&&G(n,L),n.doneFnCompleted&&n.doneFnCompleted(Ae),b&&fe(M,ie)})).catch(A.error)}},clearOutline:x,clearSelectionsCache:G,selectOnClick:U}},{"../../lib":299,"../../lib/clear_gl_canvases":287,"../../lib/polygon":311,"../../lib/throttle":323,"../../plot_api/subroutines":336,"../../plots/cartesian/axis_ids":350,"../../registry":387,"../color":158,"../dragelement/helpers":176,"../drawing":180,"../fx":198,"../fx/helpers":194,"../shapes/constants":250,"../shapes/display_outlines":252,"../shapes/draw_newshape/helpers":257,"../shapes/draw_newshape/newshapes":258,"../shapes/handle_outline":259,"../shapes/helpers":260,"./constants":239,"./draw":241,"./draw_newselection/newselections":244,"./helpers":245,"point-in-polygon/nested":75,polybooljs:76}],248:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":275,"../../lib/extend":293,"../../plot_api/plot_template":335,"../../traces/scatter/attributes":509,"../annotations/attributes":141,"../drawing/attributes":179}],249:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,m=d>0?d+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o1&&(2!==e.length||"Z"!==e[1][0])&&(0===S&&(e[0][0]="M"),t[L]=e,T(),M())}}()}}function F(e,r){!function(e,r){if(t.length)for(var n=0;nx?(M=f,S="y0",k=x,O="y1"):(M=x,S="y1",k=f,O="y0");J(n),$(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===P?X:K,W.altKey=n.altKey},doneFn:function(){if(v(e))return;p(t),Q(l),_(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(v(e))return;Q(l)}};function J(r){if(v(e))P=null;else if(z)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=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!N&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),P=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=V(b+n)):(o=function(e){return V(Y(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),I?F("yanchor",r.yanchor=Z(T+a)):(s=function(e){return Z(q(e)+a)},H&&"date"===H.type&&(s=m.encodeDate(s))),F("path",r.path=w(E,o,s))}else R?F("xanchor",r.xanchor=V(b+n)):(F("x0",r.x0=V(c+n)),F("x1",r.x1=V(g+n))),I?F("yanchor",r.yanchor=Z(T+a)):(F("y0",r.y0=Z(f+a)),F("y1",r.y1=Z(x+a)));t.attr("d",y(e,r)),$(l,r)}function K(n,a){if(N){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=V(b+n)):(o=function(e){return V(Y(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),I?F("yanchor",r.yanchor=Z(T+a)):(s=function(e){return Z(q(e)+a)},H&&"date"===H.type&&(s=m.encodeDate(s))),F("path",r.path=w(E,o,s))}else if(z){if("resize-over-start-point"===P){var u=c+n,d=I?f-a:f+a;F("x0",r.x0=R?u:V(u)),F("y0",r.y0=I?d:Z(d))}else if("resize-over-end-point"===P){var p=g+n,h=I?x-a:x+a;F("x1",r.x1=R?p:V(p)),F("y1",r.y1=I?h:Z(h))}}else{var v=function(e){return-1!==P.indexOf(e)},_=v("n"),B=v("s"),U=v("w"),G=v("e"),W=_?M+a:M,J=B?k+a:k,X=U?A+n:A,K=G?L+n:L;I&&(_&&(W=M-a),B&&(J=k-a)),(!I&&J-W>10||I&&W-J>10)&&(F(S,r[S]=I?W:Z(W)),F(O,r[O]=I?J:Z(J))),K-X>10&&(F(D,r[D]=R?X:V(X)),F(C,r[C]=R?K:V(K)))}t.attr("d",y(e,r)),$(l,r)}function $(e,t){(R||I)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=Y(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=q(I?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),R&&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(R){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 Q(e){e.selectAll(".visual-cue").remove()}d.init(W),G.node().onmousemove=J}(e,R,s,t,r,P):!0===s.editable&&R.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!x(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,g(e)}}(e,R)}))}}function _(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){x(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,g(e)))}t.exports={draw:g,drawOne:b,eraseActiveShape:function(e){if(!x(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&sp&&(e="X"),e}));return i>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),u+h}))}(t,l,c);if("pixel"===t.xsizemode){var b=l(t.xanchor);u=b+t.x0,f=b+t.x1}else u=l(t.x0),f=l(t.x1);if("pixel"===t.ysizemode){var _=c(t.yanchor);d=_-t.y0,p=_-t.y1}else d=c(t.y0),p=c(t.y1);if("line"===h)return"M"+u+","+d+"L"+f+","+p;if("rect"===h)return"M"+u+","+d+"H"+f+"V"+p+"H"+u+"Z";var w=(u+f)/2,T=(d+p)/2,M=Math.abs(w-u),k=Math.abs(T-d),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}},{"../../lib":299,"../../plots/cartesian/axes":346,"./constants":250}],261:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":357,"./attributes":248,"./calc_autorange":249,"./defaults":251,"./draw":253,"./draw_newshape/defaults":256}],262:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":293,"../../plot_api/edit_types":328,"../../plot_api/plot_template":335,"../../plots/animation_attributes":340,"../../plots/font_attributes":374,"../../plots/pad_attributes":379,"./constants":263}],263:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],264:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function O(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function D(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(k,t,e,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 C(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,y(t))}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,g);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var g={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(g[0],g[1]))}}}return z.call(N),P&&(S?z.on(".opacity",null):(k=0,A=!0,z.text(v).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)}))),z.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(N)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),z.classed("js-placeholder",A),T}}},{"../../constants/alignment":274,"../../constants/interactions":278,"../../lib":299,"../../lib/svg_text_utils":322,"../../plots/plots":380,"../../registry":387,"../color":158,"../drawing":180,"@plotly/d3":20,"fast-isnumeric":33}],268:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":293,"../../plot_api/edit_types":328,"../../plot_api/plot_template":335,"../../plots/font_attributes":374,"../../plots/pad_attributes":379,"../color/attributes":157}],269:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],270:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":299,"../../plots/array_container_defaults":341,"./attributes":268,"./constants":269}],271:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),y(e,n,a,i,t),l||g(e,n,a,i,t))}function y(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(v,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.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)),g(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function g(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,y=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=g.headerHeight+f.gapButtonHeader:h=g.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-f.gapButtonHeader+f.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+y+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(v,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(g.openWidth,g.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(g.openHeight,g.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=y+g;S+A>c&&(S=c-A);var O=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=O.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var D=g>T,C=l.barWidth+2*l.barPad,E=l.barLength+2*l.barPad,P=h+m,R=y;P+C>s&&(P=s-C);var I=this.container.selectAll("rect.scrollbar-vertical").data(D?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),D?(this.vbar=I.attr({rx:l.barRadius,ry:l.barRadius,x:P,y:R,width:C,height:E}),this._vbarYMin=R+E/2,this._vbarTranslateMax=T-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,N=u-.5,F=D?f+C+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+z).data(M||D?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",z).append("rect"),M||D?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,z,this.gd),this.bg.attr({x:h,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||D){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 Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(Y),D&&this.vbar.on(".drag",null).call(Y)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":299,"../color":158,"../drawing":180,"@plotly/d3":20}],274:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],275:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"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",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],276:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],277:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],278:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],279:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],280:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],281:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],283:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],284:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,m=s([r,n]);function y(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":306}],285:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),g=e.charAt(0);!c||"G"!==g&&"g"!==g||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:v);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),O=Number(T[11]||0);if(c){if(2===M.length)return u;var D;M=Number(M);try{var C=y.getComponentMethod("calendars","getCal")(t);if(w){var E="i"===k.charAt(k.length-1);k=parseInt(k,10),D=C.newDate(M,C.toMonthIndex(M,k,E),A)}else D=C.newDate(M,Number(k),A)}catch(e){return u}return D?(D.toJD()-m)*f+L*d+S*p+O*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var P=new Date(Date.UTC(2e3,k,A,L,S));return P.setUTCFullYear(M),P.getUTCMonth()!==k||P.getUTCDate()!==A?u:P.getTime()+O*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,M=3*d,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,v,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+m,S=Math.floor(s(e,f));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,O={1:"1",2:"1",3:"2",4:"2"};function D(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return O[r("%q")(a)]})),_(n))try{e=y.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+D(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return D(t,e,n,a)};var E=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+E);return c.setUTCMonth(c.getUTCMonth()+t)+n-E},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&y.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+f*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,m=d*d+p*p,y=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,m,e-a,t-i),s(d,p,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":306}],297:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],298:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],299:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var m=e("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var y=e("./dates");f.dateTime2ms=y.dateTime2ms,f.isDateTime=y.isDateTime,f.ms2DateTime=y.ms2DateTime,f.ms2DateTimeLocal=y.ms2DateTimeLocal,f.cleanDate=y.cleanDate,f.isJSDate=y.isJSDate,f.formatDate=y.formatDate,f.incrementMonth=y.incrementMonth,f.dateTick0=y.dateTick0,f.dfltRange=y.dfltRange,f.findExactDates=y.findExactDates,f.MIN_MS=y.MIN_MS,f.MAX_MS=y.MAX_MS;var g=e("./search");f.findBin=g.findBin,f.sorterAsc=g.sorterAsc,f.sorterDes=g.sorterDes,f.distinctVals=g.distinctVals,f.roundUp=g.roundUp,f.sort=g.sort,f.findIndexOfMin=g.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var v=e("./stats");f.aggNums=v.aggNums,f.len=v.len,f.mean=v.mean,f.median=v.median,f.midRange=v.midRange,f.variance=v.variance,f.stdev=v.stdev,f.interp=v.interp;var x=e("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=e("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");f.log=M.log,f.warn=M.warn,f.error=M.error;var k=e("./regex");f.counterRegex=k.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?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},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return R.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var I={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(I,arguments)};var z={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(z,arguments)};var N=/^[:|\|]/;function F(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,y="xother"===l||"yother"===l||p||m||h,g=l;if((p||h)&&(g=g.substring(1)),(m||h)&&(g=g.substring(0,g.length-1)),y){if(void 0===(c=t[g]))return""}else for(d=3;d=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 j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(e,t){e.attr("transform",f.getTextTransform(t)),e.style("display",t.scale?null:"none")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var B=f.getFirefoxVersion(),H=null!==B&&B<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":279,"./anchor_utils":283,"./angles":284,"./array":285,"./clean_number":286,"./clear_responsive":288,"./coerce":289,"./dates":290,"./dom":291,"./extend":293,"./filter_unique":294,"./filter_visible":295,"./geometry2d":296,"./identity":297,"./increment":298,"./is_plain_object":300,"./keyed_container":301,"./localize":302,"./loggers":303,"./make_trace_groups":304,"./matrix":305,"./mod":306,"./nested_property":307,"./noop":308,"./notifier":309,"./preserve_drawing_buffer":312,"./push_unique":313,"./regex":315,"./relative_attr":316,"./relink_private":317,"./search":318,"./sort_object_keys":320,"./stats":321,"./throttle":323,"./to_log_range":324,"@plotly/d3":20,"d3-format":29,"d3-time-format":30,"fast-isnumeric":33}],300:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],301:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":333,"./notifier":309}],304:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":20}],305:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],307:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,m=r.length,y=r[0][0],g=r[0][1],v=0;for(u=1;uMath.max(f,y)||c>Math.max(d,g)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":279,"./matrix":305}],312:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-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":33,"is-mobile":69}],313:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":285,"fast-isnumeric":33}],322:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&t&&t._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(s),D=n.select(e.node().parentNode);if(!D.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",D.selectAll("svg."+C).remove(),D.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s,d=parseInt((MathJax.version||"").split(".")[0]);if(2!==d&&3!==d)return void a.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+a.randstr({},64),i=(s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(i):MathJax.typeset([i])},h=function(){var t=s.select(2===d?".MathJax_SVG":".MathJax"),i=!t.empty()&&s.select("svg").node();if(i){var o,l=i.getBoundingClientRect();o=2===d?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,l)}else a.log("There was an error in the tex syntax.",e),r();s.remove()};2===d?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:f},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,h,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})):3===d&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),h(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(L[2],o,(function(n,a,o){D.selectAll("svg."+C).remove(),D.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return E(),void t();var s=D.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild);var c=o.width,u=o.height;l.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=e.node().style.fill||"black",d=l.select("g");d.attr({fill:f,stroke:f});var p=d.node().getBoundingClientRect(),h=p.width,y=p.height;(h>c||y>u)&&(l.style("overflow","hidden"),h=(p=l.node().getBoundingClientRect()).width,y=p.height);var g=+e.attr("x"),v=+e.attr("y"),x=-(r||e.node().getBoundingClientRect().height)/4;if("y"===C[0])s.attr({transform:"rotate("+[-90,g,v]+")"+i(-h/2,x-y/2)});else if("l"===C[0])v=x-y/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))g=0,v=x;else{var b=e.attr("text-anchor");g-=h*("middle"===b?.5:"end"===b?1:0),v=v+x-y/2}l.attr({x:g,y:v}),m&&m.call(e,s),t(s)}))}))):E(),e}function E(){D.empty()||(C=e.attr("class")+"-math",D.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(y," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(g),D=0;D|>|>)/g;var f=[["$","$"],["\\(","\\)"]];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"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//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 M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],l="",s=0,c=0;ca?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(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function O(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function D(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.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 e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],324:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":33}],325:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],326:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],327:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var v=r[""][""];if(c(v))t.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",f,v),!0;t.set(v)}return!m&&(d(y,g),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),O=S||[],D=u(g,f).get(),C=[],E=-1,P=O.length;for(x=0;xO.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?C.push(_):k?("add"===M&&(M={}),O.splice(_,0,M),D&&D.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===E&&(E=_);else for(b=0;b=0;x--)O.splice(C[x],1),D&&D.splice(C[x],1);if(O.length?S||t.set(O):t.set(null),m)return!1;if(d(y,g),h!==a){var R;if(-1===E)R=L;else{for(P=Math.max(O.length,P),R=[],x=0;x=E);x++)R.push(_);for(x=E;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function P(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function H(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=G(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&Y(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag,d.reselect),c.add(e,H,[e,a.undoit],H,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.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[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function Y(e,t){var r=t?function(e){var r=[];for(var n in t){var a=p.getFromId(e,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)t[i]||r.push(i)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,V=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function G(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=N(s._preGUI,c),h=Object.keys(t),m=p.list(e),y=o.extendDeepAll({},t),g={};for(B(t),h=Object.keys(t),n=0;n0&&"string"!=typeof P.parts[I];)I--;var F=P.parts[I],j=P.parts[I-1]+"."+F,H=P.parts.slice(0,I).join("."),U=l(e.layout,H).get(),Y=l(s,H).get(),G=P.get();if(void 0!==R){A[E]=R,L[E]="reverse"===F?R:z(G);var J=f.getLayoutValObject(s,P.parts);if(J&&J.impliedEdits&&null!==R)for(var X in J.impliedEdits)S(o.relativeAttr(E,X),J.impliedEdits[X]);if(-1!==["width","height"].indexOf(E))if(R){S("autosize",null);var K="height"===E?"width":"height";S(K,s[K])}else s[E]=e._initialAutoSize[E];else if("autosize"===E)S("width",R?null:s.width),S("height",R?null:s.height);else if(j.match(q))C(j),l(s,H+"._inputRange").set(null);else if(j.match(V)){C(j),l(s,H+"._inputRange").set(null);var $=l(s,H).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else j.match(Z)&&l(s,H+"._inputDomain").set(null);if("type"===F){O=U;var Q="linear"===Y.type&&"log"===R,ee="log"===Y.type&&"linear"===R;if(Q||ee){if(O&&O.range)if(Y.autorange)Q&&(O.range=O.range[1]>O.range[0]?[1,2]:[2,1]);else{var te=O.range[0],re=O.range[1];Q?(te<=0&&re<=0&&S(H+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(H+".range[0]",Math.log(te)/Math.LN10),S(H+".range[1]",Math.log(re)/Math.LN10)):(S(H+".range[0]",Math.pow(10,te)),S(H+".range[1]",Math.pow(10,re)))}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")(e,Y,R,S),u.getComponentMethod("images","convertCoords")(e,Y,R,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(F.match(M)){var ne=l(s,E).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(E);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=J||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(R)?L[E]=null:b.isRemoveVal(R)?L[E]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),g[r]||(g[r]={});var se=g[r][n];se||(se=g[r][n]={}),se[oe]=R,delete t[E]}else"reverse"===F?(U.range?U.range.reverse():(S(H+".autorange",!0),U.range=[1,0]),Y.autorange?k.calc=!0:k.plot=!0):("dragmode"===E&&(!1===R&&!1!==G||!1!==R&&!1===G)||s._has("scatter-like")&&s._has("regl")&&"dragmode"===E&&("lasso"===R||"select"===R)&&"lasso"!==G&&"select"!==G||s._has("gl2d")?k.plot=!0:J?T.update(k,J):k.calc=!0,P.set(R))}}for(r in g){b.applyContainerArrayChanges(e,d(i,r),g[r],k,d)||(k.plot=!0)}for(var ce in D){var ue=(O=p.getFromId(e,ce))&&O._constraintGroup;if(ue)for(var fe in k.calc=!0,ue)D[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:D,undoit:L,redoit:A,eventData:y}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=G(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),U(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&Y(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag,d.reselect),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function X(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],$=[{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 Q(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,m,y=0;function g(e){return Array.isArray(a)?y>=a.length?e.transitionOpts=a[y]:e.transitionOpts=a[0]:e.transitionOpts=a,y++,e}var v=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))v.push({type:"object",data:g(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);v=k}}v.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,y=(u[m]||h[m]||{}).name,g=t[n].name,v=u[y]||h[y];y&&g&&"number"==typeof g&&v&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[y]||h[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&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[m]={name:m},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!v(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function v(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return g(a,t,l)},r.getLayoutValObject=function(e,t){return g(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":299,"../plots/attributes":342}],336:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,y=h.clean,g=e("../plots/cartesian/autorange").doAutoRange;function v(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,y=e._fullLayout,g=y._size,x=g.p,_=d.list(e,"",!0);if(y._paperdiv.style({width:e._context.responsive&&y.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":y.width+"px",height:e._context.responsive&&y.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),e._context.setBackground(e,y.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!y._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:g.l+g.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(y.paper_bgcolor)&&1===s.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(a in y._plots)if((l=y._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var O=l.xaxis.domain,D=l.yaxis.domain,C=l.plotgroup;if(v(O,D,L)){var E=C.node(),P=l.bg=o.ensureSingle(C,"rect","bg");E.insertBefore(P.node(),E.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([O,D]),S||(k.push(a),A.push(a))}var R,I,z,N,F,j,B,H,U,Y,q,V,Z,G=y._bgLayer.selectAll(".bg").data(k);for(G.enter().append("rect").classed("bg",!0),G.exit().remove(),G.each((function(e){y._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&y(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(g)}},{"../lib":299,"../plots/attributes":342,"../plots/plots":380,"./plot_config":333,"./plot_schema":334,"./plot_template":335}],338:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function m(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var y={};function g(e,r){return o.coerce(t,y,f,e,r)}var v=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},d);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function O(){return new Promise((function(e,t){var r=s(M,v,_),n=M._fullLayout.width,f=M._fullLayout.height;function d(){a.purge(M),document.body.removeChild(M)}if("full-json"===v){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===v)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:v,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(O).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":299,"../plots/plots":380,"../snapshot/helpers":391,"../snapshot/svgtoimg":393,"../snapshot/tosvg":395,"../version":561,"./plot_api":332,"fast-isnumeric":33}],339:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,g.concat(x.length)));var k,A,L,S,O,D=x.length,C=Array.isArray(M);if(C&&(D=Math.min(D,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,g.concat(A,x[A].length)));var E=x[A].length;for(k=0;k<(C?Math.min(E,M[A].length):E);k++)L=C?M[A][k]:M,S=v[A][k],O=x[A][k],n.validate(S,L)?O!==S&&O!==+S&&a.push(h("dynamic",i,g.concat(A,k),S,O)):a.push(h("value",i,g.concat(A,k),S))}else a.push(h("array",i,g.concat(A),v[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],y=i(m,d)||0,g=[],v=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,d);for(;M<=k;)M=o(M,c,d);T=o(M,-c,d)}else{for(M=y+(w=Math.round((k-y)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}g[_]=p?T:h?M:(T+M)/2,v[_]=T,x[_]=M}return{vals:g,starts:v,ends:x}}},{"../../constants/numerical":279,"../../lib":299,"fast-isnumeric":33}],344:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],345:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,y=f[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>O?M/T>D&&(_=x,w=b,D=M/T):M/S>D&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},D=M/S));if(d===y){var C=d-1,E=d+1;if(A)if(0===d)a=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=d/(1-Math.min(.5,P/S));a=d>0?[0,R]:[R,0]}else a=L?[Math.max(0,C),Math.max(1,E)]:[C,E]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-D*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),D=(w.val-_.val-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-D*l(_),w.val+D*s(w)];return g&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),O=k(r.vpadminus||r.vpad);if(!T){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=E;n--)C(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":180,"../../constants/numerical":279,"../../lib":299,"../../registry":387,"./axis_ids":350,"@plotly/d3":20,"fast-isnumeric":33}],346:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,O=m.ONEMIN,D=m.ONESEC,C=m.MINUS_SIGN,E=m.BADNUM,P={K:"zeroline"},R={K:"gridline",L:"path"},I={K:"minor-gridline",L:"path"},z={K:"tick",L:"path"},N={K:"tick",L:"text"},F={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j=e("../../constants/alignment"),B=j.MID_SHIFT,H=j.CAP_SHIFT,U=j.LINE_SPACING,Y=j.OPPOSITE_SIDE,q=t.exports={};q.setConvert=e("./set_convert");var V=e("./axis_autotype"),Z=e("./axis_ids"),G=Z.idSort,W=Z.isLinked;q.id2name=Z.id2name,q.name2id=Z.name2id,q.cleanId=Z.cleanId,q.list=Z.list,q.listIds=Z.listIds,q.getFromId=Z.getFromId,q.getFromTrace=Z.getFromTrace;var J=e("./autorange");q.getAutoRange=J.getAutoRange,q.findExtremes=J.findExtremes;function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}q.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},q.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},q.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==q.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=q.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},q.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:q.getFromId(t,r).cleanPos)(e)},q.redrawComponents=function(e,t){t=t||q.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;ur&&f2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},q.saveRangeInitial=function(e,t){for(var r=q.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=q.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=q.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=q.tickIncrement(e,r);if(s<=n)return s}return e}(v,e,g,c,i)),y=v,0;y<=u;)y=q.tickIncrement(y,g,!1,i);return{start:t.c2r(v,0,i),end:t.c2r(y,0,i),size:g,_dataSpan:u-c}},q.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,i=t.dtick&&a(t._tmin);if(i){var o=q.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var s=l.simpleMap(t.range,t.r2l);n=[s[0],.8*s[0]+.2*s[1]]}if(e.range=l.simpleMap(n,t.l2r),e._isMinor=!0,q.prepTicks(e,r),i){var c=a(t.dtick),u=a(e.dtick),f=c?t.dtick:+t.dtick.substring(1),d=u?e.dtick:+e.dtick.substring(1);c&&u?ee(f,d)?f===2*k&&d===2*A&&(e.dtick=k):f===2*k&&d===3*A?e.dtick=k:f!==k||(t._input.minor||{}).nticks?te(f/d,2.5)?e.dtick=f/2:e.dtick=f:e.dtick=A:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ee(f,d)?f>=12&&2===d&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ee(f,d)||(e.dtick=te(f/d,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},q.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,q.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=q.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dtick=(P?0:1);R--){var I=!R;R?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var z=R?e:l.extendFlat({},e,e.minor);if(I?q.prepMinorTicks(z,e,t):q.prepTicks(z,t),"array"!==z.tickmode){var N=X(u),F=N[0],j=N[1],B=a(z.dtick),H="log"===i&&!(B||"L"===z.dtick.charAt(0)),U=q.tickFirst(z,t);if(R){if(e._tmin=U,U=j:G<=j;G=q.tickIncrement(G,W,f,o)){if(R&&Y++,z.rangebreaks&&!f){if(G=p)break}if(D.length>h||G===Z)break;Z=G;var J={value:G};R?(H&&G!==(0|G)&&(J.simpleLabel=!0),s>1&&Y%s&&(J.skipLabel=!0),D.push(J)):(J.minor=!0,C.push(J))}}else R?(D=[],m=ne(e)):(C=[],O=ne(e))}if(P&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=D.map((function(e){return e.value})),$=[],Q=0;Q0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=v?d=u>=v&&u<=y?u:g:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=M?d=u>=M&&u<=w?u:T:r===k&&f>=k?d=k: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(t.rangebreaks&&d>0){for(var h=0,m=0;m<84;m++){var O=(m+.5)/84;t.maskBreaks(a*(1-O)+O*p)!==E&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>k&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(D,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),oe=1;"auto"===e.tickmode&&(oe=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=D.length-1;r>-1;r--)if(D[r].drop)D.splice(r,1);else{D[r].value=Ee(D[r].value,e);var se=e.c2p(D[r].value);(ie?le>se-oe:lep||uep&&(ce.periodX=p),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=O&&i<=16||t>=S)e._tickround="M";else if(t>=D&&i<=19||t>=O)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(me(e.exponentformat)&&!ye(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}q.autoTicks=function(e,t,r){var n;function i(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var o=2*t;if(o>g)t/=g,n=i(10),e.dtick="M"+12*fe(t,n,ae);else if(o>T)t/=T,e.dtick="M"+fe(t,1,ie);else if(o>A){if(e.dtick=fe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:le),!r){var s=q.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(s)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else o>S?e.dtick=fe(t,S,ie):o>O?e.dtick=fe(t,O,oe):o>D?e.dtick=fe(t,D,oe):(n=i(10),e.dtick=fe(t,n,ae))}else if("log"===e.type){e.tick0=0;var u=l.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=i(10),e.dtick="L"+fe(t,n,ae)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Ce(e)?(e.tick0=0,n=1,e.dtick=fe(t,n,ue)):(e.tick0=0,n=i(10),e.dtick=fe(t,n,ae));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},q.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ce:se,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},q.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=ge(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||me(p)&&ye(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":C)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":C)+d:(t.text=ge(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):Ce(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=ge(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=ge(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=ge(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var y=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[y(o.x-.5),y(o.x+e.dtick-.5)]}return o},q.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return q.hoverLabelText(e,n,r)+" - "+q.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=q.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var he=["f","p","n","\u03bc","m","","k","M","G","T"];function me(e){return"SI"===e||"B"===e}function ye(e){return e>14||e<-15}function ge(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=q.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};de(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":me(s)&&(e+=he[c/3+5]));return i?C+e:e}function ve(e,t){if(e){var r=Object.keys(F).reduce((function(e,r){return-1!==t.indexOf(r)&&F[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function xe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var y=r.right-(t._offset+t._length);y>0&&(n.xr=1,n.r=y);var g=t._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var v=r.bottom-(t._offset+t._length);v>0&&(n.yb=0,n.b=v);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=we(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ae&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ve(n,t.automargin),ve(a,t.automargin)),i.autoMargin(e,ke(t),n),i.autoMargin(e,Ae(t),a),i.autoMargin(e,Le(t),l)})),r.skipTitle||ae&&"bottom"===t.side||re.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+we(t);else{var l=Pe(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,m=q.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,f="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var y=t._selections[t._id+"tick"];if(h={selection:y,side:t.side},y&&y.node()&&y.node().parentNode){var g=d.getTranslate(y.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(re)}}function ie(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=Me(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},q.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],a=e.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},q.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},q.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},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=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*H,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-H));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(be(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(be(t)))}},q.makeTickPath=function(e,t,r,n){n||(n={});var a=n.minor;if(a&&!e.minor)return"";var i=void 0!==n.len?n.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*r)+"v"+i*r:"M"+(t+l*r)+",0h"+i*r},q.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=d?e.ticklen:0;if(f?m*=-1:u&&(m=0),d&&(p+=m,r)){var y=l.deg2rad(r);p=m*Math.cos(y)+1,h=m*Math.sin(y)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var g,v,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!f&&"bottom"===M||f&&"top"===M)?1:-1,f&&(b*=-1),g=h*b,v=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=B:x=-90===A&&"bottom"===M?H:90===A&&"top"===M?B:.5,T=B/2*(A/90)),w.xFn=function(e){return e.dx+g+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===k){if(b=(_=!f&&"left"===M||f&&"right"===M)?1:-1,f&&(b*=-1),g=p,v=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?H:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*H*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*B},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},q.drawTicks=function(e,t,r){r=r||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,_e);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return d.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Re(t,[z]),o.attr("transform",r.transFn)},q.drawGrid=function(e,t,r){r=r||{};var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?r.vals.filter((function(e){return e.minor})):[],l=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],s=r.counterAxis;if(s&&q.shouldShowZeroLine(e,t,s))for(var c="array"===t.tickmode,u=0;u=0;g--){var v=g?m:y;if(v){var x=v.selectAll("path."+a).data(g?l:o,_e);x.exit().remove(),x.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return d.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}Re(t,[R,I])},q.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=q.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return G(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Re(t,[P])},q.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,m=r.secondary?0:t.tickangle,y=(t._prevTickAngles||{})[f],g=r.layer.selectAll("g."+f).data(t.showticklabels?p:[],_e),v=[];function x(e,i){e.each((function(e){var o=n.select(this),l=o.select(".text-math-group"),u=h.anchorFn(e,i),f=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=c.lineCount(o),m=U*e.fontSize,y=h.heightFn(e,a(i)?+i:0,(p-1)*m);if(y&&(f+=s(0,y)),l.empty()){var g=o.select("text");g.attr({transform:f,"text-anchor":u}),g.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var v=d.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr("transform",f+s(v,0))}}))}g.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(d.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?v.push(e._promises.pop().then((function(){x(r,m)}))):x(r,m)})),Re(t,[N]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),s=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=l.simpleMap(t.range,t.r2l);s=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var f=Math.min(s,c),p=Math.max(s,c),h=t.side,m=1/0,y=-1/0;for(var v in g.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=d.bBox(r.node()),l=0;o?(i.right>p||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(g,y+1?y:m);var b=null;t._selections&&(t._selections[f]=g);var _=[function(){return v.length&&Promise.all(v)}];t.automargin&&i._redrawFromAutoMarginCount&&90===y?(b=90,_.push((function(){x(g,y)}))):_.push((function(){if(x(g,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=Me(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"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),y=f("left"),v=f("right"),_=f("bottom")||y||h||v?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var y="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,y)?"category":function(e,t){for(var r=e.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=y;break}var f=a("pattern",u);if(f===y)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case y:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":387,"./constants":353}],351:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function y(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rP&&NC&&(C=N);d/=(C-D)/(2*E),D=s.l2r(D),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(e,t,a,i)}function U(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function Y(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(e){E&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),E=!1)}function V(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function Z(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(Y(a),2!==e||ge||qe(),ye)o.indexOf("select")>-1&&L(r,a,X,K,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ge){var l=m?P:E,c="s"===m||"w"===g?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",y="middle";if(l.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===g&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:y}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,Oe.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),Oe.attr("d",V(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,Oe.attr("d",V(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":299,"fast-isnumeric":33}],363:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,l=n(e);r("tickprefix")&&r("showtickprefix",l),r("ticksuffix",o)&&r("showticksuffix",l)}},{"./show_dflt":366}],364:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":274}],365:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,y=p.LOG_CLIP,g=p.ONEWEEK,v=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function O(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function D(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function E(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=P(e);return void 0!==t?t:l(e)?+e:void 0}function I(e){return l(e)?+e:P(e)}function z(e,t,r){return n.round(r+t*e,2)}function N(e,t,r){return(e-r)/t}var F=function(t){return l(t)?z(t,e._m,e._b):m},j=function(t){return N(t,e._m,e._b)};if(e.rangebreaks){var B="y"===p;F=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);var n=B;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?z(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return N(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:f,e.l2c="log"===e.type?A:f,e.l2p=F,e.p2l=j,e.c2p="log"===e.type?function(e,t){return F(S(e,t))}:F,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=O,e.c2d=e.c2r=e.l2d=e.l2r=D,e.d2p=e.r2p=function(t,r,n){return e.l2p(O(t,0,n))},e.p2d=e.p2r=function(e,t,r){return D(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=E,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=I(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=I,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=P,e.l2r=e.c2r=f,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function y(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),y=h[1]-h[0],g=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*g/y),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(d){var v=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=v[1]-v[0],_=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(v[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,M=f?p[0]:0,k=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,O=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,O).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":180,"../../lib":299,"../../registry":387,"./axes":346,"@plotly/d3":20}],371:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.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=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(d,s,f,n),b.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),H=!(!n._has||!n._has("cartesian"))||j,U=!(!s._has||!s._has("cartesian"))||B;H&&!U?n._bgLayer.remove():U&&!H&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(p){var v=(r.t+r.b)/p;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:x,size:r.l+y},r:{val:_,size:r.r+y},b:{val:T,size:r.b+y},t:{val:w,size:r.t+y}},m[t]=1}else delete h[t],delete m[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),D(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,m=t._pushmargin,y=t._pushmarginIds,g=t.minreducedwidth,v=t.minreducedheight;if(!1!==t.margin.autoexpand){for(var x in m)y[x]||delete m[x];for(var _ in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},m){var w=m[_].l||{},T=m[_].b||{},M=w.val,k=w.size,A=T.val,L=T.size;for(var S in m){if(o(k)&&m[S].r){var O=m[S].r.val,C=m[S].r.size;if(O>M){var E=(k*O+(C-r)*M)/(O-M),P=(C*(1-M)+(k-r)*(1-O))/(O-M);E+P>c+f&&(c=E,f=P)}}if(o(L)&&m[S].t){var R=m[S].t.val,I=m[S].t.size;if(R>A){var z=(L*R+(I-n)*A)/(R-A),N=(I*(1-A)+(L-n)*(1-R))/(R-A);z+N>h+d&&(h=z,d=N)}}}}}var F=u.constrain(r-i.l-i.r,2,g),j=u.constrain(n-i.t-i.b,2,v),B=Math.max(0,r-F),H=Math.max(0,n-j);if(B){var U=(c+f)/B;U>1&&(c/=U,f/=U)}if(H){var Y=(h+d)/H;Y>1&&(h/=Y,d/=Y)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var q=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(R(o,c,f),a=0;a0){for(var n=[],a=0;a=u&&(d.min=0,h.min=0,y.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function m(e,t,r,n){var a=d[t._name];function o(r,n){return i.coerce(e,t,a,r,n)}o("uirevision",n.uirevision),t.type="linear";var p=o("color"),h=p!==a.color.dflt?p:r.font.color,m=t._name.charAt(0).toUpperCase(),y="Component "+m,g=o("title.text",y);t._hovertitle=g===y?g:m,i.coerceFont(o,"title.font",{family:r.font.family,size:i.bigFont(r.font.size),color:h}),o("min"),u(e,t,o,"linear"),s(e,t,o,"linear"),l(e,t,o,"linear"),c(e,t,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:h}),o("tickangle"),o("tickformat")),f(e,t,o,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}t.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:d,handleDefaults:h,font:t.font,paper_bgcolor:t.paper_bgcolor})}},{"../../components/color":158,"../../lib":299,"../../plot_api/plot_template":335,"../cartesian/line_grid_defaults":361,"../cartesian/prefix_suffix_defaults":363,"../cartesian/tick_label_defaults":367,"../cartesian/tick_mark_defaults":368,"../cartesian/tick_value_defaults":369,"../subplot_defaults":381,"./layout_attributes":384}],386:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../lib"),l=o.strTranslate,s=o._,c=e("../../components/color"),u=e("../../components/drawing"),f=e("../cartesian/set_convert"),d=e("../../lib/extend").extendFlat,p=e("../plots"),h=e("../cartesian/axes"),m=e("../../components/dragelement"),y=e("../../components/fx"),g=e("../../components/dragelement/helpers"),v=g.freeMode,x=g.rectMode,b=e("../../components/titles"),_=e("../../components/selections").prepSelect,w=e("../../components/selections").selectOnClick,T=e("../../components/selections").clearOutline,M=e("../../components/selections").clearSelectionsCache,k=e("../cartesian/constants");function A(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=A;var L=A.prototype;L.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},L.plot=function(e,t){var r=t[this.id],n=t._size;this._hasClipOnAxisFalse=!1;for(var a=0;aS*b?a=(i=b)*S:i=(a=x)/S,o=g*a/x,s=v*i/b,r=t.l+t.w*m-a/2,n=t.t+t.h*(1-y)-i/2,p.x0=r,p.y0=n,p.w=a,p.h=i,p.sum=_,p.xaxis={type:"linear",range:[w+2*M-_,_-w-2*T],domain:[m-o/2,m+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(e){return e.a>=p.aaxis.range[0]&&e.a<=p.aaxis.range[1]&&e.b>=p.baxis.range[1]&&e.b<=p.baxis.range[0]&&e.c>=p.caxis.range[1]&&e.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-M],domain:[y-s/2,y+s/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var k=p.yaxis.domain[0],A=p.aaxis=d({},e.aaxis,{range:[w,_-T-M],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});f(A,p.graphDiv._fullLayout),A.setScale();var L=p.baxis=d({},e.baxis,{range:[_-w-M,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});f(L,p.graphDiv._fullLayout),L.setScale();var O=p.caxis=d({},e.caxis,{range:[_-w-T,M],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});f(O,p.graphDiv._fullLayout),O.setScale();var D="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDef.select("path").attr("d",D),p.layers.plotbg.select("path").attr("d",D);var C="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDefRelative.select("path").attr("d",C);var E=l(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",E),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 R=l(r+a/2,n)+"rotate(30)"+l(0,-A._offset);p.layers.aaxis.attr("transform",R),p.layers.agrid.attr("transform",R);var I=l(r+a/2,n)+"rotate(-30)"+l(0,-O._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",O.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,O.linecolor||"#000").style("stroke-width",(O.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},L.drawAxes=function(e){var t=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),e){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(t,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(t,"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(t,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(t,"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(t,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(t,"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(e){var t,r=this.graphDiv,n=e._name,a=n.charAt(0),i=e._id,l=this.layers[n],s=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),e.setScale();var u=h.calcTicks(e),f=h.clipEnds(e,u),d=h.makeTransTickFn(e),p=h.getTickSigns(e)[2],m=o.deg2rad(30),y=p*(e.linewidth||1)/2,g=p*e.ticklen,v=this.w,x=this.h,b="b"===a?"M0,"+y+"l"+Math.sin(m)*g+","+Math.cos(m)*g:"M"+y+",0l"+Math.cos(m)*g+","+-Math.sin(m)*g,_={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[a];h.drawTicks(r,e,{vals:"inside"===e.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),h.drawGrid(r,e,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1}),h.drawLabels(r,e,{vals:u,layer:l,transFn:d,labelFns:h.makeLabelFns(e,0,30)})};var O=k.MINZOOM/2+.87,D="m-0.87,.5h"+O+"v3h-"+(O+5.2)+"l"+(O/2+2.6)+",-"+(.87*O+4.5)+"l2.6,1.5l-"+O/2+","+.87*O+"Z",C="m0.87,.5h-"+O+"v3h"+(O+5.2)+"l-"+(O/2+2.6)+",-"+(.87*O+4.5)+"l-2.6,1.5l"+O/2+","+.87*O+"Z",E="m0,1l"+O/2+","+.87*O+"l2.6,-1.5l-"+(O/2+2.6)+",-"+(.87*O+4.5)+"l-"+(O/2+2.6)+","+(.87*O+4.5)+"l2.6,1.5l"+O/2+",-"+.87*O+"Z",P=!0;function R(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}L.clearOutline=function(){M(this.dragOptions),T(this.dragOptions.gd)},L.initInteractions=function(){var e,t,r,n,f,d,p,h,g,b,T,M,A=this,L=A.layers.plotbg.select("path").node(),O=A.graphDiv,I=O._fullLayout._zoomlayer;function z(e){var t={};return t[A.id+".aaxis.min"]=e.a,t[A.id+".baxis.min"]=e.b,t[A.id+".caxis.min"]=e.c,t}function N(e,t){var r=O._fullLayout.clickmode;R(O),2===e&&(O.emit("plotly_doubleclick",null),i.call("_guiRelayout",O,z({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,O,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&y.click(O,t,A.id)}function F(e,t){return 1-t/A.h}function j(e,t){return 1-(e+(A.h-t)/Math.sqrt(3))/A.w}function B(e,t){return(e-(A.h-t)/Math.sqrt(3))/A.w}function H(a,i){var o=r+a*e,l=n+i*t,s=Math.max(0,Math.min(1,F(0,n),F(0,l))),c=Math.max(0,Math.min(1,j(r,n),j(o,l))),u=Math.max(0,Math.min(1,B(r,n),B(o,l))),m=(s/2+u)*A.w,y=(1-s/2-c)*A.w,v=(m+y)/2,x=y-m,_=(1-s)*A.h,w=_-x/S;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),M.transition().style("opacity",1).duration(200),b=!0),O.emit("plotly_relayouting",z(p))}function U(){R(O),p!==f&&(i.call("_guiRelayout",O,z(p)),P&&O.data&&O._context.showTips&&(o.notifier(s(O,"Double-click to zoom back out"),"long"),P=!1))}function Y(e,t){var r=e/A.xaxis._m,n=t/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]},t=(f.a-p.a)*A.yaxis._m,e=(f.c-p.c-f.b+p.b)*A.xaxis._m);var d=l(A.x0+e,A.y0+t);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var h=l(-e,-t);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),O.emit("plotly_relayouting",z(p))}function q(){i.call("_guiRelayout",O,z(p))}this.dragOptions={element:L,gd:O,plotinfo:{id:A.id,domain:O._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],e=O._fullLayout._invScaleX,t=O._fullLayout._invScaleY;var m=A.dragOptions.dragmode=O._fullLayout.dragmode;v(m)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===m?(A.dragOptions.moveFn=H,A.dragOptions.clickFn=N,A.dragOptions.doneFn=U,function(e,t,i){var s=L.getBoundingClientRect();r=t-s.left,n=i-s.top,O._fullLayout._calcInverseTransform(O);var u=O._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[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(),g="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",g),M=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.clearOutline(O)}(0,s,u)):"pan"===m?(A.dragOptions.moveFn=Y,A.dragOptions.clickFn=N,A.dragOptions.doneFn=q,f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,A.clearOutline(O)):(x(m)||v(m))&&_(i,s,u,A.dragOptions,m)}},L.onmousemove=function(e){y.hover(O,e,A.id),O._fullLayout._lasthover=L,O._fullLayout._hoversubplot=A.id},L.onmouseout=function(e){O._dragging||m.unhover(O,e)},m.init(this.dragOptions)}},{"../../components/color":158,"../../components/dragelement":177,"../../components/dragelement/helpers":176,"../../components/drawing":180,"../../components/fx":198,"../../components/selections":246,"../../components/titles":267,"../../lib":299,"../../lib/extend":293,"../../registry":387,"../cartesian/axes":346,"../cartesian/constants":353,"../cartesian/set_convert":365,"../plots":380,"@plotly/d3":20,tinycolor2:122}],387:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),l=e("./lib/dom").addStyleRule,s=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])return void n.log("Plot type "+t+" already registered.");for(var a in g(e),r.subplotsRegistry[t]=e,r.componentsRegistry)b(a,e.name)}(e.basePlotModule);for(var o={},s=0;s-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":158,"../components/drawing":180,"../constants/xmlns_namespaces":280,"../lib":299,"@plotly/d3":20}],396:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function R(e){var t=u,r=e.b,a=P(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var I=e[f+"a"],z=e[d+"a"];m=Math.abs(I.r2c(I.range[1])-I.r2c(I.range[0]));var N=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(y,N,e),!1!==e.index&&y[e.index].p!==c){M||(O=function(e){return Math.min(k(e),e.p-v.bargroupwidth/2)},D=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var F=y[e.index],j=g.base?F.b+F.s:F.s;e[d+"0"]=e[d+"1"]=z.c2p(F[d],!0),e[d+"LabelVal"]=j;var B=v.extents[v.extents.round(F.p)];e[f+"0"]=I.c2p(x?O(F):B[0],!0),e[f+"1"]=I.c2p(x?D(F):B[1],!0);var H=void 0!==F.orig_p;return e[f+"LabelVal"]=H?F.orig_p:F.p,e.labelLabel=s(I,e[f+"LabelVal"],g[f+"hoverformat"]),e.valueLabel=s(z,e[d+"LabelVal"],g[d+"hoverformat"]),e.baseLabel=s(z,F.b,g[d+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=P(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(F)+function(e){return C(k(e),A(e),w)}(F))/2,e[f+"Spike"]=I.c2p(F.p,!0),o(F,g,e),e.hovertemplate=g.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=f(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":158,"../../components/fx":198,"../../constants/numerical":279,"../../lib":299,"../../plots/cartesian/axes":346,"../../registry":387,"./helpers":403}],405:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":358,"../scatter/marker_colorbar":527,"./arrays_to_calcdata":396,"./attributes":397,"./calc":398,"./cross_trace_calc":400,"./defaults":401,"./event_data":402,"./hover":404,"./layout_attributes":406,"./layout_defaults":407,"./plot":408,"./select":409,"./style":411}],406:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],407:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function O(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,m=a.height,y=Math.abs(t-e),g=Math.abs(n-r),v=y>2*_&&g>2*_?_:0;y-=2*v,g-=2*v;var x=L(s);"auto"!==s||h<=y&&m<=g||!(h>y||m>g)||(h>g||m>y)&&h.01?q:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?q(e):e>t?Math.ceil(e):Math.floor(e)};F=V(F,j,I),j=V(j,F,I),B=V(B,H,!I),H=V(H,B,!I)}var Z=k(i.ensureSingle(E,"path"),C,y,g);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-F)*(H-B))||U&&e._context.staticPlot?"M0,0Z":"M"+F+","+B+"V"+H+"H"+j+"V"+B+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&z){var G=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,G,e)}!function(e,t,r,n,a,l,c,f,p,y,g){var w,T=t.xaxis,A=t.yaxis,D=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var E=n[0].trace,P="h"===E.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="histogram"===o.type,h="waterfall"===o.type,m="funnel"===o.type,y="h"===o.orientation;y?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,d.c2l(e),!0).text}var v=t[r],x={};x.label=v.p,x.labelLabel=x[s+"Label"]=(_=v.p,u(c,c.c2l(_),!0).text);var _;var w=i.castOption(o,v.i,"text");(0===w||w)&&(x.text=w);x.value=v.s,x.valueLabel=x[f+"Label"]=g(v.s);var T={};b(T,o,v.i),(p||void 0===T.x)&&(T.x=y?x.value:x.label);(p||void 0===T.y)&&(T.y=y?x.label:x.value);(p||void 0===T.xLabel)&&(T.xLabel=y?x.valueLabel:x.labelLabel);(p||void 0===T.yLabel)&&(T.yLabel=y?x.labelLabel:x.valueLabel);h&&(x.delta=+v.rawS||v.s,x.deltaLabel=g(x.delta),x.final=v.v,x.finalLabel=g(x.final),x.initial=x.final-x.delta,x.initialLabel=g(x.initial));m&&(x.value=v.s,x.valueLabel=g(x.value),x.percentInitial=v.begR,x.percentInitialLabel=i.formatPercent(v.begR),x.percentPrevious=v.difR,x.percentPreviousLabel=i.formatPercent(v.difR),x.percentTotal=v.sumR,x.percenTotalLabel=i.formatPercent(v.sumR));var M=i.castOption(o,v.i,"customdata");M&&(x.customdata=M);return i.texttemplateString(l,x,e._d3locale,T,x,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),m=[],y=function(e){return-1!==h.indexOf(e)};y("label")&&m.push((g=e[t].p,u(o?n:r,g,!0).text));var g;y("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&m.push(f);if(l){var v=+p.rawS||p.s,x=p.v,b=x-v;y("initial")&&m.push(c(b)),y("delta")&&m.push(c(v)),y("final")&&m.push(c(x))}if(s){y("value")&&m.push(c(p.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),m.push(f)),y("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),m.push(f)),y("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(v,o)}(D,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(E,a);var I="stack"===y.mode||"relative"===y.mode,z=n[a],N=!I||z._outmost;if(!R||"none"===w||(z.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var F=D.font,j=h.getBarColor(n[a],E),B=h.getInsideTextFont(E,a,F,j),H=h.getOutsideTextFont(E,a,F),U=r.datum();P?"log"===T.type&&U.s0<=0&&(l=T.range[0]=V*(J/Z):J>=Z*(W/V);V>0&&Z>0&&(X||K||$)?w="inside":(w="outside",Y.remove(),Y=null)}else w="inside";if(!Y){G=i.ensureUniformFontSize(e,"outside"===w?H:B);var Q=(Y=C(r,R,G)).attr("transform");if(Y.attr("transform",""),q=s.bBox(Y.node()),V=q.width,Z=q.height,Y.attr("transform",Q),V<=0||Z<=0)return void Y.remove()}var ee,te,re=E.textangle;"outside"===w?(te="both"===E.constraintext||"outside"===E.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var m=L(c),y=S(a,m),g=(l?y.x:y.y)/2,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*g):(w=n+A*o,k=-A*g);return{textX:v,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,f,p,q,{isHorizontal:P,constrained:te,angle:re})):(te="both"===E.constraintext||"inside"===E.constraintext,ee=O(l,c,f,p,q,{isHorizontal:P,constrained:te,angle:re,anchor:E.insidetextanchor}));ee.fontSize=G.size,d("histogram"===E.type?"bar":E.type,ee,D),z.transform=ee;var ne=k(Y,D,y,g);i.setTransormAndDisplay(ne,ee)}(e,t,E,r,p,F,j,B,H,y,g),t.layerClipId&&s.hideOutsideRangePoint(c,E.select("text"),w,D,f.xcalendar,f.ycalendar)}));var B=!1===f.cliponaxis;s.setClipUrl(c,B?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,E,t,y)},toMoveInsideBar:O}},{"../../components/color":158,"../../components/drawing":180,"../../components/fx/helpers":194,"../../lib":299,"../../lib/svg_text_utils":322,"../../plots/cartesian/axes":346,"../../registry":387,"./attributes":397,"./constants":399,"./helpers":403,"./style":411,"./uniform_text":413,"@plotly/d3":20,"fast-isnumeric":33}],409:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,y(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":158,"../../components/drawing":180,"../../lib":299,"../../registry":387,"./attributes":397,"./helpers":403,"./uniform_text":413,"@plotly/d3":20}],412:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":158,"../../components/colorscale/defaults":168,"../../components/colorscale/helpers":169,"../../lib":299}],413:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=oS.uf};if(t._hasPreCompStats){var H=t[x],U=function(e){return v.d2c((t[e]||[])[r])},Y=1/0,q=-1/0;for(r=0;r=S.q1&&S.q3>=S.med){var Z=U("lowerfence");S.lf=Z!==l&&Z<=S.q1?Z:p(S,D,C);var G=U("upperfence");S.uf=G!==l&&G>=S.q3?G:h(S,D,C);var W=U("mean");S.mean=W!==l?W:C?o.mean(D,C):(S.q1+S.q3)/2;var J=U("sd");S.sd=W!==l&&J>=0?J:C?o.stdev(D,C,S.mean):S.q3-S.q1,S.lo=m(S),S.uo=y(S);var X=U("notchspan");X=X!==l&&X>0?X:g(S,C),S.ln=S.med-X,S.un=S.med+X;var K=S.lf,$=S.uf;t.boxpoints&&D.length&&(K=Math.min(K,D[0]),$=Math.max($,D[C-1])),t.notched&&(K=Math.min(K,S.ln),$=Math.max($,S.un)),S.min=K,S.max=$}else{var Q;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+S.q1,"median = "+S.med,"q3 = "+S.q3].join("\n")),Q=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=Q,S.q1=S.q3=Q,S.lf=S.uf=Q,S.mean=S.sd=Q,S.ln=S.un=Q,S.min=S.max=Q}Y=Math.min(Y,S.min),q=Math.max(q,S.max),S.pts2=O.filter(B),A.push(S)}}t._extremes[v._id]=a.findExtremes(v,[Y,q],{padded:!0})}else{var ee=v.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),a=0;a=0&&ae0){var ue,fe;if((S={}).pos=S[_]=F[r],O=S.pts=ne[r].sort(f),C=(D=S[x]=O.map(d)).length,S.min=D[0],S.max=D[C-1],S.mean=o.mean(D,C),S.sd=o.stdev(D,C,S.mean),S.med=o.interp(D,.5),C%2&&(se||ce))se?(ue=D.slice(0,C/2),fe=D.slice(C/2+1)):ce&&(ue=D.slice(0,C/2+1),fe=D.slice(C/2)),S.q1=o.interp(ue,.5),S.q3=o.interp(fe,.5);else S.q1=o.interp(D,.25),S.q3=o.interp(D,.75);S.lf=p(S,D,C),S.uf=h(S,D,C),S.lo=m(S),S.uo=y(S);var de=g(S,C);S.ln=S.med-de,S.un=S.med+de,ie=Math.min(ie,S.ln),oe=Math.max(oe,S.un),S.pts2=O.filter(B),A.push(S)}t._extremes[v._id]=a.findExtremes(v,t.notched?ee.concat([ie,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(A[0].t={num:T[L],dPos:j,posLetter:_,valLetter:x,labels:{med:s(e,"median:"),min:s(e,"min:"),q1:s(e,"q1:"),q3:s(e,"q3:"),max:s(e,"max:"),mean:"sd"===t.boxmean?s(e,"mean \xb1 \u03c3:"):s(e,"mean:"),lf:s(e,"lower fence:"),uf:s(e,"upper fence:")}},T[L]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(e,t,r){for(var n in c)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[c[n]]=t[n][r[0]][r[1]]):e[c[n]]=t[n][r])}function f(e,t){return e.v-t.v}function d(e){return e.v}function p(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function h(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function m(e){return 4*e.q1-3*e.q3}function y(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},{"../../constants/numerical":279,"../../lib":299,"../../plots/cartesian/align_period":343,"../../plots/cartesian/axes":346,"fast-isnumeric":33}],416:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function l(e,t,r,o){var l,s,c,u=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],m=0;for(l=0;l1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l0){var q=S.pointpos,V=S.jitter,Z=S.marker.size/2,G=0;q+V>=0&&((G=U*(q+V))>A?(Y=!0,B=Z,F=G):G>z&&(B=Z,F=A)),G<=A&&(F=A);var W=0;q-V<=0&&((W=-U*(q-V))>L?(Y=!0,H=Z,j=W):W>N&&(H=Z,j=L)),W<=L&&(j=L)}else F=A,j=L;var J=new Array(c.length);for(s=0;s0?(y="v",g=x>0?Math.min(_,b):Math.min(b)):x>0?(y="h",g=Math.min(_)):g=0;if(g){t._length=g;var L=r("orientation",y);t._hasPreCompStats?"v"===L&&0===x?(r("x0",0),r("dx",1)):"h"===L&&0===v&&(r("y0",0),r("dy",1)):"v"===L&&0===x?r("x0"):"h"===L&&0===v&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i)}else t.visible=!1}function f(e,t,r,a){var i=a.prefix,o=n.coerce2(e,t,c,"marker.outliercolor"),l=r("marker.line.outliercolor"),s="outliers";t._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.angle"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",t.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 t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}t.exports={supplyDefaults:function(e,t,r,a){function l(r,a){return n.coerce(e,t,c,r,a)}if(u(e,t,l,a),!1!==t.visible){o(e,t,a,l),l("xhoverformat"),l("yhoverformat");var s=t._hasPreCompStats;s&&(l("lowerfence"),l("upperfence")),l("line.color",(e.marker||{}).color||r),l("line.width"),l("fillcolor",i.addOpacity(t.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 m=!1;if(s){var y=l("notchspan");y&&y.length&&(m=!0)}else n.validate(e.notchwidth,c.notchwidth)&&(m=!0);l("notched",m)&&l("notchwidth"),f(e,t,l,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,a;function i(e){return n.coerce(a._input,a,c,e)}for(var o=0;oe.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.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=e.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(e){var t=c.c2l(e.pos+f,!0),a=c.l2p(t-o)+d,i=c.l2p(t+l)+d,h=u?(a+i)/2:c.l2p(t)+d,m=s.c2p(e.mean,!0),y=s.c2p(e.mean-e.sd,!0),g=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===p?"m0,0L"+y+","+h+"L"+m+","+a+"L"+g+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===p?"m0,0L"+h+","+y+"L"+a+","+m+"L"+h+","+g+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":180,"../../lib":299,"@plotly/d3":20}],424:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a=e.cd,i=e.xaxis,o=e.yaxis,l=[];if(!1===t)for(r=0;ro.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":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],429:[function(e,t,r){"use strict";var n=e("../../components/colorscale"),a=e("./make_color_map"),i=e("./end_plus");t.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,l=t.line,s=o.size||1,c=o.coloring,u=a(t,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(t);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":170,"./end_plus":437,"./make_color_map":442}],430:[function(e,t,r){"use strict";t.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}}},{}],431:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./label_defaults"),i=e("../../components/color"),o=i.addOpacity,l=i.opacity,s=e("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,r,i,s,f){var d,p,h,m=t.contours,y=r("contours.operation");(m._operation=c[y],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,m),"="===y?d=m.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((e.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(t.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":158,"../../constants/filter_ops":277,"./label_defaults":441,"fast-isnumeric":33}],432:[function(e,t,r){"use strict";var n=e("../../constants/filter_ops"),a=e("fast-isnumeric");function i(e,t){var r,i=Array.isArray(t);function o(e){return a(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(i?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=i?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=i?t.map(o):[o(t)]),r}function o(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function l(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":277,"fast-isnumeric":33}],433:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,l=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],434:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}t.exports=function(e,t){var r,i,o,l=function(e){return e.reverse()},s=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),i=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return s}},{"../../lib":299,"./constraint_mapping":432,"./end_plus":437}],437:[function(e,t,r){"use strict";t.exports=function(e){return e.end+e.size/1e6}},{}],438:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constants");function i(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(e)?i=1:-1!==a.LEFTSTART.indexOf(e)?n=1:-1!==a.TOPSTART.indexOf(e)?i=-1:n=-1;return[n,i]}(f,r,t),p=[l(e,t,[-d[0],-d[1]])],h=e.z.length,m=e.z[0].length,y=t.slice(),g=d.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(d[0]||d[1])<0?0:1],e.crossings[u]=a.SADDLEREMAINDER[f]):delete e.crossings[u],!(d=a.NEWDELTA[f])){n.log("Found bad marching index:",f,t,e.level);break}p.push(l(e,t,d)),t[0]+=d[0],t[1]+=d[1],u=t.join(","),i(p[p.length-1],p[p.length-2],o,s)&&p.pop();var v=d[0]&&(t[0]<0||t[0]>m-2)||d[1]&&(t[1]<0||t[1]>h-2);if(t[0]===y[0]&&t[1]===y[1]&&d[0]===g[0]&&d[1]===g[1]||r&&v)break;f=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,M,k,A,L,S,O,D,C,E,P,R=i(p[0],p[p.length-1],o,s),I=0,z=.2*e.smoothing,N=[],F=0;for(c=1;c=F;c--)if((x=N[c])=F&&x+N[b]A&&L--,e.edgepaths[L]=O.concat(p,S));break}U||(e.edgepaths[A]=p.concat(S))}for(A=0;Ae?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,r,i,o,l,s,c,u,f,d=e[0].z,p=d.length,h=d[0].length,m=2===p||2===h;for(r=0;r=0&&(n=v,l=s):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,l=s):a.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,l>=0)break;f+="L"+n}if(l===e.edgepaths.length){a.log("unclosed perimeter path");break}d=l,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;dn.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=g.EDGECOST*(1/(d-1)+1/(p-1));h+=g.ANGLECOST*c*c;for(var m=l-u,y=s-f,v=l+u,x=s+f,b=0;b2*g.MAXCOST)break;p&&(l/=2),s=(o=c-l/2)+1.5*l}if(d<=g.MAXCOST)return u},r.addLabelData=function(e,t,r,n){var a=t.fontSize,i=t.width+a/3,o=Math.max(0,t.height-a/3),l=e.x,s=e.y,c=e.theta,u=Math.sin(c),f=Math.cos(c),d=function(e,t){return[l+e*f-t*u,s+e*u+t*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:t.text,x:l,y:s,dy:t.dy,theta:c,level:t.level,width:i,height:o}),n.push(p)},r.drawLabels=function(e,t,r,i,o){var s=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,a=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:a,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+a+")"}).call(l.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),a.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,d=e._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,e.ncontours).dtick,d.size=r.size=c}}},{"../../lib":299,"../../plots/cartesian/axes":346}],446:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../heatmap/style"),o=e("./make_color_map");t.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[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;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(e.level):l.color,l.dash)}));var h=i.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(e.level):l.color)})})),u)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var m;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===m&&(m=e.level),p(e.level+.5*s)})),void 0===m&&(m=c),t.selectAll("g.contourbg path").style("fill",p(m-.5*s))}})),i(e)}},{"../../components/drawing":180,"../heatmap/style":461,"./make_color_map":442,"@plotly/d3":20}],447:[function(e,t,r){"use strict";var n=e("../../components/colorscale/defaults"),a=e("./label_defaults");t.exports=function(e,t,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!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":168,"./label_defaults":441}],448:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/attributes"),i=e("../../plots/font_attributes"),o=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,l=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/template_attributes").texttemplateAttrs,c=e("../../components/colorscale/attributes"),u=e("../../lib/extend").extendFlat;t.exports=u({z:{valType:"data_array",editType:"calc"},x:u({},n.x,{impliedEdits:{xtype:"array"}}),x0:u({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:u({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:u({},n.y,{impliedEdits:{ytype:"array"}}),y0:u({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:u({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:u({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:u({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:u({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:u({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:u({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:u({},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"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:l(),texttemplate:s({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:i({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:u({},a.showlegend,{dflt:!1})},{transforms:void 0},c("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":165,"../../lib/extend":293,"../../plots/attributes":342,"../../plots/cartesian/axis_format_attributes":349,"../../plots/font_attributes":374,"../../plots/template_attributes":382,"../scatter/attributes":509}],449:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../histogram2d/calc"),s=e("../../components/colorscale/calc"),c=e("./convert_column_xyz"),u=e("./clean_2d_array"),f=e("./interp2d"),d=e("./find_empties"),p=e("./make_bound_array"),h=e("../../constants/numerical").BADNUM;function m(e){for(var t=[],r=e.length,n=0;nI){P("x scale is not linear");break}}if(x.length&&"fast"===C){var z=(x[x.length-1]-x[0])/(x.length-1),N=Math.abs(z/100);for(M=0;MN){P("y scale is not linear");break}}}var F=a.maxRowLength(T),j="scaled"===t.xtype?"":r,B=p(t,j,y,g,F,A),H="scaled"===t.ytype?"":x,U=p(t,H,b,_,T.length,L);D||(t._extremes[A._id]=i.findExtremes(A,B),t._extremes[L._id]=i.findExtremes(L,U));var Y={x:B,y:U,z:T,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&v&&(Y.orig_x=v),t.yperiodalignment&&w&&(Y.orig_y=w),j&&j.length===B.length-1&&(Y.xCenter=j),H&&H.length===U.length-1&&(Y.yCenter=H),O&&(Y.xRanges=k.xRanges,Y.yRanges=k.yRanges,Y.pts=k.pts),S||s(e,t,{vals:T,cLetter:"z"}),S&&t.contours&&"heatmap"===t.contours.coloring){var q={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};Y.xfill=p(q,j,y,g,F,A),Y.yfill=p(q,H,b,_,T.length,L)}return[Y]}},{"../../components/colorscale/calc":166,"../../constants/numerical":279,"../../lib":299,"../../plots/cartesian/align_period":343,"../../plots/cartesian/axes":346,"../../registry":387,"../histogram2d/calc":478,"./clean_2d_array":450,"./convert_column_xyz":452,"./find_empties":454,"./interp2d":457,"./make_bound_array":459}],450:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r,o){var l,s,c,u,f,d;function p(e){if(n(e))return+e}if(t&&t.transpose){for(l=0,f=0;f=0;o--)(l=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||m)[2]+(f[[r+1,a]]||m)[2]+(f[[r,a-1]]||m)[2]+(f[[r,a+1]]||m)[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(e,t){return t[2]-e[2]}))}},{"../../lib":299}],455:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../components/colorscale").extractOpts;t.exports=function(e,t,r,l,s){s||(s={});var c,u,f,d,p=s.isContour,h=e.cd[0],m=h.trace,y=e.xa,g=e.ya,v=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,T=h.zmask,M=m.zhoverformat,k=v,A=x;if(!1!==e.index){try{f=Math.round(e.index[1]),d=Math.round(e.index[0])}catch(t){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(f<0||f>=b[0].length||d<0||d>b.length)return}else{if(n.inbox(t-v[0],t-v[v.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var L;for(k=[2*v[0]-v[1]],L=1;Lm&&(g=Math.max(g,Math.abs(e[i][o]-h)/(y-m))))}return g}t.exports=function(e,t){var r,a=1;for(o(e,t),r=0;r.01;r++)a=o(e,t,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),e}},{"../../lib":299}],458:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){e("texttemplate");var r=n.extendFlat({},t.font,{color:"auto",size:"auto"});n.coerceFont(e,"textfont",r)}},{"../../lib":299}],459:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i,o,l){var s,c,u,f=[],d=n.traceIs(e,"contour"),p=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(a(t)&&t.length>1&&!p&&"category"!==l.type){var m=t.length;if(!(m<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d||h)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],u=1;u0;)_=w.c2p(z[L]),L--;for(_0;)A=T.c2p(N[L]),L--;if(AVe||Ve>T._length))for(S=He;SGe||Ge>w._length)){var We=u({x:Ze,y:qe},E,e._fullLayout);We.x=Ze,We.y=qe;var Je=C.z[L][S];void 0===Je?(We.z="",We.zLabel=""):(We.z=Je,We.zLabel=l.tickText(Ne,Je,"hover").text);var Xe=C.text&&C.text[L]&&C.text[L][S];void 0!==Xe&&!1!==Xe||(Xe=""),We.text=Xe;var Ke=s.texttemplateString(Ie,We,e._fullLayout._d3locale,We,E._meta||{});if(Ke){var $e=Ke.split("
"),Qe=$e.length,et=0;for(O=0;O0&&(i=!0);for(var s=0;si){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],m=r[1],y=Math.min(f(h+d,h+p,n,i),f(m+d,m+p,n,i)),g=Math.min(f(h+c,h+d,n,i),f(m+c,m+d,n,i));if(y>g&&go){var v=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",v);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(F)&&(B=o.tickIncrement(B,b.size,!0,p)),R.start=r.l2r(B),N||a.nestedProperty(t,g+".start").set(R.start)}var H=b.end,U=r.r2l(P.end),Y=void 0!==U;if((b.endFound||Y)&&U!==r.r2l(H)){var q=Y?U:a.aggNums(Math.max,null,h);R.end=r.l2r(q),Y||a.nestedProperty(t,g+".start").set(R.end)}var V="autobin"+l;return!1===t._input[V]&&(t._input[g]=a.extendFlat({},t[g]||{}),delete t._input[V],delete t[V]),[R,h]}t.exports={calc:function(e,t){var r,i,p,h,m=[],y=[],g="h"===t.orientation,v=o.getFromId(e,g?t.yaxis:t.xaxis),x=g?"y":"x",b={x:"y",y:"x"}[x],_=t[x+"calendar"],w=t.cumulative,T=d(e,t,v,x),M=T[0],k=T[1],A="string"==typeof M.size,L=[],S=A?L:M,O=[],D=[],C=[],E=0,P=t.histnorm,R=t.histfunc,I=-1!==P.indexOf("density");w.enabled&&I&&(P=P.replace(/ ?density$/,""),I=!1);var z,N="max"===R||"min"===R?null:0,F=s.count,j=c[P],B=!1,H=function(e){return v.r2c(e,0,_)};for(a.isArrayOrTypedArray(t[b])&&"count"!==R&&(z=t[b],B="avg"===R,F=s[R]),r=H(M.start),p=H(M.end)+(r-o.tickIncrement(r,M.size,!1,_))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(y,w.direction,w.currentbin);var K=Math.min(m.length,y.length),$=[],Q=0,ee=K-1;for(r=0;r=Q;r--)if(y[r]){ee=r;break}for(r=Q;r<=ee;r++)if(n(m[r])&&n(y[r])){var te={p:m[r],s:y[r],b:0};w.enabled||(te.pts=C[r],Z?te.ph0=te.ph1=C[r].length?k[C[r][0]]:m[r]:(t._computePh=!0,te.ph0=q(L[r]),te.ph1=q(L[r+1],!0))),$.push(te)}return 1===$.length&&($[0].width1=o.tickIncrement($[0].p,M.size,!1,_)-$[0].p),l($,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected($,t,J),$},calcAllAutoBins:d}},{"../../lib":299,"../../plots/cartesian/axes":346,"../../registry":387,"../bar/arrays_to_calcdata":396,"./average":465,"./bin_functions":467,"./bin_label_vals":468,"./norm_functions":476,"fast-isnumeric":33}],470:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],471:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../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"];t.exports=function(e,t){var r,f,d,p,h,m,y,g=t._histogramBinOpts={},v=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=g[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.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",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(g[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;hL&&T.splice(L,T.length-L),A.length>L&&A.splice(L,A.length-L);var S=[],O=[],D=[],C="string"==typeof w.size,E="string"==typeof k.size,P=[],R=[],I=C?P:w,z=E?R:k,N=0,F=[],j=[],B=t.histnorm,H=t.histfunc,U=-1!==B.indexOf("density"),Y="max"===H||"min"===H?null:0,q=i.count,V=o[B],Z=!1,G=[],W=[],J="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";J&&"count"!==H&&(Z="avg"===H,q=i[H]);var X=w.size,K=x(w.start),$=x(w.end)+(K-a.tickIncrement(K,X,!1,g))/1e6;for(r=K;r<$;r=a.tickIncrement(r,X,!1,g))O.push(Y),P.push(r),Z&&D.push(0);P.push(r);var Q,ee=O.length,te=(r-K)/ee,re=(Q=K+te/2,m.c2r(Q,0,g)),ne=k.size,ae=b(k.start),ie=b(k.end)+(ae-a.tickIncrement(ae,ne,!1,v))/1e6;for(r=ae;r=0&&p=0&&h0||n.inbox(r-o.y0,r-(o.y0+o.h*l.dy),0)>0)){var u,f=Math.floor((t-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",{willReadFrequently:!0}).getImageData(f,d,1,1).data),u){var p,h=o.hi||l.hoverinfo;if(h){var m=h.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(p=!0)}var y,g=i.colormodel[l.colormodel],v=g.colormodel||l.colormodel,x=v.length,b=l._scaler(u),_=g.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(""),e.extraText=v.toUpperCase()+": "+w),Array.isArray(l.hovertext)&&Array.isArray(l.hovertext[d])?y=l.hovertext[d][f]:Array.isArray(l.text)&&Array.isArray(l.text[d])&&(y=l.text[d][f]);var T=c.c2p(o.y0+(d+.5)*l.dy),M=o.x0+(f+.5)*l.dx,k=o.y0+(d+.5)*l.dy,A="["+u.slice(0,l.colormodel.length).join(", ")+"]";return[a.extendFlat(e,{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:M,xLabelVal:M,yVal:k,yLabelVal:k,zLabelVal:A,text:y,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":198,"../../lib":299,"./constants":488}],493:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover"),eventData:e("./event_data"),moduleType:"trace",name:"image",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":358,"./attributes":486,"./calc":487,"./defaults":489,"./event_data":490,"./hover":492,"./plot":494,"./style":495}],494:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.strTranslate,o=e("../../constants/xmlns_namespaces"),l=e("./constants"),s=a.isIOS()||a.isSafari()||a.isIE();t.exports=function(e,t,r,c){var u=t.xaxis,f=t.yaxis,d=!(s||e._context._exportedPlot);a.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),s=t[0],c=s.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&d)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=p;var h,m,y,g,v,x,b=s.z,_=s.x0,w=s.y0,T=s.w,M=s.h,k=c.dx,A=c.dy;for(x=0;void 0===h&&x0;)m=u.c2p(_+x*k),x--;for(x=0;void 0===g&&x0;)v=f.c2p(w+x*A),x--;if(mE[0];if(P||R){var I=h+L/2,z=g+S/2;D+="transform:"+i(I+"px",z+"px")+"scale("+(P?-1:1)+","+(R?-1:1)+")"+i(-I+"px",-z+"px")+";"}}O.attr("style",D);var N=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===M&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=T,t.height=M;var r=t.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e;if(c._hasZ)e=F((function(e,t){return b[t][e]})).toDataURL("image/png");else if(c._hasSource)if(p)e=c.source;else{var t=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,T,M).data;e=F((function(e,r){var n=4*(r*T+e);return[t[n],t[n+1],t[n+2],t[n+3]]})).toDataURL("image/png")}O.attr({"xlink:href":e,height:S,width:L,x:h,y:g})}));e._promises.push(N)}function F(e){var t=document.createElement("canvas");t.width=L,t.height=S;var r,n=t.getContext("2d",{willReadFrequently:!0}),i=function(e){return a.constrain(Math.round(u.c2p(_+e*k)-h),0,L)},o=function(e){return a.constrain(Math.round(f.c2p(w+e*A)-g),0,S)},d=l.colormodel[c.colormodel],p=d.colormodel||c.colormodel,m=d.fmt;for(x=0;x=0})),("funnelarea"===t.type?g:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=y),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var y=c("hole");if(c("title.text")){var g=c("title.position",y?"middle center":"top center");y||"middle center"!==g||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":299,"../../plots/domain":373,"../bar/defaults":401,"./attributes":496,"fast-isnumeric":33}],500:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":194}],501:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:f.hovertemplate||-1!==d.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:y.castOption(_.bgcolor,e.pts)||e.color,borderColor:y.castOption(_.bordercolor,e.pts),fontFamily:y.castOption(w.family,e.pts),fontSize:y.castOption(w.size,e.pts),fontColor:y.castOption(w.color,e.pts),nameLength:y.castOption(_.namelength,e.pts),textAlign:y.castOption(_.align,e.pts),hovertemplate:y.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=y.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=y.castOption(e._input.textfont.color,t.pts));var a=y.castOption(e.insidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.insidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;y-=2)g(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)g(Math.PI*(y+1),"tan")}if(f||p){for(y=4;y>=-4;y-=2)g(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)g(Math.PI*(y+.5),"rad")}}if(l||h||f){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/v,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||d)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function O(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function D(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=E(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.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+=e.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-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function E(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n1?(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")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:y.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:y.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=y.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function z(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._context.staticPlot,i=e._fullLayout,d=i._size;h("pie",i),_(t,e),P(t,d);var m=s.makeTraceGroups(i._pielayer,t,"trace").each((function(t){var h=n.select(this),m=t[0],g=m.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=y.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.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))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var v=n.select(this).selectAll("g.slice").data(t);v.enter().append("g").classed("slice",!0),v.exit().remove();var _=[[[],[]],[[],[]]],T=!1;v.each((function(a,o){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=g.index,_[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var c=m.cx,u=m.cy,d=n.select(this),h=d.selectAll("path.surface").data([a]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),d.call(x,e,t),g.pull){var v=+y.castOption(g.pull,a.pts)||0;v>0&&(c+=v*a.pxmid[0],u+=v*a.pxmid[1])}a.cxFinal=c,a.cyFinal=u;var M=g.hole;if(a.v===m.vTotal){var k="M"+(c+a.px0[0])+","+(u+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";M?h.attr("d","M"+(c+M*a.px0[0])+","+(u+M*a.px0[1])+C(a.px0,a.pxmid,!1,M)+C(a.pxmid,a.px0,!1,M)+"Z"+k):h.attr("d",k)}else{var A=C(a.px0,a.px1,!0,1);if(M){var L=1-M;h.attr("d","M"+(c+M*a.px1[0])+","+(u+M*a.px1[1])+C(a.px1,a.px0,!1,M)+"l"+L*a.px0[0]+","+L*a.px0[1]+A+"Z")}else h.attr("d","M"+c+","+u+"l"+a.px0[0]+","+a.px0[1]+A+"Z")}I(e,a,m);var S=y.castOption(g.textposition,a.pts),D=d.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);D.enter().append("g").classed("slicetext",!0),D.exit().remove(),D.each((function(){var r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=y.castOption(e.outsidetextfont.color,t.pts)||y.castOption(e.textfont.color,t.pts)||r.color,a=y.castOption(e.outsidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.outsidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(g,a,i.font):b(g,a,i.font));r.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,e);var h,v=l.bBox(r.node());if("outside"===S)h=O(v,a);else if(h=w(v,a,m),"auto"===S&&h.scale<1){var x=s.ensureUniformFontSize(e,g.outsidetextfont);r.call(l.font,x),h=O(v=l.bBox(r.node()),a)}var _=h.textPosAngle,M=void 0===_?a.pxmid:R(m.r,_);if(h.targetX=c+M[0]*h.rCenter+(h.x||0),h.targetY=u+M[1]*h.rCenter+(h.y||0),z(h,v),h.outside){var k=h.targetY;a.yLabelMin=k-v.height/2,a.yLabelMid=k,a.yLabelMax=k+v.height/2,a.labelExtraX=0,a.labelExtraY=0,T=!0}h.fontSize=d.size,p(g.type,h,i),t[o].transform=h,s.setTransormAndDisplay(r,h)}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*m.r+","+n*m.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var M=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(M.enter().append("g").classed("titletext",!0),M.exit().remove(),M.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.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,e),t="middle center"===g.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(m):D(m,d),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),T&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function v(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),v=p-h;if(v*s>0&&(e.labelExtraY=v),Array.isArray(t.pull))for(c=0;c=(y.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=v):(m+e.labelExtraY-g)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?m:g,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(v,g),T&&g.automargin){var k=l.bBox(h.node()),A=g.domain,L=d.w*(A.x[1]-A.x[0]),S=d.h*(A.y[1]-A.y[0]),C=(.5*L-m.r)/d.w,E=(.5*S-m.r)/d.h;a.autoMargin(e,"pie."+g.uid+".automargin",{xl:A.x[0]-C,xr:A.x[1]+C,yb:A.y[0]-E,yt:A.y[1]+E,l:Math.max(m.cx-m.r-k.left,0),r:Math.max(k.right-(m.cx+m.r),0),b:Math.max(k.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-k.top,0),pad:5})}}))}));setTimeout((function(){m.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:I,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:D,prerenderTitles:_,layoutAreas:P,attachFxHandlers:x,computeTransform:z}},{"../../components/color":158,"../../components/drawing":180,"../../components/fx":198,"../../lib":299,"../../lib/svg_text_utils":322,"../../plots/plots":380,"../bar/constants":399,"../bar/uniform_text":413,"./event_data":500,"./helpers":501,"@plotly/d3":20}],506:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":413,"./style_one":507,"@plotly/d3":20}],507:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":158,"./helpers":501}],508:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&D[g].gap;)g--;for(x=D[g].s,m=D.length-1;m>g;m--)D[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],516:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults"),y=e("../../lib").coercePattern;t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var x=s(e,t,g,v);if(x||(t.visible=!1),t.visible){c(e,t,g,v),v("xhoverformat"),v("yhoverformat");var b=u(e,t,g,v),_=!b&&x=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iG!=(j=R[E][1])>=G&&(z=R[E-1][0],N=R[E][0],j-F&&(I=z+(N-z)*(G-F)/(j-F),Y=Math.min(Y,I),q=Math.max(q,I)));Y=Math.max(Y,0),q=Math.min(q,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:Y,x1:q,y0:G,y1:G,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":158,"../../components/fx":198,"../../lib":299,"../../registry":387,"./get_trace_color":519}],521:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":358,"./arrays_to_calcdata":508,"./attributes":509,"./calc":510,"./cross_trace_calc":514,"./cross_trace_defaults":515,"./defaults":516,"./format_labels":518,"./hover":520,"./marker_colorbar":527,"./plot":530,"./select":531,"./style":533,"./subtypes":534}],522:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){s||(s={});var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},{"../../components/colorscale/defaults":168,"../../components/colorscale/helpers":169,"../../lib":299}],523:[function(e,t,r){"use strict";var n=e("../../components/drawing"),a=e("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,c=e("../../lib"),u=c.segmentsIntersect,f=c.constrain,d=e("./constants");t.exports=function(e,t){var r,a,o,p,h,m,y,g,v,x,b,_,w,T,M,k,A,L,S=t.trace||{},O=t.xaxis,D=t.yaxis,C="log"===O.type,E="log"===D.type,P=O._length,R=D._length,I=t.backoff,z=S.marker,N=t.connectGaps,F=t.baseTolerance,j=t.shape,B="linear"===j,H=S.fill&&"none"!==S.fill,U=[],Y=d.minTolerance,q=e.length,V=new Array(q),Z=0;function G(r){var n=e[r];if(!n)return!1;var a=t.linearized?O.l2p(n.x):O.c2p(n.x),o=t.linearized?D.l2p(n.y):D.c2p(n.y);if(a===i){if(C&&(a=O.c2p(n.x,!0)),a===i)return!1;E&&o===i&&(a*=Math.abs(O._m*R*(O._m>0?l:s)/(D._m*P*(D._m>0?l:s)))),a*=1e3}if(o===i){if(E&&(o=D.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function W(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&coe||e[1]se)return[f(e[0],ie,oe),f(e[1],le,se)]}function fe(e,t){return e[0]===t[0]&&(e[0]===ie||e[0]===oe)||(e[1]===t[1]&&(e[1]===le||e[1]===se)||void 0)}function de(e,t,r){return function(n,a){var i=ue(n),o=ue(a),l=[];if(i&&o&&fe(i,o))return l;i&&l.push(i),o&&l.push(o);var s=2*c.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);s&&((i&&o?s>0==i[e]>o[e]?i:o:i||o)[e]+=s);return l}}function pe(e){var t=e[0],r=e[1],n=t===V[Z-1][0],a=r===V[Z-1][1];if(!n||!a)if(Z>1){var i=t===V[Z-2][0],o=r===V[Z-2][1];n&&(t===ie||t===oe)&&i?o?Z--:V[Z-1]=e:a&&(r===le||r===se)&&o?i?Z--:V[Z-1]=e:V[Z++]=e}else V[Z++]=e}function he(e){V[Z-1][0]!==e[0]&&V[Z-1][1]!==e[1]&&pe([Q,ee]),pe(e),te=null,Q=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ce[a],o=u(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,e)oe?oe:0,$=t[1]se?se:0,K||$){if(Z)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),V[Z++]=n[1])}else re=ne(V[Z-1],t)[0],V[Z++]=re;else V[Z++]=[K||t[0],$||t[1]];var a=V[Z-1];K&&$&&(a[0]!==K||a[1]!==$)?(te&&(Q!==K&&ee!==$?pe(Q&&ee?(i=te,l=(o=t)[0]-i[0],s=(o[1]-i[1])/l,(i[1]*o[0]-o[1]*i[0])/l>0?[s>0?ie:oe,se]:[s>0?oe:ie,le]):[Q||K,ee||$]):Q&&ee&&pe([Q,ee])),pe([K,$])):Q-K&&ee-$&&pe([K||Q,$||ee]),te=t,Q=K,ee=$}else te&&he(ne(te,t)[0]),V[Z++]=t;var i,o,l,s}for(r=0;rJ(m,ge))break;o=m,(w=v[0]*g[0]+v[1]*g[1])>b?(b=w,p=m,y=!1):w<_&&(_=w,h=m,y=!0)}if(y?(ye(p),o!==h&&ye(h)):(h!==a&&ye(h),o!==p&&ye(p)),ye(o),r>=e.length||!m)break;ye(m),a=m}}else ye(p)}te&&pe([Q||te[0],ee||te[1]]),U.push(V.slice(0,Z))}var ve=j.slice(j.length-1);if(I&&"h"!==ve&&"v"!==ve){for(var xe=!1,be=-1,_e=[],we=0;we=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":33}],527:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],528:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),c.noAngle||(s("marker.angle"),c.noAngleRef||s("marker.angleref"),c.noStandOff||s("marker.standoff")),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":158,"../../components/colorscale/defaults":168,"../../components/colorscale/helpers":169,"./subtypes":534}],529:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":279,"../../lib":299}],530:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,m){var y;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),m=Math.ceil(h.length/p),y=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(e){return g?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,O;v(T).style("opacity",_.opacity);var D=_.fill.charAt(_.fill.length-1);"x"!==D&&"y"!==D&&(D=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,E,P="",R=[],I=_._prevtrace;I&&(P=I._prevRevpath||"",O=I._nextFill,R=I._polygons);var z,N,F,j,B,H,U,Y="",q="",V=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(O&&O.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(z=s.steps(w.shape),N=s.steps(w.shape.split("").reverse().join(""))):z=N="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return N(e.reverse())},V=u(f,{xaxis:x,yaxis:b,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(V.length),y=0;y1){var r=n.select(this);if(r.datum(f),e)v(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",C),s.singleLineStyle(f,a)}}}}}var G=k.selectAll(".js-line").data(V);v(G.exit()).style("opacity",0).remove(),G.each(Z(!1)),G.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(G,r.layerClipId,e),V.length?(S?(S.datum(f),j&&H&&(D?("y"===D?j[1]=H[1]=b.c2p(0,!0):"x"===D&&(j[0]=H[0]=x.c2p(0,!0)),v(S).attr("d","M"+H+"L"+j+"L"+Y.substr(1)).call(s.singleFillStyle,e)):v(S).attr("d",Y+"Z").call(s.singleFillStyle,e))):O&&("tonext"===_.fill.substr(0,6)&&Y&&P?("tonext"===_.fill?v(O).attr("d",Y+"Z"+P+"Z").call(s.singleFillStyle,e):v(O).attr("d",Y+"L"+P.substr(1)+"Z").call(s.singleFillStyle,e),_._polygons=_._polygons.concat(R)):(J(O),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?J(S):O&&J(O),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,m=te;if(f||d){var y=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?K:X:_&&!w&&(y=$),f&&(h=y),d&&(m=y)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);g&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=v(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=v(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(L,W,e)}function J(e){v(e).attr("d","M0,0Z")}function X(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function $(e){return e.filter((function(e){return!e.gap}))}function Q(e){return e.id}function ee(e){if(e.ids)return Q}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,m=!!i&&i.duration>0,y=f(e,t,r);((u=a.selectAll("g.trace").data(y,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,y,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,y,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":180,"../../lib":299,"../../lib/polygon":311,"../../registry":387,"./line_points":523,"./link_traces":525,"./subtypes":534,"@plotly/d3":20}],531:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r"),o.hovertemplate=d.hovertemplate,i}function x(e,t){g.push(e._hovertitle+": "+t)}}},{"../scatter/hover":520}],543:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:e("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":383,"../scatter/marker_colorbar":527,"../scatter/select":531,"../scatter/style":533,"./attributes":537,"./calc":538,"./defaults":539,"./event_data":540,"./format_labels":541,"./hover":542,"./plot":544}],544:[function(e,t,r){"use strict";var n=e("../scatter/plot");t.exports=function(e,t,r){var a=t.plotContainer;a.select(".scatterlayer").selectAll("*").remove();for(var i=t.xaxis,o=t.yaxis,l={xaxis:i,yaxis:o,plot:a,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},s=t.layers.frontplot.select("g.scatterlayer"),c=0;c0){var b,_,w,T,M,k=e.xa,A=e.ya;"h"===h.orientation?(M=t,b="y",w=A,_="x",T=k):(M=r,b="x",w=k,_="y",T=A);var L=p[e.index];if(M>=L.span[0]&&M<=L.span[1]){var S=a.extendFlat({},e),O=T.c2p(M,!0),D=l.getKdeValue(L,h,M),C=l.getPositionOnKdePath(L,h,O),E=w._offset,P=w._length;S[b+"0"]=C[0],S[b+"1"]=C[1],S[_+"0"]=S[_+"1"]=O,S[_+"Label"]=_+": "+i.hoverLabelText(T,M,h[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+D.toFixed(3);for(var R=0,I=0;Ia&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),x={},b={},_=0;h?(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(y);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],79:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(d)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function y(){if(h){var e=u(d,h);if(e)return e}return!!m&&u(d,m)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!m&&m.seg);var g,v=y();if(v){var x;if(e)(x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=d.seg.myFill;r&&r.segmentUpdate(v.seg),d.other.remove(),d.remove()}if(i.getHead()!==d){r&&r.rewind(d.seg);continue}if(e)x=null===d.seg.myFill.below||d.seg.myFill.above!==d.seg.myFill.below,d.seg.myFill.below=m?m.seg.myFill.above:a,d.seg.myFill.above=x?!d.seg.myFill.below:d.seg.myFill.below;else if(null===d.seg.otherFill)g=m?d.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:d.primary?o:a,d.seg.otherFill={above:g,below:g};r&&r.status(d.seg,!!h&&h.seg,!!m&&m.seg),d.other.status=p.insert(n.node({ev:d}))}else{var b=d.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(b.prev)&&l.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},i.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));case 5:case 10:case 11:case 12:case 7:default:return null}},i.prototype.scan_ifd=function(e,t,r){var i=this.read_uint16(t);t+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var h=[],m=d,y=0;y0&&(this.ifds_to_read.push({id:l,offset:h[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:e,tag:l,format:s,count:c,entry_offset:t+this.start,data_length:f,data_offset:d+this.start,value:h,is_subifd_link:p}))return void(this.aborted=!0);t+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(e){return-1}}},{}],86:[function(e,t,r){"use strict";var n=e("./common").readUInt16BE,a=e("./common").readUInt32BE;function i(e,t){if(e.length<4+t)return null;var r=a(e,t);return e.length>4&15,a=15&e[4],i=e[5]>>4&15,o=n(e,6),s=8,c=0;ct.width||e.width===t.width&&e.height>t.height?e:t})),a=r.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t})),n.width>a.height||n.width===a.height&&n.height>a.width?n:a),l=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(l=0===e.value?r[l]:t[l=t[l=r[l]]]),"irot"===e.type)for(var n=0;n1&&(d.variants=f.variants),f.orientation&&(d.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=e.length){var p=i(e,f.exif_location.offset),h=e.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),m=l.get_orientation(h);m>0&&(d.orientation=m)}return d}}}}}}},{"../common":84,"../exif_utils":85,"../miaf_utils":86}],88:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("BM");t.exports=function(e){if(!(e.length<26)&&a(e,0,o))return{width:i(e,18),height:i(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":84}],89:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt16LE,o=n("GIF87a"),l=n("GIF89a");t.exports=function(e){if(!(e.length<10)&&(a(e,0,o)||a(e,0,l)))return{width:i(e,6),height:i(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":84}],90:[function(e,t,r){"use strict";var n=e("../common").readUInt16LE;t.exports=function(e){var t=n(e,0),r=n(e,2),a=n(e,4);if(0===t&&1===r&&a){for(var i=[],o={width:0,height:0},l=0;lo.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:i,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":84}],91:[function(e,t,r){"use strict";var n=e("../common").readUInt16BE,a=e("../common").str2arr,i=e("../common").sliceEq,o=e("../exif_utils"),l=a("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var r,a,s=e[t++];255===s;)s=e[t++];if(208<=s&&s<=217||1===s)r=0;else{if(!(192<=s&&s<=254))return;if(e.length-t<2)return;r=n(e,t)-2,t+=2}if(217===s||218===s)return;if(225===s&&r>=10&&i(e,t,l)&&(a=o.get_orientation(e.slice(t+6,t+r))),r>=5&&192<=s&&s<=207&&196!==s&&200!==s&&204!==s){if(e.length-t0&&(c.orientation=a),c}t+=r}}},{"../common":84,"../exif_utils":85}],92:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),l=n("IHDR");t.exports=function(e){if(!(e.length<24)&&a(e,0,o)&&a(e,12,l))return{width:i(e,16),height:i(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":84}],93:[function(e,t,r){"use strict";var n=e("../common").str2arr,a=e("../common").sliceEq,i=e("../common").readUInt32BE,o=n("8BPS\0\x01");t.exports=function(e){if(!(e.length<22)&&a(e,0,o))return{width:i(e,18),height:i(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":84}],94:[function(e,t,r){"use strict";function n(e){return"number"==typeof e&&isFinite(e)&&e>0}var a=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,l=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(e){return c.test(e)?e.match(c)[0]:"px"}t.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function d(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||u(e,t+8):"VP8L"===p&&h>=9?r=r||f(e,t+8):"VP8X"===p&&h>=10?r=r||d(e,t+8):"EXIF"===p&&(n=l.get_orientation(e.slice(t+8,t+8+h)),t=1/0),t+=8+h}else t++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":84,"../exif_utils":85}],97:[function(e,t,r){"use strict";t.exports={avif:e("./parse_sync/avif"),bmp:e("./parse_sync/bmp"),gif:e("./parse_sync/gif"),ico:e("./parse_sync/ico"),jpeg:e("./parse_sync/jpeg"),png:e("./parse_sync/png"),psd:e("./parse_sync/psd"),svg:e("./parse_sync/svg"),tiff:e("./parse_sync/tiff"),webp:e("./parse_sync/webp")}},{"./parse_sync/avif":87,"./parse_sync/bmp":88,"./parse_sync/gif":89,"./parse_sync/ico":90,"./parse_sync/jpeg":91,"./parse_sync/png":92,"./parse_sync/psd":93,"./parse_sync/svg":94,"./parse_sync/tiff":95,"./parse_sync/webp":96}],98:[function(e,t,r){"use strict";var n=e("./lib/parsers_sync");t.exports=function(e){return function(e){for(var t=Object.keys(n),r=0;r1)for(var r=1;r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,a,o,l;if("string"==typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";l='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(i(t,"type"))}return l+=". Received type ".concat(typeof r)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],103:[function(e,t,r){(function(r){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var a=e("./_stream_readable"),i=e("./_stream_writable");e("inherits")(c,a);for(var o=n(i.prototype),l=0;l0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)o.endEmitted?w(e,new _):L(e,o,t,!0);else if(o.ended)w(e,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?L(e,o,t,!1):C(e,o)):L(e,o,t,!1)}else n||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(D,e))}function D(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,z(e)}function C(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(E,e,t))}function E(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){c("readable nexttick read 0"),e.read(0)}function I(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),z(e),t.flowing&&!t.reading&&e.read(0)}function z(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function N(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(j,t,e))}function j(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):O(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,a=t.needReadable;return c("need readable",a),(0===t.length||t.length-e0?N(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(e){w(this,new b("_read()"))},k.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,c("pipe count=%d opts=%j",a.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?s:y;function l(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",l),n.removeListener("end",s),n.removeListener("end",y),n.removeListener("data",d),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function s(){c("onend"),e.end()}a.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",l);var u=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,z(e))}}(n);e.on("drain",u);var f=!1;function d(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==B(a.pipes,e))&&!f&&(c("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function p(t){c("onerror",t),y(),e.removeListener("error",p),0===i(e,"error")&&w(e,t)}function h(){e.removeListener("finish",m),y()}function m(){c("onfinish"),e.removeListener("close",h),y()}function y(){c("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",m),e.emit("pipe",n),a.flowing||(c("pipe resume"),n.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,c("on readable",a.length,a.reading),a.length?O(this):a.reading||r.nextTick(R,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(P,this),n},k.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(P,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(I,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var a in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){(c("wrapped data"),r.decoder&&(a=r.decoder.write(a)),r.objectMode&&null==a)||(r.objectMode||a&&a.length)&&(t.push(a)||(n=!0,e.pause()))})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,n){var a=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,a,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":102,"./_stream_duplex":103,"./internal/streams/destroy":110,"./internal/streams/state":114,"./internal/streams/stream":115,_process:99,buffer:28,inherits:67,"util-deprecate":123}],108:[function(e,t,r){(function(r){(function(){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=e("./end-of-stream"),o=Symbol("lastResolve"),l=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function h(e){var t=e[o];if(null!==t){var r=e[d].read();null!==r&&(e[u]=null,e[o]=null,e[l]=null,t(p(r,!1)))}}function m(e){r.nextTick(h,e)}var y=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((a(n={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,n){r.nextTick((function(){e[s]?n(e[s]):t(p(void 0,!0))}))}));var n,a=this[u];if(a)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(p(void 0,!0)):t[f](r,n)}),n)}}(a,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(p(i,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),a(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),y);t.exports=function(e){var t,r=Object.create(g,(a(t={},d,{value:e,writable:!0}),a(t,o,{value:null,writable:!0}),a(t,l,{value:null,writable:!0}),a(t,s,{value:null,writable:!0}),a(t,c,{value:e._readableState.endEmitted,writable:!0}),a(t,f,{value:function(e,t){var n=r[d].read();n?(r[u]=null,r[o]=null,r[l]=null,e(p(n,!1))):(r[o]=e,r[l]=t)},writable:!0}),t));return r[u]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[u]=null,r[o]=null,r[l]=null,t(e)),void(r[s]=e)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[l]=null,n(p(void 0,!0))),r[c]=!0})),e.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":111,_process:99}],109:[function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,a=o.allocUnsafe(e>>>0),i=this.head,l=0;i;)t=i.data,r=a,n=l,o.prototype.copy.call(t,r,n),l+=i.data.length,i=i.next;return a}},{key:"consume",value:function(e,t){var r;return ea.length?a.length:e;if(i===a.length?n+=a:n+=a.slice(0,e),0==(e-=i)){i===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,i),0==(e-=i)){i===a.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(i));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return l(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&o.forEach(c),i||(o.forEach(c),a(n))}))}));return t.reduce(u)}},{"../../../errors":102,"./end-of-stream":111}],114:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,a){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(a?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},{"../../../errors":102}],115:[function(e,t,r){t.exports=e("events").EventEmitter},{events:27}],116:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=c,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function l(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(e.lastNeed=a-1),a;if(--n=0)return a>0&&(e.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":100}],117:[function(e,t,r){(function(r,n){(function(){var r=e("assert"),a=e("debug")("stream-parser");t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");a("extending Parser into stream"),e._bytes=o,e._skipBytes=l,t&&(e._passthrough=s);t?e._transform=u:e._write=c};function i(e){a("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||i(this),a("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function l(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function s(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||i(this),a("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function c(e,t,r){this._parserInit||i(this),a("write(%o bytes)",e.length),"function"==typeof t&&(r=t),d(this,e,null,r)}function u(e,t,r){this._parserInit||i(this),a("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),d(this,e,t,r)}function f(e,t,r,i){if(e._parserBytesLeft-=t.length,a("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return i;var o=e._parserCallback;if(o&&0===e._parserState&&e._parserBuffers.length>1&&(t=n.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),o){var l=[];t&&l.push(t),r&&l.push(r);var s=o.length>l.length;s&&l.push(p(i));var c=o.apply(e,l);if(!s||i===c)return i}}var d=p((function e(t,r,n,a){return t._parserBytesLeft<=0?a(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return f(t,r,n,a)}:function(){var i=r.slice(0,t._parserBytesLeft);return f(t,i,n,(function(o){return o?a(o):r.length>i.length?function(){return e(t,r.slice(i.length),n,a)}:void 0}))}}));function p(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:99,assert:21,buffer:28,debug:118}],118:[function(e,t,r){(function(n){(function(){function a(){var e;try{e=r.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}(r=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff),!t)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var a=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(a++,"%c"===e&&(i=a))})),e.splice(i,0,n)},r.save=function(e){try{null==e?r.storage.removeItem("debug"):r.storage.debug=e}catch(e){}},r.load=a,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(a())}).call(this)}).call(this,e("_process"))},{"./debug":119,_process:99}],119:[function(e,t,r){var n;function a(e){function t(){if(t.enabled){var e=t,a=+new Date,i=a-(n||a);e.diff=i,e.prev=n,e.curr=a,n=a;for(var o=new Array(arguments.length),l=0;l0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*a;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===s&&!1===isNaN(e))return t.long?l(r=e,o,"day")||l(r,i,"hour")||l(r,a,"minute")||l(r,n,"second")||r+" ms":function(e){if(e>=o)return Math.round(e/o)+"d";if(e>=i)return Math.round(e/i)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],121:[function(e,t,r){(function(t,n){(function(){var a=e("process/browser.js").nextTick,i=Function.prototype.apply,o=Array.prototype.slice,l={},s=0;function c(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":99,timers:121}],122:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:E(t[1]),g:E(t[2]),b:E(t[3]),a:z(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:E(t[1]),g:E(t[2]),b:E(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:E(t[1]+""+t[1]),g:E(t[2]+""+t[2]),b:E(t[3]+""+t[3]),a:z(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:E(t[1]+""+t[1]),g:E(t[2]+""+t[2]),b:E(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*D(p,255),g:255*D(h,255),b:255*D(m,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=R(t.s),c=R(t.v),a=function(t,r,n){t=6*D(t,360),r=D(r,100),n=D(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=R(t.s),u=R(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=D(e,360),t=D(t,100),r=D(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=O(i),{ok:f,format:t.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}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=D(e,255),t=D(t,255),r=D(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=O(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[P(i(e).toString(16)),P(i(t).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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*D(this._r,255))+"%",g:i(100*D(this._g,255))+"%",b:i(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%)":"rgba("+i(100*D(this._r,255))+"%, "+i(100*D(this._g,255))+"%, "+i(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function O(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function D(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function E(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function I(t){return e.round(255*parseFloat(t)).toString(16)}function z(e){return E(e)/255}var N,F,j,B=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",j="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],123:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],124:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!y||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":138,"object-assign":73}],127:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":138,"object-assign":73}],128:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":138,"object-assign":73}],129:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":138,"object-assign":73}],130:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":138,"object-assign":73}],131:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":138,"object-assign":73}],132:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":138,"object-assign":73}],133:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":138,"object-assign":73}],135:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":138,"object-assign":73}],136:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":138,"object-assign":73}],137:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":138,"object-assign":73}],138:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":73}],139:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=v(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){v("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=v(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(d,p);h>S;S=this.daysInMonth(d,p))p++,h-=S}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":138,"object-assign":73}],140:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],141:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":275,"../../plot_api/plot_template":335,"../../plots/cartesian/constants":353,"../../plots/font_attributes":374,"./arrow_paths":140}],142:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,m=p-d,y=3*e.startarrowsize*e.arrowwidth||0,g=y+d,v=y-d;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,g),ppadminus:Math.max(f,v)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else g=l?g+l:g,v=l?v-l:v,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,g),ppadminus:Math.max(f,m,v)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":299,"../../plots/cartesian/axes":346,"./draw":147}],143:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var G=!1,W=["x","y"],J=0;J1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(G=!0):G=!0),X=ae._offset+ae.r2p(t[te]),Q=.5}else{var he="domain"===de;"x"===te?($=t[te],X=he?ae._offset+ae._length*$:X=T.l+T.w*$):($=1-t[te],X=he?ae._offset+ae._length*$:X=T.t+T.h*$),Q=t.showarrow?.5:$}if(t.showarrow){fe.head=X;var me=t["a"+te];if(ee=oe*q(.5,t.xanchor)-le*q(.5,t.yanchor),ne===re){var ye=s.getRefType(ne);"domain"===ye?("y"===te&&(me=1-me),fe.tail=ae._offset+ae._length*me):"paper"===ye?"y"===te?(me=1-me,fe.tail=T.t+T.h*me):fe.tail=T.l+T.w*me:fe.tail=ae._offset+ae.r2p(me),K=ee}else fe.tail=X+me,K=ee+me;fe.text=fe.tail+ee;var ge=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,ge-1)),"pixel"===ne){var ve=-Math.max(fe.tail-3,fe.text),xe=Math.min(fe.tail+3,fe.text)-ge;ve>0?(fe.tail+=ve,fe.text+=ve):xe>0&&(fe.tail-=xe,fe.text-=xe)}fe.tail+=ue,fe.head+=ue}else K=ee=se*q(Q,ce),fe.text=X+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(G)z.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(I-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,H?O:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;V.call(d.positionText,Te,we).call(u.setClipUrl,H?O:null,e)}U.select("rect").call(u.setRect,j,j,k,I),B.call(u.setRect,N/2,N/2,F-N,Y-N),z.call(u.setTranslate,Math.round(D.x.text-F/2),Math.round(D.y.text-Y/2)),P.attr({transform:"rotate("+C+","+D.x.text+","+D.y.text+")"});var Me,ke=function(r,n){E.selectAll(".annotation-arrow-g").remove();var s=D.x.head,f=D.y.head,d=D.x.tail+r,p=D.y.tail+n,m=D.x.text+r,b=D.y.text+n,_=o.rotationXYMatrix(C,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),O=+B.attr("width"),R=+B.attr("height"),I=m-.5*O,N=I+O,F=b-.5*R,j=F+R,H=[[I,F,I,j],[I,j,N,j],[N,j,N,F],[N,F,I,F]].map(k);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var U=t.arrowwidth,Y=t.arrowcolor,q=t.arrowside,V=E.append("g").style({opacity:c.opacity(Y)}).classed("annotation-arrow-g",!0),Z=V.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",U+"px").call(c.stroke,c.rgb(Y));if(y(Z,q,t),M.annotationPosition&&Z.node().parentNode&&!i){var G=s,W=f;if(t.standoff){var J=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));G+=t.standoff*(d-s)/J,W+=t.standoff*(p-f)/J}var X,K,$=V.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-G)+","+(p-W),transform:l(G,W)}).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:e,prepFn:function(){var e=u.getTranslate(z);X=e.x,K=e.y,g&&g.autorange&&A(g._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,K),a=n[0]+e,i=n[1]+r;z.call(u.setTranslate,a,i),L("x",v(g,e,"x",T,t)),L("y",v(x,r,"y",T,t)),t.axref===t.xref&&L("ax",v(g,e,"ax",T,t)),t.ayref===t.yref&&L("ay",v(x,r,"ay",T,t)),V.attr("transform",l(e,r)),P.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),R)h.init({element:z.node(),gd:e,prepFn:function(){Me=P.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",v(g,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",v(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(g)a=v(g,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=v(x,r,"y",T,t);else{var u=t._ysize/T.h,f=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(f-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),g&&x||(n=h.getCursor(g?.5:a,x?.5:o,t.xanchor,t.yanchor))}P.attr({transform:l(e,r)+Me}),p(z,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",Z(n))},doneFn:function(){p(z),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*y+r.standoff,_=m.backoff*g+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.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 R();if(b){if(b*b>w*w+T*T)return void R();var M=b*Math.cos(f),k=b*Math.sin(f);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void R();var A=_*Math.cos(f),L=_*Math.sin(f);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),O="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":377,"../annotations/draw":147}],154:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).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()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var ce=Math.pow(10,Math.floor(Math.log(se)/Math.LN10));oe*=ce*c.roundUp(se/ce,[2,5,10]),(Math.abs(q.start)/q.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+E/z.h,re+K-E/z.h]:[re+C/z.w,re+K-C/z.w],ae.setScale(),e.attr("transform",u(Math.round(z.l),Math.round(z.t)));var ue,fe=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(z.l),-Math.round(z.t))),de=ae.ticklabelposition,pe=ae.title.font.size,he=e.select("."+k.cbaxis),me=0,ye=0;function ge(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:I._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===B&&(e=C+z.l+z.w*P,t=E+z.t+z.h*(1-re-K)+3+.75*pe),"bottom"===B&&(e=C+z.l+z.w*P,t=E+z.t+z.h*(1-re)-3-.25*pe),"right"===B&&(t=E+z.t+z.h*R+3+.75*pe,e=C+z.l+z.w*re),ge(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,s=e.select("."+k.cbtitle),f=s.select("text"),d=[-A/2,A/2],h=s.select(".h"+ae._id+"title-math-group").node(),m=15.6;if(f.node()&&(m=parseInt(f.node().style.fontSize,10)*w),h?(i=p.bBox(h),ye=i.width,(me=i.height)>m&&(d[1]-=(me-m)/2)):f.node()&&!f.classed(k.jsPlaceholder)&&(i=p.bBox(f.node()),ye=i.width,me=i.height),o){if(me){if(me+=5,"top"===B)ae.domain[1]-=me/z.h,d[1]*=-1;else{ae.domain[0]+=me/z.h;var g=y.lineCount(f);d[1]+=(1-g)*m}s.attr("transform",u(d[0],d[1])),ae.setScale()}}else ye&&("right"===B&&(ae.domain[0]+=(ye+pe/2)/z.w),s.attr("transform",u(d[0],d[1])),ae.setScale())}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",o?u(0,Math.round(z.h*(1-ae.domain[1]))):u(Math.round(z.w*ae.domain[0]),0)),he.attr("transform",o?u(0,Math.round(-z.t)):u(Math.round(-z.l),0));var v=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(Z);v.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),v.exit().remove();var x=H.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var l=[0===i?H[0]:(Z[i]+Z[i-1])/2,i===Z.length-1?H[1]:(Z[i]+Z[i+1])/2].map(ae.c2p).map(Math.round);o&&(l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,x[0],x[1]));var s=n.select(this).attr(o?"x":"y",$).attr(o?"y":"x",n.min(l)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(l)-n.min(l),2));if(t._fillgradient)p.gradient(s,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=Y(e).replace("e-","");s.attr("fill",a(u).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(F.color&&F.width?G:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){var t=$,r=Math.round(ae.c2p(e))+F.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+W).call(p.lineGroupStyle,F.width,U(e),F.dash)})),he.selectAll("g."+ae._id+"tick,path").remove();var _=$+W+(A||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(ae),M=l.getTickSigns(ae)[2];return l.drawTicks(r,ae,{vals:"inside"===ae.ticks?l.clipEnds(ae,T):T,layer:he,path:l.makeTickPath(ae,_,M),transFn:l.makeTransTickFn(ae)}),l.drawLabels(r,ae,{vals:T,layer:he,transFn:l.makeTransTickLabelFn(ae),labelFns:l.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,l=ae._offset+ae._length/2;if("right"===B)a=l,e=z.l+z.w*i+10+pe*(ae.showticklabels?1:.5);else if(e=l,"bottom"===B&&(a=z.t+z.h*i+10+(-1===de.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===B){var s=j.text.split("
").length;a=z.t+z.h*i+10-W-w*pe*s}ge((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:B,offsetTop:o?0:z.t,offsetLeft:o?z.l:0,maxShift:o?I.width:I.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,l=W+A/2;-1===de.indexOf("inside")&&(n=p.bBox(he.node()),l+=o?n.width:n.height),ue=fe.select("text");var c=0,f=o&&"top"===B,m=!o&&"right"===B,y=0;if(ue.node()&&!ue.classed(k.jsPlaceholder)){var v,x=fe.select(".h"+ae._id+"title-math-group").node();x&&(o&&ie||!o&&!ie)?(c=(n=p.bBox(x)).width,v=n.height):(c=(n=p.bBox(fe.node())).right-z.l-(o?$:ne),v=n.bottom-z.t-(o?ne:$),o||"top"!==B||(l+=n.height,y=n.height)),m&&(ue.attr("transform",u(c/2+pe/2,0)),c*=2),l=Math.max(l,o?c:v)}var b=2*(o?C:E)+l+L+A/2,w=0;!o&&j.text&&"bottom"===D&&R<=0&&(b+=w=b/2,y+=w),I._hColorbarMoveTitle=w,I._hColorbarMoveCBTitle=y;var N=L+A;e.select("."+k.cbbg).attr("x",(o?$:ne)-N/2-(o?C:0)).attr("y",(o?ne:$)-(o?X:E+y-w)).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(X+N,2)).call(h.fill,S).call(h.stroke,t.bordercolor).style("stroke-width",L);var F=m?Math.max(c-10,0):0;if(e.selectAll("."+k.cboutline).attr("x",(o?$:ne+C)+F).attr("y",(o?ne+E-X:$)+(f?me:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(X-(o?2*E+me:2*C+F),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(z.l-(o?Q*b:0),z.t-(o?0:(1-ee)*b-y))),!o&&(L||a(S).getAlpha()&&!a.equals(I.paper_bgcolor,S))){var H=he.selectAll("text"),U=H[0].length,Y=e.select("."+k.cbbg).node(),q=p.bBox(Y),V=p.getTranslate(e);H.each((function(e,t){var r=U-1;if(0===t||t===r){var n,a=p.bBox(this),i=p.getTranslate(this);if(t===r){var o=a.right+i.x;(n=q.right+V.x+ne-L-2+P-o)>0&&(n=0)}else if(0===t){var l=a.left+i.x;(n=q.left+V.x+ne+L+2-l)<0&&(n=0)}n&&(U<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var Z={},G=T[O],J=M[O],K=T[D],te=M[D],re=b-W;o?("pixels"===d?(Z.y=R,Z.t=X*K,Z.b=X*te):(Z.t=Z.b=0,Z.yt=R+s*K,Z.yb=R-s*te),"pixels"===_?(Z.x=P,Z.l=b*G,Z.r=b*J):(Z.l=re*G,Z.r=re*J,Z.xl=P-g*G,Z.xr=P+g*J)):("pixels"===d?(Z.x=P,Z.l=X*G,Z.r=X*J):(Z.l=Z.r=0,Z.xl=P+s*G,Z.xr=P-s*J),"pixels"===_?(Z.y=1-R,Z.t=b*K,Z.b=b*te):(Z.t=re*K,Z.b=re*te,Z.yt=R-g*K,Z.yb=R+g*te)),i.autoMargin(r,t._id,Z)}],r)}(r,t,e);g&&g.then&&(e._promises||[]).push(g),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l="v"===t.orientation,c=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align((l?t._uFrac:t._vFrac)+r/c.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=s.align((l?t._vFrac:1-t._uFrac)-o/c.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var f=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,f)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":274,"../../lib":299,"../../lib/extend":293,"../../lib/setcursor":319,"../../lib/svg_text_utils":322,"../../plots/cartesian/axes":346,"../../plots/cartesian/axis_defaults":348,"../../plots/cartesian/layout_attributes":359,"../../plots/cartesian/position_defaults":362,"../../plots/plots":380,"../../registry":387,"../color":158,"../colorscale/helpers":169,"../dragelement":177,"../drawing":180,"../titles":267,"./constants":160,"@plotly/d3":20,tinycolor2:122}],163:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":299}],164:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":159,"./defaults":161,"./draw":162,"./has_colorbar":163}],165:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",y=i+"mid",g=(l(d+p),l(d+h),l(d+m),{});g[h]=g[m]=void 0;var v={};v[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},x[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":315,"../../lib/sort_object_keys":320,"../colorbar/attributes":159,"./scales.js":173}],166:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,m=f.mid,y=function(){return a.aggNums(Math.min,null,s)},g=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=y():d&&(p=u._colorAx&&n(p)?Math.min(p,y()):y()),void 0===h?h=g():d&&(h=u._colorAx&&n(h)?Math.max(h,g()):g()),d&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":299,"./helpers":169,"fast-isnumeric":33}],167:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],175:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":299}],176:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],177:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,m,y=e.gd,g=1,v=y._context.doubleClickDelay,x=e.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)v&&(g=Math.max(g-1,1)),y._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(g,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},s.coverSlip=u},{"../../lib":299,"../../plots/cartesian/constants":353,"./align":174,"./cursor":175,"./unhover":178,"has-hover":64,"has-passive-events":65,"mouse-event-offset":71}],178:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":291,"../../lib/events":292,"../../lib/throttle":323,"../fx/constants":192}],179:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],180:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),g=e("../../traces/scatter/make_bubble_size_func"),v=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};function b(e,t,r){var n=t.fillpattern,a=n&&x.getPatternAttr(n.shape,0,"");if(a){var i=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),l=n.fgopacity,s=x.getPatternAttr(n.size,0,8),u=x.getPatternAttr(n.solidity,0,.3),f=t.uid;x.pattern(e,"point",r,f,a,s,u,void 0,n.fillmode,i,o,l)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e,t){var r=n.select(e.node());b(e,((r.data()[0]||[])[0]||{}).trace||{},t)},x.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&b(r,e[0].trace,t)}))};var _=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,x.symbolBackOffs[r]=t.backoff||0,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function T(e,t,r,n){var a=e%100;return x.symbolFuncs[a](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var M={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=i("~f"),L={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=L[i],d=new Array(u),p=0;p=100;var f=re(e,r),d=V(e,r);t.attr("d",T(u,s,f,d))}var p,h,m,y=!1;if(e.so)m=l.outlierwidth,h=l.outliercolor,p=o.outliercolor;else{var g=(l||{}).width;m=(e.mlw+1||g+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,y=!0),p="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,p).style({"stroke-width":(m||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:m)+"px");var v=o.gradient,b=e.mgt;b?y=!0:b=v&&v.type,a.isArrayOrTypedArray(b)&&(b=b[0],L[b]||(b=0));var _=o.pattern,w=_&&x.getPatternAttr(_.shape,e.i,"");if(b&&"none"!==b){var M=e.mgc;M?y=!0:M=v.color;var k=r.uid;y&&(k+="-"+e.i),x.gradient(t,i,k,b,[[0,M],[1,p]],"fill")}else if(w){var A=x.getPatternAttr(_.bgcolor,e.i,null),S=x.getPatternAttr(_.fgcolor,e.i,null),O=_.fgopacity,D=x.getPatternAttr(_.size,e.i,8),C=x.getPatternAttr(_.solidity,e.i,.3),E=e.mcc||a.isArrayOrTypedArray(_.shape)||a.isArrayOrTypedArray(_.bgcolor)||a.isArrayOrTypedArray(_.size)||a.isArrayOrTypedArray(_.solidity),P=r.uid;E&&(P+="-"+e.i),x.pattern(t,"point",i,P,w,D,C,e.mcc,_.fillmode,A,S,O)}else c.fill(t,p);m&&c.stroke(t,h)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=y.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:m*t});var h=i.color,y=o.color,g=l.color;(y||g)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?y||t:g||t});var v=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);e.attr("d",T(x.symbolNumber(i),o,re(n,t),V(n,t))),n.mrc2=o})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};v(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var m=e.tp||t.textposition,y=D(e,t),g=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,y,g).text(c).call(d.convertToTspans,r).call(O,m,y,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=D(e,t);c.fill(a,i);var u=s.traceIs(t,"bar-like");O(a,o,l,e.mrc2||e.mrc,u)}))}};var C,E;function P(e,t,r){return r&&(e=j(e)),t?I(e[1]):R(e[0])}function R(e){var t=n.round(e,2);return C=t,t}function I(e){var t=n.round(e,2);return E=t,t}function z(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],l=r[1]-t[1],s=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+l*l,.25),u=(c*c*a-s*s*o)*n,f=(c*c*i-s*s*l)*n,d=3*c*(s+c),p=3*s*(s+c);return[[R(t[0]+(d&&u/d)),I(t[1]+(d&&f/d))],[R(t[0]-(p&&u/p)),I(t[1]-(p&&f/p))]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=c||b>=f&&b<=c)&&(_<=d&&_>=u||_>=d&&_<=u)&&(e=[b,_])}return e}x.steps=function(e){var t=N[e]||F;return function(e){for(var r="M"+R(e[0][0])+","+I(e[0][1]),n=e.length,a=1;a=1e4&&(x.savedBBoxes={},B=0),r&&(x.savedBBoxes[r]=y),B++,a.extendFlat({},y)},x.setClipUrl=function(e,t,r){e.attr("clip-path",U(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var Y=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(Y,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var q=/translate\([^)]*\)\s*$/;function V(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(q);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))},x.getMarkerStandoff=V;var Z,G,W,J,X,K,$=Math.atan2,Q=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*Q(e)-n*ee(e),r*ee(e)+n*Q(e)]}function re(e,t){var r,n,a=e.ma;void 0===a&&(a=t.marker.angle||0);var i=t.marker.angleref;if("previous"===i||"north"===i){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var s=t._xA,c=t._yA;if(!s||!c)return 90;r=s.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,f=e.lonlat[0],d=e.lonlat[1],p=t._geo.project([f,d+1e-5]),h=t._geo.project([f+1e-5,d]),m=$(h[1]-n,h[0]-r),y=$(p[1]-n,p[0]-r);if("north"===i)u=a/180*Math.PI;else if("previous"===i){var g=f/180*Math.PI,v=d/180*Math.PI,x=Z/180*Math.PI,b=G/180*Math.PI,_=x-g,w=Q(b)*ee(_),T=ee(b)*Q(v)-Q(b)*ee(v)*Q(_);u=-$(w,T)-Math.PI,Z=f,G=d}var M=te(m,[Q(u),0]),k=te(y,[ee(u),0]);a=$(M[1]+k[1],M[0]+k[0])/Math.PI*180,"previous"!==i||K===t.uid&&e.i===X+1||(a=null)}if("previous"===i&&!t._geo)if(K===t.uid&&e.i===X+1&&o(r)&&o(n)){var A=r-W,L=n-J,S=t.line&&t.line.shape||"",O=S.slice(S.length-1);"h"===O&&(L=0),"v"===O&&(A=0),a+=$(L,A)/Math.PI*180+90}else a=null}return W=r,J=n,X=e.i,K=t.uid,a}x.getMarkerAngle=re},{"../../components/fx/helpers":194,"../../constants/alignment":274,"../../constants/interactions":278,"../../constants/xmlns_namespaces":280,"../../lib":299,"../../lib/svg_text_utils":322,"../../registry":387,"../../traces/scatter/make_bubble_size_func":526,"../../traces/scatter/subtypes":534,"../color":158,"../colorscale":170,"./symbol_defs":181,"@plotly/d3":20,"fast-isnumeric":33,tinycolor2:122}],181:[function(e,t,r){"use strict";var n,a,i,o,l=e("parse-svg-path"),s=e("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,d=Math.cos,p=Math.sin;function h(e){return null===e}function m(e,t,r){if(!(e&&e%360!=0||t))return r;if(i===e&&o===t&&n===r)return a;function s(e,r){var n=d(e),a=p(e),i=r[0],o=r[1]+(t||0);return[i*n-o*a,i*a+o*n]}i=e,o=t,n=r;for(var c=e/180*f,u=0,h=0,m=l(r),y="",g=0;g0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var m=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,f);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),h.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);u&&g.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.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=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!d.size()?d=t.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":534,"../drawing":180,"@plotly/d3":20,"fast-isnumeric":33}],188:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":158,"@plotly/d3":20}],189:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":293,"../../plots/font_attributes":374,"./layout_attributes":199}],190:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||oe<0||oe>w[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,U="xval"in t?g.flat(s,t.xval):g.p2c(_,ie),Y="yval"in t?g.flat(s,t.yval):g.p2c(w,oe),!a(U[0])||!a(Y[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(V=0;Vee&&(te.splice(0,ee),ce=te[0].distance),v&&0!==F&&0===te.length){Q.distance=F,Q.index=!1;var f=G._module.hoverPoints(Q,K,$,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=F}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var m=h[0];a(m.x0)&&a(m.y0)&&(d=de(m),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>d.spikeDistance)&&(ne.vLinePoint=d))}var y=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(d=de(x),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>d.spikeDistance)&&(ne.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)De(te[Ae]);te=Le,ye()}var Ce=e._hoverdata,Ee=[],Pe=B(e),Re=H(e);for(q=0;q1||te.length>1)||"closest"===C&&ae&&te.length>1,Ge=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),We=E(te,{gd:e,hovermode:C,rotateLabels:Ze,bgColor:Ge,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});g.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&v.pmin===x.pmin&&v.pmax===x.pmax){for(l=g.length-1;l>=0;l--)g[l].dp+=a;for(y.push.apply(y,g),p.splice(o+1,1),c=0,l=y.length-1;l>=0;l--)c+=y[l].dp;for(i=c/y.length,l=y.length-1;l>=0;l--)y[l].dp-=i;n=!1}else o++}p.forEach(m)}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}}}(We,Ze?"xa":"ya",u),R(We,Ze,u._invScaleX,u._invScaleY));if(l&&l.tagName){var Je=y.getComponentMethod("annotations","hasClickToShow")(e,Ee);f(n.select(l),Je?"pointer":"")}if(!l||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:U,yvals:Y})}(e,t,r,i,l)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=B(a),o=H(a),l=E(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,x=g.offsetTop;u+=v,f+=v,d+=x,h+=x}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function E(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var T=t.fontFamily||v.HOVERFONT,M=t.fontSize||v.HOVERFONTSIZE,k=e[0],S=k.xa,O=k.ya,C=i.charAt(0),E=C+"Label",R=k[E];if(void 0===R&&"multicategory"===S.type)for(var I=0;Ia.width-b?(y=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+v.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+v.width/2)+"v"+x+(2*L+v.height)+"H-"+(L+v.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,D,C;"right"===O.side?(_="start",D=1,C="",y=S._offset+S._length):(_="end",D=-1,C="-",y=S._offset),g=O._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+v.height/2)+"h"+C+(2*L+v.width)+"V-"+(L+v.height/2)+"H"+C+A+"V-"+A+"Z");var E,P=v.height/2,I=N-v.top-P,z="clip"+a._uid+"commonlabel"+O._id;if(y=0?le:se+fe=0?se:xe+fe=0?ie:oe+de=0?oe:be+de=0,"top"!==e.idealAlign&&V||!Z?V?(E+=z/2,e.anchor="start"):e.anchor="middle":(E-=z/2,e.anchor="end");else if(e.pos=E,V=C+I/2+G<=F,Z=C-I/2-G>=0,"left"!==e.idealAlign&&V||!Z)if(V)C+=I/2,e.anchor="start";else{e.anchor="middle";var W=G/2,J=C+W-F,X=C-W;J>0&&(C-=J),X<0&&(C+=-X)}else C-=I/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(C,E)+(c?s(_):""))})),_e}function P(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=F(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=F(r,e.nameLength),""}))}return[s,l]}function R(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+L),p=f+c*(e.txwidth+L),h=0,m=e.offset,y="middle"===l;y&&(f-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",y?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var g=h+f,v=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),g=y?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),g=y?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(g),o(v)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function I(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function z(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var y,g,v=t.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=c.pointerX,g=c.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var x,b,_=i.readability(v.color,h)<1.5?p.contrast(h):v.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=y),-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:g,y2:g,"stroke-width":T,stroke:M,"stroke-dasharray":d.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:g,y2:g,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:g,r:T,fill:M}).classed("spikeline",!0)}if(f){var S,O,D=t.vLinePoint;n=D&&D.xa,a=D&&D.ya,"cursor"===n.spikesnap?(S=c.pointerX,O=c.pointerY):(S=n._offset+D.x,O=a._offset+D.y);var C,E,P=i.readability(D.color,h)<1.5?p.contrast(h):D.color,R=n.spikemode,I=n.spikethickness,z=n.spikecolor||P,N=m.getPxPosition(e,n);if(-1!==R.indexOf("toaxis")||-1!==R.indexOf("across")){if(-1!==R.indexOf("toaxis")&&(C=N,E=O),-1!==R.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,E=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:E,"stroke-width":I,stroke:z,"stroke-dasharray":d.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:E,"stroke-width":I+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==R.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?I:-I),r:I,fill:z}).classed("spikeline",!0)}}}function N(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function F(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}function U(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),f=c[0],d=c[1],p=u[0],h=u[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},{"../../lib":299,"../../lib/events":292,"../../lib/override_cursor":310,"../../lib/svg_text_utils":322,"../../plots/cartesian/axes":346,"../../registry":387,"../color":158,"../dragelement":177,"../drawing":180,"../legend/defaults":210,"../legend/draw":211,"./constants":192,"./helpers":194,"@plotly/d3":20,"fast-isnumeric":33,tinycolor2:122}],196:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var l=t.legend;function s(e){o.font[e]||(o.font[e]=l?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),l?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":299,"../color":158,"./helpers":194}],197:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":299,"./layout_attributes":199}],198:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":299,"../dragelement":177,"./attributes":189,"./calc":190,"./click":191,"./constants":192,"./defaults":193,"./helpers":194,"./hover":195,"./layout_attributes":199,"./layout_defaults":200,"./layout_global_defaults":201,"@plotly/d3":20}],199:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":374,"./constants":192}],200:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":299,"./hoverlabel_defaults":196,"./hovermode_defaults":197,"./layout_attributes":199}],201:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":299,"./hoverlabel_defaults":196,"./layout_attributes":199}],202:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===M("pattern")&&(d=!0);y._hasSubplotGrid=d;var x,b,_="top to bottom"===M("roworder"),w=d?.2:.1,T=d?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),y._domains={x:u("x",M,w,x,v),y:u("y",M,T,b,g,_)}}else delete t.grid}function M(e,t){return n.coerce(r,y,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(h){var x=d.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1===_&&(t.legend=void 0),(!1!==_||f.uirevision)&&(p("uirevision",t.uirevision),!1!==_)){p("bgcolor",t.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,T,M,k=a.coerceFont(p,"font",t.font),A="h"===p("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(T=1.1,M="bottom"):(T=-.1,M="top")):(w=1.02,T=1,M="auto"),p("traceorder",x),c.isGrouped(t.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",T),p("yanchor",M),p("valign"),a.noneOrAll(f,d,["x","y"]),p("title.text")){p("title.side",A?"left":"top");var L=a.extendFlat({},k,{size:a.bigFont(k.size)});a.coerceFont(p,"title.font",L)}}}},{"../../lib":299,"../../plot_api/plot_template":335,"../../plots/attributes":342,"../../plots/layout_attributes":378,"../../registry":387,"./attributes":208,"./helpers":214}],211:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,y=h.FROM_TL,g=h.FROM_BR,v=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r){var n=e[0],a=n.width,i=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===i?t._maxWidth*o:r+(o||a)}function w(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function T(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(d?M(n,h):n);var y=r.itemwidth+2*p.itemGap;f.positionText(m,y,0),d?m.call(f.makeEditable,{gd:t,text:n}).call(A,e,t,r).on("edit",(function(n){this.text(M(n,h)).call(A,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):A(m,e,t,r)}function M(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(t,r,e,o,n.event)}})))}function A(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*m;if(o){var y=c.bBox(o);u=y.height,d=y.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var g=e.select(1===n?".legendtitletext":".legendtext"),v=f.lineCount(g),x=g.node();if(u=h*v,d=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(g,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,d-=r.itemwidth),f.positionText(g,b,-h*((v-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function L(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=v(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&v(e.calcdata,t)}var m=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var M=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),O=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),D=a.ensureSingle(M,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));D.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(M,"g","scrollbox"),E=t.title;if(t._titleWidth=0,t._titleHeight=0,E.text){var P=a.ensureSingle(C,"text","legendtitletext");P.attr("text-anchor","start").call(c.font,E.font).text(E.text),A(P,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var R=a.ensureSingle(M,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),I=C.selectAll("g.groups").data(l);I.enter().append("g").attr("class","groups"),I.exit().remove();var z=I.selectAll("g.traces").data(a.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(T,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u="fraction"===a.entrywidthmode,f=a.borderwidth,d=2*f,h=p.itemGap,m=a.itemwidth+2*h,y=2*(f+h),g=S(a),v=a.y<0||0===a.y&&"top"===g,x=a.y>1||1===a.y&&"bottom"===g,w=a.tracegroupgap,T={};a._maxHeight=Math.max(v||x?i.height/2:o.h,30);var M=0;a._width=0,a._height=0;var k=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,f+k[0],f+k[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),M=m+a._width,a._width+=h+m+d,a._height+=y,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=L(a),O=a.x<0||0===a.x&&"right"===A,D=a.x>1||1===a.x&&"left"===A,C=x||v,E=i.width/2;a._maxWidth=Math.max(O?C&&"left"===A?o.l+o.w:E:D?C&&"right"===A?o.r+o.w:E:o.w,2*m);var P=0,R=0;r.each((function(e){var t=_(e,a,m);P=Math.max(P,t),R+=t})),M=null;var I=0;if(s){var z=0,N=0,F=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,a,m),i=r[0].height;c.setTranslate(this,k[0],k[1]+f+h+i/2+t),t+=i,e=Math.max(e,n),T[r[0].trace.legendgroup]=e}));var r=e+h;N>0&&r+f+N>a._maxWidth?(I=Math.max(I,N),N=0,F+=z+w,z=t):z=Math.max(z,t),c.setTranslate(this,N,F),N+=r})),a._width=Math.max(I,N)+f,a._height=F+z+y}else{var j=r.size(),B=R+d+(j-1)*h=a._maxWidth&&(I=Math.max(I,q),U=0,Y+=H,a._height+=H,H=0),c.setTranslate(this,k[0]+f+U,k[1]+f+Y+t/2+h),q=U+r+h,U+=n,H=Math.max(H,t)})),B?(a._width=U+d,a._height=H+y):(a._width=Math.max(I,q)+d,a._height+=H+y)}}a._width=Math.ceil(Math.max(a._width+k[0],a._titleWidth+2*(f+p.titlePad))),a._height=Math.ceil(Math.max(a._height+k[1],a._titleHeight+2*(f+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var V=e._context.edits,Z=V.legendText||V.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,i=e[0].trace.legendgroup,o=_(e,a,m);s&&""!==i&&(o=T[i]);var f=Z?m:M||o;l||u||(f+=h/2),c.setRect(t,0,-r/2,f,r)}))}(e,I,z,t)},function(){var l,u,m,v,x=f._size,b=t.borderwidth;if(!h){if(function(e){var t=e._fullLayout.legend,r=L(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*y[r],r:t._width*g[r],b:t._effHeight*g[n],t:t._effHeight*y[n]})}(e))return;var _=x.l+x.w*t.x-y[L(t)]*t._width,T=x.t+x.h*(1-t.y)-y[S(t)]*t._effHeight;if(f.margin.autoexpand){var k=_,A=T;_=a.constrain(_,0,f.width-t._width),T=a.constrain(T,0,f.height-t._effHeight),_!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==A&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(M,_,T)}if(R.on(".drag",null),M.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var E=t._effHeight;h&&(E=t._height),D.attr({width:t._width-b,height:E-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),O.select("rect").attr({width:t._width-2*b,height:E-2*b,x:b,y:b}),c.setClipUrl(C,d,e),c.setRect(R,0,0,0,0),delete t._scrollY}else{var P,I,z,N=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-N-2*p.scrollBarMargin,j=t._height-t._effHeight,B=F/j,H=Math.min(t._scrollY||0,j);D.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),O.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+H}),c.setClipUrl(C,d,e),q(H,N,B),M.on("wheel",(function(){q(H=a.constrain(t._scrollY+n.event.deltaY/F*j,0,j),N,B),0!==H&&H!==j&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;P="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,z=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(I="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,q(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,j)}(z,P,I),N,B))}));R.call(U);var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(P=e.changedTouches[0].clientY,z=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(I=e.changedTouches[0].clientY,q(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,j)}(z,P,I),N,B))}));C.call(Y)}function q(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(R,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),O.select("rect").attr("y",b+r)}e._context.edits.legendPosition&&(M.classed("cursor-move",!0),s.init({element:M.node(),gd:e,prepFn:function(){var e=c.getTranslate(M);m=e.x,v=e.y},moveFn:function(e,r){var n=m+e,a=v+r;c.setTranslate(M,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&w(e,M,a,t,n)}}))}],e)}(e,t)}},{"../../constants/alignment":274,"../../lib":299,"../../lib/events":292,"../../lib/svg_text_utils":322,"../../plots/plots":380,"../../registry":387,"../color":158,"../dragelement":177,"../drawing":180,"./constants":209,"./get_legend_data":212,"./handle_click":213,"./helpers":214,"./style":216,"@plotly/d3":20}],212:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var g=t._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return v?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(f,"")(m)}var g=p||i.mc||f.color,v=f.pattern,x=v&&l.getPatternAttr(v.shape,0,"");if(x){var b=l.getPatternAttr(v.bgcolor,0,null),_=l.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,M=y(v.size,8,10),k=y(v.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,v.fillmode,b,_,T)}else a.call(s.fill,g);o&&s.stroke(a,i.mlc||d.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(d(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});f(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,f=n.select(this),d=c(a),p=d.colorscale,m=d.reversescale;if(p){if(!r){var y=p.length;u=0===o?p[m?y-1:0][1]:1===o?p[m?0:y-1][1]:p[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}f.attr("d",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,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,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=e[0],b=v.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(s)l.fillGroupStyle(e,t);else{var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}})),f||d){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(v,{trace:a})]}var O=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);O.enter().append("path").classed("js-line",!0),O.exit().remove(),O.attr("d",k+(d?"l"+x+",0.0001":"h"+x)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,y=!d&&!c&&!s&&u.hasText(h);function g(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||y||f){var b={},w={};if(d){b.mc=g("marker.color",x),b.mx=g("marker.symbol",x),b.mo=g("marker.opacity",i.mean,[.2,1]),b.mlc=g("marker.line.color",x),b.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:g("line.width",x,[0,10],5)}),y&&(b.tx="Aa",b.tp=g("textposition",x),b.ts=10,b.tc=g("textfont.color",x),b.tf=g("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(d?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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":299,"../../registry":387,"../../traces/pie/helpers":501,"../../traces/pie/style_one":507,"../../traces/scatter/subtypes":534,"../color":158,"../colorscale/helpers":169,"../drawing":180,"./constants":209,"@plotly/d3":20}],217:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":219}],218:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,y=(1-h)/2;for(a=0;a1?(E=["toggleHover"],P=["resetViews"]):g?(C=["zoomInGeo","zoomOutGeo"],E=["hoverClosestGeo"],P=["resetGeo"]):y?(E=["hoverClosest3d"],P=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],E=["toggleHover"],P=["resetViewMapbox"]):b?E=["hoverClosestGl2d"]:v?E=["hoverClosestPie"]:k?(E=["hoverClosestCartesian","hoverCompareCartesian"],P=["resetViewSankey"]):E=["toggleHover"];m&&(E=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=N[r+1];else if(e=n.pmax)t=N[r+1];else if(e=0;M--){var k=r.append("path").attr(y).style("opacity",M?.1:g).call(o.stroke,x).call(o.fill,v).call(l.dashLine,M?"solid":_,M?4+b:b);if(h(k,e,i),w){var A=s(e.layout,"selections",i);k.style({cursor:"move"});var L={element:k.node(),plotinfo:p,gd:e,editHelpers:A,isActiveSelection:!0},S=n(c,e);a(S,k,L)}else k.style("pointer-events",M?"all":"none");T[M]=k}var O=T[0];T[1].node().addEventListener("click",(function(){return function(e,t){if(!d(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void m(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=m,f(e)}}(e,O)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;l.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function m(e){d(e)&&(e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,f(e)))}t.exports={draw:f,drawOne:p,activateLastSelection:function(e){if(!d(e))return;var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=m,f(e)}}},{"../../plot_api/plot_template":335,"../color":158,"../drawing":180,"../shapes/display_outlines":252,"../shapes/draw_newshape/helpers":257,"../shapes/handle_outline":259,"../shapes/helpers":260}],242:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":293,"../../drawing/attributes":179}],243:[function(e,t,r){"use strict";t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],244:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers").selectMode,a=e("../../shapes/handle_outline").clearOutline,i=e("../../shapes/draw_newshape/helpers"),o=i.readPaths,l=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var i=r.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,f=t.plotinfo,d=f.xaxis,p=f.yaxis,h=t.isActiveSelection,m=t.dragmode,y=(c.layout||{}).selections||[];if(!n(m)&&void 0!==h){var g=c._fullLayout._activeSelectionIndex;if(g-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(g)){Z(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=K(_))){for(o&&o.remove(),y=0;y=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,l=p(r),s=m(r);if(l||s){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&a._fullLayout._outlining)l&&(c=T(f,e)),c&&i.call("_guiRelayout",a,{shapes:c}),s&&!H(e)&&(u=M(f,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&k(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function W(e){return e._id}function J(e,t,r,n){if(!e.calcdata)return[];var a,i,o,l=[],s=t.map(W),c=r.map(W);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function $(e,t,r){var n,a;for(n=0;n-1&&t;if(!i&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ce(te);ue([D(e,ne,"x"),D(e,pe,"y")])(Q,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&fe(e,Q),d._reselect=!1}if(!i&&d._deselect){var me=d._deselect;(function(e,t,r){for(var n=0;n=0)M._fullLayout._deactivateShape(M);else if(!x){var r=k.clickmode;O.done(ke).then((function(){if(O.clear(ke),2===e){for(be.remove(),K=0;K-1&&U(t,M,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&fe(M,void 0);s.click(M,t)})).catch(A.error)}},n.doneFn=function(){Me.remove(),O.done(ke).then((function(){O.clear(ke),!L&&X&&n.selectionDefs&&(X.subtract=xe,n.selectionDefs.push(X),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,W)),(L||x)&&G(n,L),n.doneFnCompleted&&n.doneFnCompleted(Ae),b&&fe(M,ie)})).catch(A.error)}},clearOutline:x,clearSelectionsCache:G,selectOnClick:U}},{"../../lib":299,"../../lib/clear_gl_canvases":287,"../../lib/polygon":311,"../../lib/throttle":323,"../../plot_api/subroutines":336,"../../plots/cartesian/axis_ids":350,"../../registry":387,"../color":158,"../dragelement/helpers":176,"../drawing":180,"../fx":198,"../fx/helpers":194,"../shapes/constants":250,"../shapes/display_outlines":252,"../shapes/draw_newshape/helpers":257,"../shapes/draw_newshape/newshapes":258,"../shapes/handle_outline":259,"../shapes/helpers":260,"./constants":239,"./draw":241,"./draw_newselection/newselections":244,"./helpers":245,"point-in-polygon/nested":75,polybooljs:76}],248:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":275,"../../lib/extend":293,"../../plot_api/plot_template":335,"../../traces/scatter/attributes":509,"../annotations/attributes":141,"../drawing/attributes":179}],249:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,m=d>0?d+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o1&&(2!==e.length||"Z"!==e[1][0])&&(0===S&&(e[0][0]="M"),t[L]=e,T(),M())}}()}}function F(e,r){!function(e,r){if(t.length)for(var n=0;nx?(M=f,S="y0",k=x,O="y1"):(M=x,S="y1",k=f,O="y0");J(n),$(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===P?X:K,W.altKey=n.altKey},doneFn:function(){if(v(e))return;p(t),Q(l),_(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(v(e))return;Q(l)}};function J(r){if(v(e))P=null;else if(z)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=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!N&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),P=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=V(b+n)):(o=function(e){return V(Y(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),I?F("yanchor",r.yanchor=Z(T+a)):(s=function(e){return Z(q(e)+a)},H&&"date"===H.type&&(s=m.encodeDate(s))),F("path",r.path=w(E,o,s))}else R?F("xanchor",r.xanchor=V(b+n)):(F("x0",r.x0=V(c+n)),F("x1",r.x1=V(g+n))),I?F("yanchor",r.yanchor=Z(T+a)):(F("y0",r.y0=Z(f+a)),F("y1",r.y1=Z(x+a)));t.attr("d",y(e,r)),$(l,r)}function K(n,a){if(N){var i=function(e){return e},o=i,s=i;R?F("xanchor",r.xanchor=V(b+n)):(o=function(e){return V(Y(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),I?F("yanchor",r.yanchor=Z(T+a)):(s=function(e){return Z(q(e)+a)},H&&"date"===H.type&&(s=m.encodeDate(s))),F("path",r.path=w(E,o,s))}else if(z){if("resize-over-start-point"===P){var u=c+n,d=I?f-a:f+a;F("x0",r.x0=R?u:V(u)),F("y0",r.y0=I?d:Z(d))}else if("resize-over-end-point"===P){var p=g+n,h=I?x-a:x+a;F("x1",r.x1=R?p:V(p)),F("y1",r.y1=I?h:Z(h))}}else{var v=function(e){return-1!==P.indexOf(e)},_=v("n"),B=v("s"),U=v("w"),G=v("e"),W=_?M+a:M,J=B?k+a:k,X=U?A+n:A,K=G?L+n:L;I&&(_&&(W=M-a),B&&(J=k-a)),(!I&&J-W>10||I&&W-J>10)&&(F(S,r[S]=I?W:Z(W)),F(O,r[O]=I?J:Z(J))),K-X>10&&(F(D,r[D]=R?X:V(X)),F(C,r[C]=R?K:V(K)))}t.attr("d",y(e,r)),$(l,r)}function $(e,t){(R||I)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=Y(R?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=q(I?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),R&&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(R){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 Q(e){e.selectAll(".visual-cue").remove()}d.init(W),G.node().onmousemove=J}(e,R,s,t,r,P):!0===s.editable&&R.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");R.node().addEventListener("click",(function(){return function(e,t){if(!x(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,g(e)}}(e,R)}))}}function _(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){x(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,g(e)))}t.exports={draw:g,drawOne:b,eraseActiveShape:function(e){if(!x(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&sp&&(e="X"),e}));return i>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),u+h}))}(t,l,c);if("pixel"===t.xsizemode){var b=l(t.xanchor);u=b+t.x0,f=b+t.x1}else u=l(t.x0),f=l(t.x1);if("pixel"===t.ysizemode){var _=c(t.yanchor);d=_-t.y0,p=_-t.y1}else d=c(t.y0),p=c(t.y1);if("line"===h)return"M"+u+","+d+"L"+f+","+p;if("rect"===h)return"M"+u+","+d+"H"+f+"V"+p+"H"+u+"Z";var w=(u+f)/2,T=(d+p)/2,M=Math.abs(w-u),k=Math.abs(T-d),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}},{"../../lib":299,"../../plots/cartesian/axes":346,"./constants":250}],261:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":357,"./attributes":248,"./calc_autorange":249,"./defaults":251,"./draw":253,"./draw_newshape/defaults":256}],262:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":293,"../../plot_api/edit_types":328,"../../plot_api/plot_template":335,"../../plots/animation_attributes":340,"../../plots/font_attributes":374,"../../plots/pad_attributes":379,"./constants":263}],263:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],264:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function O(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function D(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(k,t,e,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 C(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,y(t))}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,g);s.enter().append("g").classed(f.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||d<0){var g={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(g[0],g[1]))}}}return z.call(N),P&&(S?z.on(".opacity",null):(k=0,A=!0,z.text(v).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)}))),z.call(f.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,g,t,x):o.call("_guiRelayout",e,g,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(N)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),z.classed("js-placeholder",A),T}}},{"../../constants/alignment":274,"../../constants/interactions":278,"../../lib":299,"../../lib/svg_text_utils":322,"../../plots/plots":380,"../../registry":387,"../color":158,"../drawing":180,"@plotly/d3":20,"fast-isnumeric":33}],268:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":293,"../../plot_api/edit_types":328,"../../plot_api/plot_template":335,"../../plots/font_attributes":374,"../../plots/pad_attributes":379,"../color/attributes":157}],269:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],270:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":299,"../../plots/array_container_defaults":341,"./attributes":268,"./constants":269}],271:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),y(e,n,a,i,t),l||g(e,n,a,i,t))}function y(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(v,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.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)),g(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function g(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,y=0,g=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=g.headerHeight+f.gapButtonHeader:h=g.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-f.gapButtonHeader+f.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-f.gapButtonHeader+f.gapButton-g.openWidth);var b={x:g.lx+h+o.pad.l,y:g.ly+y+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(v,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(g.openWidth,g.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(g.openHeight,g.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=y+g;S+A>c&&(S=c-A);var O=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=O.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var D=g>T,C=l.barWidth+2*l.barPad,E=l.barLength+2*l.barPad,P=h+m,R=y;P+C>s&&(P=s-C);var I=this.container.selectAll("rect.scrollbar-vertical").data(D?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),D?(this.vbar=I.attr({rx:l.barRadius,ry:l.barRadius,x:P,y:R,width:C,height:E}),this._vbarYMin=R+E/2,this._vbarTranslateMax=T-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,N=u-.5,F=D?f+C+.5:f+.5,j=d-.5,B=M?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+z).data(M||D?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",z).append("rect"),M||D?(this._clipRect=H.select("rect").attr({x:Math.floor(N),y:Math.floor(j),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,z,this.gd),this.bg.attr({x:h,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||D){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 Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(Y),D&&this.vbar.on(".drag",null).call(Y)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":299,"../color":158,"../drawing":180,"@plotly/d3":20}],274:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],275:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"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",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],276:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],277:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],278:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],279:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],280:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],281:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],283:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],284:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,m=s([r,n]);function y(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":306}],285:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),g=e.charAt(0);!c||"G"!==g&&"g"!==g||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:v);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),O=Number(T[11]||0);if(c){if(2===M.length)return u;var D;M=Number(M);try{var C=y.getComponentMethod("calendars","getCal")(t);if(w){var E="i"===k.charAt(k.length-1);k=parseInt(k,10),D=C.newDate(M,C.toMonthIndex(M,k,E),A)}else D=C.newDate(M,Number(k),A)}catch(e){return u}return D?(D.toJD()-m)*f+L*d+S*p+O*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var P=new Date(Date.UTC(2e3,k,A,L,S));return P.setUTCFullYear(M),P.getUTCMonth()!==k||P.getUTCDate()!==A?u:P.getTime()+O*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*f,M=3*d,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,v,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/f)+m,S=Math.floor(s(e,f));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=g("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,O={1:"1",2:"1",3:"2",4:"2"};function D(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return O[r("%q")(a)]})),_(n))try{e=y.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+D(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return D(t,e,n,a)};var E=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+E);return c.setUTCMonth(c.getUTCMonth()+t)+n-E},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&y.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+f*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,m=d*d+p*p,y=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,m,e-a,t-i),s(d,p,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":306}],297:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],298:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],299:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var m=e("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var y=e("./dates");f.dateTime2ms=y.dateTime2ms,f.isDateTime=y.isDateTime,f.ms2DateTime=y.ms2DateTime,f.ms2DateTimeLocal=y.ms2DateTimeLocal,f.cleanDate=y.cleanDate,f.isJSDate=y.isJSDate,f.formatDate=y.formatDate,f.incrementMonth=y.incrementMonth,f.dateTick0=y.dateTick0,f.dfltRange=y.dfltRange,f.findExactDates=y.findExactDates,f.MIN_MS=y.MIN_MS,f.MAX_MS=y.MAX_MS;var g=e("./search");f.findBin=g.findBin,f.sorterAsc=g.sorterAsc,f.sorterDes=g.sorterDes,f.distinctVals=g.distinctVals,f.roundUp=g.roundUp,f.sort=g.sort,f.findIndexOfMin=g.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var v=e("./stats");f.aggNums=v.aggNums,f.len=v.len,f.mean=v.mean,f.median=v.median,f.midRange=v.midRange,f.variance=v.variance,f.stdev=v.stdev,f.interp=v.interp;var x=e("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=e("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");f.log=M.log,f.warn=M.warn,f.error=M.error;var k=e("./regex");f.counterRegex=k.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?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},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return R.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var I={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(I,arguments)};var z={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(z,arguments)};var N=/^[:|\|]/;function F(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,y="xother"===l||"yother"===l||p||m||h,g=l;if((p||h)&&(g=g.substring(1)),(m||h)&&(g=g.substring(0,g.length-1)),y){if(void 0===(c=t[g]))return""}else for(d=3;d=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 j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(e,t){e.attr("transform",f.getTextTransform(t)),e.style("display",t.scale?null:"none")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var B=f.getFirefoxVersion(),H=null!==B&&B<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":279,"./anchor_utils":283,"./angles":284,"./array":285,"./clean_number":286,"./clear_responsive":288,"./coerce":289,"./dates":290,"./dom":291,"./extend":293,"./filter_unique":294,"./filter_visible":295,"./geometry2d":296,"./identity":297,"./increment":298,"./is_plain_object":300,"./keyed_container":301,"./localize":302,"./loggers":303,"./make_trace_groups":304,"./matrix":305,"./mod":306,"./nested_property":307,"./noop":308,"./notifier":309,"./preserve_drawing_buffer":312,"./push_unique":313,"./regex":315,"./relative_attr":316,"./relink_private":317,"./search":318,"./sort_object_keys":320,"./stats":321,"./throttle":323,"./to_log_range":324,"@plotly/d3":20,"d3-format":29,"d3-time-format":30,"fast-isnumeric":33}],300:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],301:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":333,"./notifier":309}],304:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":20}],305:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],307:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,m=r.length,y=r[0][0],g=r[0][1],v=0;for(u=1;uMath.max(f,y)||c>Math.max(d,g)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":279,"./matrix":305}],312:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-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":33,"is-mobile":69}],313:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":285,"fast-isnumeric":33}],322:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&t&&t._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(s),D=n.select(e.node().parentNode);if(!D.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",D.selectAll("svg."+C).remove(),D.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s,d=parseInt((MathJax.version||"").split(".")[0]);if(2!==d&&3!==d)return void a.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+a.randstr({},64),i=(s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(i):MathJax.typeset([i])},h=function(){var t=s.select(2===d?".MathJax_SVG":".MathJax"),i=!t.empty()&&s.select("svg").node();if(i){var o,l=i.getBoundingClientRect();o=2===d?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,l)}else a.log("There was an error in the tex syntax.",e),r();s.remove()};2===d?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:f},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,h,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})):3===d&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),h(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(L[2],o,(function(n,a,o){D.selectAll("svg."+C).remove(),D.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return E(),void t();var s=D.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild);var c=o.width,u=o.height;l.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=e.node().style.fill||"black",d=l.select("g");d.attr({fill:f,stroke:f});var p=d.node().getBoundingClientRect(),h=p.width,y=p.height;(h>c||y>u)&&(l.style("overflow","hidden"),h=(p=l.node().getBoundingClientRect()).width,y=p.height);var g=+e.attr("x"),v=+e.attr("y"),x=-(r||e.node().getBoundingClientRect().height)/4;if("y"===C[0])s.attr({transform:"rotate("+[-90,g,v]+")"+i(-h/2,x-y/2)});else if("l"===C[0])v=x-y/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))g=0,v=x;else{var b=e.attr("text-anchor");g-=h*("middle"===b?.5:"end"===b?1:0),v=v+x-y/2}l.attr({x:g,y:v}),m&&m.call(e,s),t(s)}))}))):E(),e}function E(){D.empty()||(C=e.attr("class")+"-math",D.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(y," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(g),D=0;D|>|>)/g;var f=[["$","$"],["\\(","\\)"]];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"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//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 M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(g),o=[],l="",s=0,c=0;ca?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(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function O(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function D(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.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 e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(g),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],324:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":33}],325:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],326:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],327:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(P.x=1.02,P.xanchor="left"):P.x<-2&&(P.x=-.02,P.xanchor="right"),P.y>3?(P.y=1.02,P.yanchor="bottom"):P.y<-2&&(P.y=-.02,P.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var v=r[""][""];if(c(v))t.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",f,v),!0;t.set(v)}return!m&&(d(y,g),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),O=S||[],D=u(g,f).get(),C=[],E=-1,P=O.length;for(x=0;xO.length-(k?0:1))i.warn("index out of range",f,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?C.push(_):k?("add"===M&&(M={}),O.splice(_,0,M),D&&D.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,M),-1===E&&(E=_);else for(b=0;b=0;x--)O.splice(C[x],1),D&&D.splice(C[x],1);if(O.length?S||t.set(O):t.set(null),m)return!1;if(d(y,g),h!==a){var R;if(-1===E)R=L;else{for(P=Math.max(O.length,P),R=[],x=0;x=E);x++)R.push(_);for(x=E;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function E(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function P(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=D(r,e.data.length-1),t)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function H(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=G(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(U(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&Y(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag,d.reselect),c.add(e,H,[e,a.undoit],H,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function U(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.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[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function Y(e,t){var r=t?function(e){var r=[];for(var n in t){var a=p.getFromId(e,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)t[i]||r.push(i)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,V=/^[xyz]axis[0-9]*\.autorange$/,Z=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function G(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=N(s._preGUI,c),h=Object.keys(t),m=p.list(e),y=o.extendDeepAll({},t),g={};for(B(t),h=Object.keys(t),n=0;n0&&"string"!=typeof P.parts[I];)I--;var F=P.parts[I],j=P.parts[I-1]+"."+F,H=P.parts.slice(0,I).join("."),U=l(e.layout,H).get(),Y=l(s,H).get(),G=P.get();if(void 0!==R){A[E]=R,L[E]="reverse"===F?R:z(G);var J=f.getLayoutValObject(s,P.parts);if(J&&J.impliedEdits&&null!==R)for(var X in J.impliedEdits)S(o.relativeAttr(E,X),J.impliedEdits[X]);if(-1!==["width","height"].indexOf(E))if(R){S("autosize",null);var K="height"===E?"width":"height";S(K,s[K])}else s[E]=e._initialAutoSize[E];else if("autosize"===E)S("width",R?null:s.width),S("height",R?null:s.height);else if(j.match(q))C(j),l(s,H+"._inputRange").set(null);else if(j.match(V)){C(j),l(s,H+"._inputRange").set(null);var $=l(s,H).get();$._inputDomain&&($._input.domain=$._inputDomain.slice())}else j.match(Z)&&l(s,H+"._inputDomain").set(null);if("type"===F){O=U;var Q="linear"===Y.type&&"log"===R,ee="log"===Y.type&&"linear"===R;if(Q||ee){if(O&&O.range)if(Y.autorange)Q&&(O.range=O.range[1]>O.range[0]?[1,2]:[2,1]);else{var te=O.range[0],re=O.range[1];Q?(te<=0&&re<=0&&S(H+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(H+".range[0]",Math.log(te)/Math.LN10),S(H+".range[1]",Math.log(re)/Math.LN10)):(S(H+".range[0]",Math.pow(10,te)),S(H+".range[1]",Math.pow(10,re)))}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")(e,Y,R,S),u.getComponentMethod("images","convertCoords")(e,Y,R,S)}else S(H+".autorange",!0),S(H+".range",null);l(s,H+"._inputRange").set(null)}else if(F.match(M)){var ne=l(s,E).get(),ae=(R||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(E);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=J||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(R)?L[E]=null:b.isRemoveVal(R)?L[E]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),g[r]||(g[r]={});var se=g[r][n];se||(se=g[r][n]={}),se[oe]=R,delete t[E]}else"reverse"===F?(U.range?U.range.reverse():(S(H+".autorange",!0),U.range=[1,0]),Y.autorange?k.calc=!0:k.plot=!0):("dragmode"===E&&(!1===R&&!1!==G||!1!==R&&!1===G)||s._has("scatter-like")&&s._has("regl")&&"dragmode"===E&&("lasso"===R||"select"===R)&&"lasso"!==G&&"select"!==G||s._has("gl2d")?k.plot=!0:J?T.update(k,J):k.calc=!0,P.set(R))}}for(r in g){b.applyContainerArrayChanges(e,d(i,r),g[r],k,d)||(k.plot=!0)}for(var ce in D){var ue=(O=p.getFromId(e,ce))&&O._constraintGroup;if(ue)for(var fe in k.calc=!0,ue)D[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:D,undoit:L,redoit:A,eventData:y}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=G(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),U(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&Y(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag,d.reselect),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function X(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],$=[{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 Q(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,m,y=0;function g(e){return Array.isArray(a)?y>=a.length?e.transitionOpts=a[y]:e.transitionOpts=a[0]:e.transitionOpts=a,y++,e}var v=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))v.push({type:"object",data:g(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);v=k}}v.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,y=(u[m]||h[m]||{}).name,g=t[n].name,v=u[y]||h[y];y&&g&&"number"==typeof g&&v&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[y]||h[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&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[m]={name:m},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!v(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function v(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return g(a,t,l)},r.getLayoutValObject=function(e,t){return g(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":299,"../plots/attributes":342}],336:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,y=h.clean,g=e("../plots/cartesian/autorange").doAutoRange;function v(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,y=e._fullLayout,g=y._size,x=g.p,_=d.list(e,"",!0);if(y._paperdiv.style({width:e._context.responsive&&y.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":y.width+"px",height:e._context.responsive&&y.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),e._context.setBackground(e,y.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!y._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:g.t+g.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:g.l+g.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(y.paper_bgcolor)&&1===s.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(a in y._plots)if((l=y._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var O=l.xaxis.domain,D=l.yaxis.domain,C=l.plotgroup;if(v(O,D,L)){var E=C.node(),P=l.bg=o.ensureSingle(C,"rect","bg");E.insertBefore(P.node(),E.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([O,D]),S||(k.push(a),A.push(a))}var R,I,z,N,F,j,B,H,U,Y,q,V,Z,G=y._bgLayer.selectAll(".bg").data(k);for(G.enter().append("rect").classed("bg",!0),G.exit().remove(),G.each((function(e){y._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&y(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(g)}},{"../lib":299,"../plots/attributes":342,"../plots/plots":380,"./plot_config":333,"./plot_schema":334,"./plot_template":335}],338:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function m(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var y={};function g(e,r){return o.coerce(t,y,f,e,r)}var v=g("format"),x=g("width"),b=g("height"),_=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},d);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function O(){return new Promise((function(e,t){var r=s(M,v,_),n=M._fullLayout.width,f=M._fullLayout.height;function d(){a.purge(M),document.body.removeChild(M)}if("full-json"===v){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),d(),e(T?p:l.encodeJSON(p))}if(d(),"svg"===v)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:v,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(O).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":299,"../plots/plots":380,"../snapshot/helpers":391,"../snapshot/svgtoimg":393,"../snapshot/tosvg":395,"../version":561,"./plot_api":332,"fast-isnumeric":33}],339:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;dx.length&&a.push(h("unused",i,g.concat(x.length)));var k,A,L,S,O,D=x.length,C=Array.isArray(M);if(C&&(D=Math.min(D,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,g.concat(A,x[A].length)));var E=x[A].length;for(k=0;k<(C?Math.min(E,M[A].length):E);k++)L=C?M[A][k]:M,S=v[A][k],O=x[A][k],n.validate(S,L)?O!==S&&O!==+S&&a.push(h("dynamic",i,g.concat(A,k),S,O)):a.push(h("value",i,g.concat(A,k),S))}else a.push(h("array",i,g.concat(A),v[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],y=i(m,d)||0,g=[],v=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,d);for(;M<=k;)M=o(M,c,d);T=o(M,-c,d)}else{for(M=y+(w=Math.round((k-y)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}g[_]=p?T:h?M:(T+M)/2,v[_]=T,x[_]=M}return{vals:g,starts:v,ends:x}}},{"../../constants/numerical":279,"../../lib":299,"fast-isnumeric":33}],344:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],345:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,y=f[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>O?M/T>D&&(_=x,w=b,D=M/T):M/S>D&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},D=M/S));if(d===y){var C=d-1,E=d+1;if(A)if(0===d)a=[0,1];else{var P=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),R=d/(1-Math.min(.5,P/S));a=d>0?[0,R]:[R,0]}else a=L?[Math.max(0,C),Math.max(1,E)]:[C,E]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-D*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),D=(w.val-_.val-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-D*l(_),w.val+D*s(w)];return g&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),O=k(r.vpadminus||r.vpad);if(!T){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=E;n--)C(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":180,"../../constants/numerical":279,"../../lib":299,"../../registry":387,"./axis_ids":350,"@plotly/d3":20,"fast-isnumeric":33}],346:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,O=m.ONEMIN,D=m.ONESEC,C=m.MINUS_SIGN,E=m.BADNUM,P={K:"zeroline"},R={K:"gridline",L:"path"},I={K:"minor-gridline",L:"path"},z={K:"tick",L:"path"},N={K:"tick",L:"text"},F={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j=e("../../constants/alignment"),B=j.MID_SHIFT,H=j.CAP_SHIFT,U=j.LINE_SPACING,Y=j.OPPOSITE_SIDE,q=t.exports={};q.setConvert=e("./set_convert");var V=e("./axis_autotype"),Z=e("./axis_ids"),G=Z.idSort,W=Z.isLinked;q.id2name=Z.id2name,q.name2id=Z.name2id,q.cleanId=Z.cleanId,q.list=Z.list,q.listIds=Z.listIds,q.getFromId=Z.getFromId,q.getFromTrace=Z.getFromTrace;var J=e("./autorange");q.getAutoRange=J.getAutoRange,q.findExtremes=J.findExtremes;function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}q.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},q.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},q.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==q.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=q.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},q.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:q.getFromId(t,r).cleanPos)(e)},q.redrawComponents=function(e,t){t=t||q.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;ur&&f2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},q.saveRangeInitial=function(e,t){for(var r=q.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=q.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=q.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=q.tickIncrement(e,r);if(s<=n)return s}return e}(v,e,g,c,i)),y=v,0;y<=u;)y=q.tickIncrement(y,g,!1,i);return{start:t.c2r(v,0,i),end:t.c2r(y,0,i),size:g,_dataSpan:u-c}},q.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,i=t.dtick&&a(t._tmin);if(i){var o=q.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var s=l.simpleMap(t.range,t.r2l);n=[s[0],.8*s[0]+.2*s[1]]}if(e.range=l.simpleMap(n,t.l2r),e._isMinor=!0,q.prepTicks(e,r),i){var c=a(t.dtick),u=a(e.dtick),f=c?t.dtick:+t.dtick.substring(1),d=u?e.dtick:+e.dtick.substring(1);c&&u?ee(f,d)?f===2*k&&d===2*A&&(e.dtick=k):f===2*k&&d===3*A?e.dtick=k:f!==k||(t._input.minor||{}).nticks?te(f/d,2.5)?e.dtick=f/2:e.dtick=f:e.dtick=A:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ee(f,d)?f>=12&&2===d&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ee(f,d)||(e.dtick=te(f/d,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},q.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,q.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=q.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dtick=(P?0:1);R--){var I=!R;R?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var z=R?e:l.extendFlat({},e,e.minor);if(I?q.prepMinorTicks(z,e,t):q.prepTicks(z,t),"array"!==z.tickmode){var N=X(u),F=N[0],j=N[1],B=a(z.dtick),H="log"===i&&!(B||"L"===z.dtick.charAt(0)),U=q.tickFirst(z,t);if(R){if(e._tmin=U,U=j:G<=j;G=q.tickIncrement(G,W,f,o)){if(R&&Y++,z.rangebreaks&&!f){if(G=p)break}if(D.length>h||G===Z)break;Z=G;var J={value:G};R?(H&&G!==(0|G)&&(J.simpleLabel=!0),s>1&&Y%s&&(J.skipLabel=!0),D.push(J)):(J.minor=!0,C.push(J))}}else R?(D=[],m=ne(e)):(C=[],O=ne(e))}if(P&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=D.map((function(e){return e.value})),$=[],Q=0;Q0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=v?d=u>=v&&u<=y?u:g:r===b&&f>=_?d=u>=_&&u<=x?u:b:f>=M?d=u>=M&&u<=w?u:T:r===k&&f>=k?d=k: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(t.rangebreaks&&d>0){for(var h=0,m=0;m<84;m++){var O=(m+.5)/84;t.maskBreaks(a*(1-O)+O*p)!==E&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>k&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(D,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),oe=1;"auto"===e.tickmode&&(oe=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=D.length-1;r>-1;r--)if(D[r].drop)D.splice(r,1);else{D[r].value=Ee(D[r].value,e);var se=e.c2p(D[r].value);(ie?le>se-oe:lep||uep&&(ce.periodX=p),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=O&&i<=16||t>=S)e._tickround="M";else if(t>=D&&i<=19||t>=O)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(me(e.exponentformat)&&!ye(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}q.autoTicks=function(e,t,r){var n;function i(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var o=2*t;if(o>g)t/=g,n=i(10),e.dtick="M"+12*fe(t,n,ae);else if(o>T)t/=T,e.dtick="M"+fe(t,1,ie);else if(o>A){if(e.dtick=fe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:le),!r){var s=q.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(s)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else o>S?e.dtick=fe(t,S,ie):o>O?e.dtick=fe(t,O,oe):o>D?e.dtick=fe(t,D,oe):(n=i(10),e.dtick=fe(t,n,ae))}else if("log"===e.type){e.tick0=0;var u=l.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=i(10),e.dtick="L"+fe(t,n,ae)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Ce(e)?(e.tick0=0,n=1,e.dtick=fe(t,n,ue)):(e.tick0=0,n=i(10),e.dtick=fe(t,n,ae));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},q.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ce:se,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},q.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=ge(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||me(p)&&ye(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":C)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":C)+d:(t.text=ge(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):Ce(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=ge(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=ge(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=ge(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var y=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[y(o.x-.5),y(o.x+e.dtick-.5)]}return o},q.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return q.hoverLabelText(e,n,r)+" - "+q.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=q.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var he=["f","p","n","\u03bc","m","","k","M","G","T"];function me(e){return"SI"===e||"B"===e}function ye(e){return e>14||e<-15}function ge(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=q.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};de(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":me(s)&&(e+=he[c/3+5]));return i?C+e:e}function ve(e,t){if(e){var r=Object.keys(F).reduce((function(e,r){return-1!==t.indexOf(r)&&F[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function xe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var y=r.right-(t._offset+t._length);y>0&&(n.xr=1,n.r=y);var g=t._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var v=r.bottom-(t._offset+t._length);v>0&&(n.yb=0,n.b=v);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=we(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ae&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ve(n,t.automargin),ve(a,t.automargin)),i.autoMargin(e,ke(t),n),i.autoMargin(e,Ae(t),a),i.autoMargin(e,Le(t),l)})),r.skipTitle||ae&&"bottom"===t.side||re.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+we(t);else{var l=Pe(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,m=q.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,f="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var y=t._selections[t._id+"tick"];if(h={selection:y,side:t.side},y&&y.node()&&y.node().parentNode){var g=d.getTranslate(y.node().parentNode);h.offsetLeft=g.x,h.offsetTop=g.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(re)}}function ie(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=Me(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},q.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],a=e.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},q.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},q.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},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=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*H,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-H));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(be(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(be(t)))}},q.makeTickPath=function(e,t,r,n){n||(n={});var a=n.minor;if(a&&!e.minor)return"";var i=void 0!==n.len?n.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*r)+"v"+i*r:"M"+(t+l*r)+",0h"+i*r},q.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=d?e.ticklen:0;if(f?m*=-1:u&&(m=0),d&&(p+=m,r)){var y=l.deg2rad(r);p=m*Math.cos(y)+1,h=m*Math.sin(y)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var g,v,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!f&&"bottom"===M||f&&"top"===M)?1:-1,f&&(b*=-1),g=h*b,v=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(f?x+=B:x=-90===A&&"bottom"===M?H:90===A&&"top"===M?B:.5,T=B/2*(A/90)),w.xFn=function(e){return e.dx+g+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===k){if(b=(_=!f&&"left"===M||f&&"right"===M)?1:-1,f&&(b*=-1),g=p,v=h*b,x=0,f||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?H:.5),f){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*H*b,x=0}}w.xFn=function(e){return e.dx+t-(g+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*B},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},q.drawTicks=function(e,t,r){r=r||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,_e);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return d.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Re(t,[z]),o.attr("transform",r.transFn)},q.drawGrid=function(e,t,r){r=r||{};var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?r.vals.filter((function(e){return e.minor})):[],l=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],s=r.counterAxis;if(s&&q.shouldShowZeroLine(e,t,s))for(var c="array"===t.tickmode,u=0;u=0;g--){var v=g?m:y;if(v){var x=v.selectAll("path."+a).data(g?l:o,_e);x.exit().remove(),x.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return d.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}Re(t,[R,I])},q.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=q.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return G(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Re(t,[P])},q.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,m=r.secondary?0:t.tickangle,y=(t._prevTickAngles||{})[f],g=r.layer.selectAll("g."+f).data(t.showticklabels?p:[],_e),v=[];function x(e,i){e.each((function(e){var o=n.select(this),l=o.select(".text-math-group"),u=h.anchorFn(e,i),f=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=c.lineCount(o),m=U*e.fontSize,y=h.heightFn(e,a(i)?+i:0,(p-1)*m);if(y&&(f+=s(0,y)),l.empty()){var g=o.select("text");g.attr({transform:f,"text-anchor":u}),g.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var v=d.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr("transform",f+s(v,0))}}))}g.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(d.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?v.push(e._promises.pop().then((function(){x(r,m)}))):x(r,m)})),Re(t,[N]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),s=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=l.simpleMap(t.range,t.r2l);s=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var f=Math.min(s,c),p=Math.max(s,c),h=t.side,m=1/0,y=-1/0;for(var v in g.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=d.bBox(r.node()),l=0;o?(i.right>p||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(g,y+1?y:m);var b=null;t._selections&&(t._selections[f]=g);var _=[function(){return v.length&&Promise.all(v)}];t.automargin&&i._redrawFromAutoMarginCount&&90===y?(b=90,_.push((function(){x(g,y)}))):_.push((function(){if(x(g,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(g.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=Me(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"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),y=f("left"),v=f("right"),_=f("bottom")||y||h||v?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var y="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,y)?"category":function(e,t){for(var r=e.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=y;break}var f=a("pattern",u);if(f===y)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case y:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case g:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":387,"./constants":353}],351:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function y(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rP&&NC&&(C=N);d/=(C-D)/(2*E),D=s.l2r(D),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(e,t,a,i)}function U(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function Y(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(e){E&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),E=!1)}function V(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function Z(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(Y(a),2!==e||ge||qe(),ye)o.indexOf("select")>-1&&L(r,a,X,K,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ge){var l=m?P:E,c="s"===m||"w"===g?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",y="middle";if(l.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===g&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:y}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Re(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,Oe.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),Oe.attr("d",V(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,Oe.attr("d",V(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":299,"fast-isnumeric":33}],363:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,l=n(e);r("tickprefix")&&r("showtickprefix",l),r("ticksuffix",o)&&r("showticksuffix",l)}},{"./show_dflt":366}],364:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":274}],365:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,y=p.LOG_CLIP,g=p.ONEWEEK,v=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function O(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function D(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function E(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function P(t){if(e._categoriesMap)return e._categoriesMap[t]}function R(e){var t=P(e);return void 0!==t?t:l(e)?+e:void 0}function I(e){return l(e)?+e:P(e)}function z(e,t,r){return n.round(r+t*e,2)}function N(e,t,r){return(e-r)/t}var F=function(t){return l(t)?z(t,e._m,e._b):m},j=function(t){return N(t,e._m,e._b)};if(e.rangebreaks){var B="y"===p;F=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);var n=B;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?z(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return N(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return N(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:f,e.l2c="log"===e.type?A:f,e.l2p=F,e.p2l=j,e.c2p="log"===e.type?function(e,t){return F(S(e,t))}:F,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=O,e.c2d=e.c2r=e.l2d=e.l2r=D,e.d2p=e.r2p=function(t,r,n){return e.l2p(O(t,0,n))},e.p2d=e.p2r=function(e,t,r){return D(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=E,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=I(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=I,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=R,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=P,e.l2r=e.c2r=f,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function y(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),y=h[1]-h[0],g=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*g/y),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(d){var v=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=v[1]-v[0],_=x[1]-x[0];p[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(v[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(v[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,T=d?u/p[3]:1,M=f?p[0]:0,k=d?p[1]:0,A=f?p[0]/p[2]*c:0,L=d?p[1]/p[3]*u:0,S=a._offset-A,O=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,O).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":180,"../../lib":299,"../../registry":387,"./axes":346,"@plotly/d3":20}],371:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.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=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&R.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&R.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(d,s,f,n),b.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),H=!(!n._has||!n._has("cartesian"))||j,U=!(!s._has||!s._has("cartesian"))||B;H&&!U?n._bgLayer.remove():U&&!H&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var f=1-2*l;n=Math.round(f*n),a=Math.round(f*a)}}var d=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(p){var v=(r.t+r.b)/p;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:x,size:r.l+y},r:{val:_,size:r.r+y},b:{val:T,size:r.b+y},t:{val:w,size:r.t+y}},m[t]=1}else delete h[t],delete m[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),D(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,m=t._pushmargin,y=t._pushmarginIds,g=t.minreducedwidth,v=t.minreducedheight;if(!1!==t.margin.autoexpand){for(var x in m)y[x]||delete m[x];for(var _ in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},m){var w=m[_].l||{},T=m[_].b||{},M=w.val,k=w.size,A=T.val,L=T.size;for(var S in m){if(o(k)&&m[S].r){var O=m[S].r.val,C=m[S].r.size;if(O>M){var E=(k*O+(C-r)*M)/(O-M),P=(C*(1-M)+(k-r)*(1-O))/(O-M);E+P>c+f&&(c=E,f=P)}}if(o(L)&&m[S].t){var R=m[S].t.val,I=m[S].t.size;if(R>A){var z=(L*R+(I-n)*A)/(R-A),N=(I*(1-A)+(L-n)*(1-R))/(R-A);z+N>h+d&&(h=z,d=N)}}}}}var F=u.constrain(r-i.l-i.r,2,g),j=u.constrain(n-i.t-i.b,2,v),B=Math.max(0,r-F),H=Math.max(0,n-j);if(B){var U=(c+f)/B;U>1&&(c/=U,f/=U)}if(H){var Y=(h+d)/H;Y>1&&(h/=Y,d/=Y)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var q=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(R(o,c,f),a=0;a0){for(var n=[],a=0;a=u&&(d.min=0,h.min=0,y.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function m(e,t,r,n){var a=d[t._name];function o(r,n){return i.coerce(e,t,a,r,n)}o("uirevision",n.uirevision),t.type="linear";var p=o("color"),h=p!==a.color.dflt?p:r.font.color,m=t._name.charAt(0).toUpperCase(),y="Component "+m,g=o("title.text",y);t._hovertitle=g===y?g:m,i.coerceFont(o,"title.font",{family:r.font.family,size:i.bigFont(r.font.size),color:h}),o("min"),u(e,t,o,"linear"),s(e,t,o,"linear"),l(e,t,o,"linear"),c(e,t,o,{outerTicks:!0}),o("showticklabels")&&(i.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:h}),o("tickangle"),o("tickformat")),f(e,t,o,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),o("hoverformat"),o("layer")}t.exports=function(e,t,r){o(e,t,r,{type:"ternary",attributes:d,handleDefaults:h,font:t.font,paper_bgcolor:t.paper_bgcolor})}},{"../../components/color":158,"../../lib":299,"../../plot_api/plot_template":335,"../cartesian/line_grid_defaults":361,"../cartesian/prefix_suffix_defaults":363,"../cartesian/tick_label_defaults":367,"../cartesian/tick_mark_defaults":368,"../cartesian/tick_value_defaults":369,"../subplot_defaults":381,"./layout_attributes":384}],386:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("tinycolor2"),i=e("../../registry"),o=e("../../lib"),l=o.strTranslate,s=o._,c=e("../../components/color"),u=e("../../components/drawing"),f=e("../cartesian/set_convert"),d=e("../../lib/extend").extendFlat,p=e("../plots"),h=e("../cartesian/axes"),m=e("../../components/dragelement"),y=e("../../components/fx"),g=e("../../components/dragelement/helpers"),v=g.freeMode,x=g.rectMode,b=e("../../components/titles"),_=e("../../components/selections").prepSelect,w=e("../../components/selections").selectOnClick,T=e("../../components/selections").clearOutline,M=e("../../components/selections").clearSelectionsCache,k=e("../cartesian/constants");function A(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=A;var L=A.prototype;L.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},L.plot=function(e,t){var r=t[this.id],n=t._size;this._hasClipOnAxisFalse=!1;for(var a=0;aS*b?a=(i=b)*S:i=(a=x)/S,o=g*a/x,s=v*i/b,r=t.l+t.w*m-a/2,n=t.t+t.h*(1-y)-i/2,p.x0=r,p.y0=n,p.w=a,p.h=i,p.sum=_,p.xaxis={type:"linear",range:[w+2*M-_,_-w-2*T],domain:[m-o/2,m+o/2],_id:"x"},f(p.xaxis,p.graphDiv._fullLayout),p.xaxis.setScale(),p.xaxis.isPtWithinRange=function(e){return e.a>=p.aaxis.range[0]&&e.a<=p.aaxis.range[1]&&e.b>=p.baxis.range[1]&&e.b<=p.baxis.range[0]&&e.c>=p.caxis.range[1]&&e.c<=p.caxis.range[0]},p.yaxis={type:"linear",range:[w,_-T-M],domain:[y-s/2,y+s/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var k=p.yaxis.domain[0],A=p.aaxis=d({},e.aaxis,{range:[w,_-T-M],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});f(A,p.graphDiv._fullLayout),A.setScale();var L=p.baxis=d({},e.baxis,{range:[_-w-M,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:a});f(L,p.graphDiv._fullLayout),L.setScale();var O=p.caxis=d({},e.caxis,{range:[_-w-T,M],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[k,k+s*S],anchor:"free",position:0,_id:"y",_length:a});f(O,p.graphDiv._fullLayout),O.setScale();var D="M"+r+","+(n+i)+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDef.select("path").attr("d",D),p.layers.plotbg.select("path").attr("d",D);var C="M0,"+i+"h"+a+"l-"+a/2+",-"+i+"Z";p.clipDefRelative.select("path").attr("d",C);var E=l(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",E),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 R=l(r+a/2,n)+"rotate(30)"+l(0,-A._offset);p.layers.aaxis.attr("transform",R),p.layers.agrid.attr("transform",R);var I=l(r+a/2,n)+"rotate(-30)"+l(0,-O._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",O.showline?"M"+(r+a/2)+","+n+"l"+a/2+","+i:"M0,0").call(c.stroke,O.linecolor||"#000").style("stroke-width",(O.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},L.drawAxes=function(e){var t=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),e){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(t,"a"+r,{propContainer:a,propName:this.id+".aaxis.title",placeholder:s(t,"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(t,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:s(t,"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(t,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:s(t,"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(e){var t,r=this.graphDiv,n=e._name,a=n.charAt(0),i=e._id,l=this.layers[n],s=a+"tickLayout",c=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);this[s]!==c&&(l.selectAll("."+i+"tick").remove(),this[s]=c),e.setScale();var u=h.calcTicks(e),f=h.clipEnds(e,u),d=h.makeTransTickFn(e),p=h.getTickSigns(e)[2],m=o.deg2rad(30),y=p*(e.linewidth||1)/2,g=p*e.ticklen,v=this.w,x=this.h,b="b"===a?"M0,"+y+"l"+Math.sin(m)*g+","+Math.cos(m)*g:"M"+y+",0l"+Math.cos(m)*g+","+-Math.sin(m)*g,_={a:"M0,0l"+x+",-"+v/2,b:"M0,0l-"+v/2+",-"+x,c:"M0,0l-"+x+","+v/2}[a];h.drawTicks(r,e,{vals:"inside"===e.ticks?f:u,layer:l,path:b,transFn:d,crisp:!1}),h.drawGrid(r,e,{vals:f,layer:this.layers[a+"grid"],path:_,transFn:d,crisp:!1}),h.drawLabels(r,e,{vals:u,layer:l,transFn:d,labelFns:h.makeLabelFns(e,0,30)})};var O=k.MINZOOM/2+.87,D="m-0.87,.5h"+O+"v3h-"+(O+5.2)+"l"+(O/2+2.6)+",-"+(.87*O+4.5)+"l2.6,1.5l-"+O/2+","+.87*O+"Z",C="m0.87,.5h-"+O+"v3h"+(O+5.2)+"l-"+(O/2+2.6)+",-"+(.87*O+4.5)+"l-2.6,1.5l"+O/2+","+.87*O+"Z",E="m0,1l"+O/2+","+.87*O+"l2.6,-1.5l-"+(O/2+2.6)+",-"+(.87*O+4.5)+"l-"+(O/2+2.6)+","+(.87*O+4.5)+"l2.6,1.5l"+O/2+",-"+.87*O+"Z",P=!0;function R(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}L.clearOutline=function(){M(this.dragOptions),T(this.dragOptions.gd)},L.initInteractions=function(){var e,t,r,n,f,d,p,h,g,b,T,M,A=this,L=A.layers.plotbg.select("path").node(),O=A.graphDiv,I=O._fullLayout._zoomlayer;function z(e){var t={};return t[A.id+".aaxis.min"]=e.a,t[A.id+".baxis.min"]=e.b,t[A.id+".caxis.min"]=e.c,t}function N(e,t){var r=O._fullLayout.clickmode;R(O),2===e&&(O.emit("plotly_doubleclick",null),i.call("_guiRelayout",O,z({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,O,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&y.click(O,t,A.id)}function F(e,t){return 1-t/A.h}function j(e,t){return 1-(e+(A.h-t)/Math.sqrt(3))/A.w}function B(e,t){return(e-(A.h-t)/Math.sqrt(3))/A.w}function H(a,i){var o=r+a*e,l=n+i*t,s=Math.max(0,Math.min(1,F(0,n),F(0,l))),c=Math.max(0,Math.min(1,j(r,n),j(o,l))),u=Math.max(0,Math.min(1,B(r,n),B(o,l))),m=(s/2+u)*A.w,y=(1-s/2-c)*A.w,v=(m+y)/2,x=y-m,_=(1-s)*A.h,w=_-x/S;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),M.transition().style("opacity",1).duration(200),b=!0),O.emit("plotly_relayouting",z(p))}function U(){R(O),p!==f&&(i.call("_guiRelayout",O,z(p)),P&&O.data&&O._context.showTips&&(o.notifier(s(O,"Double-click to zoom back out"),"long"),P=!1))}function Y(e,t){var r=e/A.xaxis._m,n=t/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]},t=(f.a-p.a)*A.yaxis._m,e=(f.c-p.c-f.b+p.b)*A.xaxis._m);var d=l(A.x0+e,A.y0+t);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",d);var h=l(-e,-t);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),O.emit("plotly_relayouting",z(p))}function q(){i.call("_guiRelayout",O,z(p))}this.dragOptions={element:L,gd:O,plotinfo:{id:A.id,domain:O._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],e=O._fullLayout._invScaleX,t=O._fullLayout._invScaleY;var m=A.dragOptions.dragmode=O._fullLayout.dragmode;v(m)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===m?(A.dragOptions.moveFn=H,A.dragOptions.clickFn=N,A.dragOptions.doneFn=U,function(e,t,i){var s=L.getBoundingClientRect();r=t-s.left,n=i-s.top,O._fullLayout._calcInverseTransform(O);var u=O._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[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(),g="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",g),M=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.clearOutline(O)}(0,s,u)):"pan"===m?(A.dragOptions.moveFn=Y,A.dragOptions.clickFn=N,A.dragOptions.doneFn=q,f={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},p=f,A.clearOutline(O)):(x(m)||v(m))&&_(i,s,u,A.dragOptions,m)}},L.onmousemove=function(e){y.hover(O,e,A.id),O._fullLayout._lasthover=L,O._fullLayout._hoversubplot=A.id},L.onmouseout=function(e){O._dragging||m.unhover(O,e)},m.init(this.dragOptions)}},{"../../components/color":158,"../../components/dragelement":177,"../../components/dragelement/helpers":176,"../../components/drawing":180,"../../components/fx":198,"../../components/selections":246,"../../components/titles":267,"../../lib":299,"../../lib/extend":293,"../../registry":387,"../cartesian/axes":346,"../cartesian/constants":353,"../cartesian/set_convert":365,"../plots":380,"@plotly/d3":20,tinycolor2:122}],387:[function(e,t,r){"use strict";var n=e("./lib/loggers"),a=e("./lib/noop"),i=e("./lib/push_unique"),o=e("./lib/is_plain_object"),l=e("./lib/dom").addStyleRule,s=e("./lib/extend"),c=e("./plots/attributes"),u=e("./plots/layout_attributes"),f=s.extendFlat,d=s.extendDeepAll;function p(e){var t=e.name,a=e.categories,i=e.meta;if(r.modules[t])n.log("Type "+t+" already registered");else{r.subplotsRegistry[e.basePlotModule.name]||function(e){var t=e.name;if(r.subplotsRegistry[t])return void n.log("Plot type "+t+" already registered.");for(var a in g(e),r.subplotsRegistry[t]=e,r.componentsRegistry)b(a,e.name)}(e.basePlotModule);for(var o={},s=0;s-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":158,"../components/drawing":180,"../constants/xmlns_namespaces":280,"../lib":299,"@plotly/d3":20}],396:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rf+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function R(e){var t=u,r=e.b,a=P(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var I=e[f+"a"],z=e[d+"a"];m=Math.abs(I.r2c(I.range[1])-I.r2c(I.range[0]));var N=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(y,N,e),!1!==e.index&&y[e.index].p!==c){M||(O=function(e){return Math.min(k(e),e.p-v.bargroupwidth/2)},D=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var F=y[e.index],j=g.base?F.b+F.s:F.s;e[d+"0"]=e[d+"1"]=z.c2p(F[d],!0),e[d+"LabelVal"]=j;var B=v.extents[v.extents.round(F.p)];e[f+"0"]=I.c2p(x?O(F):B[0],!0),e[f+"1"]=I.c2p(x?D(F):B[1],!0);var H=void 0!==F.orig_p;return e[f+"LabelVal"]=H?F.orig_p:F.p,e.labelLabel=s(I,e[f+"LabelVal"],g[f+"hoverformat"]),e.valueLabel=s(z,e[d+"LabelVal"],g[d+"hoverformat"]),e.baseLabel=s(z,F.b,g[d+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=P(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(F)+function(e){return C(k(e),A(e),w)}(F))/2,e[f+"Spike"]=I.c2p(F.p,!0),o(F,g,e),e.hovertemplate=g.hovertemplate,e}}function f(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=f(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":158,"../../components/fx":198,"../../constants/numerical":279,"../../lib":299,"../../plots/cartesian/axes":346,"../../registry":387,"./helpers":403}],405:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":358,"../scatter/marker_colorbar":527,"./arrays_to_calcdata":396,"./attributes":397,"./calc":398,"./cross_trace_calc":400,"./defaults":401,"./event_data":402,"./hover":404,"./layout_attributes":406,"./layout_defaults":407,"./plot":408,"./select":409,"./style":411}],406:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],407:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,f={},d=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function O(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,f="start"===c,d=((i.leftToRight||0)+1)/2,p=1-d,h=a.width,m=a.height,y=Math.abs(t-e),g=Math.abs(n-r),v=y>2*_&&g>2*_?_:0;y-=2*v,g-=2*v;var x=L(s);"auto"!==s||h<=y&&m<=g||!(h>y||m>g)||(h>g||m>y)&&h.01?q:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?q(e):e>t?Math.ceil(e):Math.floor(e)};F=V(F,j,I),j=V(j,F,I),B=V(B,H,!I),H=V(H,B,!I)}var Z=k(i.ensureSingle(E,"path"),C,y,g);if(Z.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-F)*(H-B))||U&&e._context.staticPlot?"M0,0Z":"M"+F+","+B+"V"+H+"H"+j+"V"+B+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&z){var G=s.makePointStyleFns(f);s.singlePointStyle(c,Z,f,G,e)}!function(e,t,r,n,a,l,c,f,p,y,g){var w,T=t.xaxis,A=t.yaxis,D=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var E=n[0].trace,P="h"===E.orientation,R=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,f,d,p="histogram"===o.type,h="waterfall"===o.type,m="funnel"===o.type,y="h"===o.orientation;y?(s="y",c=a,f="x",d=n):(s="x",c=n,f="y",d=a);function g(e){return u(d,d.c2l(e),!0).text}var v=t[r],x={};x.label=v.p,x.labelLabel=x[s+"Label"]=(_=v.p,u(c,c.c2l(_),!0).text);var _;var w=i.castOption(o,v.i,"text");(0===w||w)&&(x.text=w);x.value=v.s,x.valueLabel=x[f+"Label"]=g(v.s);var T={};b(T,o,v.i),(p||void 0===T.x)&&(T.x=y?x.value:x.label);(p||void 0===T.y)&&(T.y=y?x.label:x.value);(p||void 0===T.xLabel)&&(T.xLabel=y?x.valueLabel:x.labelLabel);(p||void 0===T.yLabel)&&(T.yLabel=y?x.labelLabel:x.valueLabel);h&&(x.delta=+v.rawS||v.s,x.deltaLabel=g(x.delta),x.final=v.v,x.finalLabel=g(x.final),x.initial=x.final-x.delta,x.initialLabel=g(x.initial));m&&(x.value=v.s,x.valueLabel=g(x.value),x.percentInitial=v.begR,x.percentInitialLabel=i.formatPercent(v.begR),x.percentPrevious=v.difR,x.percentPreviousLabel=i.formatPercent(v.difR),x.percentTotal=v.sumR,x.percenTotalLabel=i.formatPercent(v.sumR));var M=i.castOption(o,v.i,"customdata");M&&(x.customdata=M);return i.texttemplateString(l,x,e._d3locale,T,x,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var f,d=a.textinfo,p=e[t],h=d.split("+"),m=[],y=function(e){return-1!==h.indexOf(e)};y("label")&&m.push((g=e[t].p,u(o?n:r,g,!0).text));var g;y("text")&&(0===(f=i.castOption(a,p.i,"text"))||f)&&m.push(f);if(l){var v=+p.rawS||p.s,x=p.v,b=x-v;y("initial")&&m.push(c(b)),y("delta")&&m.push(c(v)),y("final")&&m.push(c(x))}if(s){y("value")&&m.push(c(p.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(f=i.formatPercent(p.begR),w&&(f+=" of initial"),m.push(f)),y("percent previous")&&(f=i.formatPercent(p.difR),w&&(f+=" of previous"),m.push(f)),y("percent total")&&(f=i.formatPercent(p.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(v,o)}(D,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(E,a);var I="stack"===y.mode||"relative"===y.mode,z=n[a],N=!I||z._outmost;if(!R||"none"===w||(z.isBlank||l===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var F=D.font,j=h.getBarColor(n[a],E),B=h.getInsideTextFont(E,a,F,j),H=h.getOutsideTextFont(E,a,F),U=r.datum();P?"log"===T.type&&U.s0<=0&&(l=T.range[0]=V*(J/Z):J>=Z*(W/V);V>0&&Z>0&&(X||K||$)?w="inside":(w="outside",Y.remove(),Y=null)}else w="inside";if(!Y){G=i.ensureUniformFontSize(e,"outside"===w?H:B);var Q=(Y=C(r,R,G)).attr("transform");if(Y.attr("transform",""),q=s.bBox(Y.node()),V=q.width,Z=q.height,Y.attr("transform",Q),V<=0||Z<=0)return void Y.remove()}var ee,te,re=E.textangle;"outside"===w?(te="both"===E.constraintext||"outside"===E.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,f=a.height,d=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:d>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/f):Math.min(1,d/u));var m=L(c),y=S(a,m),g=(l?y.x:y.y)/2,v=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*g):(w=n+A*o,k=-A*g);return{textX:v,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,f,p,q,{isHorizontal:P,constrained:te,angle:re})):(te="both"===E.constraintext||"inside"===E.constraintext,ee=O(l,c,f,p,q,{isHorizontal:P,constrained:te,angle:re,anchor:E.insidetextanchor}));ee.fontSize=G.size,d("histogram"===E.type?"bar":E.type,ee,D),z.transform=ee;var ne=k(Y,D,y,g);i.setTransormAndDisplay(ne,ee)}(e,t,E,r,p,F,j,B,H,y,g),t.layerClipId&&s.hideOutsideRangePoint(c,E.select("text"),w,D,f.xcalendar,f.ycalendar)}));var B=!1===f.cliponaxis;s.setClipUrl(c,B?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,E,t,y)},toMoveInsideBar:O}},{"../../components/color":158,"../../components/drawing":180,"../../components/fx/helpers":194,"../../lib":299,"../../lib/svg_text_utils":322,"../../plots/cartesian/axes":346,"../../registry":387,"./attributes":397,"./constants":399,"./helpers":403,"./style":411,"./uniform_text":413,"@plotly/d3":20,"fast-isnumeric":33}],409:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,y(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":158,"../../components/drawing":180,"../../lib":299,"../../registry":387,"./attributes":397,"./helpers":403,"./uniform_text":413,"@plotly/d3":20}],412:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":158,"../../components/colorscale/defaults":168,"../../components/colorscale/helpers":169,"../../lib":299}],413:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=oS.uf};if(t._hasPreCompStats){var H=t[x],U=function(e){return v.d2c((t[e]||[])[r])},Y=1/0,q=-1/0;for(r=0;r=S.q1&&S.q3>=S.med){var Z=U("lowerfence");S.lf=Z!==l&&Z<=S.q1?Z:p(S,D,C);var G=U("upperfence");S.uf=G!==l&&G>=S.q3?G:h(S,D,C);var W=U("mean");S.mean=W!==l?W:C?o.mean(D,C):(S.q1+S.q3)/2;var J=U("sd");S.sd=W!==l&&J>=0?J:C?o.stdev(D,C,S.mean):S.q3-S.q1,S.lo=m(S),S.uo=y(S);var X=U("notchspan");X=X!==l&&X>0?X:g(S,C),S.ln=S.med-X,S.un=S.med+X;var K=S.lf,$=S.uf;t.boxpoints&&D.length&&(K=Math.min(K,D[0]),$=Math.max($,D[C-1])),t.notched&&(K=Math.min(K,S.ln),$=Math.max($,S.un)),S.min=K,S.max=$}else{var Q;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+S.q1,"median = "+S.med,"q3 = "+S.q3].join("\n")),Q=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=Q,S.q1=S.q3=Q,S.lf=S.uf=Q,S.mean=S.sd=Q,S.ln=S.un=Q,S.min=S.max=Q}Y=Math.min(Y,S.min),q=Math.max(q,S.max),S.pts2=O.filter(B),A.push(S)}}t._extremes[v._id]=a.findExtremes(v,[Y,q],{padded:!0})}else{var ee=v.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),a=0;a=0&&ae0){var ue,fe;if((S={}).pos=S[_]=F[r],O=S.pts=ne[r].sort(f),C=(D=S[x]=O.map(d)).length,S.min=D[0],S.max=D[C-1],S.mean=o.mean(D,C),S.sd=o.stdev(D,C,S.mean),S.med=o.interp(D,.5),C%2&&(se||ce))se?(ue=D.slice(0,C/2),fe=D.slice(C/2+1)):ce&&(ue=D.slice(0,C/2+1),fe=D.slice(C/2)),S.q1=o.interp(ue,.5),S.q3=o.interp(fe,.5);else S.q1=o.interp(D,.25),S.q3=o.interp(D,.75);S.lf=p(S,D,C),S.uf=h(S,D,C),S.lo=m(S),S.uo=y(S);var de=g(S,C);S.ln=S.med-de,S.un=S.med+de,ie=Math.min(ie,S.ln),oe=Math.max(oe,S.un),S.pts2=O.filter(B),A.push(S)}t._extremes[v._id]=a.findExtremes(v,t.notched?ee.concat([ie,oe]):ee,{padded:!0})}return function(e,t){if(o.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(A[0].t={num:T[L],dPos:j,posLetter:_,valLetter:x,labels:{med:s(e,"median:"),min:s(e,"min:"),q1:s(e,"q1:"),q3:s(e,"q3:"),max:s(e,"max:"),mean:"sd"===t.boxmean?s(e,"mean \xb1 \u03c3:"):s(e,"mean:"),lf:s(e,"lower fence:"),uf:s(e,"upper fence:")}},T[L]++,A):[{t:{empty:!0}}]};var c={text:"tx",hovertext:"htx"};function u(e,t,r){for(var n in c)o.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?o.isArrayOrTypedArray(t[n][r[0]])&&(e[c[n]]=t[n][r[0]][r[1]]):e[c[n]]=t[n][r])}function f(e,t){return e.v-t.v}function d(e){return e.v}function p(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(o.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function h(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(o.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function m(e){return 4*e.q1-3*e.q3}function y(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}},{"../../constants/numerical":279,"../../lib":299,"../../plots/cartesian/align_period":343,"../../plots/cartesian/axes":346,"fast-isnumeric":33}],416:[function(e,t,r){"use strict";var n=e("../../plots/cartesian/axes"),a=e("../../lib"),i=e("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function l(e,t,r,o){var l,s,c,u=t.calcdata,f=t._fullLayout,d=o._id,p=d.charAt(0),h=[],m=0;for(l=0;l1,b=1-f[e+"gap"],_=1-f[e+"groupgap"];for(l=0;l0){var q=S.pointpos,V=S.jitter,Z=S.marker.size/2,G=0;q+V>=0&&((G=U*(q+V))>A?(Y=!0,B=Z,F=G):G>z&&(B=Z,F=A)),G<=A&&(F=A);var W=0;q-V<=0&&((W=-U*(q-V))>L?(Y=!0,H=Z,j=W):W>N&&(H=Z,j=L)),W<=L&&(j=L)}else F=A,j=L;var J=new Array(c.length);for(s=0;s0?(y="v",g=x>0?Math.min(_,b):Math.min(b)):x>0?(y="h",g=Math.min(_)):g=0;if(g){t._length=g;var L=r("orientation",y);t._hasPreCompStats?"v"===L&&0===x?(r("x0",0),r("dx",1)):"h"===L&&0===v&&(r("y0",0),r("dy",1)):"v"===L&&0===x?r("x0"):"h"===L&&0===v&&r("y0"),a.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i)}else t.visible=!1}function f(e,t,r,a){var i=a.prefix,o=n.coerce2(e,t,c,"marker.outliercolor"),l=r("marker.line.outliercolor"),s="outliers";t._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.angle"),r("marker.color",t.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===u&&(r("marker.line.outliercolor",t.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 t.marker;var f=r("hoveron");"all"!==f&&-1===f.indexOf("points")||r("hovertemplate"),n.coerceSelectionMarkerOpacity(t,r)}t.exports={supplyDefaults:function(e,t,r,a){function l(r,a){return n.coerce(e,t,c,r,a)}if(u(e,t,l,a),!1!==t.visible){o(e,t,a,l),l("xhoverformat"),l("yhoverformat");var s=t._hasPreCompStats;s&&(l("lowerfence"),l("upperfence")),l("line.color",(e.marker||{}).color||r),l("line.width"),l("fillcolor",i.addOpacity(t.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 m=!1;if(s){var y=l("notchspan");y&&y.length&&(m=!0)}else n.validate(e.notchwidth,c.notchwidth)&&(m=!0);l("notched",m)&&l("notchwidth"),f(e,t,l,{prefix:"box"})}},crossTraceDefaults:function(e,t){var r,a;function i(e){return n.coerce(a._input,a,c,e)}for(var o=0;oe.lo&&(x.so=!0)}return i}));d.enter().append("path").classed("point",!0),d.exit().remove(),d.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.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=e.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(e){var t=c.c2l(e.pos+f,!0),a=c.l2p(t-o)+d,i=c.l2p(t+l)+d,h=u?(a+i)/2:c.l2p(t)+d,m=s.c2p(e.mean,!0),y=s.c2p(e.mean-e.sd,!0),g=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===p?"m0,0L"+y+","+h+"L"+m+","+a+"L"+g+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===p?"m0,0L"+h+","+y+"L"+a+","+m+"L"+h+","+g+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],f=i.t,d=i.trace;(f.wdPos=f.bdPos*d.whiskerwidth,!0!==d.visible||f.empty)?a.remove():("h"===d.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},d,f),l(a,{x:c,y:u},d,f),s(a,{pos:t,val:r},d,f))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":180,"../../lib":299,"@plotly/d3":20}],424:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,a=e.cd,i=e.xaxis,o=e.yaxis,l=[];if(!1===t)for(r=0;ro.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":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),d=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],429:[function(e,t,r){"use strict";var n=e("../../components/colorscale"),a=e("./make_color_map"),i=e("./end_plus");t.exports={min:"zmin",max:"zmax",calc:function(e,t,r){var o=t.contours,l=t.line,s=o.size||1,c=o.coloring,u=a(t,{isColorbar:!0});if("heatmap"===c){var f=n.extractOpts(t);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":170,"./end_plus":437,"./make_color_map":442}],430:[function(e,t,r){"use strict";t.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}}},{}],431:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./label_defaults"),i=e("../../components/color"),o=i.addOpacity,l=i.opacity,s=e("../../constants/filter_ops"),c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,r,i,s,f){var d,p,h,m=t.contours,y=r("contours.operation");(m._operation=c[y],function(e,t){var r;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),Array.isArray(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(r=parseFloat(t.value[0]),t.value=[r,r+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:n(t.value)&&(r=parseFloat(t.value),t.value=[r,r+1])):(e("contours.value",0),n(t.value)||(Array.isArray(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(r,m),"="===y?d=m.showlines=!0:(d=r("contours.showlines"),h=r("fillcolor",o((e.line||{}).color||s,.5))),d)&&(p=r("line.color",h&&l(h)?o(t.fillcolor,1):s),r("line.width",2),r("line.dash"));r("line.smoothing"),a(r,i,p,f)}},{"../../components/color":158,"../../constants/filter_ops":277,"./label_defaults":441,"fast-isnumeric":33}],432:[function(e,t,r){"use strict";var n=e("../../constants/filter_ops"),a=e("fast-isnumeric");function i(e,t){var r,i=Array.isArray(t);function o(e){return a(e)?+e:null}return-1!==n.COMPARISON_OPS2.indexOf(e)?r=o(i?t[0]:t):-1!==n.INTERVAL_OPS.indexOf(e)?r=i?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==n.SET_OPS.indexOf(e)&&(r=i?t.map(o):[o(t)]),r}function o(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function l(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":o("[]"),"][":o("]["),">":l(">"),"<":l("<"),"=":l("=")}},{"../../constants/filter_ops":277,"fast-isnumeric":33}],433:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var a=n("contours.start"),i=n("contours.end"),o=!1===a||!1===i,l=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{}],434:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return n.extendFlat({},e,{edgepaths:n.extendDeep([],e.edgepaths),paths:n.extendDeep([],e.paths),starts:n.extendDeep([],e.starts)})}t.exports=function(e,t){var r,i,o,l=function(e){return e.reverse()},s=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&n.warn("Contour data invalid for the specified inequality operation."),i=e[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",e);break}return s}},{"../../lib":299,"./constraint_mapping":432,"./end_plus":437}],437:[function(e,t,r){"use strict";t.exports=function(e){return e.end+e.size/1e6}},{}],438:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./constants");function i(e,t,r,n){return Math.abs(e[0]-t[0])20&&t?208===e||1114===e?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==a.BOTTOMSTART.indexOf(e)?i=1:-1!==a.LEFTSTART.indexOf(e)?n=1:-1!==a.TOPSTART.indexOf(e)?i=-1:n=-1;return[n,i]}(f,r,t),p=[l(e,t,[-d[0],-d[1]])],h=e.z.length,m=e.z[0].length,y=t.slice(),g=d.slice();for(c=0;c<1e4;c++){if(f>20?(f=a.CHOOSESADDLE[f][(d[0]||d[1])<0?0:1],e.crossings[u]=a.SADDLEREMAINDER[f]):delete e.crossings[u],!(d=a.NEWDELTA[f])){n.log("Found bad marching index:",f,t,e.level);break}p.push(l(e,t,d)),t[0]+=d[0],t[1]+=d[1],u=t.join(","),i(p[p.length-1],p[p.length-2],o,s)&&p.pop();var v=d[0]&&(t[0]<0||t[0]>m-2)||d[1]&&(t[1]<0||t[1]>h-2);if(t[0]===y[0]&&t[1]===y[1]&&d[0]===g[0]&&d[1]===g[1]||r&&v)break;f=e.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,M,k,A,L,S,O,D,C,E,P,R=i(p[0],p[p.length-1],o,s),I=0,z=.2*e.smoothing,N=[],F=0;for(c=1;c=F;c--)if((x=N[c])=F&&x+N[b]A&&L--,e.edgepaths[L]=O.concat(p,S));break}U||(e.edgepaths[A]=p.concat(S))}for(A=0;Ae?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,r,i,o,l,s,c,u,f,d=e[0].z,p=d.length,h=d[0].length,m=2===p||2===h;for(r=0;r=0&&(n=v,l=s):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,l=s):a.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,l>=0)break;f+="L"+n}if(l===e.edgepaths.length){a.log("unclosed perimeter path");break}d=l,(h=-1===p.indexOf(d))&&(d=p[0],f+="Z")}for(d=0;dn.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=g.EDGECOST*(1/(d-1)+1/(p-1));h+=g.ANGLECOST*c*c;for(var m=l-u,y=s-f,v=l+u,x=s+f,b=0;b2*g.MAXCOST)break;p&&(l/=2),s=(o=c-l/2)+1.5*l}if(d<=g.MAXCOST)return u},r.addLabelData=function(e,t,r,n){var a=t.fontSize,i=t.width+a/3,o=Math.max(0,t.height-a/3),l=e.x,s=e.y,c=e.theta,u=Math.sin(c),f=Math.cos(c),d=function(e,t){return[l+e*f-t*u,s+e*u+t*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:t.text,x:l,y:s,dy:t.dy,theta:c,level:t.level,width:i,height:o}),n.push(p)},r.drawLabels=function(e,t,r,i,o){var s=e.selectAll("text").data(t,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(s.exit().remove(),s.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var t=e.x+Math.sin(e.theta)*e.dy,a=e.y-Math.cos(e.theta)*e.dy;n.select(this).text(e.text).attr({x:t,y:a,transform:"rotate("+180*e.theta/Math.PI+" "+t+" "+a+")"}).call(l.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),a.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if("constraint"!==r.type){var c,u=r.start,f=r.end,d=e._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,e.ncontours).dtick,d.size=r.size=c}}},{"../../lib":299,"../../plots/cartesian/axes":346}],446:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../heatmap/style"),o=e("./make_color_map");t.exports=function(e){var t=n.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=n.select(this),r=e[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;t.selectAll("g.contourlevel").each((function(e){n.select(this).selectAll("path").call(a.lineGroupStyle,l.width,f?p(e.level):l.color,l.dash)}));var h=i.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){a.font(n.select(this),{family:h.family,size:h.size,color:h.color||(f?p(e.level):l.color)})})),u)t.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(d){var m;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===m&&(m=e.level),p(e.level+.5*s)})),void 0===m&&(m=c),t.selectAll("g.contourbg path").style("fill",p(m-.5*s))}})),i(e)}},{"../../components/drawing":180,"../heatmap/style":461,"./make_color_map":442,"@plotly/d3":20}],447:[function(e,t,r){"use strict";var n=e("../../components/colorscale/defaults"),a=e("./label_defaults");t.exports=function(e,t,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!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,n(e,t,i,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),a(r,i,c,o)}},{"../../components/colorscale/defaults":168,"./label_defaults":441}],448:[function(e,t,r){"use strict";var n=e("../scatter/attributes"),a=e("../../plots/attributes"),i=e("../../plots/font_attributes"),o=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,l=e("../../plots/template_attributes").hovertemplateAttrs,s=e("../../plots/template_attributes").texttemplateAttrs,c=e("../../components/colorscale/attributes"),u=e("../../lib/extend").extendFlat;t.exports=u({z:{valType:"data_array",editType:"calc"},x:u({},n.x,{impliedEdits:{xtype:"array"}}),x0:u({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:u({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:u({},n.y,{impliedEdits:{ytype:"array"}}),y0:u({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:u({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:u({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:u({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:u({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:u({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:u({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:u({},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"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:l(),texttemplate:s({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:i({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:u({},a.showlegend,{dflt:!1})},{transforms:void 0},c("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":165,"../../lib/extend":293,"../../plots/attributes":342,"../../plots/cartesian/axis_format_attributes":349,"../../plots/font_attributes":374,"../../plots/template_attributes":382,"../scatter/attributes":509}],449:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../histogram2d/calc"),s=e("../../components/colorscale/calc"),c=e("./convert_column_xyz"),u=e("./clean_2d_array"),f=e("./interp2d"),d=e("./find_empties"),p=e("./make_bound_array"),h=e("../../constants/numerical").BADNUM;function m(e){for(var t=[],r=e.length,n=0;nI){P("x scale is not linear");break}}if(x.length&&"fast"===C){var z=(x[x.length-1]-x[0])/(x.length-1),N=Math.abs(z/100);for(M=0;MN){P("y scale is not linear");break}}}var F=a.maxRowLength(T),j="scaled"===t.xtype?"":r,B=p(t,j,y,g,F,A),H="scaled"===t.ytype?"":x,U=p(t,H,b,_,T.length,L);D||(t._extremes[A._id]=i.findExtremes(A,B),t._extremes[L._id]=i.findExtremes(L,U));var Y={x:B,y:U,z:T,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&v&&(Y.orig_x=v),t.yperiodalignment&&w&&(Y.orig_y=w),j&&j.length===B.length-1&&(Y.xCenter=j),H&&H.length===U.length-1&&(Y.yCenter=H),O&&(Y.xRanges=k.xRanges,Y.yRanges=k.yRanges,Y.pts=k.pts),S||s(e,t,{vals:T,cLetter:"z"}),S&&t.contours&&"heatmap"===t.contours.coloring){var q={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};Y.xfill=p(q,j,y,g,F,A),Y.yfill=p(q,H,b,_,T.length,L)}return[Y]}},{"../../components/colorscale/calc":166,"../../constants/numerical":279,"../../lib":299,"../../plots/cartesian/align_period":343,"../../plots/cartesian/axes":346,"../../registry":387,"../histogram2d/calc":478,"./clean_2d_array":450,"./convert_column_xyz":452,"./find_empties":454,"./interp2d":457,"./make_bound_array":459}],450:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("../../constants/numerical").BADNUM;t.exports=function(e,t,r,o){var l,s,c,u,f,d;function p(e){if(n(e))return+e}if(t&&t.transpose){for(l=0,f=0;f=0;o--)(l=((f[[(r=(i=d[o])[0])-1,a=i[1]]]||m)[2]+(f[[r+1,a]]||m)[2]+(f[[r,a-1]]||m)[2]+(f[[r,a+1]]||m)[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(e,t){return t[2]-e[2]}))}},{"../../lib":299}],455:[function(e,t,r){"use strict";var n=e("../../components/fx"),a=e("../../lib"),i=e("../../plots/cartesian/axes"),o=e("../../components/colorscale").extractOpts;t.exports=function(e,t,r,l,s){s||(s={});var c,u,f,d,p=s.isContour,h=e.cd[0],m=h.trace,y=e.xa,g=e.ya,v=h.x,x=h.y,b=h.z,_=h.xCenter,w=h.yCenter,T=h.zmask,M=m.zhoverformat,k=v,A=x;if(!1!==e.index){try{f=Math.round(e.index[1]),d=Math.round(e.index[0])}catch(t){return void a.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(f<0||f>=b[0].length||d<0||d>b.length)return}else{if(n.inbox(t-v[0],t-v[v.length-1],0)>0||n.inbox(r-x[0],r-x[x.length-1],0)>0)return;if(p){var L;for(k=[2*v[0]-v[1]],L=1;Lm&&(g=Math.max(g,Math.abs(e[i][o]-h)/(y-m))))}return g}t.exports=function(e,t){var r,a=1;for(o(e,t),r=0;r.01;r++)a=o(e,t,i(a));return a>.01&&n.log("interp2d didn't converge quickly",a),e}},{"../../lib":299}],458:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){e("texttemplate");var r=n.extendFlat({},t.font,{color:"auto",size:"auto"});n.coerceFont(e,"textfont",r)}},{"../../lib":299}],459:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib").isArrayOrTypedArray;t.exports=function(e,t,r,i,o,l){var s,c,u,f=[],d=n.traceIs(e,"contour"),p=n.traceIs(e,"histogram"),h=n.traceIs(e,"gl2d");if(a(t)&&t.length>1&&!p&&"category"!==l.type){var m=t.length;if(!(m<=o))return d?t.slice(0,o):t.slice(0,o+1);if(d||h)f=t.slice(0,o);else if(1===o)f=[t[0]-.5,t[0]+.5];else{for(f=[1.5*t[0]-.5*t[1]],u=1;u0;)_=w.c2p(z[L]),L--;for(_0;)A=T.c2p(N[L]),L--;if(AVe||Ve>T._length))for(S=He;SGe||Ge>w._length)){var We=u({x:Ze,y:qe},E,e._fullLayout);We.x=Ze,We.y=qe;var Je=C.z[L][S];void 0===Je?(We.z="",We.zLabel=""):(We.z=Je,We.zLabel=l.tickText(Ne,Je,"hover").text);var Xe=C.text&&C.text[L]&&C.text[L][S];void 0!==Xe&&!1!==Xe||(Xe=""),We.text=Xe;var Ke=s.texttemplateString(Ie,We,e._fullLayout._d3locale,We,E._meta||{});if(Ke){var $e=Ke.split("
"),Qe=$e.length,et=0;for(O=0;O0&&(i=!0);for(var s=0;si){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,d=-.1*t,p=e-d,h=r[0],m=r[1],y=Math.min(f(h+d,h+p,n,i),f(m+d,m+p,n,i)),g=Math.min(f(h+c,h+d,n,i),f(m+c,m+d,n,i));if(y>g&&go){var v=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",v);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(F)&&(B=o.tickIncrement(B,b.size,!0,p)),R.start=r.l2r(B),N||a.nestedProperty(t,g+".start").set(R.start)}var H=b.end,U=r.r2l(P.end),Y=void 0!==U;if((b.endFound||Y)&&U!==r.r2l(H)){var q=Y?U:a.aggNums(Math.max,null,h);R.end=r.l2r(q),Y||a.nestedProperty(t,g+".start").set(R.end)}var V="autobin"+l;return!1===t._input[V]&&(t._input[g]=a.extendFlat({},t[g]||{}),delete t._input[V],delete t[V]),[R,h]}t.exports={calc:function(e,t){var r,i,p,h,m=[],y=[],g="h"===t.orientation,v=o.getFromId(e,g?t.yaxis:t.xaxis),x=g?"y":"x",b={x:"y",y:"x"}[x],_=t[x+"calendar"],w=t.cumulative,T=d(e,t,v,x),M=T[0],k=T[1],A="string"==typeof M.size,L=[],S=A?L:M,O=[],D=[],C=[],E=0,P=t.histnorm,R=t.histfunc,I=-1!==P.indexOf("density");w.enabled&&I&&(P=P.replace(/ ?density$/,""),I=!1);var z,N="max"===R||"min"===R?null:0,F=s.count,j=c[P],B=!1,H=function(e){return v.r2c(e,0,_)};for(a.isArrayOrTypedArray(t[b])&&"count"!==R&&(z=t[b],B="avg"===R,F=s[R]),r=H(M.start),p=H(M.end)+(r-o.tickIncrement(r,M.size,!1,_))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(y,w.direction,w.currentbin);var K=Math.min(m.length,y.length),$=[],Q=0,ee=K-1;for(r=0;r=Q;r--)if(y[r]){ee=r;break}for(r=Q;r<=ee;r++)if(n(m[r])&&n(y[r])){var te={p:m[r],s:y[r],b:0};w.enabled||(te.pts=C[r],Z?te.ph0=te.ph1=C[r].length?k[C[r][0]]:m[r]:(t._computePh=!0,te.ph0=q(L[r]),te.ph1=q(L[r+1],!0))),$.push(te)}return 1===$.length&&($[0].width1=o.tickIncrement($[0].p,M.size,!1,_)-$[0].p),l($,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected($,t,J),$},calcAllAutoBins:d}},{"../../lib":299,"../../plots/cartesian/axes":346,"../../registry":387,"../bar/arrays_to_calcdata":396,"./average":465,"./bin_functions":467,"./bin_label_vals":468,"./norm_functions":476,"fast-isnumeric":33}],470:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],471:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../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"];t.exports=function(e,t){var r,f,d,p,h,m,y,g=t._histogramBinOpts={},v=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=g[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.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",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(g[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;hL&&T.splice(L,T.length-L),A.length>L&&A.splice(L,A.length-L);var S=[],O=[],D=[],C="string"==typeof w.size,E="string"==typeof k.size,P=[],R=[],I=C?P:w,z=E?R:k,N=0,F=[],j=[],B=t.histnorm,H=t.histfunc,U=-1!==B.indexOf("density"),Y="max"===H||"min"===H?null:0,q=i.count,V=o[B],Z=!1,G=[],W=[],J="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";J&&"count"!==H&&(Z="avg"===H,q=i[H]);var X=w.size,K=x(w.start),$=x(w.end)+(K-a.tickIncrement(K,X,!1,g))/1e6;for(r=K;r<$;r=a.tickIncrement(r,X,!1,g))O.push(Y),P.push(r),Z&&D.push(0);P.push(r);var Q,ee=O.length,te=(r-K)/ee,re=(Q=K+te/2,m.c2r(Q,0,g)),ne=k.size,ae=b(k.start),ie=b(k.end)+(ae-a.tickIncrement(ae,ne,!1,v))/1e6;for(r=ae;r=0&&p=0&&h0||n.inbox(r-o.y0,r-(o.y0+o.h*l.dy),0)>0)){var u,f=Math.floor((t-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",{willReadFrequently:!0}).getImageData(f,d,1,1).data),u){var p,h=o.hi||l.hoverinfo;if(h){var m=h.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(p=!0)}var y,g=i.colormodel[l.colormodel],v=g.colormodel||l.colormodel,x=v.length,b=l._scaler(u),_=g.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(""),e.extraText=v.toUpperCase()+": "+w),Array.isArray(l.hovertext)&&Array.isArray(l.hovertext[d])?y=l.hovertext[d][f]:Array.isArray(l.text)&&Array.isArray(l.text[d])&&(y=l.text[d][f]);var T=c.c2p(o.y0+(d+.5)*l.dy),M=o.x0+(f+.5)*l.dx,k=o.y0+(d+.5)*l.dy,A="["+u.slice(0,l.colormodel.length).join(", ")+"]";return[a.extendFlat(e,{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:M,xLabelVal:M,yVal:k,yLabelVal:k,zLabelVal:A,text:y,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":198,"../../lib":299,"./constants":488}],493:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover"),eventData:e("./event_data"),moduleType:"trace",name:"image",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},{"../../plots/cartesian":358,"./attributes":486,"./calc":487,"./defaults":489,"./event_data":490,"./hover":492,"./plot":494,"./style":495}],494:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.strTranslate,o=e("../../constants/xmlns_namespaces"),l=e("./constants"),s=a.isIOS()||a.isSafari()||a.isIE();t.exports=function(e,t,r,c){var u=t.xaxis,f=t.yaxis,d=!(s||e._context._exportedPlot);a.makeTraceGroups(c,r,"im").each((function(t){var r=n.select(this),s=t[0],c=s.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&d)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=p;var h,m,y,g,v,x,b=s.z,_=s.x0,w=s.y0,T=s.w,M=s.h,k=c.dx,A=c.dy;for(x=0;void 0===h&&x0;)m=u.c2p(_+x*k),x--;for(x=0;void 0===g&&x0;)v=f.c2p(w+x*A),x--;if(mE[0];if(P||R){var I=h+L/2,z=g+S/2;D+="transform:"+i(I+"px",z+"px")+"scale("+(P?-1:1)+","+(R?-1:1)+")"+i(-I+"px",-z+"px")+";"}}O.attr("style",D);var N=new Promise((function(e){if(c._hasZ)e();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===T&&c._canvas.el.height===M&&c._canvas.source===c.source)e();else{var t=document.createElement("canvas");t.width=T,t.height=M;var r=t.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var n=c._image;n.onload=function(){r.drawImage(n,0,0),c._canvas={el:t,source:c.source},e()},n.setAttribute("src",c.source)}})).then((function(){var e;if(c._hasZ)e=F((function(e,t){return b[t][e]})).toDataURL("image/png");else if(c._hasSource)if(p)e=c.source;else{var t=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,T,M).data;e=F((function(e,r){var n=4*(r*T+e);return[t[n],t[n+1],t[n+2],t[n+3]]})).toDataURL("image/png")}O.attr({"xlink:href":e,height:S,width:L,x:h,y:g})}));e._promises.push(N)}function F(e){var t=document.createElement("canvas");t.width=L,t.height=S;var r,n=t.getContext("2d",{willReadFrequently:!0}),i=function(e){return a.constrain(Math.round(u.c2p(_+e*k)-h),0,L)},o=function(e){return a.constrain(Math.round(f.c2p(w+e*A)-g),0,S)},d=l.colormodel[c.colormodel],p=d.colormodel||c.colormodel,m=d.fmt;for(x=0;x=0})),("funnelarea"===t.type?g:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=y),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),f=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),f){t._length=f,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var d,p=c("text"),h=c("texttemplate");if(h||(d=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||d&&"none"!==d){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var y=c("hole");if(c("title.text")){var g=c("title.position",y?"middle center":"top center");y||"middle center"!==g||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":299,"../../plots/domain":373,"../bar/defaults":401,"./attributes":496,"fast-isnumeric":33}],500:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":194}],501:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:f.hovertemplate||-1!==d.indexOf("name")?f.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:y.castOption(_.bgcolor,e.pts)||e.color,borderColor:y.castOption(_.bordercolor,e.pts),fontFamily:y.castOption(w.family,e.pts),fontSize:y.castOption(w.size,e.pts),fontColor:y.castOption(w.color,e.pts),nameLength:y.castOption(_.namelength,e.pts),textAlign:y.castOption(_.align,e.pts),hovertemplate:y.castOption(f.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,f)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[g(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[g(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=y.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=y.castOption(e._input.textfont.color,t.pts));var a=y.castOption(e.insidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.insidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;y-=2)g(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)g(Math.PI*(y+1),"tan")}if(f||p){for(y=4;y>=-4;y-=2)g(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)g(Math.PI*(y+.5),"rad")}}if(l||h||f){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/v,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||d)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function O(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function D(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=E(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),f=t.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+=e.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-=e.titleBox.width/2),r=f/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function E(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function P(e,t){for(var r=[],n=0;n1?(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")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:y.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:y.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=y.getFirstFilled(a.text,t.pts);(v(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function z(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._context.staticPlot,i=e._fullLayout,d=i._size;h("pie",i),_(t,e),P(t,d);var m=s.makeTraceGroups(i._pielayer,t,"trace").each((function(t){var h=n.select(this),m=t[0],g=m.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=y.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.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))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var v=n.select(this).selectAll("g.slice").data(t);v.enter().append("g").classed("slice",!0),v.exit().remove();var _=[[[],[]],[[],[]]],T=!1;v.each((function(a,o){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=g.index,_[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var c=m.cx,u=m.cy,d=n.select(this),h=d.selectAll("path.surface").data([a]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),d.call(x,e,t),g.pull){var v=+y.castOption(g.pull,a.pts)||0;v>0&&(c+=v*a.pxmid[0],u+=v*a.pxmid[1])}a.cxFinal=c,a.cyFinal=u;var M=g.hole;if(a.v===m.vTotal){var k="M"+(c+a.px0[0])+","+(u+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";M?h.attr("d","M"+(c+M*a.px0[0])+","+(u+M*a.px0[1])+C(a.px0,a.pxmid,!1,M)+C(a.pxmid,a.px0,!1,M)+"Z"+k):h.attr("d",k)}else{var A=C(a.px0,a.px1,!0,1);if(M){var L=1-M;h.attr("d","M"+(c+M*a.px1[0])+","+(u+M*a.px1[1])+C(a.px1,a.px0,!1,M)+"l"+L*a.px0[0]+","+L*a.px0[1]+A+"Z")}else h.attr("d","M"+c+","+u+"l"+a.px0[0]+","+a.px0[1]+A+"Z")}I(e,a,m);var S=y.castOption(g.textposition,a.pts),D=d.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);D.enter().append("g").classed("slicetext",!0),D.exit().remove(),D.each((function(){var r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=y.castOption(e.outsidetextfont.color,t.pts)||y.castOption(e.textfont.color,t.pts)||r.color,a=y.castOption(e.outsidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.outsidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(g,a,i.font):b(g,a,i.font));r.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,d).call(f.convertToTspans,e);var h,v=l.bBox(r.node());if("outside"===S)h=O(v,a);else if(h=w(v,a,m),"auto"===S&&h.scale<1){var x=s.ensureUniformFontSize(e,g.outsidetextfont);r.call(l.font,x),h=O(v=l.bBox(r.node()),a)}var _=h.textPosAngle,M=void 0===_?a.pxmid:R(m.r,_);if(h.targetX=c+M[0]*h.rCenter+(h.x||0),h.targetY=u+M[1]*h.rCenter+(h.y||0),z(h,v),h.outside){var k=h.targetY;a.yLabelMin=k-v.height/2,a.yLabelMid=k,a.yLabelMax=k+v.height/2,a.labelExtraX=0,a.labelExtraY=0,T=!0}h.fontSize=d.size,p(g.type,h,i),t[o].transform=h,s.setTransormAndDisplay(r,h)}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*m.r+","+n*m.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var M=n.select(this).selectAll("g.titletext").data(g.title.text?[0]:[]);if(M.enter().append("g").classed("titletext",!0),M.exit().remove(),M.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.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,e),t="middle center"===g.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(m):D(m,d),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),T&&function(e,t){var r,n,a,i,o,l,s,c,u,f,d,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function g(e,t){return t.pxmid[1]-e.pxmid[1]}function v(e,r){r||(r={});var a,c,u,d,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,g=e.cyFinal+o(e.px0[1],e.px1[1]),v=p-h;if(v*s>0&&(e.labelExtraY=v),Array.isArray(t.pull))for(c=0;c=(y.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=v):(m+e.labelExtraY-g)*s>0&&(a=3*l*Math.abs(c-f.indexOf(e)),(d=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(a=n?m:g,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],f=u.concat(c),p=[],d=0;dMath.abs(f)?l+="l"+f*e.pxmid[0]/e.pxmid[1]+","+f+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(f-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(v,g),T&&g.automargin){var k=l.bBox(h.node()),A=g.domain,L=d.w*(A.x[1]-A.x[0]),S=d.h*(A.y[1]-A.y[0]),C=(.5*L-m.r)/d.w,E=(.5*S-m.r)/d.h;a.autoMargin(e,"pie."+g.uid+".automargin",{xl:A.x[0]-C,xr:A.x[1]+C,yb:A.y[0]-E,yt:A.y[1]+E,l:Math.max(m.cx-m.r-k.left,0),r:Math.max(k.right-(m.cx+m.r),0),b:Math.max(k.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-k.top,0),pad:5})}}))}));setTimeout((function(){m.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:I,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:D,prerenderTitles:_,layoutAreas:P,attachFxHandlers:x,computeTransform:z}},{"../../components/color":158,"../../components/drawing":180,"../../components/fx":198,"../../lib":299,"../../lib/svg_text_utils":322,"../../plots/plots":380,"../bar/constants":399,"../bar/uniform_text":413,"./event_data":500,"./helpers":501,"@plotly/d3":20}],506:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":413,"./style_one":507,"@plotly/d3":20}],507:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":158,"./helpers":501}],508:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&D[g].gap;)g--;for(x=D[g].s,m=D.length-1;m>g;m--)D[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],516:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults"),y=e("../../lib").coercePattern;t.exports=function(e,t,r,g){function v(r,a){return n.coerce(e,t,i,r,a)}var x=s(e,t,g,v);if(x||(t.visible=!1),t.visible){c(e,t,g,v),v("xhoverformat"),v("yhoverformat");var b=u(e,t,g,v),_=!b&&x=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iG!=(j=R[E][1])>=G&&(z=R[E-1][0],N=R[E][0],j-F&&(I=z+(N-z)*(G-F)/(j-F),Y=Math.min(Y,I),q=Math.max(q,I)));Y=Math.max(Y,0),q=Math.min(q,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:Y,x1:q,y0:G,y1:G,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":158,"../../components/fx":198,"../../lib":299,"../../registry":387,"./get_trace_color":519}],521:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":358,"./arrays_to_calcdata":508,"./attributes":509,"./calc":510,"./cross_trace_calc":514,"./cross_trace_defaults":515,"./defaults":516,"./format_labels":518,"./hover":520,"./marker_colorbar":527,"./plot":530,"./select":531,"./style":533,"./subtypes":534}],522:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){s||(s={});var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},{"../../components/colorscale/defaults":168,"../../components/colorscale/helpers":169,"../../lib":299}],523:[function(e,t,r){"use strict";var n=e("../../components/drawing"),a=e("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,c=e("../../lib"),u=c.segmentsIntersect,f=c.constrain,d=e("./constants");t.exports=function(e,t){var r,a,o,p,h,m,y,g,v,x,b,_,w,T,M,k,A,L,S=t.trace||{},O=t.xaxis,D=t.yaxis,C="log"===O.type,E="log"===D.type,P=O._length,R=D._length,I=t.backoff,z=S.marker,N=t.connectGaps,F=t.baseTolerance,j=t.shape,B="linear"===j,H=S.fill&&"none"!==S.fill,U=[],Y=d.minTolerance,q=e.length,V=new Array(q),Z=0;function G(r){var n=e[r];if(!n)return!1;var a=t.linearized?O.l2p(n.x):O.c2p(n.x),o=t.linearized?D.l2p(n.y):D.c2p(n.y);if(a===i){if(C&&(a=O.c2p(n.x,!0)),a===i)return!1;E&&o===i&&(a*=Math.abs(O._m*R*(O._m>0?l:s)/(D._m*P*(D._m>0?l:s)))),a*=1e3}if(o===i){if(E&&(o=D.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function W(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&coe||e[1]se)return[f(e[0],ie,oe),f(e[1],le,se)]}function fe(e,t){return e[0]===t[0]&&(e[0]===ie||e[0]===oe)||(e[1]===t[1]&&(e[1]===le||e[1]===se)||void 0)}function de(e,t,r){return function(n,a){var i=ue(n),o=ue(a),l=[];if(i&&o&&fe(i,o))return l;i&&l.push(i),o&&l.push(o);var s=2*c.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);s&&((i&&o?s>0==i[e]>o[e]?i:o:i||o)[e]+=s);return l}}function pe(e){var t=e[0],r=e[1],n=t===V[Z-1][0],a=r===V[Z-1][1];if(!n||!a)if(Z>1){var i=t===V[Z-2][0],o=r===V[Z-2][1];n&&(t===ie||t===oe)&&i?o?Z--:V[Z-1]=e:a&&(r===le||r===se)&&o?i?Z--:V[Z-1]=e:V[Z++]=e}else V[Z++]=e}function he(e){V[Z-1][0]!==e[0]&&V[Z-1][1]!==e[1]&&pe([Q,ee]),pe(e),te=null,Q=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ce[a],o=u(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,e)oe?oe:0,$=t[1]se?se:0,K||$){if(Z)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),V[Z++]=n[1])}else re=ne(V[Z-1],t)[0],V[Z++]=re;else V[Z++]=[K||t[0],$||t[1]];var a=V[Z-1];K&&$&&(a[0]!==K||a[1]!==$)?(te&&(Q!==K&&ee!==$?pe(Q&&ee?(i=te,l=(o=t)[0]-i[0],s=(o[1]-i[1])/l,(i[1]*o[0]-o[1]*i[0])/l>0?[s>0?ie:oe,se]:[s>0?oe:ie,le]):[Q||K,ee||$]):Q&&ee&&pe([Q,ee])),pe([K,$])):Q-K&&ee-$&&pe([K||Q,$||ee]),te=t,Q=K,ee=$}else te&&he(ne(te,t)[0]),V[Z++]=t;var i,o,l,s}for(r=0;rJ(m,ge))break;o=m,(w=v[0]*g[0]+v[1]*g[1])>b?(b=w,p=m,y=!1):w<_&&(_=w,h=m,y=!0)}if(y?(ye(p),o!==h&&ye(h)):(h!==a&&ye(h),o!==p&&ye(p)),ye(o),r>=e.length||!m)break;ye(m),a=m}}else ye(p)}te&&pe([Q||te[0],ee||te[1]]),U.push(V.slice(0,Z))}var ve=j.slice(j.length-1);if(I&&"h"!==ve&&"v"!==ve){for(var xe=!1,be=-1,_e=[],we=0;we=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":33}],527:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],528:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),c.noAngle||(s("marker.angle"),c.noAngleRef||s("marker.angleref"),c.noStandOff||s("marker.standoff")),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":158,"../../components/colorscale/defaults":168,"../../components/colorscale/helpers":169,"./subtypes":534}],529:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":279,"../../lib":299}],530:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,m){var y;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),m=Math.ceil(h.length/p),y=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(e){return g?e.transition():e}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,O;v(T).style("opacity",_.opacity);var D=_.fill.charAt(_.fill.length-1);"x"!==D&&"y"!==D&&(D=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,E,P="",R=[],I=_._prevtrace;I&&(P=I._prevRevpath||"",O=I._nextFill,R=I._polygons);var z,N,F,j,B,H,U,Y="",q="",V=[],Z=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(O&&O.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(z=s.steps(w.shape),N=s.steps(w.shape.split("").reverse().join(""))):z=N="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return N(e.reverse())},V=u(f,{xaxis:x,yaxis:b,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(V.length),y=0;y1){var r=n.select(this);if(r.datum(f),e)v(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",C),s.singleLineStyle(f,a)}}}}}var G=k.selectAll(".js-line").data(V);v(G.exit()).style("opacity",0).remove(),G.each(Z(!1)),G.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(Z(!0)),s.setClipUrl(G,r.layerClipId,e),V.length?(S?(S.datum(f),j&&H&&(D?("y"===D?j[1]=H[1]=b.c2p(0,!0):"x"===D&&(j[0]=H[0]=x.c2p(0,!0)),v(S).attr("d","M"+H+"L"+j+"L"+Y.substr(1)).call(s.singleFillStyle,e)):v(S).attr("d",Y+"Z").call(s.singleFillStyle,e))):O&&("tonext"===_.fill.substr(0,6)&&Y&&P?("tonext"===_.fill?v(O).attr("d",Y+"Z"+P+"Z").call(s.singleFillStyle,e):v(O).attr("d",Y+"L"+P.substr(1)+"Z").call(s.singleFillStyle,e),_._polygons=_._polygons.concat(R)):(J(O),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(S?J(S):O&&J(O),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),L.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,m=te;if(f||d){var y=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?K:X:_&&!w&&(y=$),f&&(h=y),d&&(m=y)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);g&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=v(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=v(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(L,W,e)}function J(e){v(e).attr("d","M0,0Z")}function X(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function $(e){return e.filter((function(e){return!e.gap}))}function Q(e){return e.id}function ee(e){if(e.ids)return Q}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,m=!!i&&i.duration>0,y=f(e,t,r);((u=a.selectAll("g.trace").data(y,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,y,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,y,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":180,"../../lib":299,"../../lib/polygon":311,"../../registry":387,"./line_points":523,"./link_traces":525,"./subtypes":534,"@plotly/d3":20}],531:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r"),o.hovertemplate=d.hovertemplate,i}function x(e,t){g.push(e._hovertitle+": "+t)}}},{"../scatter/hover":520}],543:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),plot:e("./plot"),style:e("../scatter/style").style,styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("../scatter/select"),eventData:e("./event_data"),moduleType:"trace",name:"scatterternary",basePlotModule:e("../../plots/ternary"),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/ternary":383,"../scatter/marker_colorbar":527,"../scatter/select":531,"../scatter/style":533,"./attributes":537,"./calc":538,"./defaults":539,"./event_data":540,"./format_labels":541,"./hover":542,"./plot":544}],544:[function(e,t,r){"use strict";var n=e("../scatter/plot");t.exports=function(e,t,r){var a=t.plotContainer;a.select(".scatterlayer").selectAll("*").remove();for(var i=t.xaxis,o=t.yaxis,l={xaxis:i,yaxis:o,plot:a,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},s=t.layers.frontplot.select("g.scatterlayer"),c=0;c0){var b,_,w,T,M,k=e.xa,A=e.ya;"h"===h.orientation?(M=t,b="y",w=A,_="x",T=k):(M=r,b="x",w=k,_="y",T=A);var L=p[e.index];if(M>=L.span[0]&&M<=L.span[1]){var S=a.extendFlat({},e),O=T.c2p(M,!0),D=l.getKdeValue(L,h,M),C=l.getPositionOnKdePath(L,h,O),E=w._offset,P=w._length;S[b+"0"]=C[0],S[b+"1"]=C[1],S[_+"0"]=S[_+"1"]=O,S[_+"Label"]=_+": "+i.hoverLabelText(T,M,h[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+D.toFixed(3);for(var R=0,I=0;Ia&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),x={},b={},_=0;h?(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},g=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},g=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(y);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],70:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var d=t.linesIntersect(o,l,c,u);if(!1===d){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var f=t.pointsSame(o,c),p=t.pointsSame(l,u);if(f&&p)return n;var h=!f&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(f)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===d.alongA&&(-1===d.alongB?s(e,c):0===d.alongB?s(e,d.pt):1===d.alongB&&s(e,u)),0===d.alongB&&(-1===d.alongA?s(n,o):0===d.alongA?s(n,d.pt):1===d.alongA&&s(n,l));return!1}for(var d=[];!i.isEmpty();){var f=i.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var p=c(f),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function y(){if(h){var e=u(f,h);if(e)return e}return!!m&&u(f,m)}r&&r.tempStatus(f.seg,!!h&&h.seg,!!m&&m.seg);var v,g=y();if(g){var x;if(e)(x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above);else g.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(g.seg),f.other.remove(),f.remove()}if(i.getHead()!==f){r&&r.rewind(f.seg);continue}if(e)x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:a,f.seg.myFill.above=x?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill)v=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:a,f.seg.otherFill={above:v,below:v};r&&r.status(f.seg,!!h&&h.seg,!!m&&m.seg),f.other.status=p.insert(n.node({ev:f}))}else{var b=f.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(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}d.push(f.seg)}i.getHead().remove()}return r&&r.done(),d}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":75,timers:76}],77:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,d=!1,f=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=H.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=H.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=H.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=H.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=H.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=H.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=H.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:R(t[4]),format:a?"name":"hex8"};if(t=H.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=H.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:R(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=H.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(m,255)},d=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(s=N(t.s),c=N(t.v),a=function(t,r,n){t=6*O(t,360),r=O(r,100),n=O(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),d=!0,f="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(s=N(t.s),u=N(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),d=!0,f="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=D(i),{ok:d,format:t.format||f,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=D(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return f(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(z(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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:N(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function N(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return P(e)/255}var F,E,j,H=(E="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(e){return!!H.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],78:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=f[o-f[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var d=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(d/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=d[e-d[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=d[o.year-d[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=f[a.year-f[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=f[i.year-f[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=d[i.year-d[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!y||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":92,"object-assign":64}],81:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":92,"object-assign":64}],82:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":92,"object-assign":64}],83:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":92,"object-assign":64}],84:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":92,"object-assign":64}],85:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":92,"object-assign":64}],86:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":92,"object-assign":64}],87:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),d=e-this.toJD(s,u,1)+1;return this.newDate(s,u,d)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":92,"object-assign":64}],89:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":92,"object-assign":64}],90:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":92,"object-assign":64}],91:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":92,"object-assign":64}],92:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":64}],93:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,d=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=g(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){g("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=g(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(f,p);h>S;S=this.daysInMonth(f,p))p++,h-=S}return d>-1?this.fromJD(d):this.newDate(f,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":92,"object-assign":64}],94:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],95:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":229,"../../plot_api/plot_template":290,"../../plots/cartesian/constants":308,"../../plots/font_attributes":329,"./arrow_paths":94}],96:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],d=e["_"+i+"padminus"],f={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+f,m=p-f,y=3*e.startarrowsize*e.arrowwidth||0,v=y+f,g=y-f;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,v),ppadminus:Math.max(d,g)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=l?v+l:v,g=l?g-l:g,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,v),ppadminus:Math.max(d,m,g)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":254,"../../plots/cartesian/axes":301,"./draw":101}],97:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,d=[],f=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),d={},f=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,X=["x","y"],W=0;W1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),J=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===fe;"x"===te?(Q=t[te],J=he?ae._offset+ae._length*Q:J=T.l+T.w*Q):(Q=1-t[te],J=he?ae._offset+ae._length*Q:J=T.t+T.h*Q),$=t.showarrow?.5:Q}if(t.showarrow){de.head=J;var me=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var ye=s.getRefType(ne);"domain"===ye?("y"===te&&(me=1-me),de.tail=ae._offset+ae._length*me):"paper"===ye?"y"===te?(me=1-me,de.tail=T.t+T.h*me):de.tail=T.l+T.w*me:de.tail=ae._offset+ae.r2p(me),K=ee}else de.tail=J+me,K=ee+me;de.text=de.tail+ee;var ve=w["x"===te?"width":"height"];if("paper"===re&&(de.head=o.constrain(de.head,1,ve-1)),"pixel"===ne){var ge=-Math.max(de.tail-3,de.text),xe=Math.min(de.tail+3,de.text)-ve;ge>0?(de.tail+=ge,de.text+=ge):xe>0&&(de.tail-=xe,de.text-=xe)}de.tail+=ue,de.head+=ue}else K=ee=se*U($,ce),de.text=J+ee;de.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)R.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),d)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,B?D:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;q.call(f.positionText,Te,we).call(u.setClipUrl,B?D:null,e)}Y.select("rect").call(u.setRect,j,j,k,z),H.call(u.setRect,F/2,F/2,E-F,V-F),R.call(u.setTranslate,Math.round(O.x.text-E/2),Math.round(O.y.text-V/2)),I.attr({transform:"rotate("+C+","+O.x.text+","+O.y.text+")"});var Me,ke=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=O.x.head,d=O.y.head,f=O.x.tail+r,p=O.y.tail+n,m=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(C,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),D=+H.attr("width"),N=+H.attr("height"),z=m-.5*D,F=z+D,E=b-.5*N,j=E+N,B=[[z,E,z,j],[z,j,F,j],[F,j,F,E],[F,E,z,E]].map(k);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(s,d,s+1e6,d+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(f,p,s,d,e[0],e[1],e[2],e[3]);t&&(f=t.x,p=t.y)}));var Y=t.arrowwidth,V=t.arrowcolor,U=t.arrowside,q=P.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),G=q.append("path").attr("d","M"+f+","+p+"L"+s+","+d).style("stroke-width",Y+"px").call(c.stroke,c.rgb(V));if(y(G,U,t),M.annotationPosition&&G.node().parentNode&&!i){var Z=s,X=d;if(t.standoff){var W=Math.sqrt(Math.pow(s-f,2)+Math.pow(d-p,2));Z+=t.standoff*(f-s)/W,X+=t.standoff*(p-d)/W}var J,K,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-Z)+","+(p-X),transform:l(Z,X)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:Q.node(),gd:e,prepFn:function(){var e=u.getTranslate(R);J=e.x,K=e.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(J,K),a=n[0]+e,i=n[1]+r;R.call(u.setTranslate,a,i),L("x",g(v,e,"x",T,t)),L("y",g(x,r,"y",T,t)),t.axref===t.xref&&L("ax",g(v,e,"ax",T,t)),t.ayref===t.yref&&L("ay",g(x,r,"ay",T,t)),q.attr("transform",l(e,r)),I.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),N)h.init({element:R.node(),gd:e,prepFn:function(){Me=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",g(v,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",g(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(v)a=g(v,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=g(x,r,"y",T,t);else{var u=t._ysize/T.h,d=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(d-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),v&&x||(n=h.getCursor(v?.5:a,x?.5:o,t.xanchor,t.yanchor))}I.attr({transform:l(e,r)+Me}),p(R,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(R),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*y+r.standoff,_=m.backoff*v+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(f=(d=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void N();if(b){if(b*b>w*w+T*T)return void N();var M=b*Math.cos(d),k=b*Math.sin(d);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void N();var A=_*Math.cos(d),L=_*Math.sin(d);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),D="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":332,"../annotations/draw":101}],108:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).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()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var ce=Math.pow(10,Math.floor(Math.log(se)/Math.LN10));oe*=ce*c.roundUp(se/ce,[2,5,10]),(Math.abs(U.start)/U.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+P/R.h,re+K-P/R.h]:[re+C/R.w,re+K-C/R.w],ae.setScale(),e.attr("transform",u(Math.round(R.l),Math.round(R.t)));var ue,de=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(R.l),-Math.round(R.t))),fe=ae.ticklabelposition,pe=ae.title.font.size,he=e.select("."+k.cbaxis),me=0,ye=0;function ve(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:z._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,d(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===H&&(e=C+R.l+R.w*I,t=P+R.t+R.h*(1-re-K)+3+.75*pe),"bottom"===H&&(e=C+R.l+R.w*I,t=P+R.t+R.h*(1-re)-3-.25*pe),"right"===H&&(t=P+R.t+R.h*N+3+.75*pe,e=C+R.l+R.w*re),ve(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,s=e.select("."+k.cbtitle),d=s.select("text"),f=[-A/2,A/2],h=s.select(".h"+ae._id+"title-math-group").node(),m=15.6;if(d.node()&&(m=parseInt(d.node().style.fontSize,10)*w),h?(i=p.bBox(h),ye=i.width,(me=i.height)>m&&(f[1]-=(me-m)/2)):d.node()&&!d.classed(k.jsPlaceholder)&&(i=p.bBox(d.node()),ye=i.width,me=i.height),o){if(me){if(me+=5,"top"===H)ae.domain[1]-=me/R.h,f[1]*=-1;else{ae.domain[0]+=me/R.h;var v=y.lineCount(d);f[1]+=(1-v)*m}s.attr("transform",u(f[0],f[1])),ae.setScale()}}else ye&&("right"===H&&(ae.domain[0]+=(ye+pe/2)/R.w),s.attr("transform",u(f[0],f[1])),ae.setScale())}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",o?u(0,Math.round(R.h*(1-ae.domain[1]))):u(Math.round(R.w*ae.domain[0]),0)),he.attr("transform",o?u(0,Math.round(-R.t)):u(Math.round(-R.l),0));var g=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(G);g.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),g.exit().remove();var x=B.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));g.each((function(e,i){var l=[0===i?B[0]:(G[i]+G[i-1])/2,i===G.length-1?B[1]:(G[i]+G[i+1])/2].map(ae.c2p).map(Math.round);o&&(l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,x[0],x[1]));var s=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(l)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(n.max(l)-n.min(l),2));if(t._fillgradient)p.gradient(s,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=V(e).replace("e-","");s.attr("fill",a(u).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(E.color&&E.width?Z:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){var t=Q,r=Math.round(ae.c2p(e))+E.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+X).call(p.lineGroupStyle,E.width,Y(e),E.dash)})),he.selectAll("g."+ae._id+"tick,path").remove();var _=Q+X+(A||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(ae),M=l.getTickSigns(ae)[2];return l.drawTicks(r,ae,{vals:"inside"===ae.ticks?l.clipEnds(ae,T):T,layer:he,path:l.makeTickPath(ae,_,M),transFn:l.makeTransTickFn(ae)}),l.drawLabels(r,ae,{vals:T,layer:he,transFn:l.makeTransTickLabelFn(ae),labelFns:l.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,l=ae._offset+ae._length/2;if("right"===H)a=l,e=R.l+R.w*i+10+pe*(ae.showticklabels?1:.5);else if(e=l,"bottom"===H&&(a=R.t+R.h*i+10+(-1===fe.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===H){var s=j.text.split("
").length;a=R.t+R.h*i+10-X-w*pe*s}ve((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:H,offsetTop:o?0:R.t,offsetLeft:o?R.l:0,maxShift:o?z.width:z.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,l=X+A/2;-1===fe.indexOf("inside")&&(n=p.bBox(he.node()),l+=o?n.width:n.height),ue=de.select("text");var c=0,d=o&&"top"===H,m=!o&&"right"===H,y=0;if(ue.node()&&!ue.classed(k.jsPlaceholder)){var g,x=de.select(".h"+ae._id+"title-math-group").node();x&&(o&&ie||!o&&!ie)?(c=(n=p.bBox(x)).width,g=n.height):(c=(n=p.bBox(de.node())).right-R.l-(o?Q:ne),g=n.bottom-R.t-(o?ne:Q),o||"top"!==H||(l+=n.height,y=n.height)),m&&(ue.attr("transform",u(c/2+pe/2,0)),c*=2),l=Math.max(l,o?c:g)}var b=2*(o?C:P)+l+L+A/2,w=0;!o&&j.text&&"bottom"===O&&N<=0&&(b+=w=b/2,y+=w),z._hColorbarMoveTitle=w,z._hColorbarMoveCBTitle=y;var F=L+A;e.select("."+k.cbbg).attr("x",(o?Q:ne)-F/2-(o?C:0)).attr("y",(o?ne:Q)-(o?J:P+y-w)).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(J+F,2)).call(h.fill,S).call(h.stroke,t.bordercolor).style("stroke-width",L);var E=m?Math.max(c-10,0):0;if(e.selectAll("."+k.cboutline).attr("x",(o?Q:ne+C)+E).attr("y",(o?ne+P-J:Q)+(d?me:0)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(J-(o?2*P+me:2*C+E),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(R.l-(o?$*b:0),R.t-(o?0:(1-ee)*b-y))),!o&&(L||a(S).getAlpha()&&!a.equals(z.paper_bgcolor,S))){var B=he.selectAll("text"),Y=B[0].length,V=e.select("."+k.cbbg).node(),U=p.bBox(V),q=p.getTranslate(e);B.each((function(e,t){var r=Y-1;if(0===t||t===r){var n,a=p.bBox(this),i=p.getTranslate(this);if(t===r){var o=a.right+i.x;(n=U.right+q.x+ne-L-2+I-o)>0&&(n=0)}else if(0===t){var l=a.left+i.x;(n=U.left+q.x+ne+L+2-l)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var G={},Z=T[D],W=M[D],K=T[O],te=M[O],re=b-X;o?("pixels"===f?(G.y=N,G.t=J*K,G.b=J*te):(G.t=G.b=0,G.yt=N+s*K,G.yb=N-s*te),"pixels"===_?(G.x=I,G.l=b*Z,G.r=b*W):(G.l=re*Z,G.r=re*W,G.xl=I-v*Z,G.xr=I+v*W)):("pixels"===f?(G.x=I,G.l=J*Z,G.r=J*W):(G.l=G.r=0,G.xl=I+s*Z,G.xr=I-s*W),"pixels"===_?(G.y=1-N,G.t=b*K,G.b=b*te):(G.t=re*K,G.b=re*te,G.yt=N-v*K,G.yb=N+v*te)),i.autoMargin(r,t._id,G)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l="v"===t.orientation,c=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align((l?t._uFrac:t._vFrac)+r/c.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=s.align((l?t._vFrac:1-t._uFrac)-o/c.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var d=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,d)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":228,"../../lib":254,"../../lib/extend":248,"../../lib/setcursor":274,"../../lib/svg_text_utils":277,"../../plots/cartesian/axes":301,"../../plots/cartesian/axis_defaults":303,"../../plots/cartesian/layout_attributes":314,"../../plots/cartesian/position_defaults":317,"../../plots/plots":335,"../../registry":337,"../color":112,"../colorscale/helpers":123,"../dragelement":131,"../drawing":134,"../titles":221,"./constants":114,"@plotly/d3":18,tinycolor2:77}],117:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":254}],118:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":113,"./defaults":115,"./draw":116,"./has_colorbar":117}],119:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,d=t.editTypeOverride||"",f=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(f+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",y=i+"mid",v=(l(f+p),l(f+h),l(f+m),{});v[h]=v[m]=void 0;var g={};g[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:d||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[h]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:g},x[m]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:g},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":270,"../../lib/sort_object_keys":275,"../colorbar/attributes":113,"./scales.js":127}],120:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,d=i(u),f=!1!==d.auto,p=d.min,h=d.max,m=d.mid,y=function(){return a.aggNums(Math.min,null,s)},v=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=y():f&&(p=u._colorAx&&n(p)?Math.min(p,y()):y()),void 0===h?h=v():f&&(h=u._colorAx&&n(h)?Math.max(h,v()):v()),f&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,d._sync("colorscale",o))}},{"../../lib":254,"./helpers":123,"fast-isnumeric":26}],121:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],129:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":254}],130:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],131:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function d(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,f,p,h,m,y=e.gd,v=1,g=y._context.doubleClickDelay,x=e.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)g&&(v=Math.max(v-1,1)),y._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(v,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=d(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},s.coverSlip=u},{"../../lib":254,"../../plots/cartesian/constants":308,"./align":128,"./cursor":129,"./unhover":132,"has-hover":57,"has-passive-events":58,"mouse-event-offset":62}],132:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":246,"../../lib/events":247,"../../lib/throttle":278,"../fx/constants":146}],133:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],134:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),d=a.strTranslate,f=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),v=e("../../traces/scatter/make_bubble_size_func"),g=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};function b(e,t,r){var n=t.fillpattern,a=n&&x.getPatternAttr(n.shape,0,"");if(a){var i=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),l=n.fgopacity,s=x.getPatternAttr(n.size,0,8),u=x.getPatternAttr(n.solidity,0,.3),d=t.uid;x.pattern(e,"point",r,d,a,s,u,void 0,n.fillmode,i,o,l)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",d(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e,t){var r=n.select(e.node());b(e,((r.data()[0]||[])[0]||{}).trace||{},t)},x.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&b(r,e[0].trace,t)}))};var _=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,x.symbolBackOffs[r]=t.backoff||0,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function T(e,t,r,n){var a=e%100;return x.symbolFuncs[a](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var M={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=i("~f"),L={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,d=L[i],f=new Array(u),p=0;p=100;var d=re(e,r),f=q(e,r);t.attr("d",T(u,s,d,f))}var p,h,m,y=!1;if(e.so)m=l.outlierwidth,h=l.outliercolor,p=o.outliercolor;else{var v=(l||{}).width;m=(e.mlw+1||v+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,y=!0),p="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,p).style({"stroke-width":(m||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:m)+"px");var g=o.gradient,b=e.mgt;b?y=!0:b=g&&g.type,a.isArrayOrTypedArray(b)&&(b=b[0],L[b]||(b=0));var _=o.pattern,w=_&&x.getPatternAttr(_.shape,e.i,"");if(b&&"none"!==b){var M=e.mgc;M?y=!0:M=g.color;var k=r.uid;y&&(k+="-"+e.i),x.gradient(t,i,k,b,[[0,M],[1,p]],"fill")}else if(w){var A=x.getPatternAttr(_.bgcolor,e.i,null),S=x.getPatternAttr(_.fgcolor,e.i,null),D=_.fgopacity,O=x.getPatternAttr(_.size,e.i,8),C=x.getPatternAttr(_.solidity,e.i,.3),P=e.mcc||a.isArrayOrTypedArray(_.shape)||a.isArrayOrTypedArray(_.bgcolor)||a.isArrayOrTypedArray(_.size)||a.isArrayOrTypedArray(_.solidity),I=r.uid;P&&(I+="-"+e.i),x.pattern(t,"point",i,I,w,O,C,e.mcc,_.fillmode,A,S,D)}else c.fill(t,p);m&&c.stroke(t,h)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=y.isBubble(e)?v(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,d=l.opacity,f=void 0!==u,p=void 0!==d;(a.isArrayOrTypedArray(c)||f||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?f?u:t:p?d:m*t});var h=i.color,y=o.color,v=l.color;(y||v)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?y||t:v||t});var g=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||g/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);e.attr("d",T(x.symbolNumber(i),o,re(n,t),q(n,t))),n.mrc2=o})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,d=u?u(e,t,s):{},p={};g(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,d,s._d3locale,p,e,h)}var m=e.tp||t.textposition,y=O(e,t),v=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,y,v).text(c).call(f.convertToTspans,r).call(D,m,y,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=O(e,t);c.fill(a,i);var u=s.traceIs(t,"bar-like");D(a,o,l,e.mrc2||e.mrc,u)}))}};var C,P;function I(e,t,r){return r&&(e=j(e)),t?z(e[1]):N(e[0])}function N(e){var t=n.round(e,2);return C=t,t}function z(e){var t=n.round(e,2);return P=t,t}function R(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],l=r[1]-t[1],s=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+l*l,.25),u=(c*c*a-s*s*o)*n,d=(c*c*i-s*s*l)*n,f=3*c*(s+c),p=3*s*(s+c);return[[N(t[0]+(f&&u/f)),z(t[1]+(f&&d/f))],[N(t[0]-(p&&u/p)),z(t[1]-(p&&d/p))]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=c||b>=d&&b<=c)&&(_<=f&&_>=u||_>=f&&_<=u)&&(e=[b,_])}return e}x.steps=function(e){var t=F[e]||E;return function(e){for(var r="M"+N(e[0][0])+","+z(e[0][1]),n=e.length,a=1;a=1e4&&(x.savedBBoxes={},H=0),r&&(x.savedBBoxes[r]=y),H++,a.extendFlat({},y)},x.setClipUrl=function(e,t,r){e.attr("clip-path",Y(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=d(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var V=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(V,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var U=/translate\([^)]*\)\s*$/;function q(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(U);e=1===t&&1===r?[]:[d(o,l),"scale("+t+","+r+")",d(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))},x.getMarkerStandoff=q;var G,Z,X,W,J,K,Q=Math.atan2,$=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*$(e)-n*ee(e),r*ee(e)+n*$(e)]}function re(e,t){var r,n,a=e.ma;void 0===a&&(a=t.marker.angle||0);var i=t.marker.angleref;if("previous"===i||"north"===i){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var s=t._xA,c=t._yA;if(!s||!c)return 90;r=s.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,d=e.lonlat[0],f=e.lonlat[1],p=t._geo.project([d,f+1e-5]),h=t._geo.project([d+1e-5,f]),m=Q(h[1]-n,h[0]-r),y=Q(p[1]-n,p[0]-r);if("north"===i)u=a/180*Math.PI;else if("previous"===i){var v=d/180*Math.PI,g=f/180*Math.PI,x=G/180*Math.PI,b=Z/180*Math.PI,_=x-v,w=$(b)*ee(_),T=ee(b)*$(g)-$(b)*ee(g)*$(_);u=-Q(w,T)-Math.PI,G=d,Z=f}var M=te(m,[$(u),0]),k=te(y,[ee(u),0]);a=Q(M[1]+k[1],M[0]+k[0])/Math.PI*180,"previous"!==i||K===t.uid&&e.i===J+1||(a=null)}if("previous"===i&&!t._geo)if(K===t.uid&&e.i===J+1&&o(r)&&o(n)){var A=r-X,L=n-W,S=t.line&&t.line.shape||"",D=S.slice(S.length-1);"h"===D&&(L=0),"v"===D&&(A=0),a+=Q(L,A)/Math.PI*180+90}else a=null}return X=r,W=n,J=e.i,K=t.uid,a}x.getMarkerAngle=re},{"../../components/fx/helpers":148,"../../constants/alignment":228,"../../constants/interactions":233,"../../constants/xmlns_namespaces":235,"../../lib":254,"../../lib/svg_text_utils":277,"../../registry":337,"../../traces/scatter/make_bubble_size_func":455,"../../traces/scatter/subtypes":463,"../color":112,"../colorscale":124,"./symbol_defs":135,"@plotly/d3":18,"fast-isnumeric":26,tinycolor2:77}],135:[function(e,t,r){"use strict";var n,a,i,o,l=e("parse-svg-path"),s=e("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),d=Math.PI,f=Math.cos,p=Math.sin;function h(e){return null===e}function m(e,t,r){if(!(e&&e%360!=0||t))return r;if(i===e&&o===t&&n===r)return a;function s(e,r){var n=f(e),a=p(e),i=r[0],o=r[1]+(t||0);return[i*n-o*a,i*a+o*n]}i=e,o=t,n=r;for(var c=e/180*d,u=0,h=0,m=l(r),y="",v=0;v0;t.each((function(t){var d,f=t[0].trace,p=f.error_x||{},h=f.error_y||{};f.ids&&(d=function(e){return e.id});var m=o.hasMarkers(f)&&f.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),h.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var d=h.width;i="M"+(r.x-d)+","+r.yh+"h"+2*d+"m-"+d+",0V"+r.ys,r.noYS||(i+="m-"+d+",0h"+2*d),!o.size()?o=t.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 f=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!f.size()?f=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(l.duration).ease(l.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":463,"../drawing":134,"@plotly/d3":18,"fast-isnumeric":26}],142:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":112,"@plotly/d3":18}],143:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":248,"../../plots/font_attributes":329,"./layout_attributes":153}],144:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||oe<0||oe>w[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,Y="xval"in t?v.flat(s,t.xval):v.p2c(_,ie),V="yval"in t?v.flat(s,t.yval):v.p2c(w,oe),!a(Y[0])||!a(V[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(q=0;qee&&(te.splice(0,ee),ce=te[0].distance),g&&0!==E&&0===te.length){$.distance=E,$.index=!1;var d=Z._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(d&&(d=d.filter((function(e){return e.spikeDistance<=E}))),d&&d.length){var f,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var m=h[0];a(m.x0)&&a(m.y0)&&(f=fe(m),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>f.spikeDistance)&&(ne.vLinePoint=f))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(f=fe(x),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>f.spikeDistance)&&(ne.hLinePoint=f))}}}}}function de(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)Oe(te[Ae]);te=Le,ye()}var Ce=e._hoverdata,Pe=[],Ie=H(e),Ne=B(e);for(U=0;U1||te.length>1)||"closest"===C&&ae&&te.length>1,Ze=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),Xe=P(te,{gd:e,hovermode:C,rotateLabels:Ge,bgColor:Ze,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});v.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,d=1,f=e.size(),p=new Array(f),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(d=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||d*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&g.pmin===x.pmin&&g.pmax===x.pmax){for(l=v.length-1;l>=0;l--)v[l].dp+=a;for(y.push.apply(y,v),p.splice(o+1,1),c=0,l=y.length-1;l>=0;l--)c+=y[l].dp;for(i=c/y.length,l=y.length-1;l>=0;l--)y[l].dp-=i;n=!1}else o++}p.forEach(m)}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}}}(Xe,Ge?"xa":"ya",u),N(Xe,Ge,u._invScaleX,u._invScaleY));if(l&&l.tagName){var We=y.getComponentMethod("annotations","hasClickToShow")(e,Pe);d(n.select(l),We?"pointer":"")}if(!l||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:Y,yvals:V})}(e,t,r,i,l)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=H(a),o=B(a),l=P(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),d=Math.max(r,n),f=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(y.traceIs(m,"gl3d")){var v=a._fullLayout[m.scene]._scene.container,g=v.offsetLeft,x=v.offsetTop;u+=g,d+=g,f+=x,h+=x}c.bbox={x0:u+o,x1:d+o,y0:f+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function P(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,d=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var T=t.fontFamily||g.HOVERFONT,M=t.fontSize||g.HOVERFONTSIZE,k=e[0],S=k.xa,D=k.ya,C=i.charAt(0),P=C+"Label",N=k[P];if(void 0===N&&"multicategory"===S.type)for(var z=0;za.width-b?(y=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+g.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+g.width/2)+"v"+x+(2*L+g.height)+"H-"+(L+g.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,O,C;"right"===D.side?(_="start",O=1,C="",y=S._offset+S._length):(_="end",O=-1,C="-",y=S._offset),v=D._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+g.height/2)+"h"+C+(2*L+g.width)+"V-"+(L+g.height/2)+"H"+C+A+"V-"+A+"Z");var P,I=g.height/2,z=F-g.top-I,R="clip"+a._uid+"commonlabel"+D._id;if(y=0?le:se+de=0?se:xe+de=0?ie:oe+fe=0?oe:be+fe=0,"top"!==e.idealAlign&&q||!G?q?(P+=R/2,e.anchor="start"):e.anchor="middle":(P-=R/2,e.anchor="end");else if(e.pos=P,q=C+z/2+Z<=E,G=C-z/2-Z>=0,"left"!==e.idealAlign&&q||!G)if(q)C+=z/2,e.anchor="start";else{e.anchor="middle";var X=Z/2,W=C+X-E,J=C-X;W>0&&(C-=W),J<0&&(C+=-J)}else C-=z/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(C,P)+(c?s(_):""))})),_e}function I(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var d=e.hovertemplate||!1;if(d){var f=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),s=(s=o.hovertemplateString(d,f,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=E(r,e.nameLength),""}))}return[s,l]}function N(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],d=c*(A+L),p=d+c*(e.txwidth+L),h=0,m=e.offset,y="middle"===l;y&&(d-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",y?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var v=h+d,g=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),v=y?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),v=y?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(v),o(g)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(f.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var d=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+d+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+d,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var f=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+f+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+f,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function R(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),d||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var y,v,g=t.hLinePoint;n=g&&g.xa,"cursor"===(a=g&&g.ya).spikesnap?(y=c.pointerX,v=c.pointerY):(y=n._offset+g.x,v=a._offset+g.y);var x,b,_=i.readability(g.color,h)<1.5?p.contrast(h):g.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=y),-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:v,y2:v,"stroke-width":T,stroke:M,"stroke-dasharray":f.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:v,r:T,fill:M}).classed("spikeline",!0)}if(d){var S,D,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,D=c.pointerY):(S=n._offset+O.x,D=a._offset+O.y);var C,P,I=i.readability(O.color,h)<1.5?p.contrast(h):O.color,N=n.spikemode,z=n.spikethickness,R=n.spikecolor||I,F=m.getPxPosition(e,n);if(-1!==N.indexOf("toaxis")||-1!==N.indexOf("across")){if(-1!==N.indexOf("toaxis")&&(C=F,P=D),-1!==N.indexOf("across")){var E=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(E=Math.min(E,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,P=s.t+(1-E)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z,stroke:R,"stroke-dasharray":f.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==N.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?z:-z),r:z,fill:R}).classed("spikeline",!0)}}}function F(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function H(e){return e.offsetTop+e.clientTop}function B(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),d=c[0],f=c[1],p=u[0],h=u[1];return{x:d,y:f,width:p-d,height:h-f,top:Math.min(f,h),left:Math.min(d,p),right:Math.max(d,p),bottom:Math.max(f,h)}}},{"../../lib":254,"../../lib/events":247,"../../lib/override_cursor":265,"../../lib/svg_text_utils":277,"../../plots/cartesian/axes":301,"../../registry":337,"../color":112,"../dragelement":131,"../drawing":134,"../legend/defaults":164,"../legend/draw":165,"./constants":146,"./helpers":148,"@plotly/d3":18,"fast-isnumeric":26,tinycolor2:77}],150:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var l=t.legend;function s(e){o.font[e]||(o.font[e]=l?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),l?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":254,"../color":112,"./helpers":148}],151:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":254,"./layout_attributes":153}],152:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":254,"../dragelement":131,"./attributes":143,"./calc":144,"./click":145,"./constants":146,"./defaults":147,"./helpers":148,"./hover":149,"./layout_attributes":153,"./layout_defaults":154,"./layout_global_defaults":155,"@plotly/d3":18}],153:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":329,"./constants":146}],154:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":254,"./hoverlabel_defaults":150,"./hovermode_defaults":151,"./layout_attributes":153}],155:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":254,"./hoverlabel_defaults":150,"./layout_attributes":153}],156:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),d=u*(1-o),f=0;f1){if(!f&&!p&&!h)"independent"===M("pattern")&&(f=!0);y._hasSubplotGrid=f;var x,b,_="top to bottom"===M("roworder"),w=f?.2:.1,T=f?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),y._domains={x:u("x",M,w,x,g),y:u("y",M,T,b,v,_)}}else delete t.grid}function M(e,t){return n.coerce(r,y,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,f=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,y=r.columns,v="independent"===r.pattern,g=r._axisMap={};if(h){var x=f.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1===_&&(t.legend=void 0),(!1!==_||d.uirevision)&&(p("uirevision",t.uirevision),!1!==_)){p("bgcolor",t.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,T,M,k=a.coerceFont(p,"font",t.font),A="h"===p("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(T=1.1,M="bottom"):(T=-.1,M="top")):(w=1.02,T=1,M="auto"),p("traceorder",x),c.isGrouped(t.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",T),p("yanchor",M),p("valign"),a.noneOrAll(d,f,["x","y"]),p("title.text")){p("title.side",A?"left":"top");var L=a.extendFlat({},k,{size:a.bigFont(k.size)});a.coerceFont(p,"title.font",L)}}}},{"../../lib":254,"../../plot_api/plot_template":290,"../../plots/attributes":297,"../../plots/layout_attributes":333,"../../registry":337,"./attributes":162,"./helpers":168}],165:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),d=e("../../lib/svg_text_utils"),f=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,y=h.FROM_TL,v=h.FROM_BR,g=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r){var n=e[0],a=n.width,i=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===i?t._maxWidth*o:r+(o||a)}function w(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&f(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&f(r,e,n)}}function T(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),f=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(f?M(n,h):n);var y=r.itemwidth+2*p.itemGap;d.positionText(m,y,0),f?m.call(d.makeEditable,{gd:t,text:n}).call(A,e,t,r).on("edit",(function(n){this.text(M(n,h)).call(A,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),d=u[u.length-1],f=a.keyedContainer(i,"transforms["+d+"].styles","target","value.name");f.set(l.trace._group,n),c=f.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):A(m,e,t,r)}function M(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(t,r,e,o,n.event)}})))}function A(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),d.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,f,h=l.size*m;if(o){var y=c.bBox(o);u=y.height,f=y.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var v=e.select(1===n?".legendtitletext":".legendtext"),g=d.lineCount(v),x=v.node();if(u=h*g,f=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(f+=2*p.itemGap),d.positionText(v,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,f-=r.itemwidth),d.positionText(v,b,-h*((g-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=f)}(t,r,n,a)}))}function L(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,d=e._fullLayout,f="legend"+d._uid,h=t._inHover;h?(r=t.layer,f+="-hover"):r=d._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=g(t.entries,t)}else{if(!e.calcdata)return;l=d.showlegend&&g(e.calcdata,t)}var m=d.hiddenlabels||[];if(!(h||d.showlegend&&l.length))return r.selectAll(".legend").remove(),d._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var M=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),D=a.ensureSingleById(d._topdefs,"clipPath",f,(function(e){e.append("rect")})),O=a.ensureSingle(M,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));O.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(M,"g","scrollbox"),P=t.title;if(t._titleWidth=0,t._titleHeight=0,P.text){var I=a.ensureSingle(C,"text","legendtitletext");I.attr("text-anchor","start").call(c.font,P.font).text(P.text),A(I,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var N=a.ensureSingle(M,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(l);z.enter().append("g").attr("class","groups"),z.exit().remove();var R=z.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(T,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u="fraction"===a.entrywidthmode,d=a.borderwidth,f=2*d,h=p.itemGap,m=a.itemwidth+2*h,y=2*(d+h),v=S(a),g=a.y<0||0===a.y&&"top"===v,x=a.y>1||1===a.y&&"bottom"===v,w=a.tracegroupgap,T={};a._maxHeight=Math.max(g||x?i.height/2:o.h,30);var M=0;a._width=0,a._height=0;var k=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,d+k[0],d+k[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),M=m+a._width,a._width+=h+m+f,a._height+=y,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=L(a),D=a.x<0||0===a.x&&"right"===A,O=a.x>1||1===a.x&&"left"===A,C=x||g,P=i.width/2;a._maxWidth=Math.max(D?C&&"left"===A?o.l+o.w:P:O?C&&"right"===A?o.r+o.w:P:o.w,2*m);var I=0,N=0;r.each((function(e){var t=_(e,a,m);I=Math.max(I,t),N+=t})),M=null;var z=0;if(s){var R=0,F=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,a,m),i=r[0].height;c.setTranslate(this,k[0],k[1]+d+h+i/2+t),t+=i,e=Math.max(e,n),T[r[0].trace.legendgroup]=e}));var r=e+h;F>0&&r+d+F>a._maxWidth?(z=Math.max(z,F),F=0,E+=R+w,R=t):R=Math.max(R,t),c.setTranslate(this,F,E),F+=r})),a._width=Math.max(z,F)+d,a._height=E+R+y}else{var j=r.size(),H=N+f+(j-1)*h=a._maxWidth&&(z=Math.max(z,U),Y=0,V+=B,a._height+=B,B=0),c.setTranslate(this,k[0]+d+Y,k[1]+d+V+t/2+h),U=Y+r+h,Y+=n,B=Math.max(B,t)})),H?(a._width=Y+f,a._height=B+y):(a._width=Math.max(z,U)+f,a._height+=B+y)}}a._width=Math.ceil(Math.max(a._width+k[0],a._titleWidth+2*(d+p.titlePad))),a._height=Math.ceil(Math.max(a._height+k[1],a._titleHeight+2*(d+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var q=e._context.edits,G=q.legendText||q.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,i=e[0].trace.legendgroup,o=_(e,a,m);s&&""!==i&&(o=T[i]);var d=G?m:M||o;l||u||(d+=h/2),c.setRect(t,0,-r/2,d,r)}))}(e,z,R,t)},function(){var l,u,m,g,x=d._size,b=t.borderwidth;if(!h){if(function(e){var t=e._fullLayout.legend,r=L(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*y[r],r:t._width*v[r],b:t._effHeight*v[n],t:t._effHeight*y[n]})}(e))return;var _=x.l+x.w*t.x-y[L(t)]*t._width,T=x.t+x.h*(1-t.y)-y[S(t)]*t._effHeight;if(d.margin.autoexpand){var k=_,A=T;_=a.constrain(_,0,d.width-t._width),T=a.constrain(T,0,d.height-t._effHeight),_!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==A&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(M,_,T)}if(N.on(".drag",null),M.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;h&&(P=t._height),O.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),D.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(N,0,0,0,0),delete t._scrollY}else{var I,z,R,F=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),E=t._effHeight-F-2*p.scrollBarMargin,j=t._height-t._effHeight,H=E/j,B=Math.min(t._scrollY||0,j);O.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),D.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,f,e),U(B,F,H),M.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/E*j,0,j),F,H),0!==B&&B!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;I="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,R=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,j)}(R,I,z),F,H))}));N.call(Y);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(I=e.changedTouches[0].clientY,R=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,j)}(R,I,z),F,H))}));C.call(V)}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(N,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),D.select("rect").attr("y",b+r)}e._context.edits.legendPosition&&(M.classed("cursor-move",!0),s.init({element:M.node(),gd:e,prepFn:function(){var e=c.getTranslate(M);m=e.x,g=e.y},moveFn:function(e,r){var n=m+e,a=g+r;c.setTranslate(M,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&w(e,M,a,t,n)}}))}],e)}(e,t)}},{"../../constants/alignment":228,"../../lib":254,"../../lib/events":247,"../../lib/svg_text_utils":277,"../../plots/plots":335,"../../registry":337,"../color":112,"../dragelement":131,"../drawing":134,"./constants":163,"./get_legend_data":166,"./handle_click":167,"./helpers":168,"./style":170,"@plotly/d3":18}],166:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],d=!1,f={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),d=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var v=t._fullLayout;r||(r=v.legend);var g="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return g?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,d=u.marker||{},f=d.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,d.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(d),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(d,"")(m)}var v=p||i.mc||d.color,g=d.pattern,x=g&&l.getPatternAttr(g.shape,0,"");if(x){var b=l.getPatternAttr(g.bgcolor,0,null),_=l.getPatternAttr(g.fgcolor,0,null),T=g.fgopacity,M=y(g.size,8,10),k=y(g.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,g.fillmode,b,_,T)}else a.call(s.fill,v);o&&s.stroke(a,i.mlc||f.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(f(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});d(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var d=a.selectAll("g.legendsymbols").data([e]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,d=n.select(this),f=c(a),p=f.colorscale,m=f.reversescale;if(p){if(!r){var y=p.length;u=0===o?p[m?y-1:0][1]:1===o?p[m?0:y-1][1]:p[Math.floor((y-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[o]||v[0]:v}d.attr("d",e[0]),u?d.call(s.fill,u):d.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:g?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,d=o.showLine,f=o.showGradientLine,p=o.showGradientFill,y=o.anyFill,v=o.anyLine,g=e[0],b=g.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!y?"M5,0":v?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(s)l.fillGroupStyle(e,t);else{var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}})),d||f){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(g,{trace:a})]}var D=A.select(".legendlines").selectAll("path").data(d||f?[r]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",k+(f?"l"+x+",0.0001":"h"+x)).call(d?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,d=o.showLine,f=o.showMarker,p=e[0],h=p.trace,y=!f&&!c&&!s&&u.hasText(h);function v(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(g&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(f||y||d){var b={},w={};if(f){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",i.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}d&&(w.line={width:v("line.width",x,[0,10],5)}),y&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(f?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),f&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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":254,"../../registry":337,"../../traces/pie/helpers":430,"../../traces/pie/style_one":436,"../../traces/scatter/subtypes":463,"../color":112,"../colorscale/helpers":123,"../drawing":134,"./constants":163,"@plotly/d3":18}],171:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":173}],172:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function d(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},d=i.list(e,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,y=(1-h)/2;for(a=0;a1?(P=["toggleHover"],I=["resetViews"]):v?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],I=["resetGeo"]):y?(P=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],I=["resetViewMapbox"]):b?P=["hoverClosestGl2d"]:g?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):P=["toggleHover"];m&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(e=0;M--){var k=r.append("path").attr(y).style("opacity",M?.1:v).call(o.stroke,x).call(o.fill,g).call(l.dashLine,M?"solid":_,M?4+b:b);if(h(k,e,i),w){var A=s(e.layout,"selections",i);k.style({cursor:"move"});var L={element:k.node(),plotinfo:p,gd:e,editHelpers:A,isActiveSelection:!0},S=n(c,e);a(S,k,L)}else k.style("pointer-events",M?"all":"none");T[M]=k}var D=T[0];T[1].node().addEventListener("click",(function(){return function(e,t){if(!f(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void m(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=m,d(e)}}(e,D)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;l.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function m(e){f(e)&&(e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,d(e)))}t.exports={draw:d,drawOne:p,activateLastSelection:function(e){if(!f(e))return;var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=m,d(e)}}},{"../../plot_api/plot_template":290,"../color":112,"../drawing":134,"../shapes/display_outlines":206,"../shapes/draw_newshape/helpers":211,"../shapes/handle_outline":213,"../shapes/helpers":214}],196:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":248,"../../drawing/attributes":133}],197:[function(e,t,r){"use strict";t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],198:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers").selectMode,a=e("../../shapes/handle_outline").clearOutline,i=e("../../shapes/draw_newshape/helpers"),o=i.readPaths,l=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var i=r.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,d=t.plotinfo,f=d.xaxis,p=d.yaxis,h=t.isActiveSelection,m=t.dragmode,y=(c.layout||{}).selections||[];if(!n(m)&&void 0!==h){var v=c._fullLayout._activeSelectionIndex;if(v-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){G(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(f=K(_))){for(o&&o.remove(),y=0;y=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,l=p(r),s=m(r);if(l||s){var c,u,d=o.selectAll(".select-outline-"+n.id);if(d&&a._fullLayout._outlining)l&&(c=T(d,e)),c&&i.call("_guiRelayout",a,{shapes:c}),s&&!B(e)&&(u=M(d,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&k(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function X(e){return e._id}function W(e,t,r,n){if(!e.calcdata)return[];var a,i,o,l=[],s=t.map(X),c=r.map(X);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function Q(e,t,r){var n,a;for(n=0;n-1&&t;if(!i&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ce(te);ue([O(e,ne,"x"),O(e,pe,"y")])($,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&de(e,$),f._reselect=!1}if(!i&&f._deselect){var me=f._deselect;(function(e,t,r){for(var n=0;n=0)M._fullLayout._deactivateShape(M);else if(!x){var r=k.clickmode;D.done(ke).then((function(){if(D.clear(ke),2===e){for(be.remove(),K=0;K-1&&Y(t,M,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&de(M,void 0);s.click(M,t)})).catch(A.error)}},n.doneFn=function(){Me.remove(),D.done(ke).then((function(){D.clear(ke),!L&&J&&n.selectionDefs&&(J.subtract=xe,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,X)),(L||x)&&Z(n,L),n.doneFnCompleted&&n.doneFnCompleted(Ae),b&&de(M,ie)})).catch(A.error)}},clearOutline:x,clearSelectionsCache:Z,selectOnClick:Y}},{"../../lib":254,"../../lib/clear_gl_canvases":242,"../../lib/polygon":266,"../../lib/throttle":278,"../../plot_api/subroutines":291,"../../plots/cartesian/axis_ids":305,"../../registry":337,"../color":112,"../dragelement/helpers":130,"../drawing":134,"../fx":152,"../fx/helpers":148,"../shapes/constants":204,"../shapes/display_outlines":206,"../shapes/draw_newshape/helpers":211,"../shapes/draw_newshape/newshapes":212,"../shapes/handle_outline":213,"../shapes/helpers":214,"./constants":193,"./draw":195,"./draw_newselection/newselections":198,"./helpers":199,"point-in-polygon/nested":66,polybooljs:67}],202:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":229,"../../lib/extend":248,"../../plot_api/plot_template":290,"../../traces/scatter/attributes":438,"../annotations/attributes":95,"../drawing/attributes":133}],203:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var d=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],f=n.aggNums(Math.max,null,d),p=n.aggNums(Math.min,null,d),h=p<0?Math.abs(p)+c:c,m=f>0?f+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,d,f=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=d)));return p>=f?[f,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o1&&(2!==e.length||"Z"!==e[1][0])&&(0===S&&(e[0][0]="M"),t[L]=e,T(),M())}}()}}function E(e,r){!function(e,r){if(t.length)for(var n=0;nx?(M=d,S="y0",k=x,D="y1"):(M=x,S="y1",k=d,D="y0");W(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),X.moveFn="move"===I?J:K,X.altKey=n.altKey},doneFn:function(){if(g(e))return;p(t),$(l),_(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(g(e))return;$(l)}};function W(r){if(g(e))I=null;else if(R)I="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?f.getCursor(o/a,1-l/i):"move";p(t,s),I=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;N?E("xanchor",r.xanchor=q(b+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else N?E("xanchor",r.xanchor=q(b+n)):(E("x0",r.x0=q(c+n)),E("x1",r.x1=q(v+n))),z?E("yanchor",r.yanchor=G(T+a)):(E("y0",r.y0=G(d+a)),E("y1",r.y1=G(x+a)));t.attr("d",y(e,r)),Q(l,r)}function K(n,a){if(F){var i=function(e){return e},o=i,s=i;N?E("xanchor",r.xanchor=q(b+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else if(R){if("resize-over-start-point"===I){var u=c+n,f=z?d-a:d+a;E("x0",r.x0=N?u:q(u)),E("y0",r.y0=z?f:G(f))}else if("resize-over-end-point"===I){var p=v+n,h=z?x-a:x+a;E("x1",r.x1=N?p:q(p)),E("y1",r.y1=z?h:G(h))}}else{var g=function(e){return-1!==I.indexOf(e)},_=g("n"),H=g("s"),Y=g("w"),Z=g("e"),X=_?M+a:M,W=H?k+a:k,J=Y?A+n:A,K=Z?L+n:L;z&&(_&&(X=M-a),H&&(W=k-a)),(!z&&W-X>10||z&&X-W>10)&&(E(S,r[S]=z?X:G(X)),E(D,r[D]=z?W:G(W))),K-J>10&&(E(O,r[O]=N?J:q(J)),E(C,r[C]=N?K:q(K)))}t.attr("d",y(e,r)),Q(l,r)}function Q(e,t){(N||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(N?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=U(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),N&&z){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(N){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}f.init(X),Z.node().onmousemove=W}(e,N,s,t,r,I):!0===s.editable&&N.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");N.node().addEventListener("click",(function(){return function(e,t){if(!x(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,v(e)}}(e,N)}))}}function _(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){x(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:b,eraseActiveShape:function(e){if(!x(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&sp&&(e="X"),e}));return i>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),u+h}))}(t,l,c);if("pixel"===t.xsizemode){var b=l(t.xanchor);u=b+t.x0,d=b+t.x1}else u=l(t.x0),d=l(t.x1);if("pixel"===t.ysizemode){var _=c(t.yanchor);f=_-t.y0,p=_-t.y1}else f=c(t.y0),p=c(t.y1);if("line"===h)return"M"+u+","+f+"L"+d+","+p;if("rect"===h)return"M"+u+","+f+"H"+d+"V"+p+"H"+u+"Z";var w=(u+d)/2,T=(f+p)/2,M=Math.abs(w-u),k=Math.abs(T-f),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}},{"../../lib":254,"../../plots/cartesian/axes":301,"./constants":204}],215:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":312,"./attributes":202,"./calc_autorange":203,"./defaults":205,"./draw":207,"./draw_newshape/defaults":210}],216:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":248,"../../plot_api/edit_types":283,"../../plot_api/plot_template":290,"../../plots/animation_attributes":295,"../../plots/font_attributes":329,"../../plots/pad_attributes":334,"./constants":217}],217:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],218:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*d.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+d.stepInset+(r.inputAreaLength-2*d.stepInset)*Math.min(1,Math.max(0,t))}function D(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-d.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*d.stepInset-2*r.inputAreaStart)))}function O(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",d.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,d.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(e,t){var r=t._dims,n=r.inputAreaLength-2*d.railInset,a=l.ensureSingle(e,"rect",d.railRectClass);a.attr({width:n,height:d.railWidth,rx:d.railRadius,ry:d.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,d.railInset,.5*(r.inputAreaWidth-d.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[d.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,y(t))}if(i.enter().append("g").classed(d.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+d.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+d.groupClassName).data(r,v);s.enter().append("g").classed(d.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(v[0],v[1]))}}}return R.call(F),I&&(S?R.on(".opacity",null):(k=0,A=!0,R.text(g).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(d.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,v,t,x):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(e){this.text(e||" ").call(d.positionText,_.x,_.y)}))),R.classed("js-placeholder",A),T}}},{"../../constants/alignment":228,"../../constants/interactions":233,"../../lib":254,"../../lib/svg_text_utils":277,"../../plots/plots":335,"../../registry":337,"../color":112,"../drawing":134,"@plotly/d3":18,"fast-isnumeric":26}],222:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":248,"../../plot_api/edit_types":283,"../../plot_api/plot_template":290,"../../plots/font_attributes":329,"../../plots/pad_attributes":334,"../color/attributes":111}],223:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],224:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":254,"../../plots/array_container_defaults":296,"./attributes":222,"./constants":223}],225:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,d=e("./constants"),f=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(d.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,d.name,t).applyUpdate("active",o),"buttons"===t.type?v(e,n,null,null,t):"dropdown"===t.type&&(a.attr(d.menuIndexAttrName,"-1"),y(e,n,a,i,t),l||v(e,n,a,i,t))}function y(e,t,r,n,a){var i=l.ensureSingle(t,"g",d.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||d.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(g,a,u,e).call(A,a,f,p),l.ensureSingle(t,"text",d.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(d.arrowSymbol[a.direction])})).attr({x:s.headerWidth-d.arrowOffsetX+a.pad.l,y:s.headerHeight/2+d.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),v(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function v(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(d.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?d.dropdownButtonClassName:d.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,y=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=v.headerHeight+d.gapButtonHeader:h=v.headerWidth+d.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-d.gapButtonHeader+d.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-d.gapButtonHeader+d.gapButton-v.openWidth);var b={x:v.lx+h+o.pad.l,y:v.ly+y+o.pad.t,yPad:d.gapButton,xPad:d.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(g,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(v.openWidth,v.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(v.openHeight,v.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,f=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(d.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+d.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+d.headerGroupClassName).data(r,p);s.enter().append("g").classed(d.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",d.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=y+v;S+A>c&&(S=c-A);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=D.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=v>T,C=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,I=h+m,N=y;I+C>s&&(I=s-C);var z=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:I,y:N,width:C,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,E=O?d+C+.5:d+.5,j=f-.5,H=M?p+A+.5:p+.5,B=o._topdefs.selectAll("#"+R).data(M||O?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",R).append("rect"),M||O?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(E)-Math.floor(F),height:Math.ceil(H)-Math.floor(j)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:h,y:y,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||O){var Y=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(Y);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":254,"../color":112,"../drawing":134,"@plotly/d3":18}],228:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],229:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"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",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],230:[function(e,t,r){"use strict";t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],231:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],232:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],233:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],234:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],235:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],236:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],238:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],239:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function d(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,d,f,p,h,m=s([r,n]);function y(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,d=o,f=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return d(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return d(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return d(e,t,r,n,a,i,1)}}},{"./mod":261}],240:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(d(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),v=e.charAt(0);!c||"G"!==v&&"g"!==v||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:g);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),D=Number(T[11]||0);if(c){if(2===M.length)return u;var O;M=Number(M);try{var C=y.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),O=C.newDate(M,C.toMonthIndex(M,k,P),A)}else O=C.newDate(M,Number(k),A)}catch(e){return u}return O?(O.toJD()-m)*d+L*f+S*p+D*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var I=new Date(Date.UTC(2e3,k,A,L,S));return I.setUTCFullYear(M),I.getUTCMonth()!==k||I.getUTCDate()!==A?u:I.getTime()+D*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*d,M=3*f,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,g,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/d)+m,S=Math.floor(s(e,d));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=v("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+d&&e<=a-d))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function O(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return D[r("%q")(a)]})),_(n))try{e=y.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,d),n=w(Math.floor(r/f),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+O(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return O(t,e,n,a)};var P=3*d;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,d);if(e=Math.round(e-n),r)try{var a=Math.round(e/d)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*d+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&y.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+d*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,d=n-t,f=o-a,p=c-i,h=u*u+d*d,m=f*f+p*p,y=Math.min(s(u,d,h,a-e,i-t),s(u,d,h,o-e,c-t),s(f,p,m,e-a,t-i),s(f,p,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),d=e.getPointAtLength(o(r,t)),f={x:(4*d.x+s.x+c.x)/6,y:(4*d.y+s.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),d=u;function f(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,d=r.ys?r.y-s:0;return Math.sqrt(c*c+d*d)}for(var p=f(c);p;){if((c+=p+r)>d)return;p=f(c)}for(p=f(d);p;){if(c>(d-=p+r))return;p=f(d)}return{min:c,max:d,len:d-c,total:u,isClosed:0===c&&d===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,d=0,f=0,p=l;d0?p=a:f=a,d++}return i}},{"./mod":261}],252:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],253:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],254:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,d=t.exports={};d.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var f={};d.warnBadFormat=function(e){var t=String(e);f[t]||(f[t]=1,d.warn('encountered bad format: "'+t+'"'))},d.noFormat=function(e){return String(e)},d.numberFormat=function(e){var t;try{t=i(d.adjustFormat(e))}catch(t){return d.warnBadFormat(e),d.noFormat}return t},d.nestedProperty=e("./nested_property"),d.keyedContainer=e("./keyed_container"),d.relativeAttr=e("./relative_attr"),d.isPlainObject=e("./is_plain_object"),d.toLogRange=e("./to_log_range"),d.relinkPrivateKeys=e("./relink_private");var p=e("./array");d.isTypedArray=p.isTypedArray,d.isArrayOrTypedArray=p.isArrayOrTypedArray,d.isArray1D=p.isArray1D,d.ensureArray=p.ensureArray,d.concat=p.concat,d.maxRowLength=p.maxRowLength,d.minRowLength=p.minRowLength;var h=e("./mod");d.mod=h.mod,d.modHalf=h.modHalf;var m=e("./coerce");d.valObjectMeta=m.valObjectMeta,d.coerce=m.coerce,d.coerce2=m.coerce2,d.coerceFont=m.coerceFont,d.coercePattern=m.coercePattern,d.coerceHoverinfo=m.coerceHoverinfo,d.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,d.validate=m.validate;var y=e("./dates");d.dateTime2ms=y.dateTime2ms,d.isDateTime=y.isDateTime,d.ms2DateTime=y.ms2DateTime,d.ms2DateTimeLocal=y.ms2DateTimeLocal,d.cleanDate=y.cleanDate,d.isJSDate=y.isJSDate,d.formatDate=y.formatDate,d.incrementMonth=y.incrementMonth,d.dateTick0=y.dateTick0,d.dfltRange=y.dfltRange,d.findExactDates=y.findExactDates,d.MIN_MS=y.MIN_MS,d.MAX_MS=y.MAX_MS;var v=e("./search");d.findBin=v.findBin,d.sorterAsc=v.sorterAsc,d.sorterDes=v.sorterDes,d.distinctVals=v.distinctVals,d.roundUp=v.roundUp,d.sort=v.sort,d.findIndexOfMin=v.findIndexOfMin,d.sortObjectKeys=e("./sort_object_keys");var g=e("./stats");d.aggNums=g.aggNums,d.len=g.len,d.mean=g.mean,d.median=g.median,d.midRange=g.midRange,d.variance=g.variance,d.stdev=g.stdev,d.interp=g.interp;var x=e("./matrix");d.init2dArray=x.init2dArray,d.transposeRagged=x.transposeRagged,d.dot=x.dot,d.translationMatrix=x.translationMatrix,d.rotationMatrix=x.rotationMatrix,d.rotationXYMatrix=x.rotationXYMatrix,d.apply3DTransform=x.apply3DTransform,d.apply2DTransform=x.apply2DTransform,d.apply2DTransform2=x.apply2DTransform2,d.convertCssMatrix=x.convertCssMatrix,d.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");d.deg2rad=b.deg2rad,d.rad2deg=b.rad2deg,d.angleDelta=b.angleDelta,d.angleDist=b.angleDist,d.isFullCircle=b.isFullCircle,d.isAngleInsideSector=b.isAngleInsideSector,d.isPtInsideSector=b.isPtInsideSector,d.pathArc=b.pathArc,d.pathSector=b.pathSector,d.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");d.isLeftAnchor=_.isLeftAnchor,d.isCenterAnchor=_.isCenterAnchor,d.isRightAnchor=_.isRightAnchor,d.isTopAnchor=_.isTopAnchor,d.isMiddleAnchor=_.isMiddleAnchor,d.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");d.segmentsIntersect=w.segmentsIntersect,d.segmentDistance=w.segmentDistance,d.getTextLocation=w.getTextLocation,d.clearLocationCache=w.clearLocationCache,d.getVisibleSegment=w.getVisibleSegment,d.findPointOnPath=w.findPointOnPath;var T=e("./extend");d.extendFlat=T.extendFlat,d.extendDeep=T.extendDeep,d.extendDeepAll=T.extendDeepAll,d.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");d.log=M.log,d.warn=M.warn,d.error=M.error;var k=e("./regex");d.counterRegex=k.counter;var A=e("./throttle");d.throttle=A.throttle,d.throttleDone=A.done,d.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},d.noop=e("./noop"),d.identity=e("./identity"),d.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},d.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},d.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(d.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},d.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},d.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},d.syncOrAsync=function(e,t,r){var n;function a(){return d.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},d.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},d.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},d.fillArray=function(e,t,r,n){if(n=n||d.identity,d.isArrayOrTypedArray(e))for(var a=0;a1?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},d.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var N=/^\w*$/;d.templateString=function(e,t){var r={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,n){var a;return N.test(n)?a=t[n]:(r[n]=r[n]||d.nestedProperty(t,n).get,a=r[n]()),d.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};d.hovertemplateString=function(){return E.apply(z,arguments)};var R={max:10,count:0,name:"texttemplate"};d.texttemplateString=function(){return E.apply(R,arguments)};var F=/^[:|\|]/;function E(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,f,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,y="xother"===l||"yother"===l||p||m||h,v=l;if((p||h)&&(v=v.substring(1)),(m||h)&&(v=v.substring(0,v.length-1)),y){if(void 0===(c=t[v]))return""}else for(f=3;f=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 j=2e9;d.seedPseudoRandom=function(){j=2e9},d.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?d.pseudoRandom():j/4294967296},d.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=d.extractOption(e,t,"htx","hovertext");if(d.isValidTextValue(a))return n(a);var i=d.extractOption(e,t,"tx","text");return d.isValidTextValue(i)?n(i):void 0},d.isValidTextValue=function(e){return e||0===e},d.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,d.strTranslate(a-c*(r+o),i-c*(n+l))+d.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},d.setTransormAndDisplay=function(e,t){e.attr("transform",d.getTextTransform(t)),e.style("display",t.scale?null:"none")},d.ensureUniformFontSize=function(e,t){var r=d.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},d.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},d.bigFont=function(e){return Math.round(1.2*e)};var H=d.getFirefoxVersion(),B=null!==H&&H<86;d.getPositionFromD3Event=function(){return B?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":234,"./anchor_utils":238,"./angles":239,"./array":240,"./clean_number":241,"./clear_responsive":243,"./coerce":244,"./dates":245,"./dom":246,"./extend":248,"./filter_unique":249,"./filter_visible":250,"./geometry2d":251,"./identity":252,"./increment":253,"./is_plain_object":255,"./keyed_container":256,"./localize":257,"./loggers":258,"./make_trace_groups":259,"./matrix":260,"./mod":261,"./nested_property":262,"./noop":263,"./notifier":264,"./preserve_drawing_buffer":267,"./push_unique":268,"./regex":270,"./relative_attr":271,"./relink_private":272,"./search":273,"./sort_object_keys":275,"./stats":276,"./throttle":278,"./to_log_range":279,"@plotly/d3":18,"d3-format":21,"d3-time-format":23,"fast-isnumeric":26}],255:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],256:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],f.set(e,null);if(d){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":288,"./notifier":264}],259:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":18}],260:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],262:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,d,f,p,h,m=r.length,y=r[0][0],v=r[0][1],g=0;for(u=1;uMath.max(d,y)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":234,"./matrix":260}],267:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-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":26,"is-mobile":60}],268:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,d=0,f=t.length,p=0,h=f>1?(t[f-1]-t[0])/(f-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);d90&&a.log("Long binary search..."),d-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],d=u-a;void 0===a?(s.push(u),a=u):d>l&&(i=Math.min(i,d),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":240,"fast-isnumeric":26}],277:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&t&&t._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(s),O=n.select(e.node().parentNode);if(!O.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s,f=parseInt((MathJax.version||"").split(".")[0]);if(2!==f&&3!==f)return void a.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+a.randstr({},64),i=(s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===f?MathJax.Hub.Typeset(i):MathJax.typeset([i])},h=function(){var t=s.select(2===f?".MathJax_SVG":".MathJax"),i=!t.empty()&&s.select("svg").node();if(i){var o,l=i.getBoundingClientRect();o=2===f?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,l)}else a.log("There was an error in the tex syntax.",e),r();s.remove()};2===f?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:d},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,h,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})):3===f&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=d,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),h(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(L[2],o,(function(n,a,o){O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var s=O.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild);var c=o.width,u=o.height;l.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var d=e.node().style.fill||"black",f=l.select("g");f.attr({fill:d,stroke:d});var p=f.node().getBoundingClientRect(),h=p.width,y=p.height;(h>c||y>u)&&(l.style("overflow","hidden"),h=(p=l.node().getBoundingClientRect()).width,y=p.height);var v=+e.attr("x"),g=+e.attr("y"),x=-(r||e.node().getBoundingClientRect().height)/4;if("y"===C[0])s.attr({transform:"rotate("+[-90,v,g]+")"+i(-h/2,x-y/2)});else if("l"===C[0])g=x-y/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))v=0,g=x;else{var b=e.attr("text-anchor");v-=h*("middle"===b?.5:"end"===b?1:0),g=g+x-y/2}l.attr({x:v,y:g}),m&&m.call(e,s),t(s)}))}))):P(),e}function P(){O.empty()||(C=e.attr("class")+"-math",O.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(y," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(v),O=0;O|>|>)/g;var d=[["$","$"],["\\(","\\)"]];var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,g=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//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 M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?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(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function D(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function O(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.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 e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],279:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":26}],280:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],281:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],282:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,d=(l.subplotsRegistry.ternary||{}).attrRegex,f=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",d);var g=r[""][""];if(c(g))t.set(null);else{if(!Array.isArray(g))return i.warn("Unrecognized full array edit value",d,g),!0;t.set(g)}return!m&&(f(y,v),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),D=S||[],O=u(v,d).get(),C=[],P=-1,I=D.length;for(x=0;xD.length-(k?0:1))i.warn("index out of range",d,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",d,_),c(M)?C.push(_):k?("add"===M&&(M={}),D.splice(_,0,M),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",d,_,M),-1===P&&(P=_);else for(b=0;b=0;x--)D.splice(C[x],1),O&&O.splice(C[x],1);if(D.length?S||t.set(D):t.set(null),m)return!1;if(f(y,v),h!==a){var N;if(-1===P)N=L;else{for(I=Math.max(D.length,I),N=[],x=0;x=P);x++)N.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,d,f=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=O(r,e.data.length-1),t)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[f.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||f.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(f.rehover,f.redrag,f.reselect),c.add(e,B,[e,a.undoit],B,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.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[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[];for(var n in t){var a=p.getFromId(e,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)t[i]||r.push(i)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(g,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,f=F(s._preGUI,c),h=Object.keys(t),m=p.list(e),y=o.extendDeepAll({},t),v={};for(H(t),h=Object.keys(t),n=0;n0&&"string"!=typeof I.parts[z];)z--;var E=I.parts[z],j=I.parts[z-1]+"."+E,B=I.parts.slice(0,z).join("."),Y=l(e.layout,B).get(),V=l(s,B).get(),Z=I.get();if(void 0!==N){A[P]=N,L[P]="reverse"===E?N:R(Z);var W=d.getLayoutValObject(s,I.parts);if(W&&W.impliedEdits&&null!==N)for(var J in W.impliedEdits)S(o.relativeAttr(P,J),W.impliedEdits[J]);if(-1!==["width","height"].indexOf(P))if(N){S("autosize",null);var K="height"===P?"width":"height";S(K,s[K])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",N?null:s.width),S("height",N?null:s.height);else if(j.match(U))C(j),l(s,B+"._inputRange").set(null);else if(j.match(q)){C(j),l(s,B+"._inputRange").set(null);var Q=l(s,B).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(G)&&l(s,B+"._inputDomain").set(null);if("type"===E){D=Y;var $="linear"===V.type&&"log"===N,ee="log"===V.type&&"linear"===N;if($||ee){if(D&&D.range)if(V.autorange)$&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var te=D.range[0],re=D.range[1];$?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete s[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,N,S),u.getComponentMethod("images","convertCoords")(e,V,N,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(E.match(M)){var ne=l(s,P).get(),ae=(N||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=W||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(N)?L[P]=null:b.isRemoveVal(N)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),v[r]||(v[r]={});var se=v[r][n];se||(se=v[r][n]={}),se[oe]=N,delete t[P]}else"reverse"===E?(Y.range?Y.range.reverse():(S(B+".autorange",!0),Y.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):("dragmode"===P&&(!1===N&&!1!==Z||!1!==N&&!1===Z)||s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===N||"select"===N)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:W?T.update(k,W):k.calc=!0,I.set(N))}}for(r in v){b.applyContainerArrayChanges(e,f(i,r),v[r],k,f)||(k.plot=!0)}for(var ce in O){var ue=(D=p.getFromId(e,ce))&&D._constraintGroup;if(ue)for(var de in k.calc=!0,ue)O[de]||(p.getFromId(e,de)._constraintShrinkable=!0)}return(X(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:O,undoit:L,redoit:A,eventData:y}}function X(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&f.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function W(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),d=u.flags;(s.calc||d.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];d.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(f.previousPromises),Y(e,d,u)||f.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||d.colorbars)&&p.push(w.doColorBars),d.legend&&p.push(w.doLegend),d.layoutstyle&&p.push(w.layoutStyles),d.axrange&&V(p,u.rangesAltered),d.ticks&&p.push(w.doTicksRelayout),d.modebar&&p.push(w.doModeBar),d.camera&&p.push(w.doCamera),p.push(A)),p.push(f.rehover,f.redrag,f.reselect),c.add(e,W,[e,l.undoit,u.undoit,l.traces],W,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function J(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{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 $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function d(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,f.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&d()};t()}var h,m,y=0;function v(e){return Array.isArray(a)?y>=a.length?e.transitionOpts=a[y]:e.transitionOpts=a[0]:e.transitionOpts=a,y++,e}var g=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))g.push({type:"object",data:v(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);g=k}}g.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,y=(u[m]||h[m]||{}).name,v=t[n].name,g=u[y]||h[y];y&&v&&"number"==typeof v&&g&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[y]||h[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&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[m]={name:m},p.push({frame:f.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:d+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=f.modifyFrames,u=f.modifyFrames,d=[e,l],p=[e,i];return c&&c.add(e,s,d,u,p),f.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,d=e,f=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!g(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function g(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in d(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var d=u.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return v(a,t,l)},r.getLayoutValObject=function(e,t){return v(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function d(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:d,applyUpdate:function(t,r){t&&u(t,r);var a=d();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":254,"../plots/attributes":297}],291:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),d=e("../components/modebar"),f=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,y=h.clean,v=e("../plots/cartesian/autorange").doAutoRange;function g(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,y=e._fullLayout,v=y._size,x=v.p,_=f.list(e,"",!0);if(y._paperdiv.style({width:e._context.responsive&&y.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":y.width+"px",height:e._context.responsive&&y.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),e._context.setBackground(e,y.paper_bgcolor),r.drawMainTitle(e),d.manage(e),!y._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:v.t+v.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:v.l+v.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(y.paper_bgcolor)&&1===s.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(a in y._plots)if((l=y._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var D=l.xaxis.domain,O=l.yaxis.domain,C=l.plotgroup;if(g(D,O,L)){var P=C.node(),I=l.bg=o.ensureSingle(C,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([D,O]),S||(k.push(a),A.push(a))}var N,z,R,F,E,j,H,B,Y,V,U,q,G,Z=y._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){y._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:g,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:g,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&y(i)&&e(i,o)}}({data:p,layout:f},""),u.length)return u.map(v)}},{"../lib":254,"../plots/attributes":297,"../plots/plots":335,"./plot_config":288,"./plot_schema":289,"./plot_template":290}],293:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,d={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,f,p,h;function m(e){return!(e in t)||o.validate(t[e],d[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],f=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),f=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(d.format.values,", "," or ")+".");var y={};function v(e,r){return o.coerce(t,y,d,e,r)}var g=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},f);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function D(){return new Promise((function(e,t){var r=s(M,g,_),n=M._fullLayout.width,d=M._fullLayout.height;function f(){a.purge(M),document.body.removeChild(M)}if("full-json"===g){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),e(T?p:l.encodeJSON(p))}if(f(),"svg"===g)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:g,width:n,height:d,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(D).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":254,"../plots/plots":335,"../snapshot/helpers":341,"../snapshot/svgtoimg":343,"../snapshot/tosvg":345,"../version":483,"./plot_api":287,"fast-isnumeric":26}],294:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var d=Object.keys(e),f=0;fx.length&&a.push(h("unused",i,v.concat(x.length)));var k,A,L,S,D,O=x.length,C=Array.isArray(M);if(C&&(O=Math.min(O,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,v.concat(A,x[A].length)));var P=x[A].length;for(k=0;k<(C?Math.min(P,M[A].length):P);k++)L=C?M[A][k]:M,S=g[A][k],D=x[A][k],n.validate(S,L)?D!==S&&D!==+S&&a.push(h("dynamic",i,v.concat(A,k),S,D)):a.push(h("value",i,v.concat(A,k),S))}else a.push(h("array",i,v.concat(A),g[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,v=r.length,g=0;g0&&Math.round(d)===d))return{vals:a};c=d}for(var f=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],y=i(m,f)||0,v=[],g=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,f);for(;M<=k;)M=o(M,c,f);T=o(M,-c,f)}else{for(M=y+(w=Math.round((k-y)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}v[_]=p?T:h?M:(T+M)/2,g[_]=T,x[_]=M}return{vals:v,starts:g,ends:x}}},{"../../constants/numerical":234,"../../lib":254,"fast-isnumeric":26}],299:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],300:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,d=c.isLinked;function f(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,d=c.max;if(0===u.length||0===d.length)return i.simpleMap(t.range,t.r2l);var f=u[0].val,y=d[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>D?M/T>O&&(_=x,w=b,O=M/T):M/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=M/S));if(f===y){var C=f-1,P=f+1;if(A)if(0===f)a=[0,1];else{var I=(f>0?d:u).reduce((function(e,t){return Math.max(e,s(t))}),0),N=f/(1-Math.min(.5,I/S));a=f>0?[0,N]:[N,0]}else a=L?[Math.max(0,C),Math.max(1,P)]:[C,P]}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-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-O*l(_),w.val+O*s(w)];return v&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),D=k(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(n=0;n0&&(f=i),i>p&&i-o&&(f=i),i>p&&i=P;n--)C(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],d=[];function f(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":134,"../../constants/numerical":234,"../../lib":254,"../../registry":337,"./axis_ids":305,"@plotly/d3":18,"fast-isnumeric":26}],301:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),d=e("../../components/color"),f=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),y=m.ONEMAXYEAR,v=m.ONEAVGYEAR,g=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,D=m.ONEMIN,O=m.ONESEC,C=m.MINUS_SIGN,P=m.BADNUM,I={K:"zeroline"},N={K:"gridline",L:"path"},z={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},E={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j=e("../../constants/alignment"),H=j.MID_SHIFT,B=j.CAP_SHIFT,Y=j.LINE_SPACING,V=j.OPPOSITE_SIDE,U=t.exports={};U.setConvert=e("./set_convert");var q=e("./axis_autotype"),G=e("./axis_ids"),Z=G.idSort,X=G.isLinked;U.id2name=G.id2name,U.name2id=G.name2id,U.cleanId=G.cleanId,U.list=G.list,U.listIds=G.listIds,U.getFromId=G.getFromId,U.getFromTrace=G.getFromTrace;var W=e("./autorange");U.getAutoRange=W.getAutoRange,U.findExtremes=W.findExtremes;function J(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}U.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},U.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},U.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==U.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=U.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},U.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:U.getFromId(t,r).cleanPos)(e)},U.redrawComponents=function(e,t){t=t||U.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;ur&&d2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},U.saveRangeInitial=function(e,t){for(var r=U.list(e,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=U.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=U.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=U.tickIncrement(e,r);if(s<=n)return s}return e}(g,e,v,c,i)),y=g,0;y<=u;)y=U.tickIncrement(y,v,!1,i);return{start:t.c2r(g,0,i),end:t.c2r(y,0,i),size:v,_dataSpan:u-c}},U.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,i=t.dtick&&a(t._tmin);if(i){var o=U.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var s=l.simpleMap(t.range,t.r2l);n=[s[0],.8*s[0]+.2*s[1]]}if(e.range=l.simpleMap(n,t.l2r),e._isMinor=!0,U.prepTicks(e,r),i){var c=a(t.dtick),u=a(e.dtick),d=c?t.dtick:+t.dtick.substring(1),f=u?e.dtick:+e.dtick.substring(1);c&&u?ee(d,f)?d===2*k&&f===2*A&&(e.dtick=k):d===2*k&&f===3*A?e.dtick=k:d!==k||(t._input.minor||{}).nticks?te(d/f,2.5)?e.dtick=d/2:e.dtick=d:e.dtick=A:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ee(d,f)?d>=12&&2===f&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ee(d,f)||(e.dtick=te(d/f,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},U.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,U.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=U.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dtick=(I?0:1);N--){var z=!N;N?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var R=N?e:l.extendFlat({},e,e.minor);if(z?U.prepMinorTicks(R,e,t):U.prepTicks(R,t),"array"!==R.tickmode){var F=J(u),E=F[0],j=F[1],H=a(R.dtick),B="log"===i&&!(H||"L"===R.dtick.charAt(0)),Y=U.tickFirst(R,t);if(N){if(e._tmin=Y,Y=j:Z<=j;Z=U.tickIncrement(Z,X,d,o)){if(N&&V++,R.rangebreaks&&!d){if(Z=p)break}if(O.length>h||Z===G)break;G=Z;var W={value:Z};N?(B&&Z!==(0|Z)&&(W.simpleLabel=!0),s>1&&V%s&&(W.skipLabel=!0),O.push(W)):(W.minor=!0,C.push(W))}}else N?(O=[],m=ne(e)):(C=[],D=ne(e))}if(I&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=O.map((function(e){return e.value})),Q=[],$=0;$0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),d=r||u,f=0;d>=g?f=u>=g&&u<=y?u:v:r===b&&d>=_?f=u>=_&&u<=x?u:b:d>=M?f=u>=M&&u<=w?u:T:r===k&&d>=k?f=k:d>=A?f=A:r===L&&d>=L?f=L:r===S&&d>=S&&(f=S),f>=u&&(f=u,l=!0);var p=a+f;if(t.rangebreaks&&f>0){for(var h=0,m=0;m<84;m++){var D=(m+.5)/84;t.maskBreaks(a*(1-D)+D*p)!==P&&h++}(f*=h/84)||(e[n].drop=!0),l&&u>k&&(f=u)}(f>0||0===n)&&(e[n].periodX=a+f/2)}}(O,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),oe=1;"auto"===e.tickmode&&(oe=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=O.length-1;r>-1;r--)if(O[r].drop)O.splice(r,1);else{O[r].value=Pe(O[r].value,e);var se=e.c2p(O[r].value);(ie?le>se-oe:lep||uep&&(ce.periodX=p),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=D&&i<=16||t>=S)e._tickround="M";else if(t>=O&&i<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(me(e.exponentformat)&&!ye(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}U.autoTicks=function(e,t,r){var n;function i(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var o=2*t;if(o>v)t/=v,n=i(10),e.dtick="M"+12*de(t,n,ae);else if(o>T)t/=T,e.dtick="M"+de(t,1,ie);else if(o>A){if(e.dtick=de(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:le),!r){var s=U.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(s)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else o>S?e.dtick=de(t,S,ie):o>D?e.dtick=de(t,D,oe):o>O?e.dtick=de(t,O,oe):(n=i(10),e.dtick=de(t,n,ae))}else if("log"===e.type){e.tick0=0;var u=l.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var d=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/d,n=i(10),e.dtick="L"+de(t,n,ae)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Ce(e)?(e.tick0=0,n=1,e.dtick=de(t,n,ue)):(e.tick0=0,n=i(10),e.dtick=de(t,n,ae));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},U.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ce:se,d=e+.01*o,f=l.roundUp(l.mod(d,1),u,r);return Math.floor(d)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(t)},U.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=ve(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var d=Math.round(s),f=Math.abs(d),p=e.exponentformat;"power"===p||me(p)&&ye(d)?(t.text=0===d?1:1===d?"10":"10"+(d>1?"":C)+f+"",t.fontSize*=1.25):("e"===p||"E"===p)&&f>2?t.text="1"+p+(d>0?"+":C)+f:(t.text=ve(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):Ce(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=ve(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=ve(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=ve(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var y=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[y(o.x-.5),y(o.x+e.dtick-.5)]}return o},U.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return U.hoverLabelText(e,n,r)+" - "+U.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=U.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var he=["f","p","n","\u03bc","m","","k","M","G","T"];function me(e){return"SI"===e||"B"===e}function ye(e){return e>14||e<-15}function ve(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=U.getTickFormat(t),d=t.separatethousands;if(n){var f={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};fe(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":me(s)&&(e+=he[c/3+5]));return i?C+e:e}function ge(e,t){if(e){var r=Object.keys(E).reduce((function(e,r){return-1!==t.indexOf(r)&&E[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function xe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-d:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?d-r.top:0,f),p.reverse()),r.width>0){var y=r.right-(t._offset+t._length);y>0&&(n.xr=1,n.r=y);var v=t._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?d-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-d:0,f),p.reverse()),r.height>0){var g=r.bottom-(t._offset+t._length);g>0&&(n.yb=0,n.b=g);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=we(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=f),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ae&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ge(n,t.automargin),ge(a,t.automargin)),i.autoMargin(e,ke(t),n),i.autoMargin(e,Ae(t),a),i.autoMargin(e,Le(t),l)})),r.skipTitle||ae&&"bottom"===t.side||re.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+we(t);else{var l=Ie(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,d,p,h,m=U.getPxPosition(e,t);"x"===i?(d=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,d="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var y=t._selections[t._id+"tick"];if(h={selection:y,side:t.side},y&&y.node()&&y.node().parentNode){var v=f.getTranslate(y.node().parentNode);h.offsetLeft=v.x,h.offsetTop=v.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:d,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(re)}}function ie(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=Me(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},U.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],a=e.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},U.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},U.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},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=e.side,u=s?(e.tickwidth||0)/2:0,d=3,f=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=f*B,d+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,d+=3);l&&"top"===c&&(d-=f*(1-B));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(d=-d);return[s?u:0,l?d:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(be(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(be(t)))}},U.makeTickPath=function(e,t,r,n){n||(n={});var a=n.minor;if(a&&!e.minor)return"";var i=void 0!==n.len?n.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*r)+"v"+i*r:"M"+(t+l*r)+",0h"+i*r},U.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,d=i("inside"),f="inside"===n&&"inside"===e.ticks||!d&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=f?e.ticklen:0;if(d?m*=-1:u&&(m=0),f&&(p+=m,r)){var y=l.deg2rad(r);p=m*Math.cos(y)+1,h=m*Math.sin(y)}e.showticklabels&&(f||e.showline)&&(p+=.2*e.tickfont.size);var v,g,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(d?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!d&&"bottom"===M||d&&"top"===M)?1:-1,d&&(b*=-1),v=h*b,g=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(d?x+=H:x=-90===A&&"bottom"===M?B:90===A&&"top"===M?H:.5,T=H/2*(A/90)),w.xFn=function(e){return e.dx+v+T*e.fontSize},w.yFn=function(e){return e.dy+g+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==d?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==d?-n:0};else if("y"===k){if(b=(_=!d&&"left"===M||d&&"right"===M)?1:-1,d&&(b*=-1),v=p,g=h*b,x=0,d||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?B:.5),d){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*B*b,x=0}}w.xFn=function(e){return e.dx+t-(v+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+g+e.fontSize*H},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},U.drawTicks=function(e,t,r){r=r||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,_e);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return d.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return f.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Ne(t,[R]),o.attr("transform",r.transFn)},U.drawGrid=function(e,t,r){r=r||{};var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?r.vals.filter((function(e){return e.minor})):[],l=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],s=r.counterAxis;if(s&&U.shouldShowZeroLine(e,t,s))for(var c="array"===t.tickmode,u=0;u=0;v--){var g=v?m:y;if(g){var x=g.selectAll("path."+a).data(v?l:o,_e);x.exit().remove(),x.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(e){return d.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return f.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}Ne(t,[N,z])},U.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=U.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return Z(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(d.stroke,t.zerolinecolor||d.defaultLine).style("stroke-width",f.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Ne(t,[I])},U.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),d=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,m=r.secondary?0:t.tickangle,y=(t._prevTickAngles||{})[d],v=r.layer.selectAll("g."+d).data(t.showticklabels?p:[],_e),g=[];function x(e,i){e.each((function(e){var o=n.select(this),l=o.select(".text-math-group"),u=h.anchorFn(e,i),d=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=c.lineCount(o),m=Y*e.fontSize,y=h.heightFn(e,a(i)?+i:0,(p-1)*m);if(y&&(d+=s(0,y)),l.empty()){var v=o.select("text");v.attr({transform:d,"text-anchor":u}),v.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var g=f.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr("transform",d+s(g,0))}}))}v.enter().append("g").classed(d,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(f.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?g.push(e._promises.pop().then((function(){x(r,m)}))):x(r,m)})),Ne(t,[F]),v.exit().remove(),r.repositionOnUpdate&&v.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),s=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=l.simpleMap(t.range,t.r2l);s=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var d=Math.min(s,c),p=Math.max(s,c),h=t.side,m=1/0,y=-1/0;for(var g in v.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=f.bBox(r.node()),l=0;o?(i.right>p||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(v,y+1?y:m);var b=null;t._selections&&(t._selections[d]=v);var _=[function(){return g.length&&Promise.all(g)}];t.automargin&&i._redrawFromAutoMarginCount&&90===y?(b=90,_.push((function(){x(v,y)}))):_.push((function(){if(x(v,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(v.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=Me(this),o=f.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",d=function(e){return-1!==c.indexOf(e)},h=d("top"),y=d("left"),g=d("right"),_=d("bottom")||y||h||g?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var y="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=d(r),a=0,o=0,l={},u=0;u2*a}(a,y)?"category":function(e,t){for(var r=e.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=y;break}var d=a("pattern",u);if(d===y)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(d)for(l=0;l<2;l++)switch(c=o[l],d){case y:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case v:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(t.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":337,"./constants":308}],306:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function y(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rI&&FC&&(C=F);f/=(C-O)/(2*P),O=s.l2r(O),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){P&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),P=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,i){for(var o,l,s,c,u=!1,d={},f={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ve||Ue(),ye)o.indexOf("select")>-1&&L(r,a,J,K,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ve){var l=m?I:P,c="s"===m||"w"===v?0:1,d=l._name+".range["+c+"]",f=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",y="middle";if(l.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===v&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:y}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,d,t)}))}}}function Ne(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,De.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),De.attr("d",q(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,De.attr("d",q(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":254,"fast-isnumeric":26}],318:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,l=n(e);r("tickprefix")&&r("showtickprefix",l),r("ticksuffix",o)&&r("showticksuffix",l)}},{"./show_dflt":321}],319:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":228}],320:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,d=i.ensureNumber,f=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,y=p.LOG_CLIP,v=p.ONEWEEK,g=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function D(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function O(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function P(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function N(e){var t=I(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:I(e)}function R(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var E=function(t){return l(t)?R(t,e._m,e._b):m},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var H="y"===p;E=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return R(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var d=e._B[o]||0;return isFinite(d)?R(t,e._m2,d):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:d,e.l2c="log"===e.type?A:d,e.l2p=E,e.p2l=j,e.c2p="log"===e.type?function(e,t){return E(S(e,t))}:E,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=d,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=d):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=d,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=d):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=O,e.d2p=e.r2p=function(t,r,n){return e.l2p(D(t,0,n))},e.p2d=e.p2r=function(e,t,r){return O(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=d,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:d(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var r=N(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=d,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:d(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var d=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===p;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(f=!f),f&&e._rangebreaks.reverse();var h=f?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function y(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,d=!!t.xr1,f=!!t.yr1,p=[];if(d){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),y=h[1]-h[0],v=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*v/y),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var g=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=g[1]-g[0],_=x[1]-x[0];p[1]=(g[1]*(1-r)+r*x[1]-g[1])/(g[0]-g[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(g[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(g[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=d?c/p[2]:1,T=f?u/p[3]:1,M=d?p[0]:0,k=f?p[1]:0,A=d?p[0]/p[2]*c:0,L=f?p[1]/p[3]*u:0,S=a._offset-A,D=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,D).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":134,"../../lib":254,"../../registry":337,"./axes":301,"@plotly/d3":18}],326:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",d=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(f.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],d=0;d=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&N.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&N.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(f,s,d,n),b.cleanPlot(f,s,d,n);var j=!(!n._has||!n._has("gl2d")),H=!(!s._has||!s._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||H;B&&!Y?n._bgLayer.remove():Y&&!B&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var d=1-2*l;n=Math.round(d*n),a=Math.round(d*a)}}var f=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,d=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var f in c.length||c.push(d),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),d.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(u.subplotSort);for(i=0;i1&&(r.l/=v,r.r/=v)}if(p){var g=(r.t+r.b)/p;g>1&&(r.t/=g,r.b/=g)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:x,size:r.l+y},r:{val:_,size:r.r+y},b:{val:T,size:r.b+y},t:{val:w,size:r.t+y}},m[t]=1}else delete h[t],delete m[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),O(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,d=i.r,f=i.t,h=i.b,m=t._pushmargin,y=t._pushmarginIds,v=t.minreducedwidth,g=t.minreducedheight;if(!1!==t.margin.autoexpand){for(var x in m)y[x]||delete m[x];for(var _ in m.base={l:{val:0,size:c},r:{val:1,size:d},t:{val:1,size:f},b:{val:0,size:h}},m){var w=m[_].l||{},T=m[_].b||{},M=w.val,k=w.size,A=T.val,L=T.size;for(var S in m){if(o(k)&&m[S].r){var D=m[S].r.val,C=m[S].r.size;if(D>M){var P=(k*D+(C-r)*M)/(D-M),I=(C*(1-M)+(k-r)*(1-D))/(D-M);P+I>c+d&&(c=P,d=I)}}if(o(L)&&m[S].t){var N=m[S].t.val,z=m[S].t.size;if(N>A){var R=(L*N+(z-n)*A)/(N-A),F=(z*(1-A)+(L-n)*(1-N))/(N-A);R+F>h+f&&(h=R,f=F)}}}}}var E=u.constrain(r-i.l-i.r,2,v),j=u.constrain(n-i.t-i.b,2,g),H=Math.max(0,r-E),B=Math.max(0,n-j);if(H){var Y=(c+d)/H;Y>1&&(c/=Y,d/=Y)}if(B){var V=(h+f)/B;V>1&&(h/=V,f/=V)}if(a.l=Math.round(c),a.r=Math.round(d),a.t=Math.round(f),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var d={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(d.layout=c(l),a)){var f=l._size;d.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return s&&(d.frames=c(s)),i&&(d.config=c(e._context,!0)),"object"===n?d:JSON.stringify(d)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(N(o,c,d),a=0;a0){for(var n=[],a=0;a-1&&(d[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":112,"../components/drawing":134,"../constants/xmlns_namespaces":235,"../lib":254,"@plotly/d3":18}],346:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rd+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function N(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[d+"a"],R=e[f+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(y,F,e),!1!==e.index&&y[e.index].p!==c){M||(D=function(e){return Math.min(k(e),e.p-g.bargroupwidth/2)},O=function(e){return Math.max(A(e),e.p+g.bargroupwidth/2)});var E=y[e.index],j=v.base?E.b+E.s:E.s;e[f+"0"]=e[f+"1"]=R.c2p(E[f],!0),e[f+"LabelVal"]=j;var H=g.extents[g.extents.round(E.p)];e[d+"0"]=z.c2p(x?D(E):H[0],!0),e[d+"1"]=z.c2p(x?O(E):H[1],!0);var B=void 0!==E.orig_p;return e[d+"LabelVal"]=B?E.orig_p:E.p,e.labelLabel=s(z,e[d+"LabelVal"],v[d+"hoverformat"]),e.valueLabel=s(R,e[f+"LabelVal"],v[f+"hoverformat"]),e.baseLabel=s(R,E.b,v[f+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(E)+function(e){return C(k(e),A(e),w)}(E))/2,e[d+"Spike"]=z.c2p(E.p,!0),o(E,v,e),e.hovertemplate=v.hovertemplate,e}}function d(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=d(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:d}},{"../../components/color":112,"../../components/fx":152,"../../constants/numerical":234,"../../lib":254,"../../plots/cartesian/axes":301,"../../registry":337,"./helpers":353}],355:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":313,"../scatter/marker_colorbar":456,"./arrays_to_calcdata":346,"./attributes":347,"./calc":348,"./cross_trace_calc":350,"./defaults":351,"./event_data":352,"./hover":354,"./layout_attributes":356,"./layout_defaults":357,"./plot":358,"./select":359,"./style":361}],356:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],357:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,d={},f=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function D(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,d="start"===c,f=((i.leftToRight||0)+1)/2,p=1-f,h=a.width,m=a.height,y=Math.abs(t-e),v=Math.abs(n-r),g=y>2*_&&v>2*_?_:0;y-=2*g,v-=2*g;var x=L(s);"auto"!==s||h<=y&&m<=v||!(h>y||m>v)||(h>v||m>y)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};E=q(E,j,z),j=q(j,E,z),H=q(H,B,!z),B=q(B,H,!z)}var G=k(i.ensureSingle(P,"path"),C,y,v);if(G.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-E)*(B-H))||Y&&e._context.staticPlot?"M0,0Z":"M"+E+","+H+"V"+B+"H"+j+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&R){var Z=s.makePointStyleFns(d);s.singlePointStyle(c,G,d,Z,e)}!function(e,t,r,n,a,l,c,d,p,y,v){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,I="h"===P.orientation,N=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,d,f,p="histogram"===o.type,h="waterfall"===o.type,m="funnel"===o.type,y="h"===o.orientation;y?(s="y",c=a,d="x",f=n):(s="x",c=n,d="y",f=a);function v(e){return u(f,f.c2l(e),!0).text}var g=t[r],x={};x.label=g.p,x.labelLabel=x[s+"Label"]=(_=g.p,u(c,c.c2l(_),!0).text);var _;var w=i.castOption(o,g.i,"text");(0===w||w)&&(x.text=w);x.value=g.s,x.valueLabel=x[d+"Label"]=v(g.s);var T={};b(T,o,g.i),(p||void 0===T.x)&&(T.x=y?x.value:x.label);(p||void 0===T.y)&&(T.y=y?x.label:x.value);(p||void 0===T.xLabel)&&(T.xLabel=y?x.valueLabel:x.labelLabel);(p||void 0===T.yLabel)&&(T.yLabel=y?x.labelLabel:x.valueLabel);h&&(x.delta=+g.rawS||g.s,x.deltaLabel=v(x.delta),x.final=g.v,x.finalLabel=v(x.final),x.initial=x.final-x.delta,x.initialLabel=v(x.initial));m&&(x.value=g.s,x.valueLabel=v(x.value),x.percentInitial=g.begR,x.percentInitialLabel=i.formatPercent(g.begR),x.percentPrevious=g.difR,x.percentPreviousLabel=i.formatPercent(g.difR),x.percentTotal=g.sumR,x.percenTotalLabel=i.formatPercent(g.sumR));var M=i.castOption(o,g.i,"customdata");M&&(x.customdata=M);return i.texttemplateString(l,x,e._d3locale,T,x,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var d,f=a.textinfo,p=e[t],h=f.split("+"),m=[],y=function(e){return-1!==h.indexOf(e)};y("label")&&m.push((v=e[t].p,u(o?n:r,v,!0).text));var v;y("text")&&(0===(d=i.castOption(a,p.i,"text"))||d)&&m.push(d);if(l){var g=+p.rawS||p.s,x=p.v,b=x-g;y("initial")&&m.push(c(b)),y("delta")&&m.push(c(g)),y("final")&&m.push(c(x))}if(s){y("value")&&m.push(c(p.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(d=i.formatPercent(p.begR),w&&(d+=" of initial"),m.push(d)),y("percent previous")&&(d=i.formatPercent(p.difR),w&&(d+=" of previous"),m.push(d)),y("percent total")&&(d=i.formatPercent(p.sumR),w&&(d+=" of total"),m.push(d))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(g,o)}(O,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(P,a);var z="stack"===y.mode||"relative"===y.mode,R=n[a],F=!z||R._outmost;if(!N||"none"===w||(R.isBlank||l===c||d===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var E=O.font,j=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,E,j),B=h.getOutsideTextFont(P,a,E),Y=r.datum();I?"log"===T.type&&Y.s0<=0&&(l=T.range[0]=q*(W/G):W>=G*(X/q);q>0&&G>0&&(J||K||Q)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){Z=i.ensureUniformFontSize(e,"outside"===w?B:H);var $=(V=C(r,N,Z)).attr("transform");if(V.attr("transform",""),U=s.bBox(V.node()),q=U.width,G=U.height,V.attr("transform",$),q<=0||G<=0)return void V.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,d=a.height,f=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:f>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/d):Math.min(1,f/u));var m=L(c),y=S(a,m),v=(l?y.x:y.y)/2,g=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*v):(w=n+A*o,k=-A*v);return{textX:g,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=D(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=Z.size,f("histogram"===P.type?"bar":P.type,ee,O),R.transform=ee;var ne=k(V,O,y,v);i.setTransormAndDisplay(ne,ee)}(e,t,P,r,p,E,j,H,B,y,v),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,d.xcalendar,d.ycalendar)}));var H=!1===d.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,y)},toMoveInsideBar:D}},{"../../components/color":112,"../../components/drawing":134,"../../components/fx/helpers":148,"../../lib":254,"../../lib/svg_text_utils":277,"../../plots/cartesian/axes":301,"../../registry":337,"./attributes":347,"./constants":349,"./helpers":353,"./style":361,"./uniform_text":363,"@plotly/d3":18,"fast-isnumeric":26}],359:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,y(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:g,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":112,"../../components/drawing":134,"../../lib":254,"../../registry":337,"./attributes":347,"./helpers":353,"./uniform_text":363,"@plotly/d3":18}],362:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":112,"../../components/colorscale/defaults":122,"../../components/colorscale/helpers":123,"../../lib":254}],363:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o1,b=1-d[e+"gap"],_=1-d[e+"groupgap"];for(l=0;l0){var U=S.pointpos,q=S.jitter,G=S.marker.size/2,Z=0;U+q>=0&&((Z=Y*(U+q))>A?(V=!0,H=G,E=Z):Z>R&&(H=G,E=A)),Z<=A&&(E=A);var X=0;U-q<=0&&((X=-Y*(U-q))>L?(V=!0,B=G,j=X):X>F&&(B=G,j=L)),X<=L&&(j=L)}else E=A,j=L;var W=new Array(c.length);for(s=0;se.lo&&(x.so=!0)}return i}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.pos,u=!!c.rangebreaks,d=i.bPos,f=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=e.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(e){var t=c.c2l(e.pos+d,!0),a=c.l2p(t-o)+f,i=c.l2p(t+l)+f,h=u?(a+i)/2:c.l2p(t)+f,m=s.c2p(e.mean,!0),y=s.c2p(e.mean-e.sd,!0),v=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===p?"m0,0L"+y+","+h+"L"+m+","+a+"L"+v+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===p?"m0,0L"+h+","+y+"L"+a+","+m+"L"+h+","+v+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],d=i.t,f=i.trace;(d.wdPos=d.bdPos*f.whiskerwidth,!0!==f.visible||d.empty)?a.remove():("h"===f.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},f,d),l(a,{x:c,y:u},f,d),s(a,{pos:t,val:r},f,d))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":134,"../../lib":254,"@plotly/d3":18}],369:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../components/drawing");t.exports={style:function(e,t,r){var o=r||n.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var r=n.select(this),o=t[0].trace,l=o.line.width;function s(e,t,r,n){e.style("stroke-width",t+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];s(t,r.line.width,r.line.color,r.fillcolor),t.style("opacity",o.selectedpoints&&!e.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,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}},{"../../components/color":112,"../../components/drawing":134,"@plotly/d3":18}],370:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../ohlc/attributes"),o=e("../box/attributes");function l(e){return{line:{color:n({},o.line.color,{dflt:e}),width:o.line.width,editType:"style"},fillcolor:o.fillcolor,editType:"style"}}t.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n({},o.line.width,{}),editType:"style"},increasing:l(i.increasing.line.color.dflt),decreasing:l(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,whiskerwidth:n({},o.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel}},{"../../lib":254,"../../plots/cartesian/axis_format_attributes":304,"../box/attributes":364,"../ohlc/attributes":416}],371:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/cartesian/align_period"),o=e("../ohlc/calc").calcCommon;function l(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var r=e._fullLayout,s=a.getFromId(e,t.xaxis),c=a.getFromId(e,t.yaxis),u=s.makeCalcdata(t,"x"),d=i(t,s,"x",u).vals,f=o(e,t,u,d,c,l);return f.length?(n.extendFlat(f[0].t,{num:r._numBoxes,dPos:n.distinctVals(d).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,f):[{t:{empty:!0}}]}},{"../../lib":254,"../../plots/cartesian/align_period":298,"../../plots/cartesian/axes":301,"../ohlc/calc":417}],372:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../ohlc/ohlc_defaults"),o=e("../scatter/period_defaults"),l=e("./attributes");function s(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}t.exports=function(e,t,r,a){function c(r,a){return n.coerce(e,t,l,r,a)}i(e,t,c,a)?(o(e,t,a,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),s(e,t,c,"increasing"),s(e,t,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),a._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../components/color":112,"../../lib":254,"../ohlc/ohlc_defaults":421,"../scatter/period_defaults":458,"./attributes":370}],373:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:e("./attributes"),layoutAttributes:e("../box/layout_attributes"),supplyLayoutDefaults:e("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:e("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("../box/plot").plot,layerName:"boxlayer",style:e("../box/style").style,hoverPoints:e("../ohlc/hover").hoverPoints,selectPoints:e("../ohlc/select")}},{"../../plots/cartesian":313,"../box/cross_trace_calc":365,"../box/layout_attributes":366,"../box/layout_defaults":367,"../box/plot":368,"../box/style":369,"../ohlc/hover":419,"../ohlc/select":423,"./attributes":370,"./calc":371,"./defaults":372}],374:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r"),s.color=function(e,t){var r=e.marker,a=t.mc||r.color,i=t.mlc||r.line.color,o=t.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(u,f),[s]}}},{"../../components/color":112,"../../lib":254,"../bar/hover":354}],382:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":313,"../bar/select":359,"./attributes":375,"./calc":376,"./cross_trace_calc":378,"./defaults":379,"./event_data":380,"./hover":381,"./layout_attributes":383,"./layout_defaults":384,"./plot":385,"./style":386}],383:[function(e,t,r){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],384:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l path").each((function(e){if(!e.isBlank){var t=l.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(a.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,l.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":112,"../../components/drawing":134,"../../constants/interactions":233,"../bar/style":361,"../bar/uniform_text":363,"@plotly/d3":18}],387:[function(e,t,r){"use strict";var n=e("../pie/attributes"),a=e("../../plots/attributes"),i=e("../../plots/domain").attributes,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../lib/extend").extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":248,"../../plots/attributes":297,"../../plots/domain":328,"../../plots/template_attributes":336,"../pie/attributes":425}],388:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="funnelarea",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":335}],389:[function(e,t,r){"use strict";var n=e("../pie/calc");t.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},{"../pie/calc":427}],390:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,l=e("../pie/defaults").handleLabelsAndValues;t.exports=function(e,t,r,s){function c(r,i){return n.coerce(e,t,a,r,i)}var u=c("labels"),d=c("values"),f=l(u,d),p=f.len;if(t._hasLabels=f.hasLabels,t._hasValues=f.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),p){t._length=p,c("marker.line.width")&&c("marker.line.color",s.paper_bgcolor),c("marker.colors"),c("scalegroup");var h,m=c("text"),y=c("texttemplate");if(y||(h=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),y||h&&"none"!==h){var v=c("textposition");o(e,t,s,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(t,s,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",s.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},{"../../lib":254,"../../plots/domain":328,"../bar/defaults":351,"../pie/defaults":428,"./attributes":387}],391:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":436,"./attributes":387,"./base_plot":388,"./calc":389,"./defaults":390,"./layout_attributes":392,"./layout_defaults":393,"./plot":394,"./style":395}],392:[function(e,t,r){"use strict";var n=e("../pie/layout_attributes").hiddenlabels;t.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":432}],393:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},{"../../lib":254,"./layout_attributes":392}],394:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../lib"),o=i.strScale,l=i.strTranslate,s=e("../../lib/svg_text_utils"),c=e("../bar/plot").toMoveInsideBar,u=e("../bar/uniform_text"),d=u.recordMinTextSize,f=u.clearMinTextSize,p=e("../pie/helpers"),h=e("../pie/plot"),m=h.attachFxHandlers,y=h.determineInsideTextFont,v=h.layoutAreas,g=h.prerenderTitles,x=h.positionTitleOutside,b=h.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var r=e._context.staticPlot,u=e._fullLayout;f("funnelarea",u),g(t,e),v(t,u._size),i.makeTraceGroups(u._funnelarealayer,t,"trace").each((function(t){var f=n.select(this),h=t[0],v=h.trace;!function(e){if(!e.length)return;var t=e[0],r=t.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),l=t.vTotal,s=l,c=l*o/(1-o)/l;function u(){var e,t={x:e=Math.sqrt(c),y:-e};return[t.x,t.y]}var d,f,p=[];for(p.push(u()),d=e.length-1;d>-1;d--)if(!(f=e[d]).hidden){var h=f.v/s;c+=h,p.push(u())}var m=1/0,y=-1/0;for(d=0;d-1;d--)if(!(f=e[d]).hidden){var k=p[M+=1][0],A=p[M][1];f.TL=[-k,A],f.TR=[k,A],f.BL=w,f.BR=T,f.pxmid=(L=f.TR,S=f.BR,[.5*(L[0]+S[0]),.5*(L[1]+S[1])]),w=f.TL,T=f.TR}var L,S}(t),f.each((function(){var f=n.select(this).selectAll("g.slice").data(t);f.enter().append("g").classed("slice",!0),f.exit().remove(),f.each((function(o,l){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=v.index;var f=h.cx,g=h.cy,x=n.select(this),w=x.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),x.call(m,e,t);var T="M"+(f+o.TR[0])+","+(g+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",T),b(e,o,h);var M=p.castOption(v.textposition,o.pts),k=x.selectAll("g.slicetext").data(o.text&&"none"!==M?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var r=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=i.ensureUniformFontSize(e,y(v,o,u.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,p).call(s.convertToTspans,e);var h,m,x,b=a.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+g,w=Math.max(o.TL[1],o.TR[1])+g;m=Math.max(o.TL[0],o.BL[0])+f,x=Math.min(o.TR[0],o.BR[0])+f,(h=c(m,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,d(v.type,h,u),t[l].transform=h,i.setTransormAndDisplay(r,h)}))}}));var g=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var t=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),r=v.title.text;v._meta&&(r=i.templateString(r,v._meta)),t.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,v.title.font).call(s.convertToTspans,e);var c=x(h,u._size);t.attr("transform",l(c.x,c.y)+o(Math.min(1,c.scale))+l(c.tx,c.ty))}))}))}))}},{"../../components/drawing":134,"../../lib":254,"../../lib/svg_text_utils":277,"../bar/plot":358,"../bar/uniform_text":363,"../pie/helpers":430,"../pie/plot":434,"@plotly/d3":18}],395:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../pie/style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":363,"../pie/style_one":436,"@plotly/d3":18}],396:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../plots/template_attributes").texttemplateAttrs,l=e("../../plots/font_attributes"),s=e("./bin_attributes"),c=e("./constants"),u=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:a("x"),yhoverformat:a("y"),text:u({},n.text,{}),hovertext:u({},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:s("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:s("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({},{keys:c.eventDataKeys}),texttemplate:o({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:u({},n.textposition,{arrayOk:!1}),textfont:l({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:l({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:l({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:n.insidetextanchor,textangle:n.textangle,cliponaxis:n.cliponaxis,constraintext:n.constraintext,marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":248,"../../plots/cartesian/axis_format_attributes":304,"../../plots/font_attributes":329,"../../plots/template_attributes":336,"../bar/attributes":347,"./bin_attributes":398,"./constants":402}],397:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=e.length,n=0,a=0;ai){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,f=-.1*t,p=e-f,h=r[0],m=r[1],y=Math.min(d(h+f,h+p,n,i),d(m+f,m+p,n,i)),v=Math.min(d(h+c,h+f,n,i),d(m+c,m+f,n,i));if(y>v&&vo){var g=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",g);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(E)&&(H=o.tickIncrement(H,b.size,!0,p)),N.start=r.l2r(H),F||a.nestedProperty(t,v+".start").set(N.start)}var B=b.end,Y=r.r2l(I.end),V=void 0!==Y;if((b.endFound||V)&&Y!==r.r2l(B)){var U=V?Y:a.aggNums(Math.max,null,h);N.end=r.l2r(U),V||a.nestedProperty(t,v+".start").set(N.end)}var q="autobin"+l;return!1===t._input[q]&&(t._input[v]=a.extendFlat({},t[v]||{}),delete t._input[q],delete t[q]),[N,h]}t.exports={calc:function(e,t){var r,i,p,h,m=[],y=[],v="h"===t.orientation,g=o.getFromId(e,v?t.yaxis:t.xaxis),x=v?"y":"x",b={x:"y",y:"x"}[x],_=t[x+"calendar"],w=t.cumulative,T=f(e,t,g,x),M=T[0],k=T[1],A="string"==typeof M.size,L=[],S=A?L:M,D=[],O=[],C=[],P=0,I=t.histnorm,N=t.histfunc,z=-1!==I.indexOf("density");w.enabled&&z&&(I=I.replace(/ ?density$/,""),z=!1);var R,F="max"===N||"min"===N?null:0,E=s.count,j=c[I],H=!1,B=function(e){return g.r2c(e,0,_)};for(a.isArrayOrTypedArray(t[b])&&"count"!==N&&(R=t[b],H="avg"===N,E=s[N]),r=B(M.start),p=B(M.end)+(r-o.tickIncrement(r,M.size,!1,_))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(y,w.direction,w.currentbin);var K=Math.min(m.length,y.length),Q=[],$=0,ee=K-1;for(r=0;r=$;r--)if(y[r]){ee=r;break}for(r=$;r<=ee;r++)if(n(m[r])&&n(y[r])){var te={p:m[r],s:y[r],b:0};w.enabled||(te.pts=C[r],G?te.ph0=te.ph1=C[r].length?k[C[r][0]]:m[r]:(t._computePh=!0,te.ph0=U(L[r]),te.ph1=U(L[r+1],!0))),Q.push(te)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,M.size,!1,_)-Q[0].p),l(Q,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(Q,t,W),Q},calcAllAutoBins:f}},{"../../lib":254,"../../plots/cartesian/axes":301,"../../registry":337,"../bar/arrays_to_calcdata":346,"./average":397,"./bin_functions":399,"./bin_label_vals":400,"./norm_functions":408,"fast-isnumeric":26}],402:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],403:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../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"];t.exports=function(e,t){var r,d,f,p,h,m,y,v=t._histogramBinOpts={},g=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=v[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.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",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;h0}function T(e){e.each((function(e){g.stroke(n.select(this),e.line.color)})).each((function(e){g.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function M(e,t,r){var n=e._fullLayout,a=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),i={type:"linear",_id:"x"+t._id},l={letter:"x",font:n.font,noHover:!0,noTickson:!0};function s(e,t){return o.coerce(a,i,v,e,t)}return m(a,i,s,l,n),y(a,i,s,l),i}function k(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function A(e,t,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(p.convertToTspans,a).call(d.font,t),d.bBox(o.node())}function L(e,t,r,n,a,i){var l="_cache"+t;e[l]&&e[l].key===a||(e[l]={key:a,value:r});var s=o.aggNums(i,null,[e[l].value,n],2);return e[l].value=s,s}t.exports=function(e,t,r,m){var y,v=e._fullLayout;w(r)&&m&&(y=m()),o.makeTraceGroups(v._indicatorlayer,t,"trace").each((function(t){var m,S,D,O,C,P=t[0].trace,I=n.select(this),N=P._hasGauge,z=P._isAngular,R=P._isBullet,F=P.domain,E={w:v._size.w*(F.x[1]-F.x[0]),h:v._size.h*(F.y[1]-F.y[0]),l:v._size.l+v._size.w*F.x[0],r:v._size.r+v._size.w*(1-F.x[1]),t:v._size.t+v._size.h*(1-F.y[1]),b:v._size.b+v._size.h*F.y[0]},j=E.l+E.w/2,H=E.t+E.h/2,B=Math.min(E.w/2,E.h),Y=f.innerRadius*B,V=P.align||"center";if(S=H,N){if(z&&(m=j,S=H+B/2,D=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height);return[t/r,e,t]}(e,.9*Y)}),R){var U=f.bulletPadding,q=1-f.bulletNumberDomainSize+U;m=E.l+(q+(1-q)*b[V])*E.w,D=function(e){return k(e,(f.bulletNumberDomainSize-U)*E.w,E.h)}}}else m=E.l+b[V]*E.w,D=function(e){return k(e,E.w,E.h)};!function(e,t,r,a){var c,u,f,m=r[0].trace,y=a.numbersX,v=a.numbersY,T=m.align||"center",k=x[T],S=a.transitionOpts,D=a.onComplete,O=o.ensureSingle(t,"g","numbers"),C=[];m._hasNumber&&C.push("number");m._hasDelta&&(C.push("delta"),"left"===m.delta.position&&C.reverse());var P=O.selectAll("text").data(C);function I(t,r,n,a){if(!t.match("s")||n>=0==a>=0||r(n).slice(-1).match(_)||r(a).slice(-1).match(_))return r;var i=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=M(e,{tickformat:i});return function(e){return Math.abs(e)<1?h.tickText(o,e).text:r(e)}}P.enter().append("text"),P.attr("text-anchor",(function(){return k})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var N,z=m.mode+m.align;m._hasDelta&&(N=function(){var t=M(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),h.prepTicks(t);var a=function(e){return h.tickText(t,e).text},o=m.delta.suffix,l=m.delta.prefix,s=function(e){return m.delta.relative?e.relativeDelta:e.delta},c=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+l+t(e)+o},f=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=s(r[0]));var y=O.select("text.delta");function v(){y.text(c(s(r[0]),a)).call(g.fill,f(r[0])).call(p.convertToTspans,e)}return y.call(d.font,m.delta.font).call(g.fill,f({delta:m._deltaLastValue})),w(S)?y.transition().duration(S.duration).ease(S.easing).tween("text",(function(){var e=n.select(this),t=s(r[0]),o=m._deltaLastValue,l=I(m.delta.valueformat,a,o,t),u=i(o,t);return m._deltaLastValue=t,function(t){e.text(c(u(t),l)),e.call(g.fill,f({delta:u(t)}))}})).each("end",(function(){v(),D&&D()})).each("interrupt",(function(){v(),D&&D()})):v(),u=A(c(s(r[0]),a),m.delta.font,k,e),y}(),z+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,z+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=u);m._hasNumber&&(!function(){var t=M(e,{tickformat:m.number.valueformat},m._range);t.setScale(),h.prepTicks(t);var a=function(e){return h.tickText(t,e).text},o=m.number.suffix,l=m.number.prefix,s=O.select("text.number");function u(){var t="number"==typeof r[0].y?l+a(r[0].y)+o:"-";s.text(t).call(d.font,m.number.font).call(p.convertToTspans,e)}w(S)?s.transition().duration(S.duration).ease(S.easing).each("end",(function(){u(),D&&D()})).each("interrupt",(function(){u(),D&&D()})).attrTween("text",(function(){var e=n.select(this),t=i(r[0].lastY,r[0].y);m._lastValue=r[0].y;var s=I(m.number.valueformat,a,r[0].lastY,r[0].y);return function(r){e.text(l+s(t(r))+o)}})):u(),c=A(l+a(r[0].y)+o,m.number.font,k,e)}(),z+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c);if(m._hasDelta&&m._hasNumber){var R,F,E=[(c.left+c.right)/2,(c.top+c.bottom)/2],j=[(u.left+u.right)/2,(u.top+u.bottom)/2],H=.75*m.delta.font.size;"left"===m.delta.position&&(R=L(m,"deltaPos",0,-1*(c.width*b[m.align]+u.width*(1-b[m.align])+H),z,Math.min),F=E[1]-j[1],f={width:c.width+u.width+H,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=L(m,"deltaPos",0,c.width*(1-b[m.align])+u.width*b[m.align]+H,z,Math.max),F=E[1]-j[1],f={width:c.width+u.width+H,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),N.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&O.attr("transform",(function(){var e=a.numbersScaler(f);z+=e[2];var t,r=L(m,"numbersScale",1,e[0],z,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?v-r*f.bottom:v-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+t;var n=f[T];"center"===T&&(n=(f.left+f.right)/2);var i=y-r*n;return i=L(m,"numbersTranslate",0,i,z,Math.max),s(i,t)+l(r)}))}(e,I,t,{numbersX:m,numbersY:S,numbersScaler:D,transitionOpts:r,onComplete:y}),N&&(O={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},C={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var G=I.selectAll("g.angular").data(z?t:[]);G.exit().remove();var Z=I.selectAll("g.angularaxis").data(z?t:[]);Z.exit().remove(),z&&function(e,t,r,i){var o,l,d,f,p=r[0].trace,m=i.size,y=i.radius,v=i.innerRadius,g=i.gaugeBg,x=i.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+y/2],_=i.gauge,k=i.layer,A=i.transitionOpts,L=i.onComplete,S=Math.PI/2;function D(e){var t=p.gauge.axis.range[0],r=(e-t)/(p.gauge.axis.range[1]-t)*Math.PI-S;return r<-S?-S:r>S?S:r}function O(e){return n.svg.arc().innerRadius((v+y)/2-e/2*(y-v)).outerRadius((v+y)/2+e/2*(y-v)).startAngle(-S)}function C(e){e.attr("d",(function(e){return O(e.thickness).startAngle(D(e.range[0])).endAngle(D(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",s(b[0],b[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(o=M(e,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},I={},N=h.makeLabelFns(o,0).labelStandoff;I.xFn=function(e){var t=P(e);return Math.cos(t)*N},I.yFn=function(e){var t=P(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(N+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*u)},I.anchorFn=function(e){var t=P(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},I.heightFn=function(e,t,r){var n=P(e);return-.5*(1+Math.sin(n))*r};var z=function(e){return s(b[0]+y*Math.cos(e),b[1]-y*Math.sin(e))};d=function(e){return z(P(e))};if(l=h.calcTicks(o),f=h.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;h.drawTicks(e,o,{vals:l,layer:k,path:"M"+f*R+",0h"+f*o.ticklen,transFn:function(e){var t=P(e);return z(t)+"rotate("+-c(t)+")"}}),h.drawLabels(e,o,{vals:l,layer:k,transFn:d,labelFns:I})}var F=[g].concat(p.gauge.steps),E=_.selectAll("g.bg-arc").data(F);E.enter().append("g").classed("bg-arc",!0).append("path"),E.select("path").call(C).call(T),E.exit().remove();var j=O(p.gauge.bar.thickness),H=_.selectAll("g.value-arc").data([p.gauge.bar]);H.enter().append("g").classed("value-arc",!0).append("path");var B=H.select("path");w(A)?(B.transition().duration(A.duration).ease(A.easing).each("end",(function(){L&&L()})).each("interrupt",(function(){L&&L()})).attrTween("d",(Y=j,V=D(r[0].lastY),U=D(r[0].y),function(){var e=a(V,U);return function(t){return Y.endAngle(e(t))()}})),p._lastValue=r[0].y):B.attr("d","number"==typeof r[0].y?j.endAngle(D(r[0].y)):"M0,0Z");var Y,V,U;B.call(T),H.exit().remove(),F=[];var q=p.gauge.threshold.value;(q||0===q)&&F.push({range:[q,q],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var G=_.selectAll("g.threshold-arc").data(F);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(C).call(T),G.exit().remove();var Z=_.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(C).call(T),Z.exit().remove()}(e,0,t,{radius:B,innerRadius:Y,gauge:G,layer:Z,size:E,gaugeBg:O,gaugeOutline:C,transitionOpts:r,onComplete:y});var X=I.selectAll("g.bullet").data(R?t:[]);X.exit().remove();var W=I.selectAll("g.bulletaxis").data(R?t:[]);W.exit().remove(),R&&function(e,t,r,n){var a,i,o,l,c,u=r[0].trace,d=n.gauge,p=n.layer,m=n.gaugeBg,y=n.gaugeOutline,v=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;d.enter().append("g").classed("bullet",!0),d.attr("transform",s(v.l,v.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=v.h,A=u.gauge.bar.thickness*k,L=x.x[0],S=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-f.bulletNumberDomainSize:1);(a=M(e,u.gauge.axis))._id="xbulletaxis",a.domain=[L,S],a.setScale(),i=h.calcTicks(a),o=h.makeTransTickFn(a),l=h.getTickSigns(a)[2],c=v.t+v.h,a.visible&&(h.drawTicks(e,a,{vals:"inside"===a.ticks?h.clipEnds(a,i):i,layer:p,path:h.makeTickPath(a,c,l),transFn:o}),h.drawLabels(e,a,{vals:i,layer:p,transFn:o,labelFns:h.makeLabelFns(a,c)}));function D(e){e.attr("width",(function(e){return Math.max(0,a.c2p(e.range[1])-a.c2p(e.range[0]))})).attr("x",(function(e){return a.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*k})).attr("height",(function(e){return e.thickness*k}))}var O=[m].concat(u.gauge.steps),C=d.selectAll("g.bg-bullet").data(O);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(D).call(T),C.exit().remove();var P=d.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",A).attr("y",(k-A)/2).call(T),w(b)?P.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var I=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),N=d.selectAll("g.threshold-bullet").data(I);N.enter().append("g").classed("threshold-bullet",!0).append("line"),N.select("line").attr("x1",a.c2p(u.gauge.threshold.value)).attr("x2",a.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*k).call(g.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),N.exit().remove();var z=d.selectAll("g.gauge-outline").data([y]);z.enter().append("g").classed("gauge-outline",!0).append("rect"),z.select("rect").call(D).call(T),z.exit().remove()}(e,0,t,{gauge:X,layer:W,size:E,gaugeBg:O,gaugeOutline:C,transitionOpts:r,onComplete:y});var J=I.selectAll("text.title").data(t);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?x.right:x[P.title.align]})).text(P.title.text).call(d.font,P.title.font).call(p.convertToTspans,e),J.attr("transform",(function(){var e,t=E.l+E.w*b[P.title.align],r=f.titlePadding,n=d.bBox(J.node());if(N){if(z)if(P.gauge.axis.visible)e=d.bBox(Z.node()).top-r-n.bottom;else e=E.t+E.h/2-B/2-n.bottom-r;R&&(e=S-(n.top+n.bottom)/2,t=E.l-f.bulletPadding*E.w)}else e=P._numbersTop-r-n.bottom;return s(t,e)}))}))}},{"../../components/color":112,"../../components/drawing":134,"../../constants/alignment":228,"../../lib":254,"../../lib/svg_text_utils":277,"../../plots/cartesian/axes":301,"../../plots/cartesian/axis_defaults":303,"../../plots/cartesian/layout_attributes":314,"../../plots/cartesian/position_defaults":317,"./constants":412,"@plotly/d3":18,"d3-interpolate":22}],416:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../scatter/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../components/drawing/attributes").dash,l=e("../../components/fx/attributes"),s=e("../../constants/delta.js"),c=s.INCREASING.COLOR,u=s.DECREASING.COLOR,d=a.line;function f(e){return{line:{color:n({},d.color,{dflt:e}),width:d.width,dash:o,editType:"style"},editType:"style"}}t.exports={xperiod:a.xperiod,xperiod0:a.xperiod0,xperiodalignment:a.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},d.width,{}),dash:n({},o,{}),editType:"style"},increasing:f(c),decreasing:f(u),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},l.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":133,"../../components/fx/attributes":143,"../../constants/delta.js":230,"../../lib":254,"../../plots/cartesian/axis_format_attributes":304,"../scatter/attributes":438}],417:[function(e,t,r){"use strict";var n=e("../../lib"),a=n._,i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../../constants/numerical").BADNUM;function s(e,t,r,n){return{o:e,h:t,l:r,c:n}}function c(e,t,r,o,s,c){for(var u=s.makeCalcdata(t,"open"),d=s.makeCalcdata(t,"high"),f=s.makeCalcdata(t,"low"),p=s.makeCalcdata(t,"close"),h=Array.isArray(t.text),m=Array.isArray(t.hovertext),y=!0,v=null,g=!!t.xperiodalignment,x=[],b=0;bv):y=k>w,v=k;var A=c(w,T,M,k);A.pos=_,A.yc=(w+k)/2,A.i=b,A.dir=y?"increasing":"decreasing",A.x=A.pos,A.y=[M,T],g&&(A.orig_p=r[b]),h&&(A.tx=t.text[b]),m&&(A.htx=t.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return t._extremes[s._id]=i.findExtremes(s,n.concat(f,d),{padded:!0}),x.length&&(x[0].t={labels:{open:a(e,"open:")+" ",high:a(e,"high:")+" ",low:a(e,"low:")+" ",close:a(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),l=function(e,t,r){var a=r._minDiff;if(!a){var i,l=e._fullData,s=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(l,b,s.yhoverformat):((g=a.extendFlat({},f)).y0=g.y1=_,g.yLabelVal=b,g.yLabel=c.labels[x]+n.hoverLabelText(l,b,s.yhoverformat),g.name="",d.push(g),y[b]=g)}return d}function f(e,t,r,a){var i=e.cd,o=e.ya,s=i[0].trace,d=i[0].t,f=u(e,t,r,a);if(!f)return[];var p=i[f.index],h=f.index=p.i,m=p.dir;function y(e){return d.labels[e]+n.hoverLabelText(o,s[e][h],s.yhoverformat)}var v=p.hi||s.hoverinfo,g=v.split("+"),x="all"===v,b=x||-1!==g.indexOf("y"),_=x||-1!==g.indexOf("text"),w=b?[y("open"),y("high"),y("low"),y("close")+" "+c[m]]:[];return _&&l(p,s,w),f.extraText=w.join("
"),f.y0=f.y1=o.c2p(p.yc,!0),[f]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?d(e,t,r,n):f(e,t,r,n)},hoverSplit:d,hoverOnPoints:f}},{"../../components/color":112,"../../components/fx":152,"../../constants/delta.js":230,"../../lib":254,"../../plots/cartesian/axes":301}],420:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":313,"./attributes":416,"./calc":417,"./defaults":418,"./hover":419,"./plot":422,"./select":423,"./style":424}],421:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),l=r("open"),s=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],i),l&&s&&c&&u){var d=Math.min(l.length,s.length,c.length,u.length);return o&&(d=Math.min(d,a.minRowLength(o))),t._length=d,d}}},{"../../lib":254,"../../registry":337}],422:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");t.exports=function(e,t,r,i){var o=t.yaxis,l=t.xaxis,s=!!l.rangebreaks;a.makeTraceGroups(i,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],i=r.t;if(!0!==r.trace.visible||i.empty)t.remove();else{var c=i.tickLen,u=t.selectAll("path").data(a.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=l.c2p(e.pos-c,!0),r=l.c2p(e.pos+c,!0),n=s?(t+r)/2:l.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},{"../../lib":254,"@plotly/d3":18}],423:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e.cd,a=e.xaxis,i=e.yaxis,o=[],l=n[0].t.bPos||0;if(!1===t)for(r=0;r=0})),("funnelarea"===t.type?v:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=y),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),d=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),d){t._length=d,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),h=c("texttemplate");if(h||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||f&&"none"!==f){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var y=c("hole");if(c("title.text")){var v=c("title.position",y?"middle center":"top center");y||"middle center"!==v||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":254,"../../plots/domain":328,"../bar/defaults":351,"./attributes":425,"fast-isnumeric":26}],429:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":148}],430:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:y.castOption(_.bgcolor,e.pts)||e.color,borderColor:y.castOption(_.bordercolor,e.pts),fontFamily:y.castOption(w.family,e.pts),fontSize:y.castOption(w.size,e.pts),fontColor:y.castOption(w.color,e.pts),nameLength:y.castOption(_.namelength,e.pts),textAlign:y.castOption(_.align,e.pts),hovertemplate:y.castOption(d.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[v(e,d)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[v(e,d)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[v(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[v(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=y.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=y.castOption(e._input.textfont.color,t.pts));var a=y.castOption(e.insidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.insidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;y-=2)v(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)v(Math.PI*(y+1),"tan")}if(d||p){for(y=4;y>=-4;y-=2)v(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)v(Math.PI*(y+.5),"rad")}}if(l||h||d){var g=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/g,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||f)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function D(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function O(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),d=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(d+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?d*=2:-1!==i.title.position.indexOf("right")&&(d+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=d/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n1?(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")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:y.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:y.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=y.getFirstFilled(a.text,t.pts);(g(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function R(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._context.staticPlot,i=e._fullLayout,f=i._size;h("pie",i),_(t,e),I(t,f);var m=s.makeTraceGroups(i._pielayer,t,"trace").each((function(t){var h=n.select(this),m=t[0],v=m.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=y.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.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))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var _=[[[],[]],[[],[]]],T=!1;g.each((function(a,o){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=v.index,_[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var c=m.cx,u=m.cy,f=n.select(this),h=f.selectAll("path.surface").data([a]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),f.call(x,e,t),v.pull){var g=+y.castOption(v.pull,a.pts)||0;g>0&&(c+=g*a.pxmid[0],u+=g*a.pxmid[1])}a.cxFinal=c,a.cyFinal=u;var M=v.hole;if(a.v===m.vTotal){var k="M"+(c+a.px0[0])+","+(u+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";M?h.attr("d","M"+(c+M*a.px0[0])+","+(u+M*a.px0[1])+C(a.px0,a.pxmid,!1,M)+C(a.pxmid,a.px0,!1,M)+"Z"+k):h.attr("d",k)}else{var A=C(a.px0,a.px1,!0,1);if(M){var L=1-M;h.attr("d","M"+(c+M*a.px1[0])+","+(u+M*a.px1[1])+C(a.px1,a.px0,!1,M)+"l"+L*a.px0[0]+","+L*a.px0[1]+A+"Z")}else h.attr("d","M"+c+","+u+"l"+a.px0[0]+","+a.px0[1]+A+"Z")}z(e,a,m);var S=y.castOption(v.textposition,a.pts),O=f.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);O.enter().append("g").classed("slicetext",!0),O.exit().remove(),O.each((function(){var r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=y.castOption(e.outsidetextfont.color,t.pts)||y.castOption(e.textfont.color,t.pts)||r.color,a=y.castOption(e.outsidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.outsidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(v,a,i.font):b(v,a,i.font));r.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,f).call(d.convertToTspans,e);var h,g=l.bBox(r.node());if("outside"===S)h=D(g,a);else if(h=w(g,a,m),"auto"===S&&h.scale<1){var x=s.ensureUniformFontSize(e,v.outsidetextfont);r.call(l.font,x),h=D(g=l.bBox(r.node()),a)}var _=h.textPosAngle,M=void 0===_?a.pxmid:N(m.r,_);if(h.targetX=c+M[0]*h.rCenter+(h.x||0),h.targetY=u+M[1]*h.rCenter+(h.y||0),R(h,g),h.outside){var k=h.targetY;a.yLabelMin=k-g.height/2,a.yLabelMid=k,a.yLabelMax=k+g.height/2,a.labelExtraX=0,a.labelExtraY=0,T=!0}h.fontSize=f.size,p(v.type,h,i),t[o].transform=h,s.setTransormAndDisplay(r,h)}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*m.r+","+n*m.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var M=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);if(M.enter().append("g").classed("titletext",!0),M.exit().remove(),M.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=v.title.text;v._meta&&(a=s.templateString(a,v._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,v.title.font).call(d.convertToTspans,e),t="middle center"===v.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(m):O(m,f),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),T&&function(e,t){var r,n,a,i,o,l,s,c,u,d,f,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}function g(e,r){r||(r={});var a,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,v=e.cyFinal+o(e.px0[1],e.px1[1]),g=p-h;if(g*s>0&&(e.labelExtraY=g),Array.isArray(t.pull))for(c=0;c=(y.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(g=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=g):(m+e.labelExtraY-v)*s>0&&(a=3*l*Math.abs(c-d.indexOf(e)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:v,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],d=u.concat(c),p=[],f=0;fMath.abs(d)?l+="l"+d*e.pxmid[0]/e.pxmid[1]+","+d+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(d-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,v),T&&v.automargin){var k=l.bBox(h.node()),A=v.domain,L=f.w*(A.x[1]-A.x[0]),S=f.h*(A.y[1]-A.y[0]),C=(.5*L-m.r)/f.w,P=(.5*S-m.r)/f.h;a.autoMargin(e,"pie."+v.uid+".automargin",{xl:A.x[0]-C,xr:A.x[1]+C,yb:A.y[0]-P,yt:A.y[1]+P,l:Math.max(m.cx-m.r-k.left,0),r:Math.max(k.right-(m.cx+m.r),0),b:Math.max(k.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-k.top,0),pad:5})}}))}));setTimeout((function(){m.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:R}},{"../../components/color":112,"../../components/drawing":134,"../../components/fx":152,"../../lib":254,"../../lib/svg_text_utils":277,"../../plots/plots":335,"../bar/constants":349,"../bar/uniform_text":363,"./event_data":429,"./helpers":430,"@plotly/d3":18}],435:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":363,"./style_one":436,"@plotly/d3":18}],436:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":112,"./helpers":430}],437:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&O[v].gap;)v--;for(x=O[v].s,m=O.length-1;m>v;m--)O[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],445:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),d=e("./marker_defaults"),f=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults"),y=e("../../lib").coercePattern;t.exports=function(e,t,r,v){function g(r,a){return n.coerce(e,t,i,r,a)}var x=s(e,t,v,g);if(x||(t.visible=!1),t.visible){c(e,t,v,g),g("xhoverformat"),g("yhoverformat");var b=u(e,t,v,g),_=!b&&x=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(f.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iZ!=(j=N[P][1])>=Z&&(R=N[P-1][0],F=N[P][0],j-E&&(z=R+(F-R)*(Z-E)/(j-E),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,f._length);var X=l.defaultLine;return l.opacity(d.fillcolor)?X=d.fillcolor:l.opacity((d.line||{}).color)&&(X=d.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:U,y0:Z,y1:Z,color:X,hovertemplate:!1}),delete e.index,d.text&&!Array.isArray(d.text)?e.text=String(d.text):e.text=d.name,[e]}}}},{"../../components/color":112,"../../components/fx":152,"../../lib":254,"../../registry":337,"./get_trace_color":448}],450:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":313,"./arrays_to_calcdata":437,"./attributes":438,"./calc":439,"./cross_trace_calc":443,"./cross_trace_defaults":444,"./defaults":445,"./format_labels":447,"./hover":449,"./marker_colorbar":456,"./plot":459,"./select":460,"./style":462,"./subtypes":463}],451:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){s||(s={});var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},{"../../components/colorscale/defaults":122,"../../components/colorscale/helpers":123,"../../lib":254}],452:[function(e,t,r){"use strict";var n=e("../../components/drawing"),a=e("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,c=e("../../lib"),u=c.segmentsIntersect,d=c.constrain,f=e("./constants");t.exports=function(e,t){var r,a,o,p,h,m,y,v,g,x,b,_,w,T,M,k,A,L,S=t.trace||{},D=t.xaxis,O=t.yaxis,C="log"===D.type,P="log"===O.type,I=D._length,N=O._length,z=t.backoff,R=S.marker,F=t.connectGaps,E=t.baseTolerance,j=t.shape,H="linear"===j,B=S.fill&&"none"!==S.fill,Y=[],V=f.minTolerance,U=e.length,q=new Array(U),G=0;function Z(r){var n=e[r];if(!n)return!1;var a=t.linearized?D.l2p(n.x):D.c2p(n.x),o=t.linearized?O.l2p(n.y):O.c2p(n.y);if(a===i){if(C&&(a=D.c2p(n.x,!0)),a===i)return!1;P&&o===i&&(a*=Math.abs(D._m*N*(D._m>0?l:s)/(O._m*I*(O._m>0?l:s)))),a*=1e3}if(o===i){if(P&&(o=O.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function X(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&coe||e[1]se)return[d(e[0],ie,oe),d(e[1],le,se)]}function de(e,t){return e[0]===t[0]&&(e[0]===ie||e[0]===oe)||(e[1]===t[1]&&(e[1]===le||e[1]===se)||void 0)}function fe(e,t,r){return function(n,a){var i=ue(n),o=ue(a),l=[];if(i&&o&&de(i,o))return l;i&&l.push(i),o&&l.push(o);var s=2*c.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);s&&((i&&o?s>0==i[e]>o[e]?i:o:i||o)[e]+=s);return l}}function pe(e){var t=e[0],r=e[1],n=t===q[G-1][0],a=r===q[G-1][1];if(!n||!a)if(G>1){var i=t===q[G-2][0],o=r===q[G-2][1];n&&(t===ie||t===oe)&&i?o?G--:q[G-1]=e:a&&(r===le||r===se)&&o?i?G--:q[G-1]=e:q[G++]=e}else q[G++]=e}function he(e){q[G-1][0]!==e[0]&&q[G-1][1]!==e[1]&&pe([$,ee]),pe(e),te=null,$=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ce[a],o=u(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&J(o,e)oe?oe:0,Q=t[1]se?se:0,K||Q){if(G)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),q[G++]=n[1])}else re=ne(q[G-1],t)[0],q[G++]=re;else q[G++]=[K||t[0],Q||t[1]];var a=q[G-1];K&&Q&&(a[0]!==K||a[1]!==Q)?(te&&($!==K&&ee!==Q?pe($&&ee?(i=te,l=(o=t)[0]-i[0],s=(o[1]-i[1])/l,(i[1]*o[0]-o[1]*i[0])/l>0?[s>0?ie:oe,se]:[s>0?oe:ie,le]):[$||K,ee||Q]):$&&ee&&pe([$,ee])),pe([K,Q])):$-K&&ee-Q&&pe([K||$,Q||ee]),te=t,$=K,ee=Q}else te&&he(ne(te,t)[0]),q[G++]=t;var i,o,l,s}for(r=0;rW(m,ve))break;o=m,(w=g[0]*v[0]+g[1]*v[1])>b?(b=w,p=m,y=!1):w<_&&(_=w,h=m,y=!0)}if(y?(ye(p),o!==h&&ye(h)):(h!==a&&ye(h),o!==p&&ye(p)),ye(o),r>=e.length||!m)break;ye(m),a=m}}else ye(p)}te&&pe([$||te[0],ee||te[1]]),Y.push(q.slice(0,G))}var ge=j.slice(j.length-1);if(z&&"h"!==ge&&"v"!==ge){for(var xe=!1,be=-1,_e=[],we=0;we=0?s=p:(s=p=f,f++),s0?Math.max(r,i):0}}},{"fast-isnumeric":26}],456:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],457:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),d=(e.line||{}).color;(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),c.noAngle||(s("marker.angle"),c.noAngleRef||s("marker.angleref"),c.noStandOff||s("marker.standoff")),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",d&&!Array.isArray(d)&&t.marker.color!==d?d:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":112,"../../components/colorscale/defaults":122,"../../components/colorscale/helpers":123,"./subtypes":463}],458:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":234,"../../lib":254}],459:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),d=e("./link_traces"),f=e("../../lib/polygon").tester;function p(e,t,r,d,p,h,m){var y;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),d=n.extent(i.simpleMap(s.range,s.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=d[0]&&e.y<=d[1]})),m=Math.ceil(h.length/p),y=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function g(e){return v?e.transition():e}var x=r.xaxis,b=r.yaxis,_=d[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,D;g(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),d[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,P,I="",N=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",D=z._nextFill,N=z._polygons);var R,F,E,j,H,B,Y,V="",U="",q=[],G=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(D&&D.datum(d),-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(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},E=function(e){return F(e.reverse())},q=u(d,{xaxis:x,yaxis:b,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),y=0;y1){var r=n.select(this);if(r.datum(d),e)g(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",C),s.singleLineStyle(d,a)}}}}}var Z=k.selectAll(".js-line").data(q);g(Z.exit()).style("opacity",0).remove(),Z.each(G(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(G(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(S?(S.datum(d),j&&B&&(O?("y"===O?j[1]=B[1]=b.c2p(0,!0):"x"===O&&(j[0]=B[0]=x.c2p(0,!0)),g(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle,e)):g(S).attr("d",V+"Z").call(s.singleFillStyle,e))):D&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?g(D).attr("d",V+"Z"+I+"Z").call(s.singleFillStyle,e):g(D).attr("d",V+"L"+I.substr(1)+"Z").call(s.singleFillStyle,e),_._polygons=_._polygons.concat(N)):(W(D),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(S?W(S):D&&W(D),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(d),L.datum(d),function(t,a,i){var o,u=i[0].trace,d=c.hasMarkers(u),f=c.hasText(u),p=ee(u),h=te,m=te;if(d||f){var y=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?K:J:_&&!w&&(y=Q),d&&(h=y),f&&(m=y)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);v&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),d&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=g(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=g(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){g(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,d);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){g(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,f,h=!i,m=!!i&&i.duration>0,y=d(e,t,r);((u=a.selectAll("g.trace").data(y,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,y,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,y,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":134,"../../lib":254,"../../lib/polygon":266,"../../registry":337,"./line_points":452,"./link_traces":454,"./subtypes":463,"@plotly/d3":18}],460:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],d=l[0].trace;if(!n.hasMarkers(d)&&!n.hasText(d))return[];if(!1===t)for(r=0;r")),u.color=function(e,t){var r=e[t.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(f,y),[u]}function M(e){return n(m,e,f[h+"hoverformat"])}}},{"../../components/color":112,"../../constants/delta.js":230,"../../plots/cartesian/axes":301,"../bar/hover":354}],473:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":313,"../bar/select":359,"./attributes":466,"./calc":467,"./cross_trace_calc":469,"./defaults":470,"./event_data":471,"./hover":472,"./layout_attributes":474,"./layout_defaults":475,"./plot":476,"./style":477}],474:[function(e,t,r){"use strict";t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],475:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l0&&(y+=f?"M"+d[0]+","+h[1]+"V"+h[0]:"M"+d[1]+","+h[0]+"H"+d[0]),"between"!==p&&(r.isSum||l path").each((function(e){if(!e.isBlank){var t=l[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(a.dashLine,t.line.dash,t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":112,"../../components/drawing":134,"../../constants/interactions":233,"../bar/style":361,"../bar/uniform_text":363,"@plotly/d3":18}],478:[function(e,t,r){"use strict";var n=e("../plots/cartesian/axes"),a=e("../lib"),i=e("../plot_api/plot_schema"),o=e("./helpers").pointsAccessorFunction,l=e("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var s=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=s.aggregations;function u(e,t,r,i){if(i.enabled){for(var o=i.target,s=a.nestedProperty(t,o),c=s.get(),u=function(e,t){var r=e.func,n=t.d2c,i=t.c2d;switch(r){case"count":return d;case"first":return f;case"last":return p;case"sum":return function(e,t){for(var r=0,a=0;aa&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return f(e)>l};case">=":return function(e){return f(e)>=l};case"[]":return function(e){var t=f(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=f(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=f(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=f(e);return tl[1]};case"](":return function(e){var t=f(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=f(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(f(e))};case"}{":return function(e){return-1===l.indexOf(f(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),f),x={},b={},_=0;h?(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(d))},v=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},v=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(y);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],70:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var d=t.linesIntersect(o,l,c,u);if(!1===d){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var f=t.pointsSame(o,c),p=t.pointsSame(l,u);if(f&&p)return n;var h=!f&&t.pointBetween(o,c,u),m=!p&&t.pointBetween(l,c,u);if(f)return m?s(n,l):s(e,u),n;h&&(p||(m?s(n,l):s(e,u)),s(n,o))}else 0===d.alongA&&(-1===d.alongB?s(e,c):0===d.alongB?s(e,d.pt):1===d.alongB&&s(e,u)),0===d.alongB&&(-1===d.alongA?s(n,o):0===d.alongA?s(n,d.pt):1===d.alongA&&s(n,l));return!1}for(var d=[];!i.isEmpty();){var f=i.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var p=c(f),h=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function y(){if(h){var e=u(f,h);if(e)return e}return!!m&&u(f,m)}r&&r.tempStatus(f.seg,!!h&&h.seg,!!m&&m.seg);var v,g=y();if(g){var x;if(e)(x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above);else g.seg.otherFill=f.seg.myFill;r&&r.segmentUpdate(g.seg),f.other.remove(),f.remove()}if(i.getHead()!==f){r&&r.rewind(f.seg);continue}if(e)x=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:a,f.seg.myFill.above=x?!f.seg.myFill.below:f.seg.myFill.below;else if(null===f.seg.otherFill)v=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?o:a,f.seg.otherFill={above:v,below:v};r&&r.status(f.seg,!!h&&h.seg,!!m&&m.seg),f.other.status=p.insert(n.node({ev:f}))}else{var b=f.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(),!f.primary){var _=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=_}d.push(f.seg)}i.getHead().remove()}return r&&r.done(),d}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":75,timers:76}],77:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,d=!1,f=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(L[e])e=L[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=H.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=H.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=H.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=H.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=H.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=H.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=H.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:R(t[4]),format:a?"name":"hex8"};if(t=H.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:a?"name":"hex"};if(t=H.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:R(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=H.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(B(t.r)&&B(t.g)&&B(t.b)?(p=t.r,h=t.g,m=t.b,a={r:255*O(p,255),g:255*O(h,255),b:255*O(m,255)},d=!0,f="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(s=N(t.s),c=N(t.v),a=function(t,r,n){t=6*O(t,360),r=O(r,100),n=O(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),d=!0,f="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(s=N(t.s),u=N(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=O(e,360),t=O(t,100),r=O(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),d=!0,f="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,m;return i=D(i),{ok:d,format:t.format||f,r:o(255,l(a.r,0)),g:o(255,l(a.g,0)),b:o(255,l(a.b,0)),a:i}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=O(e,255),t=O(t,255),r=O(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=D(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return f(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[I(i(e).toString(16)),I(i(t).toString(16)),I(i(r).toString(16)),I(z(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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*O(this._r,255))+"%",g:i(100*O(this._g,255))+"%",b:i(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%)":"rgba("+i(100*O(this._r,255))+"%, "+i(100*O(this._g,255))+"%, "+i(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[f(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:N(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var L=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(L);function D(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function C(e){return o(1,l(0,e))}function P(e){return parseInt(e,16)}function I(e){return 1==e.length?"0"+e:""+e}function N(e){return e<=1&&(e=100*e+"%"),e}function z(t){return e.round(255*parseFloat(t)).toString(16)}function R(e){return P(e)/255}var F,E,j,H=(E="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",j="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(e){return!!H.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],78:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"==typeof e){var r=e.match(s);return r?r[0]:""}var n=this._validateYear(e),a=e.month(),i=""+this.toChineseMonth(n,a);return t&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(e){if("string"==typeof e){var t=e.match(c);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(e){if("string"==typeof e){var t=e.match(u);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var a=t[t.length-1];r="i"===a||"I"===a}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!=typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=f[o-f[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var d=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(d/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=d[e-d[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=d[o.year-d[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(m>>5&15)-1,(31&m)+l);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=f[a.year-f[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=f[i.year-f[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=d[i.year-d[0]];for(p=0;p<13;p++){var m=h&1<<12-p?30:29;if(s>13;!y||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":92,"object-assign":64}],81:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":92,"object-assign":64}],82:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":92,"object-assign":64}],83:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":92,"object-assign":64}],84:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":92,"object-assign":64}],85:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":92,"object-assign":64}],86:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":92,"object-assign":64}],87:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),d=e-this.toJD(s,u,1)+1;return this.newDate(s,u,d)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":92,"object-assign":64}],89:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":92,"object-assign":64}],90:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":92,"object-assign":64}],91:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":92,"object-assign":64}],92:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":64}],93:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,d=r.monthNamesShort||this.local.monthNamesShort,f=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},x=function(e,r){var n=g(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(k).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,k);return k+=l[0].length,parseInt(l[0],10)},b=this,_=function(){if("function"==typeof s){g("m");var e=s.call(b,t.substring(k));return k+=e.length,e}return x("m")},w=function(e,r,n,i){for(var o=g(e,i)?n:r,l=0;l-1){p=1,h=m;for(var S=this.daysInMonth(f,p);h>S;S=this.daysInMonth(f,p))p++,h-=S}return d>-1?this.fromJD(d):this.newDate(f,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":92,"object-assign":64}],94:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],95:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":229,"../../plot_api/plot_template":290,"../../plots/cartesian/constants":308,"../../plots/font_attributes":329,"./arrow_paths":94}],96:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],d=e["_"+i+"padminus"],f={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+f,m=p-f,y=3*e.startarrowsize*e.arrowwidth||0,v=y+f,g=y-f;if(c===s){var x=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:m}),b=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,v),ppadminus:Math.max(d,g)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=l?v+l:v,g=l?g-l:g,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,v),ppadminus:Math.max(d,m,g)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":254,"../../plots/cartesian/axes":301,"./draw":101}],97:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,d=[],f=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),d={},f=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,X=["x","y"],W=0;W1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),J=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===fe;"x"===te?(Q=t[te],J=he?ae._offset+ae._length*Q:J=T.l+T.w*Q):(Q=1-t[te],J=he?ae._offset+ae._length*Q:J=T.t+T.h*Q),$=t.showarrow?.5:Q}if(t.showarrow){de.head=J;var me=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var ye=s.getRefType(ne);"domain"===ye?("y"===te&&(me=1-me),de.tail=ae._offset+ae._length*me):"paper"===ye?"y"===te?(me=1-me,de.tail=T.t+T.h*me):de.tail=T.l+T.w*me:de.tail=ae._offset+ae.r2p(me),K=ee}else de.tail=J+me,K=ee+me;de.text=de.tail+ee;var ve=w["x"===te?"width":"height"];if("paper"===re&&(de.head=o.constrain(de.head,1,ve-1)),"pixel"===ne){var ge=-Math.max(de.tail-3,de.text),xe=Math.min(de.tail+3,de.text)-ve;ge>0?(de.tail+=ge,de.text+=ge):xe>0&&(de.tail-=xe,de.text-=xe)}de.tail+=ue,de.head+=ue}else K=ee=se*U($,ce),de.text=J+ee;de.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)R.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(k-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(z-_)*("middle"===t.valign?.5:1)),d)n.select("svg").attr({x:j+be-1,y:j+_e}).call(u.setClipUrl,B?D:null,e);else{var we=j+_e-m.top,Te=j+be-m.left;q.call(f.positionText,Te,we).call(u.setClipUrl,B?D:null,e)}Y.select("rect").call(u.setRect,j,j,k,z),H.call(u.setRect,F/2,F/2,E-F,V-F),R.call(u.setTranslate,Math.round(O.x.text-E/2),Math.round(O.y.text-V/2)),I.attr({transform:"rotate("+C+","+O.x.text+","+O.y.text+")"});var Me,ke=function(r,n){P.selectAll(".annotation-arrow-g").remove();var s=O.x.head,d=O.y.head,f=O.x.tail+r,p=O.y.tail+n,m=O.x.text+r,b=O.y.text+n,_=o.rotationXYMatrix(C,m,b),w=o.apply2DTransform(_),k=o.apply2DTransform2(_),D=+H.attr("width"),N=+H.attr("height"),z=m-.5*D,F=z+D,E=b-.5*N,j=E+N,B=[[z,E,z,j],[z,j,F,j],[F,j,F,E],[F,E,z,E]].map(k);if(!B.reduce((function(e,t){return e^!!o.segmentsIntersect(s,d,s+1e6,d+1e6,t[0],t[1],t[2],t[3])}),!1)){B.forEach((function(e){var t=o.segmentsIntersect(f,p,s,d,e[0],e[1],e[2],e[3]);t&&(f=t.x,p=t.y)}));var Y=t.arrowwidth,V=t.arrowcolor,U=t.arrowside,q=P.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),G=q.append("path").attr("d","M"+f+","+p+"L"+s+","+d).style("stroke-width",Y+"px").call(c.stroke,c.rgb(V));if(y(G,U,t),M.annotationPosition&&G.node().parentNode&&!i){var Z=s,X=d;if(t.standoff){var W=Math.sqrt(Math.pow(s-f,2)+Math.pow(d-p,2));Z+=t.standoff*(f-s)/W,X+=t.standoff*(p-d)/W}var J,K,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(f-Z)+","+(p-X),transform:l(Z,X)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:Q.node(),gd:e,prepFn:function(){var e=u.getTranslate(R);J=e.x,K=e.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(J,K),a=n[0]+e,i=n[1]+r;R.call(u.setTranslate,a,i),L("x",g(v,e,"x",T,t)),L("y",g(x,r,"y",T,t)),t.axref===t.xref&&L("ax",g(v,e,"ax",T,t)),t.ayref===t.yref&&L("ay",g(x,r,"ay",T,t)),q.attr("transform",l(e,r)),I.attr({transform:"rotate("+C+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&ke(0,0),N)h.init({element:R.node(),gd:e,prepFn:function(){Me=I.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?L("ax",g(v,e,"ax",T,t)):L("ax",t.ax+e),t.ayref===t.yref?L("ay",g(x,r,"ay",T.w,t)):L("ay",t.ay+r),ke(e,r);else{if(i)return;var a,o;if(v)a=g(v,e,"x",T,t);else{var s=t._xsize/T.w,c=t.x+(t._xshift-t.xshift)/T.w-s/2;a=h.align(c+e/T.w,s,0,1,t.xanchor)}if(x)o=g(x,r,"y",T,t);else{var u=t._ysize/T.h,d=t.y-(t._yshift+t.yshift)/T.h-u/2;o=h.align(d-r/T.h,u,0,1,t.yanchor)}L("x",a),L("y",o),v&&x||(n=h.getCursor(v?.5:a,x?.5:o,t.xanchor,t.yanchor))}I.attr({transform:l(e,r)+Me}),p(R,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",G(n))},doneFn:function(){p(R),a.call("_guiRelayout",e,S());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,x=t.indexOf("end")>=0,b=h.backoff*y+r.standoff,_=m.backoff*v+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,T=o.y-u.y;if(f=(d=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void N();if(b){if(b*b>w*w+T*T)return void N();var M=b*Math.cos(d),k=b*Math.sin(d);u.x+=M,u.y+=k,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void N();var A=_*Math.cos(d),L=_*Math.sin(d);o.x-=A,o.y-=L,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var S=p.getTotalLength(),D="";if(S1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":332,"../annotations/draw":101}],108:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).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()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var ce=Math.pow(10,Math.floor(Math.log(se)/Math.LN10));oe*=ce*c.roundUp(se/ce,[2,5,10]),(Math.abs(U.start)/U.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+P/R.h,re+K-P/R.h]:[re+C/R.w,re+K-C/R.w],ae.setScale(),e.attr("transform",u(Math.round(R.l),Math.round(R.t)));var ue,de=e.select("."+k.cbtitleunshift).attr("transform",u(-Math.round(R.l),-Math.round(R.t))),fe=ae.ticklabelposition,pe=ae.title.font.size,he=e.select("."+k.cbaxis),me=0,ye=0;function ve(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:z._dfltTitle.colorbar,containerGroup:e.select("."+k.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,d(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===H&&(e=C+R.l+R.w*I,t=P+R.t+R.h*(1-re-K)+3+.75*pe),"bottom"===H&&(e=C+R.l+R.w*I,t=P+R.t+R.h*(1-re)-3-.25*pe),"right"===H&&(t=P+R.t+R.h*N+3+.75*pe,e=C+R.l+R.w*re),ve(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,s=e.select("."+k.cbtitle),d=s.select("text"),f=[-A/2,A/2],h=s.select(".h"+ae._id+"title-math-group").node(),m=15.6;if(d.node()&&(m=parseInt(d.node().style.fontSize,10)*w),h?(i=p.bBox(h),ye=i.width,(me=i.height)>m&&(f[1]-=(me-m)/2)):d.node()&&!d.classed(k.jsPlaceholder)&&(i=p.bBox(d.node()),ye=i.width,me=i.height),o){if(me){if(me+=5,"top"===H)ae.domain[1]-=me/R.h,f[1]*=-1;else{ae.domain[0]+=me/R.h;var v=y.lineCount(d);f[1]+=(1-v)*m}s.attr("transform",u(f[0],f[1])),ae.setScale()}}else ye&&("right"===H&&(ae.domain[0]+=(ye+pe/2)/R.w),s.attr("transform",u(f[0],f[1])),ae.setScale())}e.selectAll("."+k.cbfills+",."+k.cblines).attr("transform",o?u(0,Math.round(R.h*(1-ae.domain[1]))):u(Math.round(R.w*ae.domain[0]),0)),he.attr("transform",o?u(0,Math.round(-R.t)):u(Math.round(-R.l),0));var g=e.select("."+k.cbfills).selectAll("rect."+k.cbfill).attr("style","").data(G);g.enter().append("rect").classed(k.cbfill,!0).style("stroke","none"),g.exit().remove();var x=B.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));g.each((function(e,i){var l=[0===i?B[0]:(G[i]+G[i-1])/2,i===G.length-1?B[1]:(G[i]+G[i+1])/2].map(ae.c2p).map(Math.round);o&&(l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,x[0],x[1]));var s=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(l)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(n.max(l)-n.min(l),2));if(t._fillgradient)p.gradient(s,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=V(e).replace("e-","");s.attr("fill",a(u).toHexString())}}));var b=e.select("."+k.cblines).selectAll("path."+k.cbline).data(E.color&&E.width?Z:[]);b.enter().append("path").classed(k.cbline,!0),b.exit().remove(),b.each((function(e){var t=Q,r=Math.round(ae.c2p(e))+E.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+X).call(p.lineGroupStyle,E.width,Y(e),E.dash)})),he.selectAll("g."+ae._id+"tick,path").remove();var _=Q+X+(A||0)/2-("outside"===t.ticks?1:0),T=l.calcTicks(ae),M=l.getTickSigns(ae)[2];return l.drawTicks(r,ae,{vals:"inside"===ae.ticks?l.clipEnds(ae,T):T,layer:he,path:l.makeTickPath(ae,_,M),transFn:l.makeTransTickFn(ae)}),l.drawLabels(r,ae,{vals:T,layer:he,transFn:l.makeTransTickLabelFn(ae),labelFns:l.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,l=ae._offset+ae._length/2;if("right"===H)a=l,e=R.l+R.w*i+10+pe*(ae.showticklabels?1:.5);else if(e=l,"bottom"===H&&(a=R.t+R.h*i+10+(-1===fe.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===H){var s=j.text.split("
").length;a=R.t+R.h*i+10-X-w*pe*s}ve((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:H,offsetTop:o?0:R.t,offsetLeft:o?R.l:0,maxShift:o?z.width:z.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,l=X+A/2;-1===fe.indexOf("inside")&&(n=p.bBox(he.node()),l+=o?n.width:n.height),ue=de.select("text");var c=0,d=o&&"top"===H,m=!o&&"right"===H,y=0;if(ue.node()&&!ue.classed(k.jsPlaceholder)){var g,x=de.select(".h"+ae._id+"title-math-group").node();x&&(o&&ie||!o&&!ie)?(c=(n=p.bBox(x)).width,g=n.height):(c=(n=p.bBox(de.node())).right-R.l-(o?Q:ne),g=n.bottom-R.t-(o?ne:Q),o||"top"!==H||(l+=n.height,y=n.height)),m&&(ue.attr("transform",u(c/2+pe/2,0)),c*=2),l=Math.max(l,o?c:g)}var b=2*(o?C:P)+l+L+A/2,w=0;!o&&j.text&&"bottom"===O&&N<=0&&(b+=w=b/2,y+=w),z._hColorbarMoveTitle=w,z._hColorbarMoveCBTitle=y;var F=L+A;e.select("."+k.cbbg).attr("x",(o?Q:ne)-F/2-(o?C:0)).attr("y",(o?ne:Q)-(o?J:P+y-w)).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(J+F,2)).call(h.fill,S).call(h.stroke,t.bordercolor).style("stroke-width",L);var E=m?Math.max(c-10,0):0;if(e.selectAll("."+k.cboutline).attr("x",(o?Q:ne+C)+E).attr("y",(o?ne+P-J:Q)+(d?me:0)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(J-(o?2*P+me:2*C+E),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(R.l-(o?$*b:0),R.t-(o?0:(1-ee)*b-y))),!o&&(L||a(S).getAlpha()&&!a.equals(z.paper_bgcolor,S))){var B=he.selectAll("text"),Y=B[0].length,V=e.select("."+k.cbbg).node(),U=p.bBox(V),q=p.getTranslate(e);B.each((function(e,t){var r=Y-1;if(0===t||t===r){var n,a=p.bBox(this),i=p.getTranslate(this);if(t===r){var o=a.right+i.x;(n=U.right+q.x+ne-L-2+I-o)>0&&(n=0)}else if(0===t){var l=a.left+i.x;(n=U.left+q.x+ne+L+2-l)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var G={},Z=T[D],W=M[D],K=T[O],te=M[O],re=b-X;o?("pixels"===f?(G.y=N,G.t=J*K,G.b=J*te):(G.t=G.b=0,G.yt=N+s*K,G.yb=N-s*te),"pixels"===_?(G.x=I,G.l=b*Z,G.r=b*W):(G.l=re*Z,G.r=re*W,G.xl=I-v*Z,G.xr=I+v*W)):("pixels"===f?(G.x=I,G.l=J*Z,G.r=J*W):(G.l=G.r=0,G.xl=I+s*Z,G.xr=I-s*W),"pixels"===_?(G.y=1-N,G.t=b*K,G.b=b*te):(G.t=re*K,G.b=re*te,G.yt=N-v*K,G.yb=N+v*te)),i.autoMargin(r,t._id,G)}],r)}(r,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l="v"===t.orientation,c=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),f(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align((l?t._uFrac:t._vFrac)+r/c.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=s.align((l?t._vFrac:1-t._uFrac)-o/c.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var d=s.getCursor(a,i,t.xanchor,t.yanchor);f(e,d)},doneFn:function(){if(f(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":228,"../../lib":254,"../../lib/extend":248,"../../lib/setcursor":274,"../../lib/svg_text_utils":277,"../../plots/cartesian/axes":301,"../../plots/cartesian/axis_defaults":303,"../../plots/cartesian/layout_attributes":314,"../../plots/cartesian/position_defaults":317,"../../plots/plots":335,"../../registry":337,"../color":112,"../colorscale/helpers":123,"../dragelement":131,"../drawing":134,"../titles":221,"./constants":114,"@plotly/d3":18,tinycolor2:77}],117:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":254}],118:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":113,"./defaults":115,"./draw":116,"./has_colorbar":117}],119:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,d=t.editTypeOverride||"",f=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(f+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",m=i+"max",y=i+"mid",v=(l(f+p),l(f+h),l(f+m),{});v[h]=v[m]=void 0;var g={};g[p]=!1;var x={};return"color"===r&&(x.color={valType:"color",arrayOk:!0,editType:d||"style"},t.anim&&(x.color.anim=!0)),x[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:v},x[h]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:g},x[m]={valType:"number",dflt:null,editType:d||"plot",impliedEdits:g},x[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":270,"../../lib/sort_object_keys":275,"../colorbar/attributes":113,"./scales.js":127}],120:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,d=i(u),f=!1!==d.auto,p=d.min,h=d.max,m=d.mid,y=function(){return a.aggNums(Math.min,null,s)},v=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=y():f&&(p=u._colorAx&&n(p)?Math.min(p,y()):y()),void 0===h?h=v():f&&(h=u._colorAx&&n(h)?Math.max(h,v()):v()),f&&void 0!==m&&(h-m>m-p?p=m-(h-m):h-m=0?l.colorscale.sequential:l.colorscale.sequentialminus,d._sync("colorscale",o))}},{"../../lib":254,"./helpers":123,"fast-isnumeric":26}],121:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],129:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":254}],130:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],131:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function d(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,f,p,h,m,y=e.gd,v=1,g=y._context.doubleClickDelay,x=e.element;y._mouseDownTime||(y._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)g&&(v=Math.max(v-1,1)),y._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(v,p),!m){var r;try{r=new MouseEvent("click",t)}catch(e){var n=d(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},s.coverSlip=u},{"../../lib":254,"../../plots/cartesian/constants":308,"./align":128,"./cursor":129,"./unhover":132,"has-hover":57,"has-passive-events":58,"mouse-event-offset":62}],132:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":246,"../../lib/events":247,"../../lib/throttle":278,"../fx/constants":146}],133:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],134:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),d=a.strTranslate,f=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,m=e("../../constants/interactions").DESELECTDIM,y=e("../../traces/scatter/subtypes"),v=e("../../traces/scatter/make_bubble_size_func"),g=e("../../components/fx/helpers").appendArrayPointValue,x=t.exports={};function b(e,t,r){var n=t.fillpattern,a=n&&x.getPatternAttr(n.shape,0,"");if(a){var i=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),l=n.fgopacity,s=x.getPatternAttr(n.size,0,8),u=x.getPatternAttr(n.solidity,0,.3),d=t.uid;x.pattern(e,"point",r,d,a,s,u,void 0,n.fillmode,i,o,l)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}x.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,a){e.call(x.setPosition,t,r).call(x.setSize,n,a)},x.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",d(a,i)),!0)},x.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);x.translatePoint(e,a,t,r)}))},x.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),x.dashLine(t,l,o)},x.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(x.dashLine,l,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e,t){var r=n.select(e.node());b(e,((r.data()[0]||[])[0]||{}).trace||{},t)},x.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&b(r,e[0].trace,t)}))};var _=e("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,x.symbolBackOffs[r]=t.backoff||0,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function T(e,t,r,n){var a=e%100;return x.symbolFuncs[a](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var M={x1:1,x2:0,y1:0,y2:0},k={x1:0,x2:0,y1:1,y2:0},A=i("~f"),L={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:k},verticalreversed:{node:"linearGradient",attrs:k,reversed:!0}};x.gradient=function(e,t,r,i,o,s){for(var u=o.length,d=L[i],f=new Array(u),p=0;p=100;var d=re(e,r),f=q(e,r);t.attr("d",T(u,s,d,f))}var p,h,m,y=!1;if(e.so)m=l.outlierwidth,h=l.outliercolor,p=o.outliercolor;else{var v=(l||{}).width;m=(e.mlw+1||v+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,y=!0),p="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,p).style({"stroke-width":(m||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:m)+"px");var g=o.gradient,b=e.mgt;b?y=!0:b=g&&g.type,a.isArrayOrTypedArray(b)&&(b=b[0],L[b]||(b=0));var _=o.pattern,w=_&&x.getPatternAttr(_.shape,e.i,"");if(b&&"none"!==b){var M=e.mgc;M?y=!0:M=g.color;var k=r.uid;y&&(k+="-"+e.i),x.gradient(t,i,k,b,[[0,M],[1,p]],"fill")}else if(w){var A=x.getPatternAttr(_.bgcolor,e.i,null),S=x.getPatternAttr(_.fgcolor,e.i,null),D=_.fgopacity,O=x.getPatternAttr(_.size,e.i,8),C=x.getPatternAttr(_.solidity,e.i,.3),P=e.mcc||a.isArrayOrTypedArray(_.shape)||a.isArrayOrTypedArray(_.bgcolor)||a.isArrayOrTypedArray(_.size)||a.isArrayOrTypedArray(_.solidity),I=r.uid;P&&(I+="-"+e.i),x.pattern(t,"point",i,I,w,O,C,e.mcc,_.fillmode,A,S,D)}else c.fill(t,p);m&&c.stroke(t,h)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=y.isBubble(e)?v(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,d=l.opacity,f=void 0!==u,p=void 0!==d;(a.isArrayOrTypedArray(c)||f||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?f?u:t:p?d:m*t});var h=i.color,y=o.color,v=l.color;(y||v)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?y||t:v||t});var g=i.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||g/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,m))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);e.attr("d",T(x.symbolNumber(i),o,re(n,t),q(n,t))),n.mrc2=o})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}x.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,d=u?u(e,t,s):{},p={};g(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,d,s._d3locale,p,e,h)}var m=e.tp||t.textposition,y=O(e,t),v=i?i(e):e.tc||t.textfont.color;o.call(x.font,e.tf||t.textfont.family,y,v).text(c).call(f.convertToTspans,r).call(D,m,y,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=x.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=O(e,t);c.fill(a,i);var u=s.traceIs(t,"bar-like");D(a,o,l,e.mrc2||e.mrc,u)}))}};var C,P;function I(e,t,r){return r&&(e=j(e)),t?z(e[1]):N(e[0])}function N(e){var t=n.round(e,2);return C=t,t}function z(e){var t=n.round(e,2);return P=t,t}function R(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],l=r[1]-t[1],s=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+l*l,.25),u=(c*c*a-s*s*o)*n,d=(c*c*i-s*s*l)*n,f=3*c*(s+c),p=3*s*(s+c);return[[N(t[0]+(f&&u/f)),z(t[1]+(f&&d/f))],[N(t[0]-(p&&u/p)),z(t[1]-(p&&d/p))]]}x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=c||b>=d&&b<=c)&&(_<=f&&_>=u||_>=f&&_<=u)&&(e=[b,_])}return e}x.steps=function(e){var t=F[e]||E;return function(e){for(var r="M"+N(e[0][0])+","+z(e[0][1]),n=e.length,a=1;a=1e4&&(x.savedBBoxes={},H=0),r&&(x.savedBBoxes[r]=y),H++,a.extendFlat({},y)},x.setClipUrl=function(e,t,r){e.attr("clip-path",Y(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=d(t,r)).trim(),e[a]("transform",i),i},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var V=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(V,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var U=/translate\([^)]*\)\s*$/;function q(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(U);e=1===t&&1===r?[]:[d(o,l),"scale("+t+","+r+")",d(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))},x.getMarkerStandoff=q;var G,Z,X,W,J,K,Q=Math.atan2,$=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*$(e)-n*ee(e),r*ee(e)+n*$(e)]}function re(e,t){var r,n,a=e.ma;void 0===a&&(a=t.marker.angle||0);var i=t.marker.angleref;if("previous"===i||"north"===i){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var s=t._xA,c=t._yA;if(!s||!c)return 90;r=s.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,d=e.lonlat[0],f=e.lonlat[1],p=t._geo.project([d,f+1e-5]),h=t._geo.project([d+1e-5,f]),m=Q(h[1]-n,h[0]-r),y=Q(p[1]-n,p[0]-r);if("north"===i)u=a/180*Math.PI;else if("previous"===i){var v=d/180*Math.PI,g=f/180*Math.PI,x=G/180*Math.PI,b=Z/180*Math.PI,_=x-v,w=$(b)*ee(_),T=ee(b)*$(g)-$(b)*ee(g)*$(_);u=-Q(w,T)-Math.PI,G=d,Z=f}var M=te(m,[$(u),0]),k=te(y,[ee(u),0]);a=Q(M[1]+k[1],M[0]+k[0])/Math.PI*180,"previous"!==i||K===t.uid&&e.i===J+1||(a=null)}if("previous"===i&&!t._geo)if(K===t.uid&&e.i===J+1&&o(r)&&o(n)){var A=r-X,L=n-W,S=t.line&&t.line.shape||"",D=S.slice(S.length-1);"h"===D&&(L=0),"v"===D&&(A=0),a+=Q(L,A)/Math.PI*180+90}else a=null}return X=r,W=n,J=e.i,K=t.uid,a}x.getMarkerAngle=re},{"../../components/fx/helpers":148,"../../constants/alignment":228,"../../constants/interactions":233,"../../constants/xmlns_namespaces":235,"../../lib":254,"../../lib/svg_text_utils":277,"../../registry":337,"../../traces/scatter/make_bubble_size_func":455,"../../traces/scatter/subtypes":463,"../color":112,"../colorscale":124,"./symbol_defs":135,"@plotly/d3":18,"fast-isnumeric":26,tinycolor2:77}],135:[function(e,t,r){"use strict";var n,a,i,o,l=e("parse-svg-path"),s=e("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),d=Math.PI,f=Math.cos,p=Math.sin;function h(e){return null===e}function m(e,t,r){if(!(e&&e%360!=0||t))return r;if(i===e&&o===t&&n===r)return a;function s(e,r){var n=f(e),a=p(e),i=r[0],o=r[1]+(t||0);return[i*n-o*a,i*a+o*n]}i=e,o=t,n=r;for(var c=e/180*d,u=0,h=0,m=l(r),y="",v=0;v0;t.each((function(t){var d,f=t[0].trace,p=f.error_x||{},h=f.error_y||{};f.ids&&(d=function(e){return e.id});var m=o.hasMarkers(f)&&f.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var y=n.select(this).selectAll("g.errorbar").data(t,d);if(y.exit().remove(),t.length){p.visible||y.selectAll("path.xerror").remove(),h.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,e),y.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!m||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var d=h.width;i="M"+(r.x-d)+","+r.yh+"h"+2*d+"m-"+d+",0V"+r.ys,r.noYS||(i+="m-"+d+",0h"+2*d),!o.size()?o=t.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 f=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!f.size()?f=t.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(f=f.transition().duration(l.duration).ease(l.easing)),f.attr("d",i)}else f.remove()}}))}}))}},{"../../traces/scatter/subtypes":463,"../drawing":134,"@plotly/d3":18,"fast-isnumeric":26}],142:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":112,"@plotly/d3":18}],143:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":248,"../../plots/font_attributes":329,"./layout_attributes":153}],144:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||oe<0||oe>w[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,Y="xval"in t?v.flat(s,t.xval):v.p2c(_,ie),V="yval"in t?v.flat(s,t.yval):v.p2c(w,oe),!a(Y[0])||!a(V[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(q=0;qee&&(te.splice(0,ee),ce=te[0].distance),g&&0!==E&&0===te.length){$.distance=E,$.index=!1;var d=Z._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(d&&(d=d.filter((function(e){return e.spikeDistance<=E}))),d&&d.length){var f,h=d.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var m=h[0];a(m.x0)&&a(m.y0)&&(f=fe(m),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>f.spikeDistance)&&(ne.vLinePoint=f))}var y=d.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(y.length){var x=y[0];a(x.x0)&&a(x.y0)&&(f=fe(x),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>f.spikeDistance)&&(ne.hLinePoint=f))}}}}}function de(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Te-1;Ae--)Oe(te[Ae]);te=Le,ye()}var Ce=e._hoverdata,Pe=[],Ie=H(e),Ne=B(e);for(U=0;U1||te.length>1)||"closest"===C&&ae&&te.length>1,Ze=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),Xe=P(te,{gd:e,hovermode:C,rotateLabels:Ge,bgColor:Ze,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});v.isUnifiedHover(C)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,d=1,f=e.size(),p=new Array(f),h=0;function m(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(d=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?T:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||d*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=f;){for(u++,n=!0,o=0;o.01&&g.pmin===x.pmin&&g.pmax===x.pmax){for(l=v.length-1;l>=0;l--)v[l].dp+=a;for(y.push.apply(y,v),p.splice(o+1,1),c=0,l=y.length-1;l>=0;l--)c+=y[l].dp;for(i=c/y.length,l=y.length-1;l>=0;l--)y[l].dp-=i;n=!1}else o++}p.forEach(m)}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}}}(Xe,Ge?"xa":"ya",u),N(Xe,Ge,u._invScaleX,u._invScaleY));if(l&&l.tagName){var We=y.getComponentMethod("annotations","hasClickToShow")(e,Pe);d(n.select(l),We?"pointer":"")}if(!l||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,Ce))return;Ce&&e.emit("plotly_unhover",{event:t,points:Ce});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:Y,yvals:V})}(e,t,r,i,l)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=H(a),o=B(a),l=P(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),d=Math.max(r,n),f=Math.min(l,s),h=Math.max(l,s),m=e.trace;if(y.traceIs(m,"gl3d")){var v=a._fullLayout[m.scene]._scene.container,g=v.offsetLeft,x=v.offsetTop;u+=g,d+=g,f+=x,h+=x}c.bbox={x0:u+o,x1:d+o,y0:f+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function P(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,d=t.bgColor,h=t.container,m=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var T=t.fontFamily||g.HOVERFONT,M=t.fontSize||g.HOVERFONTSIZE,k=e[0],S=k.xa,D=k.ya,C=i.charAt(0),P=C+"Label",N=k[P];if(void 0===N&&"multicategory"===S.type)for(var z=0;za.width-b?(y=a.width-b,t.attr("d","M"+(b-A)+",0L"+b+","+x+A+"v"+x+(2*L+g.height)+"H-"+b+"V"+x+A+"H"+(b-2*A)+"Z")):t.attr("d","M0,0L"+A+","+x+A+"H"+(L+g.width/2)+"v"+x+(2*L+g.height)+"H-"+(L+g.width/2)+"V"+x+A+"H-"+A+"Z")}else{var _,O,C;"right"===D.side?(_="start",O=1,C="",y=S._offset+S._length):(_="end",O=-1,C="-",y=S._offset),v=D._offset+(k.y0+k.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+C+A+","+A+"V"+(L+g.height/2)+"h"+C+(2*L+g.width)+"V-"+(L+g.height/2)+"H"+C+A+"V-"+A+"Z");var P,I=g.height/2,z=F-g.top-I,R="clip"+a._uid+"commonlabel"+D._id;if(y=0?le:se+de=0?se:xe+de=0?ie:oe+fe=0?oe:be+fe=0,"top"!==e.idealAlign&&q||!G?q?(P+=R/2,e.anchor="start"):e.anchor="middle":(P-=R/2,e.anchor="end");else if(e.pos=P,q=C+z/2+Z<=E,G=C-z/2-Z>=0,"left"!==e.idealAlign&&q||!G)if(q)C+=z/2,e.anchor="start";else{e.anchor="middle";var X=Z/2,W=C+X-E,J=C-X;W>0&&(C-=W),J<0&&(C+=-J)}else C-=z/2,e.anchor="end";w.attr("text-anchor",e.anchor),S&&k.attr("text-anchor",e.anchor),t.attr("transform",l(C,P)+(c?s(_):""))})),_e}function I(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=E(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var d=e.hovertemplate||!1;if(d){var f=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(f[c+"other"]=f[c+"Val"],f[c+"otherLabel"]=f[c+"Label"]),s=(s=o.hovertemplateString(d,f,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(C,(function(t,r){return l=E(r,e.nameLength),""}))}return[s,l]}function N(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],d=c*(A+L),p=d+c*(e.txwidth+L),h=0,m=e.offset,y="middle"===l;y&&(d-=e.tx2width/2,p+=e.txwidth/2+L),t&&(m*=-k,h=e.offset*M),r.select("path").attr("d",y?"M-"+i(e.bx/2+e.tx2width/2)+","+o(m-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+m)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(m-A)+"Z");var v=h+d,g=m+e.ty0-e.by/2+L,x=e.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==l?(a.attr("text-anchor","start"),v=y?-e.bx/2-e.tx2width/2+L:-e.bx-L):"right"===x&&"end"!==l&&(a.attr("text-anchor","end"),v=y?e.bx/2-e.tx2width/2-L:e.bx+L)),a.call(u.positionText,i(v),o(g)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*L+h),o(m+e.ty0-e.by/2+L)),r.select("rect").call(f.setRect,i(p+(c-1)*e.tx2width/2+h),o(m-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function z(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:m.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:m.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var d=m.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+d+" / -"+m.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+d,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var f=m.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+f+" / -"+m.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+f,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function R(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),d||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var y,v,g=t.hLinePoint;n=g&&g.xa,"cursor"===(a=g&&g.ya).spikesnap?(y=c.pointerX,v=c.pointerY):(y=n._offset+g.x,v=a._offset+g.y);var x,b,_=i.readability(g.color,h)<1.5?p.contrast(h):g.color,w=a.spikemode,T=a.spikethickness,M=a.spikecolor||_,k=m.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=k,b=y),-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:v,y2:v,"stroke-width":T,stroke:M,"stroke-dasharray":f.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:k+("right"!==a.side?T:-T),cy:v,r:T,fill:M}).classed("spikeline",!0)}if(d){var S,D,O=t.vLinePoint;n=O&&O.xa,a=O&&O.ya,"cursor"===n.spikesnap?(S=c.pointerX,D=c.pointerY):(S=n._offset+O.x,D=a._offset+O.y);var C,P,I=i.readability(O.color,h)<1.5?p.contrast(h):O.color,N=n.spikemode,z=n.spikethickness,R=n.spikecolor||I,F=m.getPxPosition(e,n);if(-1!==N.indexOf("toaxis")||-1!==N.indexOf("across")){if(-1!==N.indexOf("toaxis")&&(C=F,P=D),-1!==N.indexOf("across")){var E=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(E=Math.min(E,n.position),j=Math.max(j,n.position)),C=s.t+(1-j)*s.h,P=s.t+(1-E)*s.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z,stroke:R,"stroke-dasharray":f.dashStyle(n.spikedash,z)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:C,y2:P,"stroke-width":z+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==N.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:F-("top"!==n.side?z:-z),r:z,fill:R}).classed("spikeline",!0)}}}function F(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function E(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function H(e){return e.offsetTop+e.clientTop}function B(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),d=c[0],f=c[1],p=u[0],h=u[1];return{x:d,y:f,width:p-d,height:h-f,top:Math.min(f,h),left:Math.min(d,p),right:Math.max(d,p),bottom:Math.max(f,h)}}},{"../../lib":254,"../../lib/events":247,"../../lib/override_cursor":265,"../../lib/svg_text_utils":277,"../../plots/cartesian/axes":301,"../../registry":337,"../color":112,"../dragelement":131,"../drawing":134,"../legend/defaults":164,"../legend/draw":165,"./constants":146,"./helpers":148,"@plotly/d3":18,"fast-isnumeric":26,tinycolor2:77}],150:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var l=t.legend;function s(e){o.font[e]||(o.font[e]=l?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),l?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":254,"../color":112,"./helpers":148}],151:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":254,"./layout_attributes":153}],152:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":254,"../dragelement":131,"./attributes":143,"./calc":144,"./click":145,"./constants":146,"./defaults":147,"./helpers":148,"./hover":149,"./layout_attributes":153,"./layout_defaults":154,"./layout_global_defaults":155,"@plotly/d3":18}],153:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":329,"./constants":146}],154:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":254,"./hoverlabel_defaults":150,"./hovermode_defaults":151,"./layout_attributes":153}],155:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":254,"./hoverlabel_defaults":150,"./layout_attributes":153}],156:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),d=u*(1-o),f=0;f1){if(!f&&!p&&!h)"independent"===M("pattern")&&(f=!0);y._hasSubplotGrid=f;var x,b,_="top to bottom"===M("roworder"),w=f?.2:.1,T=f?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),y._domains={x:u("x",M,w,x,g),y:u("y",M,T,b,v,_)}}else delete t.grid}function M(e,t){return n.coerce(r,y,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,f=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,m=r.rows,y=r.columns,v="independent"===r.pattern,g=r._axisMap={};if(h){var x=f.subplots||[];s=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1===_&&(t.legend=void 0),(!1!==_||d.uirevision)&&(p("uirevision",t.uirevision),!1!==_)){p("bgcolor",t.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,T,M,k=a.coerceFont(p,"font",t.font),A="h"===p("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(T=1.1,M="bottom"):(T=-.1,M="top")):(w=1.02,T=1,M="auto"),p("traceorder",x),c.isGrouped(t.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",T),p("yanchor",M),p("valign"),a.noneOrAll(d,f,["x","y"]),p("title.text")){p("title.side",A?"left":"top");var L=a.extendFlat({},k,{size:a.bigFont(k.size)});a.coerceFont(p,"title.font",L)}}}},{"../../lib":254,"../../plot_api/plot_template":290,"../../plots/attributes":297,"../../plots/layout_attributes":333,"../../registry":337,"./attributes":162,"./helpers":168}],165:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),d=e("../../lib/svg_text_utils"),f=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),m=h.LINE_SPACING,y=h.FROM_TL,v=h.FROM_BR,g=e("./get_legend_data"),x=e("./style"),b=e("./helpers");function _(e,t,r){var n=e[0],a=n.width,i=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===i?t._maxWidth*o:r+(o||a)}function w(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&f(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&f(r,e,n)}}function T(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),f=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var m=a.ensureSingle(e,"text","legendtext");m.attr("text-anchor","start").call(c.font,i).text(f?M(n,h):n);var y=r.itemwidth+2*p.itemGap;d.positionText(m,y,0),f?m.call(d.makeEditable,{gd:t,text:n}).call(A,e,t,r).on("edit",(function(n){this.text(M(n,h)).call(A,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),d=u[u.length-1],f=a.keyedContainer(i,"transforms["+d+"].styles","target","value.name");f.set(l.trace._group,n),c=f.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):A(m,e,t,r)}function M(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function k(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(t,r,e,o,n.event)}})))}function A(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),d.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,f,h=l.size*m;if(o){var y=c.bBox(o);u=y.height,f=y.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var v=e.select(1===n?".legendtitletext":".legendtext"),g=d.lineCount(v),x=v.node();if(u=h*g,f=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(f+=2*p.itemGap),d.positionText(v,s+p.titlePad,s+h);else{var b=2*p.itemGap+r.itemwidth;a.groupTitle&&(b=p.itemGap,f-=r.itemwidth),d.positionText(v,b,-h*((g-1)/2-.3))}}1===n?(r._titleWidth=f,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=f)}(t,r,n,a)}))}function L(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function S(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,d=e._fullLayout,f="legend"+d._uid,h=t._inHover;h?(r=t.layer,f+="-hover"):r=d._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=g(t.entries,t)}else{if(!e.calcdata)return;l=d.showlegend&&g(e.calcdata,t)}var m=d.hiddenlabels||[];if(!(h||d.showlegend&&l.length))return r.selectAll(".legend").remove(),d._topdefs.select("#"+f).remove(),i.autoMargin(e,"legend");var M=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),D=a.ensureSingleById(d._topdefs,"clipPath",f,(function(e){e.append("rect")})),O=a.ensureSingle(M,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));O.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var C=a.ensureSingle(M,"g","scrollbox"),P=t.title;if(t._titleWidth=0,t._titleHeight=0,P.text){var I=a.ensureSingle(C,"text","legendtitletext");I.attr("text-anchor","start").call(c.font,P.font).text(P.text),A(I,C,e,t,1)}else C.selectAll(".legendtitletext").remove();var N=a.ensureSingle(M,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),z=C.selectAll("g.groups").data(l);z.enter().append("g").attr("class","groups"),z.exit().remove();var R=z.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==m.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(T,e,t)})).call(x,e,t).each((function(){h||n.select(this).call(k,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=b.isVertical(a),s=b.isGrouped(a),u="fraction"===a.entrywidthmode,d=a.borderwidth,f=2*d,h=p.itemGap,m=a.itemwidth+2*h,y=2*(d+h),v=S(a),g=a.y<0||0===a.y&&"top"===v,x=a.y>1||1===a.y&&"bottom"===v,w=a.tracegroupgap,T={};a._maxHeight=Math.max(g||x?i.height/2:o.h,30);var M=0;a._width=0,a._height=0;var k=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,d+k[0],d+k[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),M=m+a._width,a._width+=h+m+f,a._height+=y,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=L(a),D=a.x<0||0===a.x&&"right"===A,O=a.x>1||1===a.x&&"left"===A,C=x||g,P=i.width/2;a._maxWidth=Math.max(D?C&&"left"===A?o.l+o.w:P:O?C&&"right"===A?o.r+o.w:P:o.w,2*m);var I=0,N=0;r.each((function(e){var t=_(e,a,m);I=Math.max(I,t),N+=t})),M=null;var z=0;if(s){var R=0,F=0,E=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,a,m),i=r[0].height;c.setTranslate(this,k[0],k[1]+d+h+i/2+t),t+=i,e=Math.max(e,n),T[r[0].trace.legendgroup]=e}));var r=e+h;F>0&&r+d+F>a._maxWidth?(z=Math.max(z,F),F=0,E+=R+w,R=t):R=Math.max(R,t),c.setTranslate(this,F,E),F+=r})),a._width=Math.max(z,F)+d,a._height=E+R+y}else{var j=r.size(),H=N+f+(j-1)*h=a._maxWidth&&(z=Math.max(z,U),Y=0,V+=B,a._height+=B,B=0),c.setTranslate(this,k[0]+d+Y,k[1]+d+V+t/2+h),U=Y+r+h,Y+=n,B=Math.max(B,t)})),H?(a._width=Y+f,a._height=B+y):(a._width=Math.max(z,U)+f,a._height+=B+y)}}a._width=Math.ceil(Math.max(a._width+k[0],a._titleWidth+2*(d+p.titlePad))),a._height=Math.ceil(Math.max(a._height+k[1],a._titleHeight+2*(d+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var q=e._context.edits,G=q.legendText||q.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,i=e[0].trace.legendgroup,o=_(e,a,m);s&&""!==i&&(o=T[i]);var d=G?m:M||o;l||u||(d+=h/2),c.setRect(t,0,-r/2,d,r)}))}(e,z,R,t)},function(){var l,u,m,g,x=d._size,b=t.borderwidth;if(!h){if(function(e){var t=e._fullLayout.legend,r=L(t),n=S(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*y[r],r:t._width*v[r],b:t._effHeight*v[n],t:t._effHeight*y[n]})}(e))return;var _=x.l+x.w*t.x-y[L(t)]*t._width,T=x.t+x.h*(1-t.y)-y[S(t)]*t._effHeight;if(d.margin.autoexpand){var k=_,A=T;_=a.constrain(_,0,d.width-t._width),T=a.constrain(T,0,d.height-t._effHeight),_!==k&&a.log("Constrain legend.x to make legend fit inside graph"),T!==A&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(M,_,T)}if(N.on(".drag",null),M.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var P=t._effHeight;h&&(P=t._height),O.attr({width:t._width-b,height:P-b,x:b/2,y:b/2}),c.setTranslate(C,0,0),D.select("rect").attr({width:t._width-2*b,height:P-2*b,x:b,y:b}),c.setClipUrl(C,f,e),c.setRect(N,0,0,0,0),delete t._scrollY}else{var I,z,R,F=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),E=t._effHeight-F-2*p.scrollBarMargin,j=t._height-t._effHeight,H=E/j,B=Math.min(t._scrollY||0,j);O.attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-b,x:b/2,y:b/2}),D.select("rect").attr({width:t._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*b,x:b,y:b+B}),c.setClipUrl(C,f,e),U(B,F,H),M.on("wheel",(function(){U(B=a.constrain(t._scrollY+n.event.deltaY/E*j,0,j),F,H),0!==B&&B!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;I="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,R=B})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(z="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(B=function(e,t,r){var n=(r-t)/H+e;return a.constrain(n,0,j)}(R,I,z),F,H))}));N.call(Y);var V=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(I=e.changedTouches[0].clientY,R=B)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(z=e.changedTouches[0].clientY,U(B=function(e,t,r){var n=(t-r)/H+e;return a.constrain(n,0,j)}(R,I,z),F,H))}));C.call(V)}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(N,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),D.select("rect").attr("y",b+r)}e._context.edits.legendPosition&&(M.classed("cursor-move",!0),s.init({element:M.node(),gd:e,prepFn:function(){var e=c.getTranslate(M);m=e.x,g=e.y},moveFn:function(e,r){var n=m+e,a=g+r;c.setTranslate(M,n,a),l=s.align(n,0,x.l,x.l+x.w,t.xanchor),u=s.align(a,0,x.t+x.h,x.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&w(e,M,a,t,n)}}))}],e)}(e,t)}},{"../../constants/alignment":228,"../../lib":254,"../../lib/events":247,"../../lib/svg_text_utils":277,"../../plots/plots":335,"../../registry":337,"../color":112,"../dragelement":131,"../drawing":134,"./constants":163,"./get_legend_data":166,"./handle_click":167,"./helpers":168,"./style":170,"@plotly/d3":18}],166:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],d=!1,f={},p=0,h=0;function m(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),d=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rk&&(M=k)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var v=t._fullLayout;r||(r=v.legend);var g="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return g?n:Math.min(a,r)};function T(e,i,o){var u=e[0].trace,d=u.marker||{},f=d.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,d.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(d),m=h.mid;void 0===m&&(m=(h.max+h.min)/2),p=l.tryColorscale(d,"")(m)}var v=p||i.mc||d.color,g=d.pattern,x=g&&l.getPatternAttr(g.shape,0,"");if(x){var b=l.getPatternAttr(g.bgcolor,0,null),_=l.getPatternAttr(g.fgcolor,0,null),T=g.fgopacity,M=y(g.size,8,10),k=y(g.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,x,M,k,p,g.fillmode,b,_,T)}else a.call(s.fill,v);o&&s.stroke(a,i.mlc||f.color)}))}function M(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(f(u.width,o.pts),u,5,2),h=i.minExtend(l,{marker:{line:{width:p}}});h.marker.line.color=u.color;var m=i.minExtend(o,{trace:h});d(c,m,h)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var d=a.selectAll("g.legendsymbols").data([e]);d.enter().append("g").classed("legendsymbols",!0),d.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,o){var u,d=n.select(this),f=c(a),p=f.colorscale,m=f.reversescale;if(p){if(!r){var y=p.length;u=0===o?p[m?y-1:0][1]:1===o?p[m?0:y-1][1]:p[Math.floor((y-1)/2)][1]}}else{var v=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(v)?v[o]||v[0]:v}d.attr("d",e[0]),u?d.call(s.fill,u):d.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(m,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,T(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){T(e,this,"funnel")})).each((function(e){T(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:g?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){M(e,this,"funnelarea")})).each((function(e){M(e,this,"pie")})).each((function(e){var r,a,o=m(e),s=o.showFill,d=o.showLine,f=o.showGradientLine,p=o.showGradientFill,y=o.anyFill,v=o.anyLine,g=e[0],b=g.trace,_=c(b),T=_.colorscale,M=_.reversescale,k=u.hasMarkers(b)||!y?"M5,0":v?"M5,-2":"M5,-3",A=n.select(this),L=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",k+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(s)l.fillGroupStyle(e,t);else{var r="legendfill-"+b.uid;l.gradient(e,t,r,h(M),T,"fill")}})),d||f){var S=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:S}}),r=[i.minExtend(g,{trace:a})]}var D=A.select(".legendlines").selectAll("path").data(d||f?[r]:[]);D.enter().append("path").classed("js-line",!0),D.exit().remove(),D.attr("d",k+(f?"l"+x+",0.0001":"h"+x)).call(d?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(M),T,"stroke")}})})).each((function(e){var r,a,o=m(e),s=o.anyFill,c=o.anyLine,d=o.showLine,f=o.showMarker,p=e[0],h=p.trace,y=!f&&!c&&!s&&u.hasText(h);function v(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(g&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(f||y||d){var b={},w={};if(f){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",i.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",i.mean,[2,16],12);b.ms=T,w.marker.size=T}d&&(w.line={width:v("line.width",x,[0,10],5)}),y&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[i.minExtend(p,b)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var M=n.select(this).select("g.legendpoints"),k=M.selectAll("path.scatterpts").data(f?r:[]);k.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),k.exit().remove(),k.call(l.pointStyle,a,t),f&&(r[0].mrc=3);var A=M.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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":254,"../../registry":337,"../../traces/pie/helpers":430,"../../traces/pie/style_one":436,"../../traces/scatter/subtypes":463,"../color":112,"../colorscale/helpers":123,"../drawing":134,"./constants":163,"@plotly/d3":18}],171:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":173}],172:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function d(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},d=i.list(e,null,!0),f=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,m=(1+h)/2,y=(1-h)/2;for(a=0;a1?(P=["toggleHover"],I=["resetViews"]):v?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],I=["resetGeo"]):y?(P=["hoverClosest3d"],I=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],I=["resetViewMapbox"]):b?P=["hoverClosestGl2d"]:g?P=["hoverClosestPie"]:k?(P=["hoverClosestCartesian","hoverCompareCartesian"],I=["resetViewSankey"]):P=["toggleHover"];m&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(e=0;M--){var k=r.append("path").attr(y).style("opacity",M?.1:v).call(o.stroke,x).call(o.fill,g).call(l.dashLine,M?"solid":_,M?4+b:b);if(h(k,e,i),w){var A=s(e.layout,"selections",i);k.style({cursor:"move"});var L={element:k.node(),plotinfo:p,gd:e,editHelpers:A,isActiveSelection:!0},S=n(c,e);a(S,k,L)}else k.style("pointer-events",M?"all":"none");T[M]=k}var D=T[0];T[1].node().addEventListener("click",(function(){return function(e,t){if(!f(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void m(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=m,d(e)}}(e,D)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;l.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function m(e){f(e)&&(e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,d(e)))}t.exports={draw:d,drawOne:p,activateLastSelection:function(e){if(!f(e))return;var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=m,d(e)}}},{"../../plot_api/plot_template":290,"../color":112,"../drawing":134,"../shapes/display_outlines":206,"../shapes/draw_newshape/helpers":211,"../shapes/handle_outline":213,"../shapes/helpers":214}],196:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":248,"../../drawing/attributes":133}],197:[function(e,t,r){"use strict";t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],198:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers").selectMode,a=e("../../shapes/handle_outline").clearOutline,i=e("../../shapes/draw_newshape/helpers"),o=i.readPaths,l=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var i=r.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,d=t.plotinfo,f=d.xaxis,p=d.yaxis,h=t.isActiveSelection,m=t.dragmode,y=(c.layout||{}).selections||[];if(!n(m)&&void 0!==h){var v=c._fullLayout._activeSelectionIndex;if(v-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){G(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(f=K(_))){for(o&&o.remove(),y=0;y=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,l=p(r),s=m(r);if(l||s){var c,u,d=o.selectAll(".select-outline-"+n.id);if(d&&a._fullLayout._outlining)l&&(c=T(d,e)),c&&i.call("_guiRelayout",a,{shapes:c}),s&&!B(e)&&(u=M(d,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&k(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function X(e){return e._id}function W(e,t,r,n){if(!e.calcdata)return[];var a,i,o,l=[],s=t.map(X),c=r.map(X);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function Q(e,t,r){var n,a;for(n=0;n-1&&t;if(!i&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ce(te);ue([O(e,ne,"x"),O(e,pe,"y")])($,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&de(e,$),f._reselect=!1}if(!i&&f._deselect){var me=f._deselect;(function(e,t,r){for(var n=0;n=0)M._fullLayout._deactivateShape(M);else if(!x){var r=k.clickmode;D.done(ke).then((function(){if(D.clear(ke),2===e){for(be.remove(),K=0;K-1&&Y(t,M,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&de(M,void 0);s.click(M,t)})).catch(A.error)}},n.doneFn=function(){Me.remove(),D.done(ke).then((function(){D.clear(ke),!L&&J&&n.selectionDefs&&(J.subtract=xe,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,X)),(L||x)&&Z(n,L),n.doneFnCompleted&&n.doneFnCompleted(Ae),b&&de(M,ie)})).catch(A.error)}},clearOutline:x,clearSelectionsCache:Z,selectOnClick:Y}},{"../../lib":254,"../../lib/clear_gl_canvases":242,"../../lib/polygon":266,"../../lib/throttle":278,"../../plot_api/subroutines":291,"../../plots/cartesian/axis_ids":305,"../../registry":337,"../color":112,"../dragelement/helpers":130,"../drawing":134,"../fx":152,"../fx/helpers":148,"../shapes/constants":204,"../shapes/display_outlines":206,"../shapes/draw_newshape/helpers":211,"../shapes/draw_newshape/newshapes":212,"../shapes/handle_outline":213,"../shapes/helpers":214,"./constants":193,"./draw":195,"./draw_newselection/newselections":198,"./helpers":199,"point-in-polygon/nested":66,polybooljs:67}],202:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":229,"../../lib/extend":248,"../../plot_api/plot_template":290,"../../traces/scatter/attributes":438,"../annotations/attributes":95,"../drawing/attributes":133}],203:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var d=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],f=n.aggNums(Math.max,null,d),p=n.aggNums(Math.min,null,d),h=p<0?Math.abs(p)+c:c,m=f>0?f+c:c;return{ppad:c,ppadplus:u?h:m,ppadminus:u?m:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,d,f=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=d)));return p>=f?[f,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o1&&(2!==e.length||"Z"!==e[1][0])&&(0===S&&(e[0][0]="M"),t[L]=e,T(),M())}}()}}function E(e,r){!function(e,r){if(t.length)for(var n=0;nx?(M=d,S="y0",k=x,D="y1"):(M=x,S="y1",k=d,D="y0");W(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),X.moveFn="move"===I?J:K,X.altKey=n.altKey},doneFn:function(){if(g(e))return;p(t),$(l),_(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(g(e))return;$(l)}};function W(r){if(g(e))I=null;else if(R)I="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?f.getCursor(o/a,1-l/i):"move";p(t,s),I=s.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;N?E("xanchor",r.xanchor=q(b+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else N?E("xanchor",r.xanchor=q(b+n)):(E("x0",r.x0=q(c+n)),E("x1",r.x1=q(v+n))),z?E("yanchor",r.yanchor=G(T+a)):(E("y0",r.y0=G(d+a)),E("y1",r.y1=G(x+a)));t.attr("d",y(e,r)),Q(l,r)}function K(n,a){if(F){var i=function(e){return e},o=i,s=i;N?E("xanchor",r.xanchor=q(b+n)):(o=function(e){return q(V(e)+n)},j&&"date"===j.type&&(o=m.encodeDate(o))),z?E("yanchor",r.yanchor=G(T+a)):(s=function(e){return G(U(e)+a)},B&&"date"===B.type&&(s=m.encodeDate(s))),E("path",r.path=w(P,o,s))}else if(R){if("resize-over-start-point"===I){var u=c+n,f=z?d-a:d+a;E("x0",r.x0=N?u:q(u)),E("y0",r.y0=z?f:G(f))}else if("resize-over-end-point"===I){var p=v+n,h=z?x-a:x+a;E("x1",r.x1=N?p:q(p)),E("y1",r.y1=z?h:G(h))}}else{var g=function(e){return-1!==I.indexOf(e)},_=g("n"),H=g("s"),Y=g("w"),Z=g("e"),X=_?M+a:M,W=H?k+a:k,J=Y?A+n:A,K=Z?L+n:L;z&&(_&&(X=M-a),H&&(W=k-a)),(!z&&W-X>10||z&&X-W>10)&&(E(S,r[S]=z?X:G(X)),E(D,r[D]=z?W:G(W))),K-J>10&&(E(O,r[O]=N?J:q(J)),E(C,r[C]=N?K:q(K)))}t.attr("d",y(e,r)),Q(l,r)}function Q(e,t){(N||z)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=V(N?t.xanchor:a.midRange(r?[t.x0,t.x1]:m.extractPathCoords(t.path,h.paramIsX))),o=U(z?t.yanchor:a.midRange(r?[t.y0,t.y1]:m.extractPathCoords(t.path,h.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),N&&z){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(N){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}f.init(X),Z.node().onmousemove=W}(e,N,s,t,r,I):!0===s.editable&&N.style("pointer-events",C||c.opacity(L)*A<=.5?"stroke":"all");N.node().addEventListener("click",(function(){return function(e,t){if(!x(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void T(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=T,v(e)}}(e,N)}))}}function _(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function T(e){x(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,v(e)))}t.exports={draw:v,drawOne:b,eraseActiveShape:function(e){if(!x(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&sp&&(e="X"),e}));return i>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),u+h}))}(t,l,c);if("pixel"===t.xsizemode){var b=l(t.xanchor);u=b+t.x0,d=b+t.x1}else u=l(t.x0),d=l(t.x1);if("pixel"===t.ysizemode){var _=c(t.yanchor);f=_-t.y0,p=_-t.y1}else f=c(t.y0),p=c(t.y1);if("line"===h)return"M"+u+","+f+"L"+d+","+p;if("rect"===h)return"M"+u+","+f+"H"+d+"V"+p+"H"+u+"Z";var w=(u+d)/2,T=(f+p)/2,M=Math.abs(w-u),k=Math.abs(T-f),A="A"+M+","+k,L=w+M+","+T;return"M"+L+A+" 0 1,1 "+(w+","+(T-k))+A+" 0 0,1 "+L+"Z"}},{"../../lib":254,"../../plots/cartesian/axes":301,"./constants":204}],215:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":312,"./attributes":202,"./calc_autorange":203,"./defaults":205,"./draw":207,"./draw_newshape/defaults":210}],216:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":248,"../../plot_api/edit_types":283,"../../plot_api/plot_template":290,"../../plots/animation_attributes":295,"../../plots/font_attributes":329,"../../plots/pad_attributes":334,"./constants":217}],217:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],218:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*d.gripWidth,t._dims.currentValueTotalHeight))}}function S(e,t){var r=e._dims;return r.inputAreaStart+d.stepInset+(r.inputAreaLength-2*d.stepInset)*Math.min(1,Math.max(0,t))}function D(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-d.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*d.stepInset-2*r.inputAreaStart)))}function O(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",d.railTouchRectClass,(function(n){n.call(k,t,e,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,d.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function C(e,t){var r=t._dims,n=r.inputAreaLength-2*d.railInset,a=l.ensureSingle(e,"rect",d.railRectClass);a.attr({width:n,height:d.railWidth,rx:d.railRadius,ry:d.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,d.railInset,.5*(r.inputAreaWidth-d.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[d.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,y(t))}if(i.enter().append("g").classed(d.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+d.groupClassName).each(l)})).remove(),0!==r.length){var s=i.selectAll("g."+d.groupClassName).data(r,v);s.enter().append("g").classed(d.groupClassName,!0),s.exit().each(l).remove();for(var c=0;c0||f<0){var v={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[b.side];t.attr("transform",s(v[0],v[1]))}}}return R.call(F),I&&(S?R.on(".opacity",null):(k=0,A=!0,R.text(g).on("mouseover.opacity",(function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(d.makeEditable,{gd:e}).on("edit",(function(t){void 0!==x?o.call("_guiRestyle",e,v,t,x):o.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(e){this.text(e||" ").call(d.positionText,_.x,_.y)}))),R.classed("js-placeholder",A),T}}},{"../../constants/alignment":228,"../../constants/interactions":233,"../../lib":254,"../../lib/svg_text_utils":277,"../../plots/plots":335,"../../registry":337,"../color":112,"../drawing":134,"@plotly/d3":18,"fast-isnumeric":26}],222:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":248,"../../plot_api/edit_types":283,"../../plot_api/plot_template":290,"../../plots/font_attributes":329,"../../plots/pad_attributes":334,"../color/attributes":111}],223:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],224:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":254,"../../plots/array_container_defaults":296,"./attributes":222,"./constants":223}],225:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,d=e("./constants"),f=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(d.menuIndexAttrName)===t._index}function m(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,d.name,t).applyUpdate("active",o),"buttons"===t.type?v(e,n,null,null,t):"dropdown"===t.type&&(a.attr(d.menuIndexAttrName,"-1"),y(e,n,a,i,t),l||v(e,n,a,i,t))}function y(e,t,r,n,a){var i=l.ensureSingle(t,"g",d.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||d.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(g,a,u,e).call(A,a,f,p),l.ensureSingle(t,"text",d.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(o.font,a.font).text(d.arrowSymbol[a.direction])})).attr({x:s.headerWidth-d.arrowOffsetX+a.pad.l,y:s.headerHeight/2+d.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(L,String(h(r,a)?-1:a._index)),v(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(t,s.lx,s.ly)}function v(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(d.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?d.dropdownButtonClassName:d.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),f=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(f.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,y=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?y=v.headerHeight+d.gapButtonHeader:h=v.headerWidth+d.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-d.gapButtonHeader+d.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(h=-d.gapButtonHeader+d.gapButton-v.openWidth);var b={x:v.lx+h+o.pad.l,y:v.ly+y+o.pad.t,yPad:d.gapButton,xPad:d.gapButton,index:0},M={l:b.x+o.borderwidth,t:b.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(g,o,l,e).call(A,o,b),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(m(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(m(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(T,o),u.call(_,o)}))})),u.call(_,o),x?(M.w=Math.max(v.openWidth,v.headerWidth),M.h=b.y-M.t):(M.w=b.x-M.l,M.h=Math.max(v.openHeight,v.headerHeight)),M.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,f=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(d.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+d.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+d.headerGroupClassName).data(r,p);s.enter().append("g").classed(d.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",d.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,k=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,L=h,S=y+v;S+A>c&&(S=c-A);var D=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),M?(this.hbar=D.attr({rx:l.barRadius,ry:l.barRadius,x:L,y:S,width:k,height:A}),this._hbarXMin=L+k/2,this._hbarTranslateMax=w-k):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=v>T,C=l.barWidth+2*l.barPad,P=l.barLength+2*l.barPad,I=h+m,N=y;I+C>s&&(I=s-C);var z=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);z.exit().on(".drag",null).remove(),z.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),O?(this.vbar=z.attr({rx:l.barRadius,ry:l.barRadius,x:I,y:N,width:C,height:P}),this._vbarYMin=N+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,E=O?d+C+.5:d+.5,j=f-.5,H=M?p+A+.5:p+.5,B=o._topdefs.selectAll("#"+R).data(M||O?[0]:[]);if(B.exit().remove(),B.enter().append("clipPath").attr("id",R).append("rect"),M||O?(this._clipRect=B.select("rect").attr({x:Math.floor(F),y:Math.floor(j),width:Math.ceil(E)-Math.floor(F),height:Math.ceil(H)-Math.floor(j)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:h,y:y,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),M||O){var Y=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(Y);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":254,"../color":112,"../drawing":134,"@plotly/d3":18}],228:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],229:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"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",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],230:[function(e,t,r){"use strict";t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],231:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],232:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],233:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],234:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],235:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],236:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],238:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],239:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function d(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,d,f,p,h,m=s([r,n]);function y(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}m?(u=0,d=o,f=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return d(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return d(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return d(e,t,r,n,a,i,1)}}},{"./mod":261}],240:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(d(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),v=e.charAt(0);!c||"G"!==v&&"g"!==v||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),T=e.match(w?x:g);if(!T)return u;var M=T[1],k=T[3]||"1",A=Number(T[5]||1),L=Number(T[7]||0),S=Number(T[9]||0),D=Number(T[11]||0);if(c){if(2===M.length)return u;var O;M=Number(M);try{var C=y.getComponentMethod("calendars","getCal")(t);if(w){var P="i"===k.charAt(k.length-1);k=parseInt(k,10),O=C.newDate(M,C.toMonthIndex(M,k,P),A)}else O=C.newDate(M,Number(k),A)}catch(e){return u}return O?(O.toJD()-m)*d+L*f+S*p+D*h:u}M=2===M.length?(Number(M)+2e3-b)%100+b:Number(M),k-=1;var I=new Date(Date.UTC(2e3,k,A,L,S));return I.setUTCFullYear(M),I.getUTCMonth()!==k||I.getUTCDate()!==A?u:I.getTime()+D*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var T=90*d,M=3*f,k=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,g,x,b=Math.floor(10*s(e+.05,1)),w=Math.round(e-b/10);if(_(r)){var L=Math.floor(w/d)+m,S=Math.floor(s(e,d));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(e){i=v("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+d&&e<=a-d))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var L=/%\d?f/g,S=/%h/g,D={1:"1",2:"1",3:"2",4:"2"};function O(e,t,r,n){e=e.replace(L,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(S,(function(){return D[r("%q")(a)]})),_(n))try{e=y.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,d),n=w(Math.floor(r/f),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),C[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+O(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return O(t,e,n,a)};var P=3*d;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,d);if(e=Math.round(e-n),r)try{var a=Math.round(e/d)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-m)*d+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+P);return c.setUTCMonth(c.getUTCMonth()+t)+n-P},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&y.getComponentMethod("calendars","getCal")(t),u=0;u1||m<0||m>1?null:{x:e+s*m,y:t+d*m}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,d=n-t,f=o-a,p=c-i,h=u*u+d*d,m=f*f+p*p,y=Math.min(s(u,d,h,a-e,i-t),s(u,d,h,o-e,c-t),s(f,p,m,e-a,t-i),s(f,p,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),d=e.getPointAtLength(o(r,t)),f={x:(4*d.x+s.x+c.x)/6,y:(4*d.y+s.y+c.y)/6,theta:u};return n[r]=f,f},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),d=u;function f(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,d=r.ys?r.y-s:0;return Math.sqrt(c*c+d*d)}for(var p=f(c);p;){if((c+=p+r)>d)return;p=f(c)}for(p=f(d);p;){if(c>(d-=p+r))return;p=f(d)}return{min:c,max:d,len:d-c,total:u,isClosed:0===c&&d===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,d=0,f=0,p=l;d0?p=a:f=a,d++}return i}},{"./mod":261}],252:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],253:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],254:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,d=t.exports={};d.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var f={};d.warnBadFormat=function(e){var t=String(e);f[t]||(f[t]=1,d.warn('encountered bad format: "'+t+'"'))},d.noFormat=function(e){return String(e)},d.numberFormat=function(e){var t;try{t=i(d.adjustFormat(e))}catch(t){return d.warnBadFormat(e),d.noFormat}return t},d.nestedProperty=e("./nested_property"),d.keyedContainer=e("./keyed_container"),d.relativeAttr=e("./relative_attr"),d.isPlainObject=e("./is_plain_object"),d.toLogRange=e("./to_log_range"),d.relinkPrivateKeys=e("./relink_private");var p=e("./array");d.isTypedArray=p.isTypedArray,d.isArrayOrTypedArray=p.isArrayOrTypedArray,d.isArray1D=p.isArray1D,d.ensureArray=p.ensureArray,d.concat=p.concat,d.maxRowLength=p.maxRowLength,d.minRowLength=p.minRowLength;var h=e("./mod");d.mod=h.mod,d.modHalf=h.modHalf;var m=e("./coerce");d.valObjectMeta=m.valObjectMeta,d.coerce=m.coerce,d.coerce2=m.coerce2,d.coerceFont=m.coerceFont,d.coercePattern=m.coercePattern,d.coerceHoverinfo=m.coerceHoverinfo,d.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,d.validate=m.validate;var y=e("./dates");d.dateTime2ms=y.dateTime2ms,d.isDateTime=y.isDateTime,d.ms2DateTime=y.ms2DateTime,d.ms2DateTimeLocal=y.ms2DateTimeLocal,d.cleanDate=y.cleanDate,d.isJSDate=y.isJSDate,d.formatDate=y.formatDate,d.incrementMonth=y.incrementMonth,d.dateTick0=y.dateTick0,d.dfltRange=y.dfltRange,d.findExactDates=y.findExactDates,d.MIN_MS=y.MIN_MS,d.MAX_MS=y.MAX_MS;var v=e("./search");d.findBin=v.findBin,d.sorterAsc=v.sorterAsc,d.sorterDes=v.sorterDes,d.distinctVals=v.distinctVals,d.roundUp=v.roundUp,d.sort=v.sort,d.findIndexOfMin=v.findIndexOfMin,d.sortObjectKeys=e("./sort_object_keys");var g=e("./stats");d.aggNums=g.aggNums,d.len=g.len,d.mean=g.mean,d.median=g.median,d.midRange=g.midRange,d.variance=g.variance,d.stdev=g.stdev,d.interp=g.interp;var x=e("./matrix");d.init2dArray=x.init2dArray,d.transposeRagged=x.transposeRagged,d.dot=x.dot,d.translationMatrix=x.translationMatrix,d.rotationMatrix=x.rotationMatrix,d.rotationXYMatrix=x.rotationXYMatrix,d.apply3DTransform=x.apply3DTransform,d.apply2DTransform=x.apply2DTransform,d.apply2DTransform2=x.apply2DTransform2,d.convertCssMatrix=x.convertCssMatrix,d.inverseTransformMatrix=x.inverseTransformMatrix;var b=e("./angles");d.deg2rad=b.deg2rad,d.rad2deg=b.rad2deg,d.angleDelta=b.angleDelta,d.angleDist=b.angleDist,d.isFullCircle=b.isFullCircle,d.isAngleInsideSector=b.isAngleInsideSector,d.isPtInsideSector=b.isPtInsideSector,d.pathArc=b.pathArc,d.pathSector=b.pathSector,d.pathAnnulus=b.pathAnnulus;var _=e("./anchor_utils");d.isLeftAnchor=_.isLeftAnchor,d.isCenterAnchor=_.isCenterAnchor,d.isRightAnchor=_.isRightAnchor,d.isTopAnchor=_.isTopAnchor,d.isMiddleAnchor=_.isMiddleAnchor,d.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");d.segmentsIntersect=w.segmentsIntersect,d.segmentDistance=w.segmentDistance,d.getTextLocation=w.getTextLocation,d.clearLocationCache=w.clearLocationCache,d.getVisibleSegment=w.getVisibleSegment,d.findPointOnPath=w.findPointOnPath;var T=e("./extend");d.extendFlat=T.extendFlat,d.extendDeep=T.extendDeep,d.extendDeepAll=T.extendDeepAll,d.extendDeepNoArrays=T.extendDeepNoArrays;var M=e("./loggers");d.log=M.log,d.warn=M.warn,d.error=M.error;var k=e("./regex");d.counterRegex=k.counter;var A=e("./throttle");d.throttle=A.throttle,d.throttleDone=A.done,d.clearThrottle=A.clear;var L=e("./dom");function S(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},d.noop=e("./noop"),d.identity=e("./identity"),d.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},d.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},d.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(d.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},d.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},d.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},d.syncOrAsync=function(e,t,r){var n;function a(){return d.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},d.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},d.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},d.fillArray=function(e,t,r,n){if(n=n||d.identity,d.isArrayOrTypedArray(e))for(var a=0;a1?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},d.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var N=/^\w*$/;d.templateString=function(e,t){var r={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,n){var a;return N.test(n)?a=t[n]:(r[n]=r[n]||d.nestedProperty(t,n).get,a=r[n]()),d.isValidTextValue(a)?a:""}))};var z={max:10,count:0,name:"hovertemplate"};d.hovertemplateString=function(){return E.apply(z,arguments)};var R={max:10,count:0,name:"texttemplate"};d.texttemplateString=function(){return E.apply(R,arguments)};var F=/^[:|\|]/;function E(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(d.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,f,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,m="xother_"===l||"yother_"===l,y="xother"===l||"yother"===l||p||m||h,v=l;if((p||h)&&(v=v.substring(1)),(m||h)&&(v=v.substring(0,v.length-1)),y){if(void 0===(c=t[v]))return""}else for(f=3;f=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 j=2e9;d.seedPseudoRandom=function(){j=2e9},d.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?d.pseudoRandom():j/4294967296},d.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=d.extractOption(e,t,"htx","hovertext");if(d.isValidTextValue(a))return n(a);var i=d.extractOption(e,t,"tx","text");return d.isValidTextValue(i)?n(i):void 0},d.isValidTextValue=function(e){return e||0===e},d.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,d.strTranslate(a-c*(r+o),i-c*(n+l))+d.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},d.setTransormAndDisplay=function(e,t){e.attr("transform",d.getTextTransform(t)),e.style("display",t.scale?null:"none")},d.ensureUniformFontSize=function(e,t){var r=d.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},d.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},d.bigFont=function(e){return Math.round(1.2*e)};var H=d.getFirefoxVersion(),B=null!==H&&H<86;d.getPositionFromD3Event=function(){return B?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":234,"./anchor_utils":238,"./angles":239,"./array":240,"./clean_number":241,"./clear_responsive":243,"./coerce":244,"./dates":245,"./dom":246,"./extend":248,"./filter_unique":249,"./filter_visible":250,"./geometry2d":251,"./identity":252,"./increment":253,"./is_plain_object":255,"./keyed_container":256,"./localize":257,"./loggers":258,"./make_trace_groups":259,"./matrix":260,"./mod":261,"./nested_property":262,"./noop":263,"./notifier":264,"./preserve_drawing_buffer":267,"./push_unique":268,"./regex":270,"./relative_attr":271,"./relink_private":272,"./search":273,"./sort_object_keys":275,"./stats":276,"./throttle":278,"./to_log_range":279,"@plotly/d3":18,"d3-format":21,"d3-time-format":23,"fast-isnumeric":26}],255:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],256:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],f.set(e,null);if(d){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":288,"./notifier":264}],259:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":18}],260:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],262:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,d,f,p,h,m=r.length,y=r[0][0],v=r[0][1],g=0;for(u=1;uMath.max(d,y)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":234,"./matrix":260}],267:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-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":26,"is-mobile":60}],268:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,d=0,f=t.length,p=0,h=f>1?(t[f-1]-t[0])/(f-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);d90&&a.log("Long binary search..."),d-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],d=u-a;void 0===a?(s.push(u),a=u):d>l&&(i=Math.min(i,d),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":240,"fast-isnumeric":26}],277:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,m){var A=e.text(),L=!e.attr("data-notex")&&t&&t._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(s),O=n.select(e.node().parentNode);if(!O.empty()){var C=e.attr("class")?e.attr("class").split(" ")[0]:"text";return C+="-math",O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),L?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s,f=parseInt((MathJax.version||"").split(".")[0]);if(2!==f&&3!==f)return void a.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+a.randstr({},64),i=(s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===f?MathJax.Hub.Typeset(i):MathJax.typeset([i])},h=function(){var t=s.select(2===f?".MathJax_SVG":".MathJax"),i=!t.empty()&&s.select("svg").node();if(i){var o,l=i.getBoundingClientRect();o=2===f?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,l)}else a.log("There was an error in the tex syntax.",e),r();s.remove()};2===f?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:d},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,h,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})):3===f&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=d,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),h(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(L[2],o,(function(n,a,o){O.selectAll("svg."+C).remove(),O.selectAll("g."+C+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return P(),void t();var s=O.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild);var c=o.width,u=o.height;l.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var d=e.node().style.fill||"black",f=l.select("g");f.attr({fill:d,stroke:d});var p=f.node().getBoundingClientRect(),h=p.width,y=p.height;(h>c||y>u)&&(l.style("overflow","hidden"),h=(p=l.node().getBoundingClientRect()).width,y=p.height);var v=+e.attr("x"),g=+e.attr("y"),x=-(r||e.node().getBoundingClientRect().height)/4;if("y"===C[0])s.attr({transform:"rotate("+[-90,v,g]+")"+i(-h/2,x-y/2)});else if("l"===C[0])g=x-y/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))v=0,g=x;else{var b=e.attr("text-anchor");v-=h*("middle"===b?.5:"end"===b?1:0),g=g+x-y/2}l.attr({x:v,y:g}),m&&m.call(e,s),t(s)}))}))):P(),e}function P(){O.empty()||(C=e.attr("class")+"-math",O.select("svg."+C).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(y," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}x.test(t)?u():(r=e,s=[{node:e}]);for(var L=t.split(v),O=0;O|>|>)/g;var d=[["$","$"],["\\(","\\)"]];var f={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},h={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,g=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//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 M(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&S(n)}var k=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(v),o=[],l="",s=0,c=0;ca?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(e){return e.replace(L,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function D(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?t:""}function O(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.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 e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(e){e=e.replace(y," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(v),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],279:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":26}],280:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],281:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],282:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,d=(l.subplotsRegistry.ternary||{}).attrRegex,f=(l.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(e);for(t=0;t3?(I.x=1.02,I.xanchor="left"):I.x<-2&&(I.x=-.02,I.xanchor="right"),I.y>3?(I.y=1.02,I.yanchor="bottom"):I.y<-2&&(I.y=-.02,I.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=b(t);r;){if(r in e)return!0;r=b(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",d);var g=r[""][""];if(c(g))t.set(null);else{if(!Array.isArray(g))return i.warn("Unrecognized full array edit value",d,g),!0;t.set(g)}return!m&&(f(y,v),p(e),!0)}var x,b,_,w,T,M,k,A,L=Object.keys(r).map(Number).sort(o),S=t.get(),D=S||[],O=u(v,d).get(),C=[],P=-1,I=D.length;for(x=0;xD.length-(k?0:1))i.warn("index out of range",d,_);else if(void 0!==M)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",d,_),c(M)?C.push(_):k?("add"===M&&(M={}),D.splice(_,0,M),O&&O.splice(_,0,{})):i.warn("Unrecognized full object edit value",d,_,M),-1===P&&(P=_);else for(b=0;b=0;x--)D.splice(C[x],1),O&&O.splice(C[x],1);if(D.length?S||t.set(D):t.set(null),m)return!1;if(f(y,v),h!==a){var N;if(-1===P)N=L;else{for(I=Math.max(D.length,I),N=[],x=0;x=P);x++)N.push(_);for(x=P;x=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),C(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function I(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in C(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,d,f=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=O(r,e.data.length-1),t)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function B(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[f.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||f.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&V(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(f.rehover,f.redrag,f.reselect),c.add(e,B,[e,a.undoit],B,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.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[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function V(e,t){var r=t?function(e){var r=[];for(var n in t){var a=p.getFromId(e,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)t[i]||r.push(i)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(g,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,f=F(s._preGUI,c),h=Object.keys(t),m=p.list(e),y=o.extendDeepAll({},t),v={};for(H(t),h=Object.keys(t),n=0;n0&&"string"!=typeof I.parts[z];)z--;var E=I.parts[z],j=I.parts[z-1]+"."+E,B=I.parts.slice(0,z).join("."),Y=l(e.layout,B).get(),V=l(s,B).get(),Z=I.get();if(void 0!==N){A[P]=N,L[P]="reverse"===E?N:R(Z);var W=d.getLayoutValObject(s,I.parts);if(W&&W.impliedEdits&&null!==N)for(var J in W.impliedEdits)S(o.relativeAttr(P,J),W.impliedEdits[J]);if(-1!==["width","height"].indexOf(P))if(N){S("autosize",null);var K="height"===P?"width":"height";S(K,s[K])}else s[P]=e._initialAutoSize[P];else if("autosize"===P)S("width",N?null:s.width),S("height",N?null:s.height);else if(j.match(U))C(j),l(s,B+"._inputRange").set(null);else if(j.match(q)){C(j),l(s,B+"._inputRange").set(null);var Q=l(s,B).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(G)&&l(s,B+"._inputDomain").set(null);if("type"===E){D=Y;var $="linear"===V.type&&"log"===N,ee="log"===V.type&&"linear"===N;if($||ee){if(D&&D.range)if(V.autorange)$&&(D.range=D.range[1]>D.range[0]?[1,2]:[2,1]);else{var te=D.range[0],re=D.range[1];$?(te<=0&&re<=0&&S(B+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),S(B+".range[0]",Math.log(te)/Math.LN10),S(B+".range[1]",Math.log(re)/Math.LN10)):(S(B+".range[0]",Math.pow(10,te)),S(B+".range[1]",Math.pow(10,re)))}else S(B+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[I.parts[0]]&&"radialaxis"===I.parts[1]&&delete s[I.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,V,N,S),u.getComponentMethod("images","convertCoords")(e,V,N,S)}else S(B+".autorange",!0),S(B+".range",null);l(s,B+"._inputRange").set(null)}else if(E.match(M)){var ne=l(s,P).get(),ae=(N||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,S),u.getComponentMethod("images","convertCoords")(e,ne,ae,S)}var ie=b.containerArrayMatch(P);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=W||{editType:"calc"};""!==n&&""===oe&&(b.isAddVal(N)?L[P]=null:b.isRemoveVal(N)?L[P]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),T.update(k,le),v[r]||(v[r]={});var se=v[r][n];se||(se=v[r][n]={}),se[oe]=N,delete t[P]}else"reverse"===E?(Y.range?Y.range.reverse():(S(B+".autorange",!0),Y.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):("dragmode"===P&&(!1===N&&!1!==Z||!1!==N&&!1===Z)||s._has("scatter-like")&&s._has("regl")&&"dragmode"===P&&("lasso"===N||"select"===N)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?k.plot=!0:W?T.update(k,W):k.calc=!0,I.set(N))}}for(r in v){b.applyContainerArrayChanges(e,f(i,r),v[r],k,f)||(k.plot=!0)}for(var ce in O){var ue=(D=p.getFromId(e,ce))&&D._constraintGroup;if(ue)for(var de in k.calc=!0,ue)O[de]||(p.getFromId(e,de)._constraintShrinkable=!0)}return(X(e)||t.height||t.width)&&(k.plot=!0),(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:O,undoit:L,redoit:A,eventData:y}}function X(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&f.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function W(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),d=u.flags;(s.calc||d.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];d.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(f.previousPromises),Y(e,d,u)||f.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||d.colorbars)&&p.push(w.doColorBars),d.legend&&p.push(w.doLegend),d.layoutstyle&&p.push(w.layoutStyles),d.axrange&&V(p,u.rangesAltered),d.ticks&&p.push(w.doTicksRelayout),d.modebar&&p.push(w.doModeBar),d.camera&&p.push(w.doCamera),p.push(A)),p.push(f.rehover,f.redrag,f.reselect),c.add(e,W,[e,l.undoit,u.undoit,l.traces],W,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function J(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{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 $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function d(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,f.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&d()};t()}var h,m,y=0;function v(e){return Array.isArray(a)?y>=a.length?e.transitionOpts=a[y]:e.transitionOpts=a[0]:e.transitionOpts=a,y++,e}var g=[],x=null==t,b=Array.isArray(t);if(!x&&!b&&o.isPlainObject(t))g.push({type:"object",data:v(o.extendFlat({},t))});else if(x||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&MM)&&k.push(m);g=k}}g.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var m=t[n].name,y=(u[m]||h[m]||{}).name,v=t[n].name,g=u[y]||h[y];y&&v&&"number"==typeof v&&g&&k<5&&(k++,o.warn('addFrames: overwriting frame "'+(u[y]||h[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===k&&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[m]={name:m},p.push({frame:f.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:d+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=f.modifyFrames,u=f.modifyFrames,d=[e,l],p=[e,i];return c&&c.add(e,s,d,u,p),f.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,d=e,f=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!g(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function g(e){return e===Math.round(e)&&e>=0}function x(){var e,t,r={};for(e in d(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var d=u.basePlotModule;d&&d.attributes&&(a=d.attributes[o])}a||(a=i[o])}return v(a,t,l)},r.getLayoutValObject=function(e,t){return v(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function d(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:d,applyUpdate:function(t,r){t&&u(t,r);var a=d();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":254,"../plots/attributes":297}],291:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),d=e("../components/modebar"),f=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),m=h.enforce,y=h.clean,v=e("../plots/cartesian/autorange").doAutoRange;function g(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function x(e){var t,a,l,u,h,m,y=e._fullLayout,v=y._size,x=v.p,_=f.list(e,"",!0);if(y._paperdiv.style({width:e._context.responsive&&y.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":y.width+"px",height:e._context.responsive&&y.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(c.setSize,y.width,y.height),e._context.setBackground(e,y.paper_bgcolor),r.drawMainTitle(e),d.manage(e),!y._has("cartesian"))return i.previousPromises(e);function T(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-x-n:t._offset+t._length+x+n:v.t+v.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+x+n:t._offset-x-n:v.l+v.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var M=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=T(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?T(u,M,p.OPPOSITE_SIDE[u.side]):null}var k=[],A=[],L=[],S=1===s.opacity(y.paper_bgcolor)&&1===s.opacity(y.plot_bgcolor)&&y.paper_bgcolor===y.plot_bgcolor;for(a in y._plots)if((l=y._plots[a]).mainplot)l.bg&&l.bg.remove(),l.bg=void 0;else{var D=l.xaxis.domain,O=l.yaxis.domain,C=l.plotgroup;if(g(D,O,L)){var P=C.node(),I=l.bg=o.ensureSingle(C,"rect","bg");P.insertBefore(I.node(),P.childNodes[0]),A.push(a)}else C.select("rect.bg").remove(),L.push([D,O]),S||(k.push(a),A.push(a))}var N,z,R,F,E,j,H,B,Y,V,U,q,G,Z=y._bgLayer.selectAll(".bg").data(k);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){y._plots[e].bg=n.select(this)})),t=0;tT?u.push({code:"unused",traceType:g,templateCount:w,dataCount:T}):T>w&&u.push({code:"reused",traceType:g,templateCount:w,dataCount:T})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=m(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&y(i)&&e(i,o)}}({data:p,layout:f},""),u.length)return u.map(v)}},{"../lib":254,"../plots/attributes":297,"../plots/plots":335,"./plot_config":288,"./plot_schema":289,"./plot_template":290}],293:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,d={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,f,p,h;function m(e){return!(e in t)||o.validate(t[e],d[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],f=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),f=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(d.format.values,", "," or ")+".");var y={};function v(e,r){return o.coerce(t,y,d,e,r)}var g=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var k=o.extendFlat({},f);x?k.width=x:null===t.width&&n(h.width)&&(k.width=h.width),b?k.height=b:null===t.height&&n(h.height)&&(k.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=l.getRedrawFunc(M);function S(){return new Promise((function(e){setTimeout(e,l.getDelay(M._fullLayout))}))}function D(){return new Promise((function(e,t){var r=s(M,g,_),n=M._fullLayout.width,d=M._fullLayout.height;function f(){a.purge(M),document.body.removeChild(M)}if("full-json"===g){var p=i.graphJson(M,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),f(),e(T?p:l.encodeJSON(p))}if(f(),"svg"===g)return e(T?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:g,width:n,height:d,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(M,r,k,A).then(L).then(S).then(D).then((function(t){e(function(e){return T?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":254,"../plots/plots":335,"../snapshot/helpers":341,"../snapshot/svgtoimg":343,"../snapshot/tosvg":345,"../version":483,"./plot_api":287,"fast-isnumeric":26}],294:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var d=Object.keys(e),f=0;fx.length&&a.push(h("unused",i,v.concat(x.length)));var k,A,L,S,D,O=x.length,C=Array.isArray(M);if(C&&(O=Math.min(O,M.length)),2===b.dimensions)for(A=0;Ax[A].length&&a.push(h("unused",i,v.concat(A,x[A].length)));var P=x[A].length;for(k=0;k<(C?Math.min(P,M[A].length):P);k++)L=C?M[A][k]:M,S=g[A][k],D=x[A][k],n.validate(S,L)?D!==S&&D!==+S&&a.push(h("dynamic",i,v.concat(A,k),S,D)):a.push(h("value",i,v.concat(A,k),S))}else a.push(h("array",i,v.concat(A),g[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,v=r.length,g=0;g0&&Math.round(d)===d))return{vals:a};c=d}for(var f=t.calendar,p="start"===s,h="end"===s,m=e[r+"period0"],y=i(m,f)||0,v=[],g=[],x=[],b=a.length,_=0;_k;)M=o(M,-c,f);for(;M<=k;)M=o(M,c,f);T=o(M,-c,f)}else{for(M=y+(w=Math.round((k-y)/u))*u;M>k;)M-=u;for(;M<=k;)M+=u;T=M-u}v[_]=p?T:h?M:(T+M)/2,g[_]=T,x[_]=M}return{vals:v,starts:g,ends:x}}},{"../../constants/numerical":234,"../../lib":254,"fast-isnumeric":26}],299:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],300:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,d=c.isLinked;function f(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=m(e,t),u=c.min,d=c.max;if(0===u.length||0===d.length)return i.simpleMap(t.range,t.r2l);var f=u[0].val,y=d[0].val;for(r=1;r0&&((T=S-l(x)-s(b))>D?M/T>O&&(_=x,w=b,O=M/T):M/S>O&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},O=M/S));if(f===y){var C=f-1,P=f+1;if(A)if(0===f)a=[0,1];else{var I=(f>0?d:u).reduce((function(e,t){return Math.max(e,s(t))}),0),N=f/(1-Math.min(.5,I/S));a=f>0?[0,N]:[N,0]}else a=L?[Math.max(0,C),Math.max(1,P)]:[C,P]}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-p(t,x.val,b.val))/(S-l(_)-s(w)),a=[_.val-O*l(_),w.val+O*s(w)];return v&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),L=k((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=k(r.vpadplus||r.vpad),D=k(r.vpadminus||r.vpad);if(!T){if(f=1/0,p=-1/0,w)for(n=0;n0&&(f=i),i>p&&i-o&&(f=i),i>p&&i=P;n--)C(n);return{min:h,max:m,opts:r}},concatExtremes:m};function m(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],d=[];function f(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":134,"../../constants/numerical":234,"../../lib":254,"../../registry":337,"./axis_ids":305,"@plotly/d3":18,"fast-isnumeric":26}],301:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),d=e("../../components/color"),f=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),m=e("../../constants/numerical"),y=m.ONEMAXYEAR,v=m.ONEAVGYEAR,g=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,M=m.ONEMINMONTH,k=m.ONEWEEK,A=m.ONEDAY,L=A/2,S=m.ONEHOUR,D=m.ONEMIN,O=m.ONESEC,C=m.MINUS_SIGN,P=m.BADNUM,I={K:"zeroline"},N={K:"gridline",L:"path"},z={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},E={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j=e("../../constants/alignment"),H=j.MID_SHIFT,B=j.CAP_SHIFT,Y=j.LINE_SPACING,V=j.OPPOSITE_SIDE,U=t.exports={};U.setConvert=e("./set_convert");var q=e("./axis_autotype"),G=e("./axis_ids"),Z=G.idSort,X=G.isLinked;U.id2name=G.id2name,U.name2id=G.name2id,U.cleanId=G.cleanId,U.list=G.list,U.listIds=G.listIds,U.getFromId=G.getFromId,U.getFromTrace=G.getFromTrace;var W=e("./autorange");U.getAutoRange=W.getAutoRange,U.findExtremes=W.findExtremes;function J(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}U.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},U.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},U.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==U.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=U.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},U.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:U.getFromId(t,r).cleanPos)(e)},U.redrawComponents=function(e,t){t=t||U.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;ur&&d2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},U.saveRangeInitial=function(e,t){for(var r=U.list(e,"",!0),n=!1,a=0;a.3*f||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=U.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=U.tickIncrement(e,"M1","reverse")+15.5*A:e-=L;var s=U.tickIncrement(e,r);if(s<=n)return s}return e}(g,e,v,c,i)),y=g,0;y<=u;)y=U.tickIncrement(y,v,!1,i);return{start:t.c2r(g,0,i),end:t.c2r(y,0,i),size:v,_dataSpan:u-c}},U.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,i=t.dtick&&a(t._tmin);if(i){var o=U.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var s=l.simpleMap(t.range,t.r2l);n=[s[0],.8*s[0]+.2*s[1]]}if(e.range=l.simpleMap(n,t.l2r),e._isMinor=!0,U.prepTicks(e,r),i){var c=a(t.dtick),u=a(e.dtick),d=c?t.dtick:+t.dtick.substring(1),f=u?e.dtick:+e.dtick.substring(1);c&&u?ee(d,f)?d===2*k&&f===2*A&&(e.dtick=k):d===2*k&&f===3*A?e.dtick=k:d!==k||(t._input.minor||{}).nticks?te(d/f,2.5)?e.dtick=d/2:e.dtick=d:e.dtick=A:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ee(d,f)?d>=12&&2===f&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ee(d,f)||(e.dtick=te(d/f,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},U.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,U.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=U.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=S,o&&!n&&e.dtick=(I?0:1);N--){var z=!N;N?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var R=N?e:l.extendFlat({},e,e.minor);if(z?U.prepMinorTicks(R,e,t):U.prepTicks(R,t),"array"!==R.tickmode){var F=J(u),E=F[0],j=F[1],H=a(R.dtick),B="log"===i&&!(H||"L"===R.dtick.charAt(0)),Y=U.tickFirst(R,t);if(N){if(e._tmin=Y,Y=j:Z<=j;Z=U.tickIncrement(Z,X,d,o)){if(N&&V++,R.rangebreaks&&!d){if(Z=p)break}if(O.length>h||Z===G)break;G=Z;var W={value:Z};N?(B&&Z!==(0|Z)&&(W.simpleLabel=!0),s>1&&V%s&&(W.skipLabel=!0),O.push(W)):(W.minor=!0,C.push(W))}}else N?(O=[],m=ne(e)):(C=[],D=ne(e))}if(I&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=O.map((function(e){return e.value})),Q=[],$=0;$0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),d=r||u,f=0;d>=g?f=u>=g&&u<=y?u:v:r===b&&d>=_?f=u>=_&&u<=x?u:b:d>=M?f=u>=M&&u<=w?u:T:r===k&&d>=k?f=k:d>=A?f=A:r===L&&d>=L?f=L:r===S&&d>=S&&(f=S),f>=u&&(f=u,l=!0);var p=a+f;if(t.rangebreaks&&f>0){for(var h=0,m=0;m<84;m++){var D=(m+.5)/84;t.maskBreaks(a*(1-D)+D*p)!==P&&h++}(f*=h/84)||(e[n].drop=!0),l&&u>k&&(f=u)}(f>0||0===n)&&(e[n].periodX=a+f/2)}}(O,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),oe=1;"auto"===e.tickmode&&(oe=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=O.length-1;r>-1;r--)if(O[r].drop)O.splice(r,1);else{O[r].value=Pe(O[r].value,e);var se=e.c2p(O[r].value);(ie?le>se-oe:lep||uep&&(ce.periodX=p),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=D&&i<=16||t>=S)e._tickround="M";else if(t>=O&&i<=19||t>=D)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(me(e.exponentformat)&&!ye(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}U.autoTicks=function(e,t,r){var n;function i(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var o=2*t;if(o>v)t/=v,n=i(10),e.dtick="M"+12*de(t,n,ae);else if(o>T)t/=T,e.dtick="M"+de(t,1,ie);else if(o>A){if(e.dtick=de(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:le),!r){var s=U.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(s)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else o>S?e.dtick=de(t,S,ie):o>D?e.dtick=de(t,D,oe):o>O?e.dtick=de(t,O,oe):(n=i(10),e.dtick=de(t,n,ae))}else if("log"===e.type){e.tick0=0;var u=l.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var d=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/d,n=i(10),e.dtick="L"+de(t,n,ae)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Ce(e)?(e.tick0=0,n=1,e.dtick=de(t,n,ue)):(e.tick0=0,n=i(10),e.dtick=de(t,n,ae));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}},U.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ce:se,d=e+.01*o,f=l.roundUp(l.mod(d,1),u,r);return Math.floor(d)+Math.log(n.round(Math.pow(10,f),1))/Math.LN10}throw"unrecognized dtick "+String(t)},U.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=ve(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var d=Math.round(s),f=Math.abs(d),p=e.exponentformat;"power"===p||me(p)&&ye(d)?(t.text=0===d?1:1===d?"10":"10"+(d>1?"":C)+f+"",t.fontSize*=1.25):("e"===p||"E"===p)&&f>2?t.text="1"+p+(d>0?"+":C)+f:(t.text=ve(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,m):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):Ce(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=ve(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=ve(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=C+t.text)}}}}(e,o,r,c,m):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=ve(t.x,e,a,n)}(e,o,0,c,m),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var y=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[y(o.x-.5),y(o.x+e.dtick-.5)]}return o},U.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return U.hoverLabelText(e,n,r)+" - "+U.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=U.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":C+o:o};var he=["f","p","n","\u03bc","m","","k","M","G","T"];function me(e){return"SI"===e||"B"===e}function ye(e){return e>14||e<-15}function ve(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=U.getTickFormat(t),d=t.separatethousands;if(n){var f={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};fe(f),o=(Number(f._tickround)||0)+4,c=f._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,C);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":me(s)&&(e+=he[c/3+5]));return i?C+e:e}function ge(e,t){if(e){var r=Object.keys(E).reduce((function(e,r){return-1!==t.indexOf(r)&&E[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function xe(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-d:0,f)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?d-r.top:0,f),p.reverse()),r.width>0){var y=r.right-(t._offset+t._length);y>0&&(n.xr=1,n.r=y);var v=t._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?d-r.left:0,f):(n[s]=t._depth=Math.max(r.height>0?r.right-d:0,f),p.reverse()),r.height>0){var g=r.bottom-(t._offset+t._length);g>0&&(n.yb=0,n.b=g);var x=t._offset-r.top;x>0&&(n.yt=1,n.t=x)}n[m]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=we(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=f),!0===t.mirror||"ticks"===t.mirror?a[m]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[m]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ae&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ge(n,t.automargin),ge(a,t.automargin)),i.autoMargin(e,ke(t),n),i.autoMargin(e,Ae(t),a),i.autoMargin(e,Le(t),l)})),r.skipTitle||ae&&"bottom"===t.side||re.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+we(t);else{var l=Ie(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,d,p,h,m=U.getPxPosition(e,t);"x"===i?(d=t._offset+t._length/2,p="top"===t.side?m-r:m+r):(p=t._offset+t._length/2,d="right"===t.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var y=t._selections[t._id+"tick"];if(h={selection:y,side:t.side},y&&y.node()&&y.node().parentNode){var v=f.getTranslate(y.node().parentNode);h.offsetLeft=v.x,h.offsetTop=v.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:d,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(re)}}function ie(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=Me(this),t=f.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},U.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],a=e.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},U.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},U.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},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=e.side,u=s?(e.tickwidth||0)/2:0,d=3,f=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=f*B,d+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,d+=3);l&&"top"===c&&(d-=f*(1-B));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(d=-d);return[s?u:0,l?d:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(be(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(be(t)))}},U.makeTickPath=function(e,t,r,n){n||(n={});var a=n.minor;if(a&&!e.minor)return"";var i=void 0!==n.len?n.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*r)+"v"+i*r:"M"+(t+l*r)+",0h"+i*r},U.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,d=i("inside"),f="inside"===n&&"inside"===e.ticks||!d&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,m=f?e.ticklen:0;if(d?m*=-1:u&&(m=0),f&&(p+=m,r)){var y=l.deg2rad(r);p=m*Math.cos(y)+1,h=m*Math.sin(y)}e.showticklabels&&(f||e.showline)&&(p+=.2*e.tickfont.size);var v,g,x,b,_,w={labelStandoff:p+=(e.linewidth||1)/2*(d?-1:1),labelShift:h},T=0,M=e.side,k=e._id.charAt(0),A=e.tickangle;if("x"===k)b=(_=!d&&"bottom"===M||d&&"top"===M)?1:-1,d&&(b*=-1),v=h*b,g=t+p*b,x=_?1:-.2,90===Math.abs(A)&&(d?x+=H:x=-90===A&&"bottom"===M?B:90===A&&"top"===M?H:.5,T=H/2*(A/90)),w.xFn=function(e){return e.dx+v+T*e.fontSize},w.yFn=function(e){return e.dy+g+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*b<0!==d?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==d?-n:0};else if("y"===k){if(b=(_=!d&&"left"===M||d&&"right"===M)?1:-1,d&&(b*=-1),v=p,g=h*b,x=0,d||90!==Math.abs(A)||(x=-90===A&&"left"===M||90===A&&"right"===M?B:.5),d){var L=a(A)?+A:0;if(0!==L){var S=l.deg2rad(L);T=Math.abs(Math.sin(S))*B*b,x=0}}w.xFn=function(e){return e.dx+t-(v+e.fontSize*x)*b+T*e.fontSize},w.yFn=function(e){return e.dy+g+e.fontSize*H},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},U.drawTicks=function(e,t,r){r=r||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,_e);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return d.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return f.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Ne(t,[R]),o.attr("transform",r.transFn)},U.drawGrid=function(e,t,r){r=r||{};var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?r.vals.filter((function(e){return e.minor})):[],l=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],s=r.counterAxis;if(s&&U.shouldShowZeroLine(e,t,s))for(var c="array"===t.tickmode,u=0;u=0;v--){var g=v?m:y;if(g){var x=g.selectAll("path."+a).data(v?l:o,_e);x.exit().remove(),x.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(e){return d.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return f.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}Ne(t,[N,z])},U.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=U.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return Z(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(d.stroke,t.zerolinecolor||d.defaultLine).style("stroke-width",f.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Ne(t,[I])},U.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),d=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,m=r.secondary?0:t.tickangle,y=(t._prevTickAngles||{})[d],v=r.layer.selectAll("g."+d).data(t.showticklabels?p:[],_e),g=[];function x(e,i){e.each((function(e){var o=n.select(this),l=o.select(".text-math-group"),u=h.anchorFn(e,i),d=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=c.lineCount(o),m=Y*e.fontSize,y=h.heightFn(e,a(i)?+i:0,(p-1)*m);if(y&&(d+=s(0,y)),l.empty()){var v=o.select("text");v.attr({transform:d,"text-anchor":u}),v.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var g=f.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr("transform",d+s(g,0))}}))}v.enter().append("g").classed(d,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(f.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?g.push(e._promises.pop().then((function(){x(r,m)}))):x(r,m)})),Ne(t,[F]),v.exit().remove(),r.repositionOnUpdate&&v.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),s=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=l.simpleMap(t.range,t.r2l);s=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var d=Math.min(s,c),p=Math.max(s,c),h=t.side,m=1/0,y=-1/0;for(var g in v.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=f.bBox(r.node()),l=0;o?(i.right>p||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},x(v,y+1?y:m);var b=null;t._selections&&(t._selections[d]=v);var _=[function(){return g.length&&Promise.all(g)}];t.automargin&&i._redrawFromAutoMarginCount&&90===y?(b=90,_.push((function(){x(v,y)}))):_.push((function(){if(x(v,m),p.length&&"x"===u&&!a(m)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){b=0;var e,n=0,i=[];if(v.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=Me(this),o=f.bBox(a.node());i.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",d=function(e){return-1!==c.indexOf(e)},h=d("top"),y=d("left"),g=d("right"),_=d("bottom")||y||h||g?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var y="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=d(r),a=0,o=0,l={},u=0;u2*a}(a,y)?"category":function(e,t){for(var r=e.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=y;break}var d=a("pattern",u);if(d===y)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(d)for(l=0;l<2;l++)switch(c=o[l],d){case y:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case v:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var f=r.range;if(f[0]f[1])return void(t.enabled=!1)}else if(o[0]>f[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":337,"./constants":308}],306:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function y(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*x)||T)for(r=0;rI&&FC&&(C=F);f/=(C-O)/(2*P),O=s.l2r(O),C=s.l2r(C),s.range=s._input.range=L=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function H(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:d.background,stroke:d.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function B(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function V(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){P&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),P=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,C)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function G(e,t,r,n,i){for(var o,l,s,c,u=!1,d={},f={},p=(i||{}).xaHash,h=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(V(a),2!==e||ve||Ue(),ye)o.indexOf("select")>-1&&L(r,a,J,K,t.id,Ce),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&ve){var l=m?I:P,c="s"===m||"w"===v?0:1,d=l._name+".range["+c+"]",f=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",y="middle";if(l.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===l.side&&(h="right")):"e"===v&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(be).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(f),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:y}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,d,t)}))}}}function Ne(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Le="",Te.r=Te.l,Te.t=Te.b,De.attr("d","M0,0Z")}if(Te.l=Math.min(_e,n),Te.r=Math.max(_e,n),Te.t=Math.min(we,a),Te.b=Math.max(we,a),re.isSubplotConstrained)i>C||o>C?(Le="xy",i/ee>o/te?(o=i*te/ee,we>a?Te.t=we-o:Te.b=we+o):(i=o*ee/te,_e>n?Te.l=_e-i:Te.r=_e+i),De.attr("d",q(Te))):l();else if(ne.isSubplotConstrained)if(i>C||o>C){Le="xy";var s=Math.min(Te.l/ee,(te-Te.b)/te),c=Math.max(Te.r/ee,(te-Te.t)/te);Te.l=s*ee,Te.r=c*ee,Te.b=(1-s)*te,Te.t=(1-c)*te,De.attr("d",q(Te))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;um[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":254,"fast-isnumeric":26}],318:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,l=n(e);r("tickprefix")&&r("showtickprefix",l),r("ticksuffix",o)&&r("showticksuffix",l)}},{"./show_dflt":321}],319:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":228}],320:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,d=i.ensureNumber,f=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,m=p.BADNUM,y=p.LOG_CLIP,v=p.ONEWEEK,g=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),T=e("./constants"),M=T.HOUR_PATTERN,k=T.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function L(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function S(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*y*Math.abs(n-a))}return m}function D(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===m){if(!l(t))return m;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function O(t,r,n){return c(t,r,n||e.calendar)}function C(t){return e._categories[Math.round(t)]}function P(t){if(L(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return m}function I(t){if(e._categoriesMap)return e._categoriesMap[t]}function N(e){var t=I(e);return void 0!==t?t:l(e)?+e:void 0}function z(e){return l(e)?+e:I(e)}function R(e,t,r){return n.round(r+t*e,2)}function F(e,t,r){return(e-r)/t}var E=function(t){return l(t)?R(t,e._m,e._b):m},j=function(t){return F(t,e._m,e._b)};if(e.rangebreaks){var H="y"===p;E=function(t){if(!l(t))return m;var r=e._rangebreaks.length;if(!r)return R(t,e._m,e._b);var n=H;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var d=e._B[o]||0;return isFinite(d)?R(t,e._m2,d):0},j=function(t){var r=e._rangebreaks.length;if(!r)return F(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return F(t,e._m2,e._B[n])}}e.c2l="log"===e.type?S:d,e.l2c="log"===e.type?A:d,e.l2p=E,e.p2l=j,e.c2p="log"===e.type?function(e,t){return E(S(e,t))}:E,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=d,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=d):"log"===e.type?(e.d2r=e.d2l=function(e,t){return S(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=d,e.c2r=S,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=d):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=D,e.c2d=e.c2r=e.l2d=e.l2r=O,e.d2p=e.r2p=function(t,r,n){return e.l2p(D(t,0,n))},e.p2d=e.p2r=function(e,t,r){return O(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,m,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=P,e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var r=z(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=d,e.r2l=z,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:d(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=C,e.d2r=e.d2l_noadd=N,e.r2c=function(t){var r=N(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=I,e.l2r=e.c2r=d,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return C(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:d(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var d=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),d="y"===p;if((d?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(f=!f),f&&e._rangebreaks.reverse();var h=f?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(d?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function y(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,d=!!t.xr1,f=!!t.yr1,p=[];if(d){var h=i.simpleMap(t.xr0,a.r2l),m=i.simpleMap(t.xr1,a.r2l),y=h[1]-h[0],v=m[1]-m[0];p[0]=(h[0]*(1-r)+r*m[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*v/y),a.range[0]=a.l2r(h[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(f){var g=i.simpleMap(t.yr0,s.r2l),x=i.simpleMap(t.yr1,s.r2l),b=g[1]-g[0],_=x[1]-x[0];p[1]=(g[1]*(1-r)+r*x[1]-g[1])/(g[0]-g[1])*u,p[3]=u*(1-r+r*_/b),s.range[0]=a.l2r(g[0]*(1-r)+r*x[0]),s.range[1]=s.l2r(g[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=d?c/p[2]:1,T=f?u/p[3]:1,M=d?p[0]:0,k=f?p[1]:0,A=d?p[0]/p[2]*c:0,L=f?p[1]/p[3]*u:0,S=a._offset-A,D=s._offset-L;n.clipRect.call(o.setTranslate,M,k).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,S,D).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}l.redrawComponents(e)}},{"../../components/drawing":134,"../../lib":254,"../../registry":337,"./axes":301,"@plotly/d3":18}],326:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.type="linear");var u=s+"calendar",d=c[u],f={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&s==={h:"x",v:"y"}[c.orientation||"v"]&&(f.noMultiCategory=!0);if(f.autotypenumbers=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],d=0;d=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){b.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},b.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function k(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&N.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&N.length>15&&0===s.shapes.length&&0===s.images.length,b.linkSubplots(f,s,d,n),b.cleanPlot(f,s,d,n);var j=!(!n._has||!n._has("gl2d")),H=!(!s._has||!s._has("gl2d")),B=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||H;B&&!Y?n._bgLayer.remove():Y&&!B&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){var d=1-2*l;n=Math.round(d*n),a=Math.round(d*a)}}var f=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-a)>1;(m||h)&&(h&&(r.width=n),m&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,d=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var f in c.length||c.push(d),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),d.finalizeSubplots(e,t)),t._subplots)t._subplots[f].sort(u.subplotSort);for(i=0;i1&&(r.l/=v,r.r/=v)}if(p){var g=(r.t+r.b)/p;g>1&&(r.t/=g,r.b/=g)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:x,size:r.l+y},r:{val:_,size:r.r+y},b:{val:T,size:r.b+y},t:{val:w,size:r.t+y}},m[t]=1}else delete h[t],delete m[t];if(!n._replotting)return b.doAutoMargin(e)}},b.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),O(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,d=i.r,f=i.t,h=i.b,m=t._pushmargin,y=t._pushmarginIds,v=t.minreducedwidth,g=t.minreducedheight;if(!1!==t.margin.autoexpand){for(var x in m)y[x]||delete m[x];for(var _ in m.base={l:{val:0,size:c},r:{val:1,size:d},t:{val:1,size:f},b:{val:0,size:h}},m){var w=m[_].l||{},T=m[_].b||{},M=w.val,k=w.size,A=T.val,L=T.size;for(var S in m){if(o(k)&&m[S].r){var D=m[S].r.val,C=m[S].r.size;if(D>M){var P=(k*D+(C-r)*M)/(D-M),I=(C*(1-M)+(k-r)*(1-D))/(D-M);P+I>c+d&&(c=P,d=I)}}if(o(L)&&m[S].t){var N=m[S].t.val,z=m[S].t.size;if(N>A){var R=(L*N+(z-n)*A)/(N-A),F=(z*(1-A)+(L-n)*(1-N))/(N-A);R+F>h+f&&(h=R,f=F)}}}}}var E=u.constrain(r-i.l-i.r,2,v),j=u.constrain(n-i.t-i.b,2,g),H=Math.max(0,r-E),B=Math.max(0,n-j);if(H){var Y=(c+d)/H;Y>1&&(c/=Y,d/=Y)}if(B){var V=(h+f)/B;V>1&&(h/=V,f/=V)}if(a.l=Math.round(c),a.r=Math.round(d),a.t=Math.round(f),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&b.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}b.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},b.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&b.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var d={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(d.layout=c(l),a)){var f=l._size;d.layout.computed={margin:{b:f.b,l:f.l,r:f.r,t:f.t}}}return s&&(d.frames=c(s)),i&&(d.config=c(e._context,!0)),"object"===n?d:JSON.stringify(d)},b.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:f,y:f}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(N(o,c,d),a=0;a0){for(var n=[],a=0;a-1&&(d[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":112,"../components/drawing":134,"../constants/xmlns_namespaces":235,"../lib":254,"@plotly/d3":18}],346:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rd+c||!n(u))}for(var p=0;pi))return t}return void 0!==r?r:e.dflt},r.coerceColor=function(e,t,r){return a(t).isValid()?t:void 0!==r?r:e.dflt},r.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},r.getValue=function(e,t){var r;return Array.isArray(e)?t0?t+=r:u<0&&(t-=r)}return t}function N(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,_+(a-t)/(a-r)-1)}var z=e[d+"a"],R=e[f+"a"];m=Math.abs(z.r2c(z.range[1])-z.r2c(z.range[0]));var F=n.getDistanceFunction(a,p,h,(function(e){return(p(e)+h(e))/2}));if(n.getClosest(y,F,e),!1!==e.index&&y[e.index].p!==c){M||(D=function(e){return Math.min(k(e),e.p-g.bargroupwidth/2)},O=function(e){return Math.max(A(e),e.p+g.bargroupwidth/2)});var E=y[e.index],j=v.base?E.b+E.s:E.s;e[f+"0"]=e[f+"1"]=R.c2p(E[f],!0),e[f+"LabelVal"]=j;var H=g.extents[g.extents.round(E.p)];e[d+"0"]=z.c2p(x?D(E):H[0],!0),e[d+"1"]=z.c2p(x?O(E):H[1],!0);var B=void 0!==E.orig_p;return e[d+"LabelVal"]=B?E.orig_p:E.p,e.labelLabel=s(z,e[d+"LabelVal"],v[d+"hoverformat"]),e.valueLabel=s(R,e[f+"LabelVal"],v[f+"hoverformat"]),e.baseLabel=s(R,E.b,v[f+"hoverformat"]),e.spikeDistance=(function(e){var t=u,r=e.b,a=I(e);return n.inbox(r-t,a-t,w+(a-t)/(a-r)-1)}(E)+function(e){return C(k(e),A(e),w)}(E))/2,e[d+"Spike"]=z.c2p(E.p,!0),o(E,v,e),e.hovertemplate=v.hovertemplate,e}}function d(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=l(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,n,i){var o=u(e,t,r,n,i);if(o){var l=o.cd,s=l[0].trace,c=l[o.index];return o.color=d(s,c),a.getComponentMethod("errorbars","hoverInfo")(c,s,o),[o]}},hoverOnBars:u,getTraceColor:d}},{"../../components/color":112,"../../components/fx":152,"../../constants/numerical":234,"../../lib":254,"../../plots/cartesian/axes":301,"../../registry":337,"./helpers":353}],355:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc").crossTraceCalc,colorbar:e("../scatter/marker_colorbar"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover").hoverPoints,eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"bar",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},{"../../plots/cartesian":313,"../scatter/marker_colorbar":456,"./arrays_to_calcdata":346,"./attributes":347,"./calc":348,"./cross_trace_calc":350,"./defaults":351,"./event_data":352,"./hover":354,"./layout_attributes":356,"./layout_defaults":357,"./plot":358,"./select":359,"./style":361}],356:[function(e,t,r){"use strict";t.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],357:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/cartesian/axes"),i=e("../../lib"),o=e("./layout_attributes");t.exports=function(e,t,r){function l(r,n){return i.coerce(e,t,o,r,n)}for(var s=!1,c=!1,u=!1,d={},f=l("barmode"),p=0;p0}function L(e){return"auto"===e?0:e}function S(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),a=Math.abs(Math.cos(r));return{x:e.width*a+e.height*n,y:e.width*n+e.height*a}}function D(e,t,r,n,a,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,c=i.anchor||"end",u="end"===c,d="start"===c,f=((i.leftToRight||0)+1)/2,p=1-f,h=a.width,m=a.height,y=Math.abs(t-e),v=Math.abs(n-r),g=y>2*_&&v>2*_?_:0;y-=2*g,v-=2*g;var x=L(s);"auto"!==s||h<=y&&m<=v||!(h>y||m>v)||(h>v||m>y)&&h.01?U:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?U(e):e>t?Math.ceil(e):Math.floor(e)};E=q(E,j,z),j=q(j,E,z),H=q(H,B,!z),B=q(B,H,!z)}var G=k(i.ensureSingle(P,"path"),C,y,v);if(G.style("vector-effect","non-scaling-stroke").attr("d",isNaN((j-E)*(B-H))||Y&&e._context.staticPlot?"M0,0Z":"M"+E+","+H+"V"+B+"H"+j+"V"+H+"Z").call(s.setClipUrl,t.layerClipId,e),!C.uniformtext.mode&&R){var Z=s.makePointStyleFns(d);s.singlePointStyle(c,G,d,Z,e)}!function(e,t,r,n,a,l,c,d,p,y,v){var w,T=t.xaxis,A=t.yaxis,O=e._fullLayout;function C(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(o.convertToTspans,e)}var P=n[0].trace,I="h"===P.orientation,N=function(e,t,r,n,a){var o,l=t[0].trace;o=l.texttemplate?function(e,t,r,n,a){var o=t[0].trace,l=i.castOption(o,r,"texttemplate");if(!l)return"";var s,c,d,f,p="histogram"===o.type,h="waterfall"===o.type,m="funnel"===o.type,y="h"===o.orientation;y?(s="y",c=a,d="x",f=n):(s="x",c=n,d="y",f=a);function v(e){return u(f,f.c2l(e),!0).text}var g=t[r],x={};x.label=g.p,x.labelLabel=x[s+"Label"]=(_=g.p,u(c,c.c2l(_),!0).text);var _;var w=i.castOption(o,g.i,"text");(0===w||w)&&(x.text=w);x.value=g.s,x.valueLabel=x[d+"Label"]=v(g.s);var T={};b(T,o,g.i),(p||void 0===T.x)&&(T.x=y?x.value:x.label);(p||void 0===T.y)&&(T.y=y?x.label:x.value);(p||void 0===T.xLabel)&&(T.xLabel=y?x.valueLabel:x.labelLabel);(p||void 0===T.yLabel)&&(T.yLabel=y?x.labelLabel:x.valueLabel);h&&(x.delta=+g.rawS||g.s,x.deltaLabel=v(x.delta),x.final=g.v,x.finalLabel=v(x.final),x.initial=x.final-x.delta,x.initialLabel=v(x.initial));m&&(x.value=g.s,x.valueLabel=v(x.value),x.percentInitial=g.begR,x.percentInitialLabel=i.formatPercent(g.begR),x.percentPrevious=g.difR,x.percentPreviousLabel=i.formatPercent(g.difR),x.percentTotal=g.sumR,x.percenTotalLabel=i.formatPercent(g.sumR));var M=i.castOption(o,g.i,"customdata");M&&(x.customdata=M);return i.texttemplateString(l,x,e._d3locale,T,x,o._meta||{})}(e,t,r,n,a):l.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,l="waterfall"===a.type,s="funnel"===a.type;function c(e){return u(o?r:n,+e,!0).text}var d,f=a.textinfo,p=e[t],h=f.split("+"),m=[],y=function(e){return-1!==h.indexOf(e)};y("label")&&m.push((v=e[t].p,u(o?n:r,v,!0).text));var v;y("text")&&(0===(d=i.castOption(a,p.i,"text"))||d)&&m.push(d);if(l){var g=+p.rawS||p.s,x=p.v,b=x-g;y("initial")&&m.push(c(b)),y("delta")&&m.push(c(g)),y("final")&&m.push(c(x))}if(s){y("value")&&m.push(c(p.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(d=i.formatPercent(p.begR),w&&(d+=" of initial"),m.push(d)),y("percent previous")&&(d=i.formatPercent(p.difR),w&&(d+=" of previous"),m.push(d)),y("percent total")&&(d=i.formatPercent(p.sumR),w&&(d+=" of total"),m.push(d))}return m.join("
")}(t,r,n,a):m.getValue(l.text,r);return m.coerceString(g,o)}(O,n,a,T,A);w=function(e,t){var r=m.getValue(e.textposition,t);return m.coerceEnumerated(x,r)}(P,a);var z="stack"===y.mode||"relative"===y.mode,R=n[a],F=!z||R._outmost;if(!N||"none"===w||(R.isBlank||l===c||d===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var E=O.font,j=h.getBarColor(n[a],P),H=h.getInsideTextFont(P,a,E,j),B=h.getOutsideTextFont(P,a,E),Y=r.datum();I?"log"===T.type&&Y.s0<=0&&(l=T.range[0]=q*(W/G):W>=G*(X/q);q>0&&G>0&&(J||K||Q)?w="inside":(w="outside",V.remove(),V=null)}else w="inside";if(!V){Z=i.ensureUniformFontSize(e,"outside"===w?B:H);var $=(V=C(r,N,Z)).attr("transform");if(V.attr("transform",""),U=s.bBox(V.node()),q=U.width,G=U.height,V.attr("transform",$),q<=0||G<=0)return void V.remove()}var ee,te,re=P.textangle;"outside"===w?(te="both"===P.constraintext||"outside"===P.constraintext,ee=function(e,t,r,n,a,i){var o,l=!!i.isHorizontal,s=!!i.constrained,c=i.angle||0,u=a.width,d=a.height,f=Math.abs(t-e),p=Math.abs(n-r);o=l?p>2*_?_:0:f>2*_?_:0;var h=1;s&&(h=l?Math.min(1,p/d):Math.min(1,f/u));var m=L(c),y=S(a,m),v=(l?y.x:y.y)/2,g=(a.left+a.right)/2,x=(a.top+a.bottom)/2,b=(e+t)/2,w=(r+n)/2,T=0,k=0,A=l?M(t,e):M(r,n);l?(b=t-A*o,T=A*v):(w=n+A*o,k=-A*v);return{textX:g,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:k,scale:h,rotate:m}}(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re})):(te="both"===P.constraintext||"inside"===P.constraintext,ee=D(l,c,d,p,U,{isHorizontal:I,constrained:te,angle:re,anchor:P.insidetextanchor}));ee.fontSize=Z.size,f("histogram"===P.type?"bar":P.type,ee,O),R.transform=ee;var ne=k(V,O,y,v);i.setTransormAndDisplay(ne,ee)}(e,t,P,r,p,E,j,H,B,y,v),t.layerClipId&&s.hideOutsideRangePoint(c,P.select("text"),w,O,d.xcalendar,d.ycalendar)}));var H=!1===d.cliponaxis;s.setClipUrl(c,H?null:t.layerClipId,e)}));c.getComponentMethod("errorbars","plot")(e,P,t,y)},toMoveInsideBar:D}},{"../../components/color":112,"../../components/drawing":134,"../../components/fx/helpers":148,"../../lib":254,"../../lib/svg_text_utils":277,"../../plots/cartesian/axes":301,"../../registry":337,"./attributes":347,"./constants":349,"./helpers":353,"./style":361,"./uniform_text":363,"@plotly/d3":18,"fast-isnumeric":26}],359:[function(e,t,r){"use strict";function n(e,t,r,n,a){var i=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),l=r.c2p(n?e.p0:e.s0,!0),s=r.c2p(n?e.p1:e.s1,!0);return a?[(i+o)/2,(l+s)/2]:n?[o,(l+s)/2]:[(i+o)/2,s]}t.exports=function(e,t){var r,a=e.cd,i=e.xaxis,o=e.yaxis,l=a[0].trace,s="funnel"===l.type,c="h"===l.orientation,u=[];if(!1===t)for(r=0;r1||0===a.bargap&&0===a.bargroupgap&&!e[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){h(n.select(this),t[0].trace,e)})),l.getComponentMethod("errorbars","style")(t)},styleTextPoints:m,styleOnSelect:function(e,t,r){var a=t[0].trace;a.selectedpoints?function(e,t,r){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,r){e.each((function(e){var a,l=n.select(this);if(e.selected){a=o.ensureUniformFontSize(r,y(l,e,t,r));var s=t.selected.textfont&&t.selected.textfont.color;s&&(a.color=s),i.font(l,a)}else i.selectedTextStyle(l,t)}))}(e.selectAll("text"),t,r)}(r,a,e):(h(r,a,e),l.getComponentMethod("errorbars","style")(r))},getInsideTextFont:g,getOutsideTextFont:x,getBarColor:_,resizeText:s}},{"../../components/color":112,"../../components/drawing":134,"../../lib":254,"../../registry":337,"./attributes":347,"./helpers":353,"./uniform_text":363,"@plotly/d3":18}],362:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("../../lib").coercePattern;t.exports=function(e,t,r,l,s){var c=r("marker.color",l),u=a(e,"marker");u&&i(e,t,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),a(e,"marker.line")&&i(e,t,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":112,"../../components/colorscale/defaults":122,"../../components/colorscale/helpers":123,"../../lib":254}],363:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o1,b=1-d[e+"gap"],_=1-d[e+"groupgap"];for(l=0;l0){var U=S.pointpos,q=S.jitter,G=S.marker.size/2,Z=0;U+q>=0&&((Z=Y*(U+q))>A?(V=!0,H=G,E=Z):Z>R&&(H=G,E=A)),Z<=A&&(E=A);var X=0;U-q<=0&&((X=-Y*(U-q))>L?(V=!0,B=G,j=X):X>F&&(B=G,j=L)),X<=L&&(j=L)}else E=A,j=L;var W=new Array(c.length);for(s=0;se.lo&&(x.so=!0)}return i}));f.enter().append("path").classed("point",!0),f.exit().remove(),f.call(i.translatePoints,o,l)}function s(e,t,r,i){var o,l,s=t.val,c=t.pos,u=!!c.rangebreaks,d=i.bPos,f=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=e.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(e){var t=c.c2l(e.pos+d,!0),a=c.l2p(t-o)+f,i=c.l2p(t+l)+f,h=u?(a+i)/2:c.l2p(t)+f,m=s.c2p(e.mean,!0),y=s.c2p(e.mean-e.sd,!0),v=s.c2p(e.mean+e.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+a+"V"+i+("sd"===p?"m0,0L"+y+","+h+"L"+m+","+a+"L"+v+","+h+"Z":"")):n.select(this).attr("d","M"+a+","+m+"H"+i+("sd"===p?"m0,0L"+h+","+y+"L"+a+","+m+"L"+h+","+v+"Z":""))}))}t.exports={plot:function(e,t,r,i){var c=t.xaxis,u=t.yaxis;a.makeTraceGroups(i,r,"trace boxes").each((function(e){var t,r,a=n.select(this),i=e[0],d=i.t,f=i.trace;(d.wdPos=d.bdPos*f.whiskerwidth,!0!==f.visible||d.empty)?a.remove():("h"===f.orientation?(t=u,r=c):(t=c,r=u),o(a,{pos:t,val:r},f,d),l(a,{x:c,y:u},f,d),s(a,{pos:t,val:r},f,d))}))},plotBoxAndWhiskers:o,plotPoints:l,plotBoxMean:s}},{"../../components/drawing":134,"../../lib":254,"@plotly/d3":18}],369:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/color"),i=e("../../components/drawing");t.exports={style:function(e,t,r){var o=r||n.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var r=n.select(this),o=t[0].trace,l=o.line.width;function s(e,t,r,n){e.style("stroke-width",t+"px").call(a.stroke,r).call(a.fill,n)}var c=r.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=n.select(this),r=o[e.dir];s(t,r.line.width,r.line.color,r.fillcolor),t.style("opacity",o.selectedpoints&&!e.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,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}},{"../../components/color":112,"../../components/drawing":134,"@plotly/d3":18}],370:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../ohlc/attributes"),o=e("../box/attributes");function l(e){return{line:{color:n({},o.line.color,{dflt:e}),width:o.line.width,editType:"style"},fillcolor:o.fillcolor,editType:"style"}}t.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:n({},o.line.width,{}),editType:"style"},increasing:l(i.increasing.line.color.dflt),decreasing:l(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,whiskerwidth:n({},o.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel}},{"../../lib":254,"../../plots/cartesian/axis_format_attributes":304,"../box/attributes":364,"../ohlc/attributes":416}],371:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("../../plots/cartesian/align_period"),o=e("../ohlc/calc").calcCommon;function l(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var r=e._fullLayout,s=a.getFromId(e,t.xaxis),c=a.getFromId(e,t.yaxis),u=s.makeCalcdata(t,"x"),d=i(t,s,"x",u).vals,f=o(e,t,u,d,c,l);return f.length?(n.extendFlat(f[0].t,{num:r._numBoxes,dPos:n.distinctVals(d).minDiff/2,posLetter:"x",valLetter:"y"}),r._numBoxes++,f):[{t:{empty:!0}}]}},{"../../lib":254,"../../plots/cartesian/align_period":298,"../../plots/cartesian/axes":301,"../ohlc/calc":417}],372:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../components/color"),i=e("../ohlc/ohlc_defaults"),o=e("../scatter/period_defaults"),l=e("./attributes");function s(e,t,r,n){var i=r(n+".line.color");r(n+".line.width",t.line.width),r(n+".fillcolor",a.addOpacity(i,.5))}t.exports=function(e,t,r,a){function c(r,a){return n.coerce(e,t,l,r,a)}i(e,t,c,a)?(o(e,t,a,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),s(e,t,c,"increasing"),s(e,t,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),a._requestRangeslider[t.xaxis]=!0):t.visible=!1}},{"../../components/color":112,"../../lib":254,"../ohlc/ohlc_defaults":421,"../scatter/period_defaults":458,"./attributes":370}],373:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"candlestick",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:e("./attributes"),layoutAttributes:e("../box/layout_attributes"),supplyLayoutDefaults:e("../box/layout_defaults").supplyLayoutDefaults,crossTraceCalc:e("../box/cross_trace_calc").crossTraceCalc,supplyDefaults:e("./defaults"),calc:e("./calc"),plot:e("../box/plot").plot,layerName:"boxlayer",style:e("../box/style").style,hoverPoints:e("../ohlc/hover").hoverPoints,selectPoints:e("../ohlc/select")}},{"../../plots/cartesian":313,"../box/cross_trace_calc":365,"../box/layout_attributes":366,"../box/layout_defaults":367,"../box/plot":368,"../box/style":369,"../ohlc/hover":419,"../ohlc/select":423,"./attributes":370,"./calc":371,"./defaults":372}],374:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;r"),s.color=function(e,t){var r=e.marker,a=t.mc||r.color,i=t.mlc||r.line.color,o=t.mlw||r.line.width;if(n(a))return a;if(n(i)&&o)return i}(u,f),[s]}}},{"../../components/color":112,"../../lib":254,"../bar/hover":354}],382:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":313,"../bar/select":359,"./attributes":375,"./calc":376,"./cross_trace_calc":378,"./defaults":379,"./event_data":380,"./hover":381,"./layout_attributes":383,"./layout_defaults":384,"./plot":385,"./style":386}],383:[function(e,t,r){"use strict";t.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],384:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l path").each((function(e){if(!e.isBlank){var t=l.marker;n.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(a.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(i.fill,l.connector.fillcolor)})),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":112,"../../components/drawing":134,"../../constants/interactions":233,"../bar/style":361,"../bar/uniform_text":363,"@plotly/d3":18}],387:[function(e,t,r){"use strict";var n=e("../pie/attributes"),a=e("../../plots/attributes"),i=e("../../plots/domain").attributes,o=e("../../plots/template_attributes").hovertemplateAttrs,l=e("../../plots/template_attributes").texttemplateAttrs,s=e("../../lib/extend").extendFlat;t.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:s({},n.marker.line.color,{dflt:null}),width:s({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:s({},n.scalegroup,{}),textinfo:s({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:l({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:s({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:s({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":248,"../../plots/attributes":297,"../../plots/domain":328,"../../plots/template_attributes":336,"../pie/attributes":425}],388:[function(e,t,r){"use strict";var n=e("../../plots/plots");r.name="funnelarea",r.plot=function(e,t,a,i){n.plotBasePlot(r.name,e,t,a,i)},r.clean=function(e,t,a,i){n.cleanBasePlot(r.name,e,t,a,i)}},{"../../plots/plots":335}],389:[function(e,t,r){"use strict";var n=e("../pie/calc");t.exports={calc:function(e,t){return n.calc(e,t)},crossTraceCalc:function(e){n.crossTraceCalc(e,{type:"funnelarea"})}}},{"../pie/calc":427}],390:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./attributes"),i=e("../../plots/domain").defaults,o=e("../bar/defaults").handleText,l=e("../pie/defaults").handleLabelsAndValues;t.exports=function(e,t,r,s){function c(r,i){return n.coerce(e,t,a,r,i)}var u=c("labels"),d=c("values"),f=l(u,d),p=f.len;if(t._hasLabels=f.hasLabels,t._hasValues=f.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),p){t._length=p,c("marker.line.width")&&c("marker.line.color",s.paper_bgcolor),c("marker.colors"),c("scalegroup");var h,m=c("text"),y=c("texttemplate");if(y||(h=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),y||h&&"none"!==h){var v=c("textposition");o(e,t,s,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}i(t,s,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",s.font)),c("aspectratio"),c("baseratio")}else t.visible=!1}},{"../../lib":254,"../../plots/domain":328,"../bar/defaults":351,"../pie/defaults":428,"./attributes":387}],391:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:e("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./calc").crossTraceCalc,plot:e("./plot"),style:e("./style"),styleOne:e("../pie/style_one"),meta:{}}},{"../pie/style_one":436,"./attributes":387,"./base_plot":388,"./calc":389,"./defaults":390,"./layout_attributes":392,"./layout_defaults":393,"./plot":394,"./style":395}],392:[function(e,t,r){"use strict";var n=e("../pie/layout_attributes").hiddenlabels;t.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":432}],393:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}r("hiddenlabels"),r("funnelareacolorway",t.colorway),r("extendfunnelareacolors")}},{"../../lib":254,"./layout_attributes":392}],394:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../components/drawing"),i=e("../../lib"),o=i.strScale,l=i.strTranslate,s=e("../../lib/svg_text_utils"),c=e("../bar/plot").toMoveInsideBar,u=e("../bar/uniform_text"),d=u.recordMinTextSize,f=u.clearMinTextSize,p=e("../pie/helpers"),h=e("../pie/plot"),m=h.attachFxHandlers,y=h.determineInsideTextFont,v=h.layoutAreas,g=h.prerenderTitles,x=h.positionTitleOutside,b=h.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}t.exports=function(e,t){var r=e._context.staticPlot,u=e._fullLayout;f("funnelarea",u),g(t,e),v(t,u._size),i.makeTraceGroups(u._funnelarealayer,t,"trace").each((function(t){var f=n.select(this),h=t[0],v=h.trace;!function(e){if(!e.length)return;var t=e[0],r=t.trace,n=r.aspectratio,a=r.baseratio;a>.999&&(a=.999);var i,o=Math.pow(a,2),l=t.vTotal,s=l,c=l*o/(1-o)/l;function u(){var e,t={x:e=Math.sqrt(c),y:-e};return[t.x,t.y]}var d,f,p=[];for(p.push(u()),d=e.length-1;d>-1;d--)if(!(f=e[d]).hidden){var h=f.v/s;c+=h,p.push(u())}var m=1/0,y=-1/0;for(d=0;d-1;d--)if(!(f=e[d]).hidden){var k=p[M+=1][0],A=p[M][1];f.TL=[-k,A],f.TR=[k,A],f.BL=w,f.BR=T,f.pxmid=(L=f.TR,S=f.BR,[.5*(L[0]+S[0]),.5*(L[1]+S[1])]),w=f.TL,T=f.TR}var L,S}(t),f.each((function(){var f=n.select(this).selectAll("g.slice").data(t);f.enter().append("g").classed("slice",!0),f.exit().remove(),f.each((function(o,l){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=v.index;var f=h.cx,g=h.cy,x=n.select(this),w=x.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),x.call(m,e,t);var T="M"+(f+o.TR[0])+","+(g+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",T),b(e,o,h);var M=p.castOption(v.textposition,o.pts),k=x.selectAll("g.slicetext").data(o.text&&"none"!==M?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each((function(){var r=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=i.ensureUniformFontSize(e,y(v,o,u.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(a.font,p).call(s.convertToTspans,e);var h,m,x,b=a.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+g,w=Math.max(o.TL[1],o.TR[1])+g;m=Math.max(o.TL[0],o.BL[0])+f,x=Math.min(o.TR[0],o.BR[0])+f,(h=c(m,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,d(v.type,h,u),t[l].transform=h,i.setTransormAndDisplay(r,h)}))}}));var g=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);g.enter().append("g").classed("titletext",!0),g.exit().remove(),g.each((function(){var t=i.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),r=v.title.text;v._meta&&(r=i.templateString(r,v._meta)),t.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(a.font,v.title.font).call(s.convertToTspans,e);var c=x(h,u._size);t.attr("transform",l(c.x,c.y)+o(Math.min(1,c.scale))+l(c.tx,c.ty))}))}))}))}},{"../../components/drawing":134,"../../lib":254,"../../lib/svg_text_utils":277,"../bar/plot":358,"../bar/uniform_text":363,"../pie/helpers":430,"../pie/plot":434,"@plotly/d3":18}],395:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../pie/style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":363,"../pie/style_one":436,"@plotly/d3":18}],396:[function(e,t,r){"use strict";var n=e("../bar/attributes"),a=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,i=e("../../plots/template_attributes").hovertemplateAttrs,o=e("../../plots/template_attributes").texttemplateAttrs,l=e("../../plots/font_attributes"),s=e("./bin_attributes"),c=e("./constants"),u=e("../../lib/extend").extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:a("x"),yhoverformat:a("y"),text:u({},n.text,{}),hovertext:u({},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:s("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:s("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({},{keys:c.eventDataKeys}),texttemplate:o({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:u({},n.textposition,{arrayOk:!1}),textfont:l({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:l({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:l({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:n.insidetextanchor,textangle:n.textangle,cliponaxis:n.cliponaxis,constraintext:n.constraintext,marker:n.marker,offsetgroup:n.offsetgroup,alignmentgroup:n.alignmentgroup,selected:n.selected,unselected:n.unselected,_deprecated:{bardir:n._deprecated.bardir}}},{"../../lib/extend":248,"../../plots/cartesian/axis_format_attributes":304,"../../plots/font_attributes":329,"../../plots/template_attributes":336,"../bar/attributes":347,"./bin_attributes":398,"./constants":402}],397:[function(e,t,r){"use strict";t.exports=function(e,t){for(var r=e.length,n=0,a=0;ai){var o=i-r[e];return r[e]=i,o}}return 0},max:function(e,t,r,a){var i=a[t];if(n(i)){if(i=Number(i),!n(r[e]))return r[e]=i,i;if(r[e]c?e>o?e>1.1*a?a:e>1.1*i?i:o:e>l?l:e>s?s:c:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,n,i,l){if(n&&e>o){var s=h(t,i,l),c=h(r,i,l),u=e===a?0:1;return s[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function h(e,t,r){var n=t.c2d(e,a,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}t.exports=function(e,t,r,n,i){var l,s,c=-1.1*t,f=-.1*t,p=e-f,h=r[0],m=r[1],y=Math.min(d(h+f,h+p,n,i),d(m+f,m+p,n,i)),v=Math.min(d(h+c,h+f,n,i),d(m+c,m+f,n,i));if(y>v&&vo){var g=l===a?1:6,x=l===a?"M12":"M1";return function(t,r){var o=n.c2d(t,a,i),l=o.indexOf("-",g);l>0&&(o=o.substr(0,l));var c=n.d2c(o,0,i);if(cr.r2l(E)&&(H=o.tickIncrement(H,b.size,!0,p)),N.start=r.l2r(H),F||a.nestedProperty(t,v+".start").set(N.start)}var B=b.end,Y=r.r2l(I.end),V=void 0!==Y;if((b.endFound||V)&&Y!==r.r2l(B)){var U=V?Y:a.aggNums(Math.max,null,h);N.end=r.l2r(U),V||a.nestedProperty(t,v+".start").set(N.end)}var q="autobin"+l;return!1===t._input[q]&&(t._input[v]=a.extendFlat({},t[v]||{}),delete t._input[q],delete t[q]),[N,h]}t.exports={calc:function(e,t){var r,i,p,h,m=[],y=[],v="h"===t.orientation,g=o.getFromId(e,v?t.yaxis:t.xaxis),x=v?"y":"x",b={x:"y",y:"x"}[x],_=t[x+"calendar"],w=t.cumulative,T=f(e,t,g,x),M=T[0],k=T[1],A="string"==typeof M.size,L=[],S=A?L:M,D=[],O=[],C=[],P=0,I=t.histnorm,N=t.histfunc,z=-1!==I.indexOf("density");w.enabled&&z&&(I=I.replace(/ ?density$/,""),z=!1);var R,F="max"===N||"min"===N?null:0,E=s.count,j=c[I],H=!1,B=function(e){return g.r2c(e,0,_)};for(a.isArrayOrTypedArray(t[b])&&"count"!==N&&(R=t[b],H="avg"===N,E=s[N]),r=B(M.start),p=B(M.end)+(r-o.tickIncrement(r,M.size,!1,_))/1e6;r=0&&h=0;n--)l(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(y,w.direction,w.currentbin);var K=Math.min(m.length,y.length),Q=[],$=0,ee=K-1;for(r=0;r=$;r--)if(y[r]){ee=r;break}for(r=$;r<=ee;r++)if(n(m[r])&&n(y[r])){var te={p:m[r],s:y[r],b:0};w.enabled||(te.pts=C[r],G?te.ph0=te.ph1=C[r].length?k[C[r][0]]:m[r]:(t._computePh=!0,te.ph0=U(L[r]),te.ph1=U(L[r+1],!0))),Q.push(te)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,M.size,!1,_)-Q[0].p),l(Q,t),a.isArrayOrTypedArray(t.selectedpoints)&&a.tagSelected(Q,t,W),Q},calcAllAutoBins:f}},{"../../lib":254,"../../plots/cartesian/axes":301,"../../registry":337,"../bar/arrays_to_calcdata":346,"./average":397,"./bin_functions":399,"./bin_label_vals":400,"./norm_functions":408,"fast-isnumeric":26}],402:[function(e,t,r){"use strict";t.exports={eventDataKeys:["binNumber"]}},{}],403:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axis_ids"),i=e("../../registry").traceIs,o=e("../bar/defaults").handleGroupingDefaults,l=n.nestedProperty,s=e("../../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"];t.exports=function(e,t){var r,d,f,p,h,m,y,v=t._histogramBinOpts={},g=[],x={},b=[];function _(e,t){return n.coerce(r._input,r,r._module.attributes,e,t)}function w(e){return"v"===e.orientation?"x":"y"}function T(e,r,i){var o=e.uid+"__"+i;r||(r=o);var l=function(e,r){return a.getFromTrace({_fullLayout:t},e,r).type}(e,i),s=e[i+"calendar"]||"",c=v[r],u=!0;c&&(l===c.axType&&s===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(i)):(r=o,l!==c.axType&&n.warn(["Attempted to group the bins of trace",e.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",e.index,"set with a",s,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[e],dirs:[i],axType:l,calendar:e[i+"calendar"]||""}),e["_"+i+"bingroup"]=r}for(h=0;h0}function T(e){e.each((function(e){g.stroke(n.select(this),e.line.color)})).each((function(e){g.fill(n.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function M(e,t,r){var n=e._fullLayout,a=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),i={type:"linear",_id:"x"+t._id},l={letter:"x",font:n.font,noHover:!0,noTickson:!0};function s(e,t){return o.coerce(a,i,v,e,t)}return m(a,i,s,l,n),y(a,i,s,l),i}function k(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function A(e,t,r,a){var i=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(i);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",e).call(p.convertToTspans,a).call(d.font,t),d.bBox(o.node())}function L(e,t,r,n,a,i){var l="_cache"+t;e[l]&&e[l].key===a||(e[l]={key:a,value:r});var s=o.aggNums(i,null,[e[l].value,n],2);return e[l].value=s,s}t.exports=function(e,t,r,m){var y,v=e._fullLayout;w(r)&&m&&(y=m()),o.makeTraceGroups(v._indicatorlayer,t,"trace").each((function(t){var m,S,D,O,C,P=t[0].trace,I=n.select(this),N=P._hasGauge,z=P._isAngular,R=P._isBullet,F=P.domain,E={w:v._size.w*(F.x[1]-F.x[0]),h:v._size.h*(F.y[1]-F.y[0]),l:v._size.l+v._size.w*F.x[0],r:v._size.r+v._size.w*(1-F.x[1]),t:v._size.t+v._size.h*(1-F.y[1]),b:v._size.b+v._size.h*F.y[0]},j=E.l+E.w/2,H=E.t+E.h/2,B=Math.min(E.w/2,E.h),Y=f.innerRadius*B,V=P.align||"center";if(S=H,N){if(z&&(m=j,S=H+B/2,D=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height);return[t/r,e,t]}(e,.9*Y)}),R){var U=f.bulletPadding,q=1-f.bulletNumberDomainSize+U;m=E.l+(q+(1-q)*b[V])*E.w,D=function(e){return k(e,(f.bulletNumberDomainSize-U)*E.w,E.h)}}}else m=E.l+b[V]*E.w,D=function(e){return k(e,E.w,E.h)};!function(e,t,r,a){var c,u,f,m=r[0].trace,y=a.numbersX,v=a.numbersY,T=m.align||"center",k=x[T],S=a.transitionOpts,D=a.onComplete,O=o.ensureSingle(t,"g","numbers"),C=[];m._hasNumber&&C.push("number");m._hasDelta&&(C.push("delta"),"left"===m.delta.position&&C.reverse());var P=O.selectAll("text").data(C);function I(t,r,n,a){if(!t.match("s")||n>=0==a>=0||r(n).slice(-1).match(_)||r(a).slice(-1).match(_))return r;var i=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=M(e,{tickformat:i});return function(e){return Math.abs(e)<1?h.tickText(o,e).text:r(e)}}P.enter().append("text"),P.attr("text-anchor",(function(){return k})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var N,z=m.mode+m.align;m._hasDelta&&(N=function(){var t=M(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),h.prepTicks(t);var a=function(e){return h.tickText(t,e).text},o=m.delta.suffix,l=m.delta.prefix,s=function(e){return m.delta.relative?e.relativeDelta:e.delta},c=function(e,t){return 0===e||"number"!=typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+l+t(e)+o},f=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=s(r[0]));var y=O.select("text.delta");function v(){y.text(c(s(r[0]),a)).call(g.fill,f(r[0])).call(p.convertToTspans,e)}return y.call(d.font,m.delta.font).call(g.fill,f({delta:m._deltaLastValue})),w(S)?y.transition().duration(S.duration).ease(S.easing).tween("text",(function(){var e=n.select(this),t=s(r[0]),o=m._deltaLastValue,l=I(m.delta.valueformat,a,o,t),u=i(o,t);return m._deltaLastValue=t,function(t){e.text(c(u(t),l)),e.call(g.fill,f({delta:u(t)}))}})).each("end",(function(){v(),D&&D()})).each("interrupt",(function(){v(),D&&D()})):v(),u=A(c(s(r[0]),a),m.delta.font,k,e),y}(),z+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,z+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=u);m._hasNumber&&(!function(){var t=M(e,{tickformat:m.number.valueformat},m._range);t.setScale(),h.prepTicks(t);var a=function(e){return h.tickText(t,e).text},o=m.number.suffix,l=m.number.prefix,s=O.select("text.number");function u(){var t="number"==typeof r[0].y?l+a(r[0].y)+o:"-";s.text(t).call(d.font,m.number.font).call(p.convertToTspans,e)}w(S)?s.transition().duration(S.duration).ease(S.easing).each("end",(function(){u(),D&&D()})).each("interrupt",(function(){u(),D&&D()})).attrTween("text",(function(){var e=n.select(this),t=i(r[0].lastY,r[0].y);m._lastValue=r[0].y;var s=I(m.number.valueformat,a,r[0].lastY,r[0].y);return function(r){e.text(l+s(t(r))+o)}})):u(),c=A(l+a(r[0].y)+o,m.number.font,k,e)}(),z+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c);if(m._hasDelta&&m._hasNumber){var R,F,E=[(c.left+c.right)/2,(c.top+c.bottom)/2],j=[(u.left+u.right)/2,(u.top+u.bottom)/2],H=.75*m.delta.font.size;"left"===m.delta.position&&(R=L(m,"deltaPos",0,-1*(c.width*b[m.align]+u.width*(1-b[m.align])+H),z,Math.min),F=E[1]-j[1],f={width:c.width+u.width+H,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=L(m,"deltaPos",0,c.width*(1-b[m.align])+u.width*b[m.align]+H,z,Math.max),F=E[1]-j[1],f={width:c.width+u.width+H,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,f={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),N.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&O.attr("transform",(function(){var e=a.numbersScaler(f);z+=e[2];var t,r=L(m,"numbersScale",1,e[0],z,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?v-r*f.bottom:v-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+t;var n=f[T];"center"===T&&(n=(f.left+f.right)/2);var i=y-r*n;return i=L(m,"numbersTranslate",0,i,z,Math.max),s(i,t)+l(r)}))}(e,I,t,{numbersX:m,numbersY:S,numbersScaler:D,transitionOpts:r,onComplete:y}),N&&(O={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},C={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var G=I.selectAll("g.angular").data(z?t:[]);G.exit().remove();var Z=I.selectAll("g.angularaxis").data(z?t:[]);Z.exit().remove(),z&&function(e,t,r,i){var o,l,d,f,p=r[0].trace,m=i.size,y=i.radius,v=i.innerRadius,g=i.gaugeBg,x=i.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+y/2],_=i.gauge,k=i.layer,A=i.transitionOpts,L=i.onComplete,S=Math.PI/2;function D(e){var t=p.gauge.axis.range[0],r=(e-t)/(p.gauge.axis.range[1]-t)*Math.PI-S;return r<-S?-S:r>S?S:r}function O(e){return n.svg.arc().innerRadius((v+y)/2-e/2*(y-v)).outerRadius((v+y)/2+e/2*(y-v)).startAngle(-S)}function C(e){e.attr("d",(function(e){return O(e.thickness).startAngle(D(e.range[0])).endAngle(D(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",s(b[0],b[1])),k.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),k.selectAll("g.xangularaxistick,path,text").remove(),(o=M(e,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},I={},N=h.makeLabelFns(o,0).labelStandoff;I.xFn=function(e){var t=P(e);return Math.cos(t)*N},I.yFn=function(e){var t=P(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(N+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*u)},I.anchorFn=function(e){var t=P(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},I.heightFn=function(e,t,r){var n=P(e);return-.5*(1+Math.sin(n))*r};var z=function(e){return s(b[0]+y*Math.cos(e),b[1]-y*Math.sin(e))};d=function(e){return z(P(e))};if(l=h.calcTicks(o),f=h.getTickSigns(o)[2],o.visible){f="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;h.drawTicks(e,o,{vals:l,layer:k,path:"M"+f*R+",0h"+f*o.ticklen,transFn:function(e){var t=P(e);return z(t)+"rotate("+-c(t)+")"}}),h.drawLabels(e,o,{vals:l,layer:k,transFn:d,labelFns:I})}var F=[g].concat(p.gauge.steps),E=_.selectAll("g.bg-arc").data(F);E.enter().append("g").classed("bg-arc",!0).append("path"),E.select("path").call(C).call(T),E.exit().remove();var j=O(p.gauge.bar.thickness),H=_.selectAll("g.value-arc").data([p.gauge.bar]);H.enter().append("g").classed("value-arc",!0).append("path");var B=H.select("path");w(A)?(B.transition().duration(A.duration).ease(A.easing).each("end",(function(){L&&L()})).each("interrupt",(function(){L&&L()})).attrTween("d",(Y=j,V=D(r[0].lastY),U=D(r[0].y),function(){var e=a(V,U);return function(t){return Y.endAngle(e(t))()}})),p._lastValue=r[0].y):B.attr("d","number"==typeof r[0].y?j.endAngle(D(r[0].y)):"M0,0Z");var Y,V,U;B.call(T),H.exit().remove(),F=[];var q=p.gauge.threshold.value;(q||0===q)&&F.push({range:[q,q],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var G=_.selectAll("g.threshold-arc").data(F);G.enter().append("g").classed("threshold-arc",!0).append("path"),G.select("path").call(C).call(T),G.exit().remove();var Z=_.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(C).call(T),Z.exit().remove()}(e,0,t,{radius:B,innerRadius:Y,gauge:G,layer:Z,size:E,gaugeBg:O,gaugeOutline:C,transitionOpts:r,onComplete:y});var X=I.selectAll("g.bullet").data(R?t:[]);X.exit().remove();var W=I.selectAll("g.bulletaxis").data(R?t:[]);W.exit().remove(),R&&function(e,t,r,n){var a,i,o,l,c,u=r[0].trace,d=n.gauge,p=n.layer,m=n.gaugeBg,y=n.gaugeOutline,v=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;d.enter().append("g").classed("bullet",!0),d.attr("transform",s(v.l,v.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var k=v.h,A=u.gauge.bar.thickness*k,L=x.x[0],S=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-f.bulletNumberDomainSize:1);(a=M(e,u.gauge.axis))._id="xbulletaxis",a.domain=[L,S],a.setScale(),i=h.calcTicks(a),o=h.makeTransTickFn(a),l=h.getTickSigns(a)[2],c=v.t+v.h,a.visible&&(h.drawTicks(e,a,{vals:"inside"===a.ticks?h.clipEnds(a,i):i,layer:p,path:h.makeTickPath(a,c,l),transFn:o}),h.drawLabels(e,a,{vals:i,layer:p,transFn:o,labelFns:h.makeLabelFns(a,c)}));function D(e){e.attr("width",(function(e){return Math.max(0,a.c2p(e.range[1])-a.c2p(e.range[0]))})).attr("x",(function(e){return a.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*k})).attr("height",(function(e){return e.thickness*k}))}var O=[m].concat(u.gauge.steps),C=d.selectAll("g.bg-bullet").data(O);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(D).call(T),C.exit().remove();var P=d.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",A).attr("y",(k-A)/2).call(T),w(b)?P.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,a.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var I=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),N=d.selectAll("g.threshold-bullet").data(I);N.enter().append("g").classed("threshold-bullet",!0).append("line"),N.select("line").attr("x1",a.c2p(u.gauge.threshold.value)).attr("x2",a.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*k).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*k).call(g.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),N.exit().remove();var z=d.selectAll("g.gauge-outline").data([y]);z.enter().append("g").classed("gauge-outline",!0).append("rect"),z.select("rect").call(D).call(T),z.exit().remove()}(e,0,t,{gauge:X,layer:W,size:E,gaugeBg:O,gaugeOutline:C,transitionOpts:r,onComplete:y});var J=I.selectAll("text.title").data(t);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?x.right:x[P.title.align]})).text(P.title.text).call(d.font,P.title.font).call(p.convertToTspans,e),J.attr("transform",(function(){var e,t=E.l+E.w*b[P.title.align],r=f.titlePadding,n=d.bBox(J.node());if(N){if(z)if(P.gauge.axis.visible)e=d.bBox(Z.node()).top-r-n.bottom;else e=E.t+E.h/2-B/2-n.bottom-r;R&&(e=S-(n.top+n.bottom)/2,t=E.l-f.bulletPadding*E.w)}else e=P._numbersTop-r-n.bottom;return s(t,e)}))}))}},{"../../components/color":112,"../../components/drawing":134,"../../constants/alignment":228,"../../lib":254,"../../lib/svg_text_utils":277,"../../plots/cartesian/axes":301,"../../plots/cartesian/axis_defaults":303,"../../plots/cartesian/layout_attributes":314,"../../plots/cartesian/position_defaults":317,"./constants":412,"@plotly/d3":18,"d3-interpolate":22}],416:[function(e,t,r){"use strict";var n=e("../../lib").extendFlat,a=e("../scatter/attributes"),i=e("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=e("../../components/drawing/attributes").dash,l=e("../../components/fx/attributes"),s=e("../../constants/delta.js"),c=s.INCREASING.COLOR,u=s.DECREASING.COLOR,d=a.line;function f(e){return{line:{color:n({},d.color,{dflt:e}),width:d.width,dash:o,editType:"style"},editType:"style"}}t.exports={xperiod:a.xperiod,xperiod0:a.xperiod0,xperiodalignment:a.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:n({},d.width,{}),dash:n({},o,{}),editType:"style"},increasing:f(c),decreasing:f(u),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:n({},l.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}})}},{"../../components/drawing/attributes":133,"../../components/fx/attributes":143,"../../constants/delta.js":230,"../../lib":254,"../../plots/cartesian/axis_format_attributes":304,"../scatter/attributes":438}],417:[function(e,t,r){"use strict";var n=e("../../lib"),a=n._,i=e("../../plots/cartesian/axes"),o=e("../../plots/cartesian/align_period"),l=e("../../constants/numerical").BADNUM;function s(e,t,r,n){return{o:e,h:t,l:r,c:n}}function c(e,t,r,o,s,c){for(var u=s.makeCalcdata(t,"open"),d=s.makeCalcdata(t,"high"),f=s.makeCalcdata(t,"low"),p=s.makeCalcdata(t,"close"),h=Array.isArray(t.text),m=Array.isArray(t.hovertext),y=!0,v=null,g=!!t.xperiodalignment,x=[],b=0;bv):y=k>w,v=k;var A=c(w,T,M,k);A.pos=_,A.yc=(w+k)/2,A.i=b,A.dir=y?"increasing":"decreasing",A.x=A.pos,A.y=[M,T],g&&(A.orig_p=r[b]),h&&(A.tx=t.text[b]),m&&(A.htx=t.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return t._extremes[s._id]=i.findExtremes(s,n.concat(f,d),{padded:!0}),x.length&&(x[0].t={labels:{open:a(e,"open:")+" ",high:a(e,"high:")+" ",low:a(e,"low:")+" ",close:a(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var r=i.getFromId(e,t.xaxis),a=i.getFromId(e,t.yaxis),l=function(e,t,r){var a=r._minDiff;if(!a){var i,l=e._fullData,s=[];for(a=1/0,i=0;i"+c.labels[x]+n.hoverLabelText(l,b,s.yhoverformat):((g=a.extendFlat({},f)).y0=g.y1=_,g.yLabelVal=b,g.yLabel=c.labels[x]+n.hoverLabelText(l,b,s.yhoverformat),g.name="",d.push(g),y[b]=g)}return d}function f(e,t,r,a){var i=e.cd,o=e.ya,s=i[0].trace,d=i[0].t,f=u(e,t,r,a);if(!f)return[];var p=i[f.index],h=f.index=p.i,m=p.dir;function y(e){return d.labels[e]+n.hoverLabelText(o,s[e][h],s.yhoverformat)}var v=p.hi||s.hoverinfo,g=v.split("+"),x="all"===v,b=x||-1!==g.indexOf("y"),_=x||-1!==g.indexOf("text"),w=b?[y("open"),y("high"),y("low"),y("close")+" "+c[m]]:[];return _&&l(p,s,w),f.extraText=w.join("
"),f.y0=f.y1=o.c2p(p.yc,!0),[f]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?d(e,t,r,n):f(e,t,r,n)},hoverSplit:d,hoverOnPoints:f}},{"../../components/color":112,"../../components/fx":152,"../../constants/delta.js":230,"../../lib":254,"../../plots/cartesian/axes":301}],420:[function(e,t,r){"use strict";t.exports={moduleType:"trace",name:"ohlc",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:e("./attributes"),supplyDefaults:e("./defaults"),calc:e("./calc").calc,plot:e("./plot"),style:e("./style"),hoverPoints:e("./hover").hoverPoints,selectPoints:e("./select")}},{"../../plots/cartesian":313,"./attributes":416,"./calc":417,"./defaults":418,"./hover":419,"./plot":422,"./select":423,"./style":424}],421:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports=function(e,t,r,i){var o=r("x"),l=r("open"),s=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],i),l&&s&&c&&u){var d=Math.min(l.length,s.length,c.length,u.length);return o&&(d=Math.min(d,a.minRowLength(o))),t._length=d,d}}},{"../../lib":254,"../../registry":337}],422:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib");t.exports=function(e,t,r,i){var o=t.yaxis,l=t.xaxis,s=!!l.rangebreaks;a.makeTraceGroups(i,r,"trace ohlc").each((function(e){var t=n.select(this),r=e[0],i=r.t;if(!0!==r.trace.visible||i.empty)t.remove();else{var c=i.tickLen,u=t.selectAll("path").data(a.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=l.c2p(e.pos-c,!0),r=l.c2p(e.pos+c,!0),n=s?(t+r)/2:l.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}},{"../../lib":254,"@plotly/d3":18}],423:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n=e.cd,a=e.xaxis,i=e.yaxis,o=[],l=n[0].t.bPos||0;if(!1===t)for(r=0;r=0})),("funnelarea"===t.type?v:t.sort)&&i.sort((function(e,t){return t.v-e.v})),i[0]&&(i[0].vTotal=y),i},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,a=e.calcdata,i=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(i=s(i,o));for(var c=0,u=0;u0){l=!0;break}}l||(o=0)}return{hasLabels:r,hasValues:i,len:o}}t.exports={handleLabelsAndValues:s,supplyDefaults:function(e,t,r,n){function c(r,n){return a.coerce(e,t,i,r,n)}var u=s(c("labels"),c("values")),d=u.len;if(t._hasLabels=u.hasLabels,t._hasValues=u.hasValues,!t._hasLabels&&t._hasValues&&(c("label0"),c("dlabel")),d){t._length=d,c("marker.line.width")&&c("marker.line.color"),c("marker.colors"),c("scalegroup");var f,p=c("text"),h=c("texttemplate");if(h||(f=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),h||f&&"none"!==f){var m=c("textposition");l(e,t,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(t,n,c);var y=c("hole");if(c("title.text")){var v=c("title.position",y?"middle center":"top center");y||"middle center"!==v||(t.title.position="top center"),a.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else t.visible=!1}}},{"../../lib":254,"../../plots/domain":328,"../bar/defaults":351,"./attributes":425,"fast-isnumeric":26}],429:[function(e,t,r){"use strict";var n=e("../../components/fx/helpers").appendArrayMultiPointValues;t.exports=function(e,t){var r={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(r.pointNumber=r.i=e.pts[0]),n(r,t,e.pts),"funnelarea"===t.type&&(delete r.v,delete r.i),r}},{"../../components/fx/helpers":148}],430:[function(e,t,r){"use strict";var n=e("../../lib");function a(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}r.formatPiePercent=function(e,t){var r=a((100*e).toPrecision(3));return n.numSeparate(r,t)+"%"},r.formatPieValue=function(e,t){var r=a(e.toPrecision(10));return n.numSeparate(r,t)},r.getFirstFilled=function(e,t){if(Array.isArray(e))for(var r=0;r"),name:d.hovertemplate||-1!==f.indexOf("name")?d.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:y.castOption(_.bgcolor,e.pts)||e.color,borderColor:y.castOption(_.bordercolor,e.pts),fontFamily:y.castOption(w.family,e.pts),fontSize:y.castOption(w.size,e.pts),fontColor:y.castOption(w.color,e.pts),nameLength:y.castOption(_.namelength,e.pts),textAlign:y.castOption(_.align,e.pts),hovertemplate:y.castOption(d.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[v(e,d)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t,inOut_bbox:T}),e.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[v(e,d)],event:n.event})}})),e.on("mouseout",(function(e){var r=t._fullLayout,a=t._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(e.originalEvent=n.event,t.emit("plotly_unhover",{points:[v(o,a)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var r=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===r.hovermode||(t._hoverdata=[v(e,a)],i.click(t,n.event))}))}function b(e,t,r){var n=y.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=y.castOption(e._input.textfont.color,t.pts));var a=y.castOption(e.insidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.insidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n||o.contrast(t.color),family:a,size:i}}function _(e,t){for(var r,n,a=0;at&&t>n||r=-4;y-=2)v(Math.PI*y,"tan");for(y=4;y>=-4;y-=2)v(Math.PI*(y+1),"tan")}if(d||p){for(y=4;y>=-4;y-=2)v(Math.PI*(y+1.5),"rad");for(y=4;y>=-4;y-=2)v(Math.PI*(y+.5),"rad")}}if(l||h||d){var g=Math.sqrt(e.width*e.width+e.height*e.height);if((i={scale:a*n*2/g,rCenter:1-a,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,i.scale>=1)return i;m.push(i)}(h||p)&&((i=T(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i)),(h||f)&&((i=M(e,n,o,s,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(i));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.width/e.height,o=L(i,n,t,r);return{scale:2*o/e.height,rCenter:k(i,o/t),rotate:A(a)}}function M(e,t,r,n,a){t=Math.max(0,t-2*m);var i=e.height/e.width,o=L(i,n,t,r);return{scale:2*o/e.width,rCenter:k(i,o/t),rotate:A(a+Math.PI/2)}}function k(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function L(e,t,r,n){var a=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(a*a+.5)+a),n/(Math.sqrt(e*e+n/2)+e))}function S(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function D(e,t){var r=t.pxmid[0],n=t.pxmid[1],a=e.width/2,i=e.height/2;return r<0&&(a*=-1),n<0&&(i*=-1),{scale:1,rCenter:1,rotate:0,x:a+Math.abs(i)*(a>0?1:-1)/2,y:i/(1+r*r/(n*n)),outside:!0}}function O(e,t){var r,n,a,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,a=P(i),-1!==i.title.position.indexOf("top")?(o.y-=(1+a)*e.r,l.ty-=e.titleBox.height):-1!==i.title.position.indexOf("bottom")&&(o.y+=(1+a)*e.r);var s,c,u=(s=e.r,c=e.trace.aspectratio,s/(void 0===c?1:c)),d=t.w*(i.domain.x[1]-i.domain.x[0])/2;return-1!==i.title.position.indexOf("left")?(d+=u,o.x-=(1+a)*u,l.tx+=e.titleBox.width/2):-1!==i.title.position.indexOf("center")?d*=2:-1!==i.title.position.indexOf("right")&&(d+=u,o.x+=(1+a)*u,l.tx-=e.titleBox.width/2),r=d/e.titleBox.width,n=C(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:l.tx,ty:l.ty}}function C(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function P(e){var t,r=e.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function I(e,t){for(var r=[],n=0;n1?(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")}if(i){var x=s.castOption(a,t.i,"texttemplate");if(x){var b=function(e){return{label:e.label,value:e.v,valueLabel:y.formatPieValue(e.v,n.separators),percent:e.v/r.vTotal,percentLabel:y.formatPiePercent(e.v/r.vTotal,n.separators),color:e.color,text:e.text,customdata:s.castOption(a,e.i,"customdata")}}(t),_=y.getFirstFilled(a.text,t.pts);(g(_)||""===_)&&(b.text=_),t.text=s.texttemplateString(x,b,e._fullLayout._d3locale,b,a._meta||{})}else t.text=""}}function R(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),a=Math.sin(r),i=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=i*n-o*a,e.textY=i*a+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var r=e._context.staticPlot,i=e._fullLayout,f=i._size;h("pie",i),_(t,e),I(t,f);var m=s.makeTraceGroups(i._pielayer,t,"trace").each((function(t){var h=n.select(this),m=t[0],v=m.trace;!function(e){var t,r,n,a=e[0],i=a.r,o=a.trace,l=y.getRotationAngle(o.rotation),s=2*Math.PI/a.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ta.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))}(t),h.attr("stroke-linejoin","round"),h.each((function(){var g=n.select(this).selectAll("g.slice").data(t);g.enter().append("g").classed("slice",!0),g.exit().remove();var _=[[[],[]],[[],[]]],T=!1;g.each((function(a,o){if(a.hidden)n.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=v.index,_[a.pxmid[1]<0?0:1][a.pxmid[0]<0?0:1].push(a);var c=m.cx,u=m.cy,f=n.select(this),h=f.selectAll("path.surface").data([a]);if(h.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),f.call(x,e,t),v.pull){var g=+y.castOption(v.pull,a.pts)||0;g>0&&(c+=g*a.pxmid[0],u+=g*a.pxmid[1])}a.cxFinal=c,a.cyFinal=u;var M=v.hole;if(a.v===m.vTotal){var k="M"+(c+a.px0[0])+","+(u+a.px0[1])+C(a.px0,a.pxmid,!0,1)+C(a.pxmid,a.px0,!0,1)+"Z";M?h.attr("d","M"+(c+M*a.px0[0])+","+(u+M*a.px0[1])+C(a.px0,a.pxmid,!1,M)+C(a.pxmid,a.px0,!1,M)+"Z"+k):h.attr("d",k)}else{var A=C(a.px0,a.px1,!0,1);if(M){var L=1-M;h.attr("d","M"+(c+M*a.px1[0])+","+(u+M*a.px1[1])+C(a.px1,a.px0,!1,M)+"l"+L*a.px0[0]+","+L*a.px0[1]+A+"Z")}else h.attr("d","M"+c+","+u+"l"+a.px0[0]+","+a.px0[1]+A+"Z")}z(e,a,m);var S=y.castOption(v.textposition,a.pts),O=f.selectAll("g.slicetext").data(a.text&&"none"!==S?[0]:[]);O.enter().append("g").classed("slicetext",!0),O.exit().remove(),O.each((function(){var r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),f=s.ensureUniformFontSize(e,"outside"===S?function(e,t,r){var n=y.castOption(e.outsidetextfont.color,t.pts)||y.castOption(e.textfont.color,t.pts)||r.color,a=y.castOption(e.outsidetextfont.family,t.pts)||y.castOption(e.textfont.family,t.pts)||r.family,i=y.castOption(e.outsidetextfont.size,t.pts)||y.castOption(e.textfont.size,t.pts)||r.size;return{color:n,family:a,size:i}}(v,a,i.font):b(v,a,i.font));r.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,f).call(d.convertToTspans,e);var h,g=l.bBox(r.node());if("outside"===S)h=D(g,a);else if(h=w(g,a,m),"auto"===S&&h.scale<1){var x=s.ensureUniformFontSize(e,v.outsidetextfont);r.call(l.font,x),h=D(g=l.bBox(r.node()),a)}var _=h.textPosAngle,M=void 0===_?a.pxmid:N(m.r,_);if(h.targetX=c+M[0]*h.rCenter+(h.x||0),h.targetY=u+M[1]*h.rCenter+(h.y||0),R(h,g),h.outside){var k=h.targetY;a.yLabelMin=k-g.height/2,a.yLabelMid=k,a.yLabelMax=k+g.height/2,a.labelExtraX=0,a.labelExtraY=0,T=!0}h.fontSize=f.size,p(v.type,h,i),t[o].transform=h,s.setTransormAndDisplay(r,h)}))}function C(e,t,r,n){var i=n*(t[0]-e[0]),o=n*(t[1]-e[1]);return"a"+n*m.r+","+n*m.r+" 0 "+a.largeArc+(r?" 1 ":" 0 ")+i+","+o}}));var M=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);if(M.enter().append("g").classed("titletext",!0),M.exit().remove(),M.each((function(){var t,r=s.ensureSingle(n.select(this),"text","",(function(e){e.attr("data-notex",1)})),a=v.title.text;v._meta&&(a=s.templateString(a,v._meta)),r.text(a).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(l.font,v.title.font).call(d.convertToTspans,e),t="middle center"===v.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(m):O(m,f),r.attr("transform",u(t.x,t.y)+c(Math.min(1,t.scale))+u(t.tx,t.ty))})),T&&function(e,t){var r,n,a,i,o,l,s,c,u,d,f,p,h;function m(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}function g(e,r){r||(r={});var a,c,u,f,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),h=n?e.yLabelMin:e.yLabelMax,m=n?e.yLabelMax:e.yLabelMin,v=e.cyFinal+o(e.px0[1],e.px1[1]),g=p-h;if(g*s>0&&(e.labelExtraY=g),Array.isArray(t.pull))for(c=0;c=(y.castOption(t.pull,u.pts)||0)||((e.pxmid[1]-u.pxmid[1])*s>0?(g=u.cyFinal+o(u.px0[1],u.px1[1])-h-e.labelExtraY)*s>0&&(e.labelExtraY+=g):(m+e.labelExtraY-v)*s>0&&(a=3*l*Math.abs(c-d.indexOf(e)),(f=u.cxFinal+i(u.px0[0],u.px1[0])+a-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=f)))}for(n=0;n<2;n++)for(a=n?m:v,o=n?Math.max:Math.min,s=n?1:-1,r=0;r<2;r++){for(i=r?Math.max:Math.min,l=r?1:-1,(c=e[n][r]).sort(a),u=e[1-n][r],d=u.concat(c),p=[],f=0;fMath.abs(d)?l+="l"+d*e.pxmid[0]/e.pxmid[1]+","+d+"H"+(i+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(d-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(r,"path","textline").call(o.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else r.select("path.textline").remove()}))}(g,v),T&&v.automargin){var k=l.bBox(h.node()),A=v.domain,L=f.w*(A.x[1]-A.x[0]),S=f.h*(A.y[1]-A.y[0]),C=(.5*L-m.r)/f.w,P=(.5*S-m.r)/f.h;a.autoMargin(e,"pie."+v.uid+".automargin",{xl:A.x[0]-C,xr:A.x[1]+C,yb:A.y[0]-P,yt:A.y[1]+P,l:Math.max(m.cx-m.r-k.left,0),r:Math.max(k.right-(m.cx+m.r),0),b:Math.max(k.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-k.top,0),pad:5})}}))}));setTimeout((function(){m.selectAll("tspan").each((function(){var e=n.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:z,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:O,prerenderTitles:_,layoutAreas:I,attachFxHandlers:x,computeTransform:R}},{"../../components/color":112,"../../components/drawing":134,"../../components/fx":152,"../../lib":254,"../../lib/svg_text_utils":277,"../../plots/plots":335,"../bar/constants":349,"../bar/uniform_text":363,"./event_data":429,"./helpers":430,"@plotly/d3":18}],435:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("./style_one"),i=e("../bar/uniform_text").resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(e){var t=e[0].trace,r=n.select(this);r.style({opacity:t.opacity}),r.selectAll("path.surface").each((function(e){n.select(this).call(a,e,t)}))}))}},{"../bar/uniform_text":363,"./style_one":436,"@plotly/d3":18}],436:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("./helpers").castOption;t.exports=function(e,t,r){var i=r.marker.line,o=a(i.color,t.pts)||n.defaultLine,l=a(i.width,t.pts)||0;e.style("stroke-width",l).call(n.fill,t.color).call(n.stroke,o)}},{"../../components/color":112,"./helpers":430}],437:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e,t){for(var r=0;rs&&O[v].gap;)v--;for(x=O[v].s,m=O.length-1;m>v;m--)O[m].s=x;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],445:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),d=e("./marker_defaults"),f=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),m=e("./fillcolor_defaults"),y=e("../../lib").coercePattern;t.exports=function(e,t,r,v){function g(r,a){return n.coerce(e,t,i,r,a)}var x=s(e,t,v,g);if(x||(t.visible=!1),t.visible){c(e,t,v,g),g("xhoverformat"),g("yhoverformat");var b=u(e,t,v,g),_=!b&&x=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(f.c2p(e.x)-h);return i=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-m);return iZ!=(j=N[P][1])>=Z&&(R=N[P-1][0],F=N[P][0],j-E&&(z=R+(F-R)*(Z-E)/(j-E),V=Math.min(V,z),U=Math.max(U,z)));V=Math.max(V,0),U=Math.min(U,f._length);var X=l.defaultLine;return l.opacity(d.fillcolor)?X=d.fillcolor:l.opacity((d.line||{}).color)&&(X=d.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:V,x1:U,y0:Z,y1:Z,color:X,hovertemplate:!1}),delete e.index,d.text&&!Array.isArray(d.text)?e.text=String(d.text):e.text=d.name,[e]}}}},{"../../components/color":112,"../../components/fx":152,"../../lib":254,"../../registry":337,"./get_trace_color":448}],450:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":313,"./arrays_to_calcdata":437,"./attributes":438,"./calc":439,"./cross_trace_calc":443,"./cross_trace_defaults":444,"./defaults":445,"./format_labels":447,"./hover":449,"./marker_colorbar":456,"./plot":459,"./select":460,"./style":462,"./subtypes":463}],451:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){s||(s={});var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},{"../../components/colorscale/defaults":122,"../../components/colorscale/helpers":123,"../../lib":254}],452:[function(e,t,r){"use strict";var n=e("../../components/drawing"),a=e("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,c=e("../../lib"),u=c.segmentsIntersect,d=c.constrain,f=e("./constants");t.exports=function(e,t){var r,a,o,p,h,m,y,v,g,x,b,_,w,T,M,k,A,L,S=t.trace||{},D=t.xaxis,O=t.yaxis,C="log"===D.type,P="log"===O.type,I=D._length,N=O._length,z=t.backoff,R=S.marker,F=t.connectGaps,E=t.baseTolerance,j=t.shape,H="linear"===j,B=S.fill&&"none"!==S.fill,Y=[],V=f.minTolerance,U=e.length,q=new Array(U),G=0;function Z(r){var n=e[r];if(!n)return!1;var a=t.linearized?D.l2p(n.x):D.c2p(n.x),o=t.linearized?O.l2p(n.y):O.c2p(n.y);if(a===i){if(C&&(a=D.c2p(n.x,!0)),a===i)return!1;P&&o===i&&(a*=Math.abs(D._m*N*(D._m>0?l:s)/(O._m*I*(O._m>0?l:s)))),a*=1e3}if(o===i){if(P&&(o=O.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function X(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&coe||e[1]se)return[d(e[0],ie,oe),d(e[1],le,se)]}function de(e,t){return e[0]===t[0]&&(e[0]===ie||e[0]===oe)||(e[1]===t[1]&&(e[1]===le||e[1]===se)||void 0)}function fe(e,t,r){return function(n,a){var i=ue(n),o=ue(a),l=[];if(i&&o&&de(i,o))return l;i&&l.push(i),o&&l.push(o);var s=2*c.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);s&&((i&&o?s>0==i[e]>o[e]?i:o:i||o)[e]+=s);return l}}function pe(e){var t=e[0],r=e[1],n=t===q[G-1][0],a=r===q[G-1][1];if(!n||!a)if(G>1){var i=t===q[G-2][0],o=r===q[G-2][1];n&&(t===ie||t===oe)&&i?o?G--:q[G-1]=e:a&&(r===le||r===se)&&o?i?G--:q[G-1]=e:q[G++]=e}else q[G++]=e}function he(e){q[G-1][0]!==e[0]&&q[G-1][1]!==e[1]&&pe([$,ee]),pe(e),te=null,$=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ce[a],o=u(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&J(o,e)oe?oe:0,Q=t[1]se?se:0,K||Q){if(G)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),q[G++]=n[1])}else re=ne(q[G-1],t)[0],q[G++]=re;else q[G++]=[K||t[0],Q||t[1]];var a=q[G-1];K&&Q&&(a[0]!==K||a[1]!==Q)?(te&&($!==K&&ee!==Q?pe($&&ee?(i=te,l=(o=t)[0]-i[0],s=(o[1]-i[1])/l,(i[1]*o[0]-o[1]*i[0])/l>0?[s>0?ie:oe,se]:[s>0?oe:ie,le]):[$||K,ee||Q]):$&&ee&&pe([$,ee])),pe([K,Q])):$-K&&ee-Q&&pe([K||$,Q||ee]),te=t,$=K,ee=Q}else te&&he(ne(te,t)[0]),q[G++]=t;var i,o,l,s}for(r=0;rW(m,ve))break;o=m,(w=g[0]*v[0]+g[1]*v[1])>b?(b=w,p=m,y=!1):w<_&&(_=w,h=m,y=!0)}if(y?(ye(p),o!==h&&ye(h)):(h!==a&&ye(h),o!==p&&ye(p)),ye(o),r>=e.length||!m)break;ye(m),a=m}}else ye(p)}te&&pe([$||te[0],ee||te[1]]),Y.push(q.slice(0,G))}var ge=j.slice(j.length-1);if(z&&"h"!==ge&&"v"!==ge){for(var xe=!1,be=-1,_e=[],we=0;we=0?s=p:(s=p=f,f++),s0?Math.max(r,i):0}}},{"fast-isnumeric":26}],456:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],457:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),d=(e.line||{}).color;(c=c||{},d&&(r=d),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),c.noAngle||(s("marker.angle"),c.noAngleRef||s("marker.angleref"),c.noStandOff||s("marker.standoff")),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",d&&!Array.isArray(d)&&t.marker.color!==d?d:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":112,"../../components/colorscale/defaults":122,"../../components/colorscale/helpers":123,"./subtypes":463}],458:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":234,"../../lib":254}],459:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),d=e("./link_traces"),f=e("../../lib/polygon").tester;function p(e,t,r,d,p,h,m){var y;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),d=n.extent(i.simpleMap(s.range,s.r2c)),f=a[0].trace;if(!c.hasMarkers(f))return;var p=f.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=d[0]&&e.y<=d[1]})),m=Math.ceil(h.length/p),y=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function g(e){return v?e.transition():e}var x=r.xaxis,b=r.yaxis,_=d[0].trace,w=_.line,T=n.select(h),M=o(T,"g","errorbars"),k=o(T,"g","lines"),A=o(T,"g","points"),L=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(e,M,r,m),!0===_.visible){var S,D;g(T).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),d[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var C,P,I="",N=[],z=_._prevtrace;z&&(I=z._prevRevpath||"",D=z._nextFill,N=z._polygons);var R,F,E,j,H,B,Y,V="",U="",q=[],G=i.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(D&&D.datum(d),-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(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},E=function(e){return F(e.reverse())},q=u(d,{xaxis:x,yaxis:b,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),y=0;y1){var r=n.select(this);if(r.datum(d),e)g(r.style("opacity",0).attr("d",C).call(s.lineGroupStyle)).style("opacity",1);else{var a=g(r);a.attr("d",C),s.singleLineStyle(d,a)}}}}}var Z=k.selectAll(".js-line").data(q);g(Z.exit()).style("opacity",0).remove(),Z.each(G(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(G(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(S?(S.datum(d),j&&B&&(O?("y"===O?j[1]=B[1]=b.c2p(0,!0):"x"===O&&(j[0]=B[0]=x.c2p(0,!0)),g(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(s.singleFillStyle,e)):g(S).attr("d",V+"Z").call(s.singleFillStyle,e))):D&&("tonext"===_.fill.substr(0,6)&&V&&I?("tonext"===_.fill?g(D).attr("d",V+"Z"+I+"Z").call(s.singleFillStyle,e):g(D).attr("d",V+"L"+I.substr(1)+"Z").call(s.singleFillStyle,e),_._polygons=_._polygons.concat(N)):(W(D),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(S?W(S):D&&W(D),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(d),L.datum(d),function(t,a,i){var o,u=i[0].trace,d=c.hasMarkers(u),f=c.hasText(u),p=ee(u),h=te,m=te;if(d||f){var y=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?y=w?K:J:_&&!w&&(y=Q),d&&(h=y),f&&(m=y)}var T,M=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);v&&M.call(s.pointStyle,u,e).call(s.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),d&&(T=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=g(a);s.translatePoint(t,i,x,b)?(s.singlePointStyle(t,i,u,T,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,x,b,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=g(t.select("text"));s.translatePoint(e,a,x,b)?r.layerClipId&&s.hideOutsideRangePoint(e,t,x,b,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=x.c2p(e.x),r=b.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){g(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,L,d);var X=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,X,e),s.setClipUrl(L,X,e)}function W(e){g(e).attr("d","M0,0Z")}function J(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,f,h=!i,m=!!i&&i.duration>0,y=d(e,t,r);((u=a.selectAll("g.trace").data(y,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),m)?(c&&(f=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,y,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,y,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":134,"../../lib":254,"../../lib/polygon":266,"../../registry":337,"./line_points":452,"./link_traces":454,"./subtypes":463,"@plotly/d3":18}],460:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],d=l[0].trace;if(!n.hasMarkers(d)&&!n.hasText(d))return[];if(!1===t)for(r=0;r")),u.color=function(e,t){var r=e[t.dir].marker,n=r.color,i=r.line.color,o=r.line.width;if(a(n))return n;if(a(i)&&o)return i}(f,y),[u]}function M(e){return n(m,e,f[h+"hoverformat"])}}},{"../../components/color":112,"../../constants/delta.js":230,"../../plots/cartesian/axes":301,"../bar/hover":354}],473:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),layoutAttributes:e("./layout_attributes"),supplyDefaults:e("./defaults").supplyDefaults,crossTraceDefaults:e("./defaults").crossTraceDefaults,supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),crossTraceCalc:e("./cross_trace_calc"),plot:e("./plot"),style:e("./style").style,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:e("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":313,"../bar/select":359,"./attributes":466,"./calc":467,"./cross_trace_calc":469,"./defaults":470,"./event_data":471,"./hover":472,"./layout_attributes":474,"./layout_defaults":475,"./plot":476,"./style":477}],474:[function(e,t,r){"use strict";t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],475:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t,r){var i=!1;function o(r,i){return n.coerce(e,t,a,r,i)}for(var l=0;l0&&(y+=f?"M"+d[0]+","+h[1]+"V"+h[0]:"M"+d[1]+","+h[0]+"H"+d[0]),"between"!==p&&(r.isSum||l path").each((function(e){if(!e.isBlank){var t=l[e.dir].marker;n.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(a.dashLine,t.line.dash,t.line.width).style("opacity",l.selectedpoints&&!e.selected?o:1)}})),c(r,l,e),r.selectAll(".lines").each((function(){var e=l.connector.line;a.lineGroupStyle(n.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}},{"../../components/color":112,"../../components/drawing":134,"../../constants/interactions":233,"../bar/style":361,"../bar/uniform_text":363,"@plotly/d3":18}],478:[function(e,t,r){"use strict";var n=e("../plots/cartesian/axes"),a=e("../lib"),i=e("../plot_api/plot_schema"),o=e("./helpers").pointsAccessorFunction,l=e("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var s=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=s.aggregations;function u(e,t,r,i){if(i.enabled){for(var o=i.target,s=a.nestedProperty(t,o),c=s.get(),u=function(e,t){var r=e.func,n=t.d2c,i=t.c2d;switch(r){case"count":return d;case"first":return f;case"last":return p;case"sum":return function(e,t){for(var r=0,a=0;aa&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return f(e)>l};case">=":return function(e){return f(e)>=l};case"[]":return function(e){var t=f(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=f(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=f(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=f(e);return tl[1]};case"](":return function(e){var t=f(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=f(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(f(e))};case"}{":return function(e){return-1===l.indexOf(f(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),f),x={},b={},_=0;h?(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set(new Array(d))},v=function(e,t){var r=x[e.astr][t];e.get()[t]=r}):(y=function(e){x[e.astr]=n.extendDeep([],e.get()),e.set([])},v=function(e,t){var r=x[e.astr][t];e.get().push(r)}),M(y);for(var w=o(t.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .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:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;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 rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",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,.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:.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":260}],2:[function(e,t,r){"use strict";t.exports=e("../src/transforms/aggregate")},{"../src/transforms/aggregate":411}],3:[function(e,t,r){"use strict";t.exports=e("../src/components/calendars")},{"../src/components/calendars":115}],4:[function(e,t,r){"use strict";t.exports=e("../src/traces/choropleth")},{"../src/traces/choropleth":365}],5:[function(e,t,r){"use strict";t.exports=e("../src/core")},{"../src/core":240}],6:[function(e,t,r){"use strict";t.exports=e("../src/transforms/filter")},{"../src/transforms/filter":412}],7:[function(e,t,r){"use strict";t.exports=e("../src/transforms/groupby")},{"../src/transforms/groupby":413}],8:[function(e,t,r){"use strict";var n=e("./core");n.register([e("./scattergeo"),e("./choropleth"),e("./aggregate"),e("./filter"),e("./groupby"),e("./sort"),e("./calendars")]),t.exports=n},{"./aggregate":2,"./calendars":3,"./choropleth":4,"./core":5,"./filter":6,"./groupby":7,"./scattergeo":9,"./sort":10}],9:[function(e,t,r){"use strict";t.exports=e("../src/traces/scattergeo")},{"../src/traces/scattergeo":407}],10:[function(e,t,r){"use strict";t.exports=e("../src/transforms/sort")},{"../src/transforms/sort":415}],11:[function(e,t,r){(function(){var e={version:"3.8.0"},r=[].slice,n=function(e){return r.call(e)},a=self.document;function i(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(e){n=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(e,t){s.call(this,e,t+"")},l.setAttributeNS=function(e,t,r){c.call(this,e,t,r+"")},u.setProperty=function(e,t,r){f.call(this,e,t+"",r)}}function d(e,t){return et?1:e>=t?0:NaN}function p(e){return null===e?NaN:+e}function h(e){return!isNaN(e)}function g(e){return{left:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}e.ascending=d,e.descending=function(e,t){return te?1:t>=e?0:NaN},e.min=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},e.max=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},e.extent=function(e,t){var r,n,a,i=-1,o=e.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(s-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(d);function m(e){return e.length}e.bisectLeft=v.left,e.bisect=e.bisectRight=v.right,e.bisector=function(e){return g(1===e.length?function(t,r){return d(e(t),r)}:e)},e.shuffle=function(e,t,r){(i=arguments.length)<3&&(r=e.length,i<2&&(t=0));for(var n,a,i=r-t;i;)a=Math.random()*i--|0,n=e[i+t],e[i+t]=e[a+t],e[a+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],a=new Array(r<0?0:r);t=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r};var y=Math.abs;function b(e){for(var t=1;e*t%1;)t*=10;return t}function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function _(){this._=Object.create(null)}e.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("infinite range");var n,a=[],i=b(y(r)),o=-1;if(e*=i,t*=i,(r*=i)<0)for(;(n=e+r*++o)>t;)a.push(n/i);else for(;(n=e+r*++o)=a.length)return r?r.call(n,i):t?i.sort(t):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new _;++d=a.length)return t;var n=[],o=i[r++];return t.forEach((function(t,a){n.push({key:t,values:e(a,r)})})),o?n.sort((function(e,t){return o(e.key,t.key)})):n}(o(e.map,t,0),0)},n.key=function(e){return a.push(e),n},n.sortKeys=function(e){return i[a.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new C;if(e)for(var r=0,n=e.length;r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(B,"\\$&")};var B=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,H={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function Y(e){return H(e,V),e}var G=function(e,t){return t.querySelector(e)},U=function(e,t){return t.querySelectorAll(e)},q=function(e,t){var r=e.matches||e[O(e,"matchesSelector")];return(q=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(G=function(e,t){return Sizzle(e,t)[0]||null},U=Sizzle,q=Sizzle.matchesSelector),e.selection=function(){return e.select(a.documentElement)};var V=e.selection.prototype=[];function Z(e){return"function"==typeof e?e:function(){return G(e,this)}}function W(e){return"function"==typeof e?e:function(){return U(e,this)}}V.select=function(e){var t,r,n,a,i=[];e=Z(e);for(var o=-1,l=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),X.hasOwnProperty(r)?{space:X[r],local:e}:e}},V.attr=function(t,r){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each(K(r,t[r]));return this}return this.each(K(t,r))},V.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=ee(e)).length,a=-1;if(t=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},V.sort=function(e){e=ce.apply(this,arguments);for(var t=-1,r=this.length;++t=t&&(t=a+1);!(o=l[t])&&++t0&&(t=t.slice(0,o));var s=ge.get(t);function c(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}return s&&(t=s,l=me),o?r?function(){var e=l(r,n(arguments));c.call(this),this.addEventListener(t,this[i]=e,e.$=a),e._=r}:c:r?E:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}e.selection.enter=fe,e.selection.enter.prototype=de,de.append=V.append,de.empty=V.empty,de.node=V.node,de.call=V.call,de.size=V.size,de.select=function(e){for(var t,r,n,a,i,o=[],l=-1,s=this.length;++l1?Le:e<-1?-Le:Math.asin(e)}function Oe(e){return((e=Math.exp(e))+1/e)/2}var Re=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,a=e[0],i=e[1],o=e[2],l=t[0],s=t[1],c=t[2],u=l-a,f=s-i,d=u*u+f*f;if(d<1e-12)n=Math.log(c/o)/Re,r=function(e){return[a+e*u,i+e*f,o*Math.exp(Re*e*n)]};else{var p=Math.sqrt(d),h=(c*c-o*o+4*d)/(2*o*2*p),g=(c*c-o*o-4*d)/(2*c*2*p),v=Math.log(Math.sqrt(h*h+1)-h),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Re,r=function(e){var t,r=e*n,l=Oe(v),s=o/(2*p)*(l*(t=Re*r+v,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+s*u,i+s*f,o*l/Oe(Re*r+v)]}}return r.duration=1e3*n,r},e.behavior.zoom=function(){var t,r,n,i,l,s,c,u,f,d={x:0,y:0,k:1},p=[960,500],h=Ie,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=j(w,"zoomstart","zoom","zoomend");function w(e){e.on(m,D).on(Ne+".zoom",R).on("dblclick.zoom",E).on(x,O)}function M(e){return[(e[0]-d.x)/d.k,(e[1]-d.y)/d.k]}function k(e){d.k=Math.max(h[0],Math.min(h[1],e))}function T(e,t){t=function(e){return[e[0]*d.k+d.x,e[1]*d.k+d.y]}(t),d.x+=e[0]-t[0],d.y+=e[1]-t[1]}function A(t,n,a,i){t.__chart__={x:d.x,y:d.y,k:d.k},k(Math.pow(2,i)),T(r=n,a),t=e.select(t),g>0&&(t=t.transition().duration(g)),t.call(w.event)}function S(){c&&c.domain(s.range().map((function(e){return(e-d.x)/d.k})).map(s.invert)),f&&f.domain(u.range().map((function(e){return(e-d.y)/d.k})).map(u.invert))}function L(e){v++||e({type:"zoomstart"})}function C(e){S(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function P(e){--v||(e({type:"zoomend"}),r=null)}function D(){var t=this,r=_.of(t,arguments),n=0,a=e.select(o(t)).on(y,s).on(b,c),i=M(e.mouse(t)),l=xe(t);function s(){n=1,T(e.mouse(t),i),C(r)}function c(){a.on(y,null).on(b,null),l(n),P(r)}Na.call(t),L(r)}function O(){var t,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+e.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=e.select(r),p=xe(r);function h(){var n=e.touches(r);return t=d.k,n.forEach((function(e){e.identifier in a&&(a[e.identifier]=M(e))})),n}function g(){var t=e.event.target;e.select(t).on(s,v).on(c,y),u.push(t);for(var n=e.event.changedTouches,o=0,f=n.length;o1){m=p[0];var b=p[1],x=m[0]-b[0],_=m[1]-b[1];i=x*x+_*_}}function v(){var o,s,c,u,f=e.touches(r);Na.call(r);for(var d=0,p=f.length;d360?e-=360:e<0&&(e+=360),e<60?n+(a-n)*e/60:e<180?a:e<240?n+(a-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+t):r+t-r*t),new Qe(i(e+120),i(e),i(e-120))}function He(t,r,n){return this instanceof He?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof He?new He(t.h,t.c,t.l):We(t instanceof Ue?t.l:(t=it((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new He(t,r,n)}je.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Fe(this.h,this.s,this.l/e)},je.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Fe(this.h,this.s,e*this.l)},je.rgb=function(){return Be(this.h,this.s,this.l)},e.hcl=He;var Ye=He.prototype=new ze;function Ge(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ue(r,Math.cos(e*=Ce)*t,Math.sin(e)*t)}function Ue(e,t,r){return this instanceof Ue?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Ue?new Ue(e.l,e.a,e.b):e instanceof He?Ge(e.h,e.c,e.l):it((e=Qe(e)).r,e.g,e.b):new Ue(e,t,r)}Ye.brighter=function(e){return new He(this.h,this.c,Math.min(100,this.l+qe*(arguments.length?e:1)))},Ye.darker=function(e){return new He(this.h,this.c,Math.max(0,this.l-qe*(arguments.length?e:1)))},Ye.rgb=function(){return Ge(this.h,this.c,this.l).rgb()},e.lab=Ue;var qe=18,Ve=Ue.prototype=new ze;function Ze(e,t,r){var n=(e+16)/116,a=n+t/500,i=n-r/200;return new Qe(Ke(3.2404542*(a=.95047*Je(a))-1.5371385*(n=1*Je(n))-.4985314*(i=1.08883*Je(i))),Ke(-.969266*a+1.8760108*n+.041556*i),Ke(.0556434*a-.2040259*n+1.0572252*i))}function We(e,t,r){return e>0?new He(Math.atan2(r,t)*Pe,Math.sqrt(t*t+r*r),e):new He(NaN,NaN,e)}function Je(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function Xe(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Ke(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function Qe(e,t,r){return this instanceof Qe?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof Qe?new Qe(e.r,e.g,e.b):nt(""+e,Qe,Be):new Qe(e,t,r)}function $e(e){return new Qe(e>>16,e>>8&255,255&e)}function et(e){return $e(e)+""}Ve.brighter=function(e){return new Ue(Math.min(100,this.l+qe*(arguments.length?e:1)),this.a,this.b)},Ve.darker=function(e){return new Ue(Math.max(0,this.l-qe*(arguments.length?e:1)),this.a,this.b)},Ve.rgb=function(){return Ze(this.l,this.a,this.b)},e.rgb=Qe;var tt=Qe.prototype=new ze;function rt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function nt(e,t,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return t(lt(a[0]),lt(a[1]),lt(a[2]))}return(i=st.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===e.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),t(o,l,s))}function at(e,t,r){var n,a,i=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=e==o?(t-r)/l+(t0&&s<1?0:n),new Fe(n,a,s)}function it(e,t,r){var n=Xe((.4124564*(e=ot(e))+.3575761*(t=ot(t))+.1804375*(r=ot(r)))/.95047),a=Xe((.2126729*e+.7151522*t+.072175*r)/1);return Ue(116*a-16,500*(n-a),200*(a-Xe((.0193339*e+.119192*t+.9503041*r)/1.08883)))}function ot(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function lt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}tt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,a=30;return t||r||n?(t&&t=200&&t<300||304===t){try{e=a.call(o,c)}catch(e){return void l.error.call(o,e)}l.load.call(o,e)}else l.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(t){var r=e.event;e.event=t;try{l.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(null==t?delete s[e]:s[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return a=e,o},["get","post"].forEach((function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}})),o.send=function(e,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(e,t,!0),null==r||"accept"in s||(s.accept=r+",*/*"),c.setRequestHeader)for(var i in s)c.setRequestHeader(i,s[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",(function(e){a(null,e)})),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},e.rebind(o,l,"on"),null==i?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(i))}st.forEach((function(e,t){st.set(e,$e(t))})),e.functor=ct,e.xhr=ut(P),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function a(e,r,n){arguments.length<3&&(n=r,r=null);var a=ft(e,t,null==r?i:o(r),n);return a.row=function(e){return arguments.length?a.response(null==(r=e)?i:o(e)):r},a}function i(e){return a.parse(e.responseText)}function o(e){return function(t){return a.parse(t.responseText,e)}}function l(t){return t.map(s).join(e)}function s(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return a.parse=function(e,t){var r;return a.parseRows(e,(function(e,n){if(r)return r(e,n-1);var a=function(t){for(var r={},n=e.length,a=0;a=s)return o;if(a)return a=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(gt),gt=setTimeout(yt,t)),ht=0):(ht=1,vt(yt))}function bt(){for(var e=Date.now(),t=dt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function xt(){for(var e,t=dt,r=1/0;t;)t.c?(t.t1&&(t=e[i[o-2]],r=e[i[o-1]],n=e[l],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;i[o++]=l}return i.slice(0,o)}function kt(e,t){return e[0]-t[0]||e[1]-t[1]}e.timer=function(){mt.apply(this,arguments)},e.timer.flush=function(){bt(),xt()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},e.geom={},e.geom.hull=function(e){var t=_t,r=wt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,a=ct(t),i=ct(r),o=e.length,l=[],s=[];for(n=0;n=0;--n)p.push(e[l[c[n]][2]]);for(n=+f;nke)l=l.L;else{if(!((a=i-Yt(l,o))>ke)){n>-ke?(t=l.P,r=l):a>-ke?(t=l,r=l.N):t=r=l;break}if(!l.R){t=l;break}l=l.R}var s=zt(e);if(Dt.insert(t,s),t||r){if(t===r)return Zt(t),r=zt(t.site),Dt.insert(s,r),s.edge=r.edge=Xt(t.site,s.site),Vt(t),void Vt(r);if(r){Zt(t),Zt(r);var c=t.site,u=c.x,f=c.y,d=e.x-u,p=e.y-f,h=r.site,g=h.x-u,v=h.y-f,m=2*(d*v-p*g),y=d*d+p*p,b=g*g+v*v,x={x:(v*y-p*b)/m+u,y:(d*b-g*y)/m+f};Qt(r.edge,c,h,x),s.edge=Xt(c,e,null,x),r.edge=Xt(e,h,null,x),Vt(t),Vt(r)}else s.edge=Xt(t.site,s.site)}}function Ht(e,t){var r=e.site,n=r.x,a=r.y,i=a-t;if(!i)return n;var o=e.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-t;if(!c)return l;var u=l-n,f=1/i-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-i/2)))/f+n:(n+l)/2}function Yt(e,t){var r=e.N;if(r)return Ht(r,t);var n=e.site;return n.y===t?n.x:1/0}function Gt(e){this.site=e,this.edges=[]}function Ut(e,t){return t.angle-e.angle}function qt(){tr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vt(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,a=e.site,i=r.site;if(n!==i){var o=a.x,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=2*(s*(v=i.y-l)-c*u);if(!(f>=-1e-12)){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=Nt.pop()||new qt;m.arc=e,m.site=a,m.x=h+o,m.y=v+Math.sqrt(h*h+g*g),m.cy=v,e.circle=m;for(var y=null,b=Rt._;b;)if(m.y=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.y1)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=l)return}else i={x:o,y:n*o+a};r={x:l,y:n*l+a}}else{if(i){if(i.x0)){if(t/=d,d<0){if(t0){if(t>f)return;t>u&&(u=t)}if(t=a-s,d||!(t<0)){if(t/=d,d<0){if(t>f)return;t>u&&(u=t)}else if(d>0){if(t0)){if(t/=p,p<0){if(t0){if(t>f)return;t>u&&(u=t)}if(t=i-c,p||!(t<0)){if(t/=p,p<0){if(t>f)return;t>u&&(u=t)}else if(p>0){if(t0&&(e.a={x:s+u*d,y:c+u*p}),f<1&&(e.b={x:s+f*d,y:c+f*p}),e}}}}}),s=o.length;s--;)(!Wt(t=o[s],e)||!l(t)||y(t.a.x-t.b.x)ke||y(a-r)>ke)&&(l.splice(o,0,new $t(Kt(i.site,u,y(n-f)ke?{x:f,y:y(t-f)ke?{x:y(r-h)ke?{x:d,y:y(t-d)ke?{x:y(r-p)=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=e[l]})),t}function l(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/ke)*ke,y:Math.round(a(e,t)/ke)*ke,i:t}}))}return o.links=function(e){return ir(l(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return ir(l(e)).cells.forEach((function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(Ut),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++ui||f>o||d=_)<<1|t>=x,M=w+4;wi&&(a=t.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(n=n[0])?l[o]?l[o]+=n:l[++o]=n:(l[++o]=null,s.push({i:o,x:hr(r,n)})),i=mr.lastIndex;return ig&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;fg&&(g=x),_>v&&(v=_),c.push(x),u.push(_)}var w=g-p,M=v-h;function k(e,t,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var s=e.x,c=e.y;if(null!=s)if(y(s-r)+y(c-n)<.01)T(e,t,r,n,a,i,o,l);else{var u=e.point;e.x=e.y=e.point=null,T(e,u,s,c,a,i,o,l),T(e,t,r,n,a,i,o,l)}else e.x=r,e.y=n,e.point=t}else T(e,t,r,n,a,i,o,l)}function T(e,t,r,n,a,i,o,l){var s=.5*(a+o),c=.5*(i+l),u=r>=s,f=n>=c,d=f<<1|u;e.leaf=!1,u?a=s:o=s,f?i=c:l=c,k(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,a,i,o,l)}w>M?v=h+w:g=p+M;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){k(A,e,+m(e,++f),+b(e,f),p,h,g,v)},visit:function(e){ur(e,A,p,h,g,v)},find:function(e){return fr(A,e[0],e[1],p,h,g,v)}};if(f=-1,null==t){for(;++f=0&&!(n=e.interpolators[a](t,r)););return n}function br(e,t){var r,n=[],a=[],i=e.length,o=t.length,l=Math.min(e.length,t.length);for(r=0;r=1?1:e(t)}}function kr(e){return function(t){return 1-e(1-t)}}function Tr(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Ar(e){return e*e}function Sr(e){return e*e*e}function Lr(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Cr(e){return 1-Math.cos(e*Le)}function Pr(e){return Math.pow(2,10*(e-1))}function Dr(e){return 1-Math.sqrt(1-e*e)}function Or(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Rr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Er(e){var t,r,n,a=[e.a,e.b],i=[e.c,e.d],o=Ir(a),l=Nr(a,i),s=Ir(((t=i)[0]+=(n=-l)*(r=a)[0],t[1]+=n*r[1],t))||0;a[0]*i[1]=0?e.slice(0,t):e,a=t>=0?e.slice(t+1):"in";return n=_r.get(n)||xr,Mr((a=wr.get(a)||P)(n.apply(null,r.call(arguments,1))))},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,a=t.c,i=t.l,o=r.h-n,l=r.c-a,s=r.l-i;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(e){return Ge(n+o*e,a+l*e,i+s*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,a=t.s,i=t.l,o=r.h-n,l=r.s-a,s=r.l-i;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(e){return Be(n+o*e,a+l*e,i+s*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,a=t.a,i=t.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(e){return Ze(n+o*e,a+l*e,i+s*e)+""}},e.interpolateRound=Rr,e.transform=function(t){var r=a.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new Er(t?t.matrix:zr)})(t)},Er.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var zr={a:1,b:0,c:0,d:1,e:0,f:0};function Fr(e){return e.length?e.pop()+",":""}function jr(t,r){var n=[],a=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:hr(e[0],t[0])},{i:a-2,x:hr(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,a),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Fr(r)+"rotate(",null,")")-2,x:hr(e,t)})):t&&r.push(Fr(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,a),function(e,t,r,n){e!==t?n.push({i:r.push(Fr(r)+"skewX(",null,")")-2,x:hr(e,t)}):t&&r.push(Fr(r)+"skewX("+t+")")}(t.skew,r.skew,n,a),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push(Fr(r)+"scale(",null,",",null,")");n.push({i:a-4,x:hr(e[0],t[0])},{i:a-2,x:hr(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Fr(r)+"scale("+t+")")}(t.scale,r.scale,n,a),t=r=null,function(e){for(var t,r=-1,i=a.length;++r0?n=e:(t.c=null,t.t=NaN,t=null,s.end({type:"end",alpha:n=0})):e>0&&(s.start({type:"start",alpha:n=e}),t=mt(l.tick)),l):n},l.start=function(){var e,t,r,n=m.length,s=y.length,u=c[0],h=c[1];for(e=0;e=0;)r.push(a[n])}function $r(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(i=e.children)&&(a=i.length))for(var a,i,o=-1;++o=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 $r(a,(function(t){var n,a;e&&(n=t.children)&&n.sort(e),r&&(a=t.parent)&&(a.value+=t.value)})),l}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(Qr(e,(function(e){e.children&&(e.value=0)})),$r(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,n){var a=t.call(this,e,n);return function e(t,r,n,a){var i=t.children;if(t.x=r,t.y=t.depth*a,t.dx=n,t.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=t.value?n/t.value:0;++cl&&(l=n),o.push(n)}for(r=0;ra&&(n=r,a=t);return n}function hn(e){return e.reduce(gn,0)}function gn(e,t){return e+t[1]}function vn(e,t){return mn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function mn(e,t){for(var r=-1,n=+e[0],a=(e[1]-n)/t,i=[];++r<=t;)i[r]=a*r+n;return i}function yn(t){return[e.min(t),e.max(t)]}function bn(e,t){return e.value-t.value}function xn(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function _n(e,t){e._pack_next=t,t._pack_prev=e}function wn(e,t){var r=t.x-e.x,n=t.y-e.y,a=e.r+t.r;return.999*a*a>r*r+n*n}function Mn(e){if((t=e.children)&&(s=t.length)){var t,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(t.forEach(kn),(r=t[0]).x=-r.r,r.y=0,b(r),s>1&&((n=t[1]).x=n.r,n.y=0,b(n),s>2))for(An(r,n,a=t[2]),b(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&s<=f[1]&&((l=c[e.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(e){return arguments.length?(r=e,i):r},i.range=function(e){return arguments.length?(n=ct(e),i):n},i.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return mn(t,e)}:ct(e),i):a},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(bn),n=0,a=[1,1];function i(e,i){var o=r.call(this,e,i),l=o[0],s=a[0],c=a[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(l.x=l.y=0,$r(l,(function(e){e.r=+u(e.value)})),$r(l,Mn),n){var f=n*(t?1:Math.max(2*l.r/s,2*l.r/c))/2;$r(l,(function(e){e.r+=f})),$r(l,Mn),$r(l,(function(e){e.r-=f}))}return function e(t,r,n,a){var i=t.children;if(t.x=r+=a*t.x,t.y=n+=a*t.y,t.r*=a,i)for(var o=-1,l=i.length;++op.x&&(p=e),e.depth>h.depth&&(h=e)}));var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),m=n[1]/(h.depth||1);Qr(u,(function(e){e.x=(e.x+g)*v,e.y=e.depth*m}))}return c}function o(e){var t=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(t.length){!function(e){var t,r=0,n=0,a=e.children,i=a.length;for(;--i>=0;)(t=a[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var i=(t[0].z+t[t.length-1].z)/2;a?(e.z=a.z+r(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+r(e._,a._));e.parent.A=function(e,t,n){if(t){for(var a,i=e,o=e,l=t,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=Cn(l),i=Ln(i),l&&i;)s=Ln(s),(o=Cn(o)).a=e,(a=l.z+f-i.z-c+r(l._,i._))>0&&(Pn(Dn(l,e,n),e,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!Cn(o)&&(o.t=l,o.m+=f-u),i&&!Ln(s)&&(s.t=i,s.m+=c-d,n=e)}return n}(e,a,e.parent.A||n[0])}function l(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e)?s:null,i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null==(n=e)?null:s,i):a?n:null},Kr(i,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],a=!1;function i(i,o){var l,s=t.call(this,i,o),c=s[0],u=0;$r(c,(function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),t.y=function(t){return 1+e.max(t,(function(e){return e.y}))}(n)):(t.x=l?u+=r(t,l):0,t.y=0,l=t)}));var f=function e(t){var r=t.children;return r&&r.length?e(r[0]):t}(c),d=function e(t){var r,n=t.children;return n&&(r=n.length)?e(n[r-1]):t}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return $r(c,a?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-p)/(h-p)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),s}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e),i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null!=(n=e),i):a?n:null},Kr(i,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=On,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,a=-1,i=e.length;++a0;)l.push(r=c[a-1]),l.area+=r.area,"squarify"!==s||(n=p(l,g))<=d?(c.pop(),d=n):(l.area-=l.pop().area,h(l,g,i,!1),g=Math.min(i.dx,i.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,i,!0),l.length=l.area=0),t.forEach(f)}}function d(e){var t=e.children;if(t&&t.length){var r,n=o(e),a=t.slice(),i=[];for(u(a,n.dx*n.dy/e.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(h(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);t.forEach(d)}}function p(e,t){for(var r,n=e.area,a=0,i=1/0,o=-1,l=e.length;++oa&&(a=r));return t*=t,(n*=n)?Math.max(t*a*c/n,n/(t*i*c)):1/0}function h(e,t,r,a){var i,o=-1,l=e.length,s=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((a||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return e+t*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?Bn:In,l=a?Hr:Br;return i=e(t,r,l,n),o=e(r,t,l,yr),s}function s(e){return i(e)}return s.invert=function(e){return o(e)},s.domain=function(e){return arguments.length?(t=e.map(Number),l()):t},s.range=function(e){return arguments.length?(r=e,l()):r},s.rangeRound=function(e){return s.range(e).interpolate(Rr)},s.clamp=function(e){return arguments.length?(a=e,l()):a},s.interpolate=function(e){return arguments.length?(n=e,l()):n},s.ticks=function(e){return Un(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Yn(t,e),l()},s.copy=function(){return e(t,r,n,a)},l()}([0,1],[0,1],yr,!1)};e.scale.log=function(){return function e(t,r,n,a){function i(e){return(n?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(r)}function o(e){return n?Math.pow(r,e):-Math.pow(r,-e)}function l(e){return t(i(e))}return l.invert=function(e){return o(t.invert(e))},l.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((a=e.map(Number)).map(i)),l):a},l.base=function(e){return arguments.length?(r=+e,t.domain(a.map(i)),l):r},l.nice=function(){var e=zn(a.map(i),n?Math:qn);return t.domain(e),a=e.map(o),l},l.ticks=function(){var e=En(a),t=[],l=e[0],s=e[1],c=Math.floor(i(l)),u=Math.ceil(i(s)),f=r%1?2:r;if(isFinite(u-c)){if(n){for(;c0;d--)t.push(o(c)*d);for(c=0;t[c]s;u--);t=t.slice(c,u)}return t},l.copy=function(){return e(t.copy(),r,n,a)},Hn(l,t)}(e.scale.linear().domain([0,1]),10,!0,[1,10])};var qn={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Vn(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}e.scale.pow=function(){return function e(t,r,n){var a=Vn(r),i=Vn(1/r);function o(e){return t(a(e))}return o.invert=function(e){return i(t.invert(e))},o.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(a)),o):n},o.ticks=function(e){return Un(n,e)},o.tickFormat=function(e,t){return d3_scale_linearTickFormat(n,e,t)},o.nice=function(e){return o.domain(Yn(n,e))},o.exponent=function(e){return arguments.length?(a=Vn(r=e),i=Vn(1/r),t.domain(n.map(a)),o):r},o.copy=function(){return e(t.copy(),r,n)},Hn(o,t)}(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return function t(r,n){var a,i,o;function l(e){return i[((a.get(e)||("range"===n.t?a.set(e,r.push(e)):NaN))-1)%i.length]}function s(t,n){return e.range(r.length).map((function(e){return t+n*e}))}return l.domain=function(e){if(!arguments.length)return r;r=[],a=new _;for(var t,i=-1,o=e.length;++i0?a[e-1]:r[0],ef?0:1;if(c=Se)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,m,y,b,x,_,w,M,k,T,A=0,S=0,L=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Qn?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=De(v/c*Math.sin(m))),l&&(A=De(v/l*Math.sin(m)))),c){y=c*Math.cos(u+S),b=c*Math.sin(u+S),x=c*Math.cos(f-S),_=c*Math.sin(f-S);var C=Math.abs(f-u-2*S)<=Te?0:1;if(S&&aa(y,b,x,_)===p^C){var P=(u+f)/2;y=c*Math.cos(P),b=c*Math.sin(P),x=_=null}}else y=b=0;if(l){w=l*Math.cos(f-A),M=l*Math.sin(f-A),k=l*Math.cos(u+A),T=l*Math.sin(u+A);var D=Math.abs(u-f+2*A)<=Te?0:1;if(A&&aa(w,M,k,T)===1-p^D){var O=(u+f)/2;w=l*Math.cos(O),M=l*Math.sin(O),k=T=null}}else w=M=0;if(d>ke&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l0?0:1}function ia(e,t,r,n,a){var i=e[0]-t[0],o=e[1]-t[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=e[0]+s,f=e[1]+c,d=t[0]+s,p=t[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,m=p-f,y=v*v+m*m,b=r-n,x=u*p-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,M=(-x*v-m*_)/y,k=(x*m+v*_)/y,T=(-x*v+m*_)/y,A=w-h,S=M-g,L=k-h,C=T-g;return A*A+S*S>L*L+C*C&&(w=k,M=T),[[w-s,M-c],[w*r/b,M*r/b]]}function oa(){return!0}function la(e){var t=_t,r=wt,n=oa,a=ca,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=ct(t),p=ct(r);function h(){s.push("M",a(e(c),o))}for(;++u1&&a.push("H",n[0]);return a.join("")},"step-before":fa,"step-after":da,basis:ga,"basis-open":function(e){if(e.length<4)return ca(e);var t,r=[],n=-1,a=e.length,i=[0],o=[0];for(;++n<3;)t=e[n],i.push(t[0]),o.push(t[1]);r.push(va(ba,i)+","+va(ba,o)),--n;for(;++n9&&(a=3*t/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(e[Math.min(s,l+1)][0]-e[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(e))}});function ca(e){return e.length>1?e.join("L"):e+"Z"}function ua(e){return e.join("L")+"Z"}function fa(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t1){l=t[1],i=e[s],s++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var c=2;cTe)+",1 "+t}function s(e,t,r,n){return"Q 0,0 "+n}return i.radius=function(e){return arguments.length?(r=ct(e),i):r},i.source=function(t){return arguments.length?(e=ct(t),i):e},i.target=function(e){return arguments.length?(t=ct(e),i):t},i.startAngle=function(e){return arguments.length?(n=ct(e),i):n},i.endAngle=function(e){return arguments.length?(a=ct(e),i):a},i},e.svg.diagonal=function(){var e=ka,t=Ta,r=Sa;function n(n,a){var i=e.call(this,n,a),o=t.call(this,n,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return"M"+(s=s.map(r))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return n.source=function(t){return arguments.length?(e=ct(t),n):e},n.target=function(e){return arguments.length?(t=ct(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=Sa,n=t.projection;return t.projection=function(e){return arguments.length?n(La(r=e)):r},t},e.svg.symbol=function(){var e=Pa,t=Ca;function r(r,n){return(Oa.get(e.call(this,r,n))||Da)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=ct(t),r):e},r.size=function(e){return arguments.length?(t=ct(e),r):t},r};var Oa=e.map({circle:Da,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Ea)),r=t*Ea;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Ra),r=t*Ra/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ra),r=t*Ra/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=Oa.keys();var Ra=Math.sqrt(3),Ea=Math.tan(30*Ce);V.transition=function(e){for(var t,r,n=Fa||++Ha,a=Ua(e),i=[],o=ja||{time:Date.now(),ease:Lr,delay:0,duration:250},l=-1,s=this.length;++l0;)c[--d].call(e,o);if(i>=1)return f.event&&f.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}f||(i=a.time,o=mt((function(e){var t=f.delay;if(o.t=t+i,t<=e)return d(e-t);o.c=d}),0,i),f=u[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:t},a=null,++u.count)}Ba.call=V.call,Ba.empty=V.empty,Ba.node=V.node,Ba.size=V.size,e.transition=function(t,r){return t&&t.transition?Fa?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=Ba,Ba.select=function(e){var t,r,n,a=this.id,i=this.namespace,o=[];e=Z(e);for(var l=-1,s=this.length;++lrect,.s>rect").attr("width",l[1]-l[0])}function g(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,m=this,y=e.select(e.event.target),b=n.of(m,arguments),x=e.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,M=!/^(e|w)$/.test(_)&&i,k=y.classed("extent"),T=xe(m),A=e.mouse(m),S=e.select(o(m)).on("keydown.brush",P).on("keyup.brush",D);if(e.event.changedTouches?S.on("touchmove.brush",O).on("touchend.brush",E):S.on("mousemove.brush",O).on("mouseup.brush",E),x.interrupt().selectAll("*").interrupt(),k)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var L=+/w$/.test(_),C=+/^n/.test(_);v=[l[1-L]-A[0],s[1-C]-A[1]],A[0]=l[L],A[1]=s[C]}else e.event.altKey&&(f=A.slice());function P(){32==e.event.keyCode&&(k||(f=null,A[0]-=l[1],A[1]-=s[1],k=2),z())}function D(){32==e.event.keyCode&&2==k&&(A[0]+=l[1],A[1]+=s[1],k=0,z())}function O(){var t=e.mouse(m),r=!1;v&&(t[0]+=v[0],t[1]+=v[1]),k||(e.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(t[0]0){t+=Math.abs(i(e[0]));for(var r=1;r2){for(l=0;l=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},r.radiansToLength=f,r.lengthToRadians=d,r.lengthToDegrees=function(e,t){return p(d(e,t))},r.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},r.radiansToDegrees=p,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(d(e,t),r)},r.convertArea=function(e,t,n){if(void 0===t&&(t="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var a=r.areaFactors[t];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return e/a*i},r.isNumber=h,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!h(e))throw new Error("bbox must only contain numbers")}))},r.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},{}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/helpers");function a(e,t,r){if(null!==e)for(var n,i,o,l,s,c,u,f,d=0,p=0,h=e.type,g="FeatureCollection"===h,v="Feature"===h,m=g?e.features.length:1,y=0;yc||p>u||h>f)return s=a,c=r,u=p,f=h,void(o=0);var g=n.lineString([s,a],e.properties);if(!1===t(g,r,i,h,o))return!1;o++,s=a}))&&void 0}}}))}function u(e,t){if(!e)throw new Error("geojson is required");s(e,(function(e,r,a){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,r,a,0,0))return!1;break;case"Polygon":for(var l=0;le[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},r.radiansToLength=f,r.lengthToRadians=d,r.lengthToDegrees=function(e,t){return p(d(e,t))},r.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},r.radiansToDegrees=p,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(d(e,t),r)},r.convertArea=function(e,t,n){if(void 0===t&&(t="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var a=r.areaFactors[t];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return e/a*i},r.isNumber=h,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!h(e))throw new Error("bbox must only contain numbers")}))},r.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/helpers");function a(e,t,r){if(null!==e)for(var n,i,o,l,s,c,u,f,d=0,p=0,h=e.type,g="FeatureCollection"===h,v="Feature"===h,m=g?e.features.length:1,y=0;yc||p>u||h>f)return s=a,c=r,u=p,f=h,void(o=0);var g=n.lineString([s,a],e.properties);if(!1===t(g,r,i,h,o))return!1;o++,s=a}))&&void 0}}}))}function u(e,t){if(!e)throw new Error("geojson is required");s(e,(function(e,r,a){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,r,a,0,0))return!1;break;case"Polygon":for(var l=0;l0&&o.length>a&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,l=s,console&&console.warn&&console.warn(l)}return e}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(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=d.bind(n);return a.listener=r,n.wrapFn=a,a}function h(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var s=a[e];if(void 0===s)return!1;if("function"==typeof s)i(s,this,t);else{var c=s.length,u=v(s,c);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},l.prototype.listeners=function(e){return h(this,e,!0)},l.prototype.rawListeners=function(e){return h(this,e,!1)},l.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},l.prototype.listenerCount=g,l.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],22:[function(e,t,r){t.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],23:[function(e,t,r){!function(e,n){n("object"==typeof r&&void 0!==t?r:e.d3=e.d3||{})}(this,(function(e){"use strict";function t(e,t){return et?1:e>=t?0:NaN}function r(e){var r;return 1===e.length&&(r=e,e=function(e,n){return t(r(e),n)}),{left:function(t,r,n,a){for(null==n&&(n=0),null==a&&(a=t.length);n>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(null==n&&(n=0),null==a&&(a=t.length);n>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}var n=r(t),a=n.right,i=n.left;function o(e,t){return[e,t]}function l(e){return null===e?NaN:+e}function s(e,t){var r,n,a=e.length,i=0,o=-1,s=0,c=0;if(null==t)for(;++o1)return c/(i-1)}function c(e,t){var r=s(e,t);return r?Math.sqrt(r):r}function u(e,t){var r,n,a,i=e.length,o=-1;if(null==t){for(;++o=r)for(n=a=r;++or&&(n=r),a=r)for(n=a=r;++or&&(n=r),a=0?(i>=m?10:i>=y?5:i>=b?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=m?10:i>=y?5:i>=b?2:1)}function _(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),i=n/a;return i>=m?a*=10:i>=y?a*=5:i>=b&&(a*=2),t=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e);return o+(+r(e[i+1],i+1,e)-o)*(a-i)}}function k(e,t){var r,n,a=e.length,i=-1;if(null==t){for(;++i=r)for(n=r;++ir&&(n=r)}else for(;++i=r)for(n=r;++ir&&(n=r);return n}function T(e){if(!(a=e.length))return[];for(var t=-1,r=k(e,A),n=new Array(r);++te?1:t>=e?0:NaN},e.deviation=c,e.extent=u,e.histogram=function(){var e=g,t=u,r=w;function n(n){var i,o,l=n.length,s=new Array(l);for(i=0;if;)d.pop(),--p;var h,g=new Array(p+1);for(i=0;i<=p;++i)(h=g[i]=[]).x0=i>0?d[i-1]:u,h.x1=i=r)for(n=r;++in&&(n=r)}else for(;++i=r)for(n=r;++in&&(n=r);return n},e.mean=function(e,t){var r,n=e.length,a=n,i=-1,o=0;if(null==t)for(;++i=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r},e.min=k,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,n=e.length-1,a=e[0],i=new Array(n<0?0:n);r0)return[e];if((n=t0)for(e=Math.ceil(e/o),t=Math.floor(t/o),i=new Array(a=Math.ceil(t-e+1));++l1?n[0]+n.slice(2):n,+e.slice(r+1)]}function r(e){return(e=t(Math.abs(e)))?e[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(e){if(!(t=a.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function l(e,r){var n=t(e,r);if(!n)return e+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var s={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return l(100*e,t)},r:l,s:function(e,r){var a=t(e,r);if(!a)return e+"";var i=a[0],o=a[1],l=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,s=i.length;return l===s?i:l>s?i+new Array(l-s+1).join("0"):l>0?i.slice(0,l)+"."+i.slice(l):"0."+new Array(1-l).join("0")+t(e,Math.max(0,r+l-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var u,f=Array.prototype.map,d=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function p(e){var t,a,o=void 0===e.grouping||void 0===e.thousands?c:(t=f.call(e.grouping,Number),a=e.thousands+"",function(e,r){for(var n=e.length,i=[],o=0,l=t[0],s=0;n>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),i.push(e.substring(n-=l,n+l)),!((s+=l+1)>r));)l=t[o=(o+1)%t.length];return i.reverse().join(a)}),l=void 0===e.currency?"":e.currency[0]+"",u=void 0===e.currency?"":e.currency[1]+"",p=void 0===e.decimal?".":e.decimal+"",h=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(f.call(e.numerals,String)),g=void 0===e.percent?"%":e.percent+"",v=void 0===e.minus?"-":e.minus+"",m=void 0===e.nan?"NaN":e.nan+"";function y(e){var t=(e=i(e)).fill,r=e.align,a=e.sign,c=e.symbol,f=e.zero,y=e.width,b=e.comma,x=e.precision,_=e.trim,w=e.type;"n"===w?(b=!0,w="g"):s[w]||(void 0===x&&(x=12),_=!0,w="g"),(f||"0"===t&&"="===r)&&(f=!0,t="0",r="=");var M="$"===c?l:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===c?u:/[%p]/.test(w)?g:"",T=s[w],A=/[defgprs%]/.test(w);function S(e){var i,l,s,c=M,u=k;if("c"===w)u=T(e)+u,e="";else{var g=(e=+e)<0||1/e<0;if(e=isNaN(e)?m:T(Math.abs(e),x),_&&(e=function(e){e:for(var t,r=e.length,n=1,a=-1;n0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),g&&0==+e&&"+"!==a&&(g=!1),c=(g?"("===a?a:v:"-"===a||"("===a?"":a)+c,u=("s"===w?d[8+n/3]:"")+u+(g&&"("===a?")":""),A)for(i=-1,l=e.length;++i(s=e.charCodeAt(i))||s>57){u=(46===s?p+e.slice(i+1):e.slice(i))+u,e=e.slice(0,i);break}}b&&!f&&(e=o(e,1/0));var S=c.length+e.length+u.length,L=S>1)+c+e+u+L.slice(S);break;default:e=L+c+e+u}return h(e)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),S.toString=function(){return e+""},S}return{format:y,formatPrefix:function(e,t){var n=y(((e=i(e)).type="f",e)),a=3*Math.max(-8,Math.min(8,Math.floor(r(t)/3))),o=Math.pow(10,-a),l=d[8+a/3];return function(e){return n(o*e)+l}}}}function h(t){return u=p(t),e.format=u.format,e.formatPrefix=u.formatPrefix,u}h({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),e.FormatSpecifier=o,e.formatDefaultLocale=h,e.formatLocale=p,e.formatSpecifier=i,e.precisionFixed=function(e){return Math.max(0,-r(Math.abs(e)))},e.precisionPrefix=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(t)/3)))-r(Math.abs(e)))},e.precisionRound=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r(t)-r(e))+1},Object.defineProperty(e,"__esModule",{value:!0})}))},{}],25:[function(e,t,r){!function(n,a){"object"==typeof r&&void 0!==t?a(r,e("d3-geo"),e("d3-array")):a(n.d3=n.d3||{},n.d3,n.d3)}(this,(function(e,t,r){"use strict";var n=Math.abs,a=Math.atan,i=Math.atan2,o=Math.cos,l=Math.exp,s=Math.floor,c=Math.log,u=Math.max,f=Math.min,d=Math.pow,p=Math.round,h=Math.sign||function(e){return e>0?1:e<0?-1:0},g=Math.sin,v=Math.tan,m=1e-6,y=Math.PI,b=y/2,x=y/4,_=Math.SQRT1_2,w=C(2),M=C(y),k=2*y,T=180/y,A=y/180;function S(e){return e>1?b:e<-1?-b:Math.asin(e)}function L(e){return e>1?0:e<-1?y:Math.acos(e)}function C(e){return e>0?Math.sqrt(e):0}function P(e){return(l(e)-l(-e))/2}function D(e){return(l(e)+l(-e))/2}function O(e){var t=v(e/2),r=2*c(o(e/2))/(t*t);function a(e,t){var n=o(e),a=o(t),i=g(t),l=a*n,s=-((1-l?c((1+l)/2)/(1-l):-.5)+r/(1+l));return[s*a*g(e),s*i]}return a.invert=function(t,a){var l,s=C(t*t+a*a),u=-e/2,f=50;if(!s)return[0,0];do{var d=u/2,p=o(d),h=g(d),v=h/p,y=-c(n(p));u-=l=(2/v*y-r*v-s)/(-y/(h*h)+1-r/(2*p*p))*(p<0?.7:1)}while(n(l)>m&&--f>0);var b=g(u);return[i(t*b,s*o(u)),S(a*b/s)]},a}function R(e,t){var r=o(t),n=function(e){return e?e/Math.sin(e):1}(L(r*o(e/=2)));return[2*r*g(e)*n,g(t)*n]}function E(e){var t=g(e),r=o(e),a=e>=0?1:-1,l=v(a*e),s=(1+t-r)/2;function c(e,n){var c=o(n),u=o(e/=2);return[(1+c)*g(e),(a*n>-i(u,l)-.001?0:10*-a)+s+g(n)*r-(1+c)*t*u]}return c.invert=function(e,c){var u=0,f=0,d=50;do{var p=o(u),h=g(u),v=o(f),y=g(f),b=1+v,x=b*h-e,_=s+y*r-b*t*p-c,w=b*p/2,M=-h*y,k=t*b*h/2,T=r*v+t*p*y,A=M*k-T*w,S=(_*M-x*T)/A/2,L=(x*k-_*w)/A;n(L)>2&&(L/=2),u-=S,f-=L}while((n(S)>m||n(L)>m)&&--d>0);return a*f>-i(o(u),l)-.001?[2*u,f]:null},c}function N(e,t){var r=v(t/2),n=C(1-r*r),a=1+n*o(e/=2),i=g(e)*n/a,l=r/a,s=i*i,c=l*l;return[4/3*i*(3+s-3*c),4/3*l*(3+3*s-c)]}R.invert=function(e,t){if(!(e*e+4*t*t>y*y+m)){var r=e,a=t,i=25;do{var l,s=g(r),c=g(r/2),u=o(r/2),f=g(a),d=o(a),p=g(2*a),h=f*f,v=d*d,b=c*c,x=1-v*u*u,_=x?L(d*u)*C(l=1/x):l=0,w=2*_*d*c-e,M=_*f-t,k=l*(v*b+_*d*u*h),T=l*(.5*s*p-2*_*f*c),A=.25*l*(p*c-_*f*v*s),S=l*(h*u+_*b*d),P=T*A-S*k;if(!P)break;var D=(M*T-w*S)/P,O=(w*A-M*k)/P;r-=D,a-=O}while((n(D)>m||n(O)>m)&&--i>0);return[r,a]}},N.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&n(t)>1)return null;var r=1+e*e+t*t,a=C((r-C(r*r-4*t*t))/2),l=S(a)/3,s=a?function(e){return c(e+C(e*e-1))}(n(t/a))/3:function(e){return c(e+C(e*e+1))}(n(e))/3,u=o(l),f=D(s),d=f*f-u*u;return[2*h(e)*i(P(s)*u,.25-d),2*h(t)*i(f*g(l),.25+d)]};var I=C(8),z=c(1+w);function F(e,t){var r=n(t);return rb){var s=i(l[1],l[0]),c=C(l[0]*l[0]+l[1]*l[1]),u=r*p((s-b)/r)+b,f=i(g(s-=u),2-o(s));s=u+S(y/c*g(f))-f,l[0]=c*o(s),l[1]=c*g(s)}return l}return l.invert=function(e,n){var l=C(e*e+n*n);if(l>b){var s=i(n,e),c=r*p((s-b)/r)+b,u=s>c?-1:1,f=l*o(c-s),d=1/v(u*L((f-y)/C(y*(y-2*f)+l*l)));s=c+2*a((d+u*C(d*d-3))/3),e=l*o(s),n=l*g(s)}return t.geoAzimuthalEquidistantRaw.invert(e,n)},l}function B(e,r){if(arguments.length<2&&(r=e),1===r)return t.geoAzimuthalEqualAreaRaw;if(r===1/0)return H;function n(n,a){var i=t.geoAzimuthalEqualAreaRaw(n/r,a);return i[0]*=e,i}return n.invert=function(n,a){var i=t.geoAzimuthalEqualAreaRaw.invert(n/e,a);return i[0]*=r,i},n}function H(e,t){return[e*o(t)/o(t/=2),2*g(t)]}function Y(e,t,r){var a,i,o,l=100;r=void 0===r?0:+r,t=+t;do{(i=e(r))===(o=e(r+m))&&(o=i+m),r-=a=-1*m*(i-t)/(i-o)}while(l-- >0&&n(a)>m);return l<0?NaN:r}function G(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=1e-12),function(a,i,o,l){var s,c,u;o=void 0===o?0:+o,l=void 0===l?0:+l;for(var f=0;fs)o-=c/=2,l-=u/=2;else{s=g;var v=(o>0?-1:1)*r,m=(l>0?-1:1)*r,y=e(o+v,l),b=e(o,l+m),x=(y[0]-d[0])/v,_=(y[1]-d[1])/v,w=(b[0]-d[0])/m,M=(b[1]-d[1])/m,k=M*x-_*w,T=(n(k)<.5?.5:1)/k;if(o+=c=(h*w-p*M)*T,l+=u=(p*_-h*x)*T,n(c)0&&(a[1]*=1+i/1.5*a[0]*a[0]),a}return t.invert=G(t),t}function q(e,t){var r,a=e*g(t),i=30;do{t-=r=(t+g(t)-a)/(1+o(t))}while(n(r)>m&&--i>0);return t/2}function V(e,t,r){function n(n,a){return[e*n*o(a=q(r,a)),t*g(a)]}return n.invert=function(n,a){return a=S(a/t),[n/(e*o(a)),S((2*a+g(2*a))/r)]},n}F.invert=function(e,t){if((i=n(t))1e-12&&--u>0);return[e/(o(s)*(I-1/g(s))),h(t)*s]},H.invert=function(e,t){var r=2*S(t/2);return[e*o(r/2)/o(r),r]};var Z=V(w/b,w,y);var W=2.00276,J=1.11072;function X(e,t){var r=q(y,t);return[W*e/(1/o(t)+J/o(r)),(t+w*g(r))/W]}function K(e){var r=0,n=t.geoProjectionMutator(e),a=n(r);return a.parallel=function(e){return arguments.length?n(r=e*A):r*T},a}function Q(e,t){return[e*o(t),t]}function $(e){if(!e)return Q;var t=1/v(e);function r(r,n){var a=t+e-n,i=a?r*o(n)/a:a;return[a*g(i),t-a*o(i)]}return r.invert=function(r,n){var a=C(r*r+(n=t-n)*n),l=t+e-a;return[a/o(l)*i(r,n),l]},r}function ee(e){function t(t,r){var n=b-r,a=n?t*e*g(n)/n:n;return[n*g(a)/e,b-n*o(a)]}return t.invert=function(t,r){var n=t*e,a=b-r,o=C(n*n+a*a),l=i(n,a);return[(o?o/g(o):1)*l/e,b-o]},t}X.invert=function(e,t){var r,a,i=W*t,l=t<0?-x:x,s=25;do{a=i-w*g(l),l-=r=(g(2*l)+2*l-y*g(a))/(2*o(2*l)+2+y*o(a)*w*o(l))}while(n(r)>m&&--s>0);return a=i-w*g(l),[e*(1/o(a)+J/o(l))/W,a]},Q.invert=function(e,t){return[e/o(t),t]};var te=V(1,4/y,y);function re(e,t,r,a,l,s){var c,u=o(s);if(n(e)>1||n(s)>1)c=L(r*l+t*a*u);else{var f=g(e/2),d=g(s/2);c=2*S(C(f*f+t*a*d*d))}return n(c)>m?[c,i(a*g(s),t*l-r*a*u)]:[0,0]}function ne(e,t,r){return L((e*e+t*t-r*r)/(2*e*t))}function ae(e){return e-2*y*s((e+y)/(2*y))}function ie(e,t,r){for(var n,a=[[e[0],e[1],g(e[1]),o(e[1])],[t[0],t[1],g(t[1]),o(t[1])],[r[0],r[1],g(r[1]),o(r[1])]],i=a[2],l=0;l<3;++l,i=n)n=a[l],i.v=re(n[1]-i[1],i[3],i[2],n[3],n[2],n[0]-i[0]),i.point=[0,0];var s=ne(a[0].v[0],a[2].v[0],a[1].v[0]),c=ne(a[0].v[0],a[1].v[0],a[2].v[0]),u=y-s;a[2].point[1]=0,a[0].point[0]=-(a[1].point[0]=a[0].v[0]/2);var f=[a[2].point[0]=a[0].point[0]+a[2].v[0]*o(s),2*(a[0].point[1]=a[1].point[1]=a[2].v[0]*g(s))];return function(e,t){var r,n=g(t),i=o(t),l=new Array(3);for(r=0;r<3;++r){var s=a[r];if(l[r]=re(t-s[1],s[3],s[2],i,n,e-s[0]),!l[r][0])return s.point;l[r][1]=ae(l[r][1]-s.v[1])}var d=f.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,h=ne(a[r].v[0],l[r][0],l[p][0]);l[r][1]<0&&(h=-h),r?1==r?(h=c-h,d[0]-=l[r][0]*o(h),d[1]-=l[r][0]*g(h)):(h=u-h,d[0]+=l[r][0]*o(h),d[1]+=l[r][0]*g(h)):(d[0]+=l[r][0]*o(h),d[1]-=l[r][0]*g(h))}return d[0]/=3,d[1]/=3,d}}function oe(e){return e[0]*=A,e[1]*=A,e}function le(e,r,n){var a=t.geoCentroid({type:"MultiPoint",coordinates:[e,r,n]}),i=[-a[0],-a[1]],o=t.geoRotation(i),l=ie(oe(o(e)),oe(o(r)),oe(o(n)));l.invert=G(l);var s=t.geoProjection(l).rotate(i),c=s.center;return delete s.rotate,s.center=function(e){return arguments.length?c(o(e)):o.invert(c())},s.clipAngle(90)}function se(e,t){var r=C(1-g(t));return[2/M*e*r,M*(1-r)]}function ce(e){var t=v(e);function r(e,r){return[e,(e?e/g(e):1)*(g(r)*o(e)-t*o(r))]}return r.invert=t?function(e,r){e&&(r*=g(e)/e);var n=o(e);return[e,2*i(C(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,S(e?t*v(e)/e:t)]},r}se.invert=function(e,t){var r=(r=t/M-1)*r;return[r>0?e*C(y/r)/2:0,S(1-r)]};var ue=C(3);function fe(e,t){return[ue*e*(2*o(2*t/3)-1)/M,ue*M*g(t/3)]}function de(e){var t=o(e);function r(e,r){return[e*t,g(r)/t]}return r.invert=function(e,r){return[e/t,S(r*t)]},r}function pe(e){var t=o(e);function r(e,r){return[e*t,(1+t)*v(r/2)]}return r.invert=function(e,r){return[e/t,2*a(r/(1+t))]},r}function he(e,t){var r=C(8/(3*y));return[r*e*(1-n(t)/y),r*t]}function ge(e,t){var r=C(4-3*g(n(t)));return[2/C(6*y)*e*r,h(t)*C(2*y/3)*(2-r)]}function ve(e,t){var r=C(y*(4+y));return[2/r*e*(1+C(1-4*t*t/(y*y))),4/r*t]}function me(e,t){var r=(2+b)*g(t);t/=2;for(var a=0,i=1/0;a<10&&n(i)>m;a++){var l=o(t);t-=i=(t+g(t)*(l+2)-r)/(2*l*(1+l))}return[2/C(y*(4+y))*e*(1+o(t)),2*C(y/(4+y))*g(t)]}function ye(e,t){return[e*(1+o(t))/C(2+y),2*t/C(2+y)]}function be(e,t){for(var r=(1+b)*g(t),a=0,i=1/0;a<10&&n(i)>m;a++)t-=i=(t+g(t)-r)/(1+o(t));return r=C(2+y),[e*(1+o(t))/r,2*t/r]}fe.invert=function(e,t){var r=3*S(t/(ue*M));return[M*e/(ue*(2*o(2*r/3)-1)),r]},he.invert=function(e,t){var r=C(8/(3*y)),a=t/r;return[e/(r*(1-n(a)/y)),a]},ge.invert=function(e,t){var r=2-n(t)/C(2*y/3);return[e*C(6*y)/(2*r),h(t)*S((4-r*r)/3)]},ve.invert=function(e,t){var r=C(y*(4+y))/2;return[e*r/(1+C(1-t*t*(4+y)/(4*y))),t*r/2]},me.invert=function(e,t){var r=t*C((4+y)/y)/2,n=S(r),a=o(n);return[e/(2/C(y*(4+y))*(1+a)),S((n+r*(a+2))/(2+b))]},ye.invert=function(e,t){var r=C(2+y),n=t*r/2;return[r*e/(1+o(n)),n]},be.invert=function(e,t){var r=1+b,n=C(r/2);return[2*e*n/(1+o(t*=n)),S((t+g(t))/r)]};var xe=3+2*w;function _e(e,t){var r=g(e/=2),n=o(e),i=C(o(t)),l=o(t/=2),s=g(t)/(l+w*n*i),u=C(2/(1+s*s)),f=C((w*l+(n+r)*i)/(w*l+(n-r)*i));return[xe*(u*(f-1/f)-2*c(f)),xe*(u*s*(f+1/f)-2*a(s))]}_e.invert=function(e,t){if(!(r=N.invert(e/1.2,1.065*t)))return null;var r,i=r[0],l=r[1],s=20;e/=xe,t/=xe;do{var d=i/2,p=l/2,h=g(d),v=o(d),y=g(p),x=o(p),M=o(l),k=C(M),T=y/(x+w*v*k),A=T*T,S=C(2/(1+A)),L=(w*x+(v+h)*k)/(w*x+(v-h)*k),P=C(L),D=P-1/P,O=P+1/P,R=S*D-2*c(P)-e,E=S*T*O-2*a(T)-t,I=y&&_*k*h*A/y,z=(w*v*x+k)/(2*(x+w*v*k)*(x+w*v*k)*k),F=-.5*T*S*S*S,j=F*I,B=F*z,H=(H=2*x+w*k*(v-h))*H*P,Y=(w*v*x*k+M)/H,G=-w*h*y/(k*H),U=D*j-2*Y/P+S*(Y+Y/L),q=D*B-2*G/P+S*(G+G/L),V=T*O*j-2*I/(1+A)+S*O*I+S*T*(Y-Y/L),Z=T*O*B-2*z/(1+A)+S*O*z+S*T*(G-G/L),W=q*V-Z*U;if(!W)break;var J=(E*q-R*Z)/W,X=(R*V-E*U)/W;i-=J,l=u(-b,f(b,l-X))}while((n(J)>m||n(X)>m)&&--s>0);return n(n(l)-b)l){var h=C(d),v=i(f,u),x=a*p(v/a),_=v-x,w=e*o(_),M=(e*g(_)-_*g(w))/(b-w),k=Ce(_,M),T=(y-e)/Pe(k,w,y);u=h;var A,S=50;do{u-=A=(e+Pe(k,w,u)*T-h)/(k(u)*T)}while(n(A)>m&&--S>0);f=_*g(u),ul){var u=C(c),f=i(s,r),d=a*p(f/a),h=f-d;r=u*o(h),s=u*g(h);for(var v=r-b,m=g(r),x=s/m,_=rm||n(p)>m)&&--b>0);return[h,v]},u}Me.invert=function(e,t){var r=t/(1+we);return[e&&e/(we*C(1-r*r)),2*a(r)]},ke.invert=function(e,t){var r=a(t/M),n=o(r),i=2*r;return[e*M/2/(o(i)*n*n),i]};var Oe=De(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);var Re=De(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);var Ee=De(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Ne(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}Ne.invert=function(e,t){var r,a=e,i=t,o=50;do{var l=i*i;i-=r=(i*(1+l/12)-t)/(1+l/4)}while(n(r)>m&&--o>0);o=50,e/=1-.162388*l;do{var s=(s=a*a)*s;a-=r=(a*(.87-952426e-9*s)-e)/(.87-.00476213*s)}while(n(r)>m&&--o>0);return[a,i]};var Ie=De(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function ze(e){var t=e(b,0)[0]-e(-b,0)[0];function r(r,n){var a=r>0?-.5:.5,i=e(r+a*y,n);return i[0]-=a*t,i}return e.invert&&(r.invert=function(r,n){var a=r>0?-.5:.5,i=e.invert(r+a*t,n),o=i[0]-a*y;return o<-y?o+=2*y:o>y&&(o-=2*y),i[0]=o,i}),r}function Fe(e,t){var r=h(e),a=h(t),l=o(t),s=o(e)*l,c=g(e)*l,u=g(a*t);e=n(i(c,u)),t=S(s),n(e-b)>m&&(e%=b);var f=function(e,t){if(t===b)return[0,0];var r,a,i=g(t),l=i*i,s=l*l,c=1+s,u=1+3*s,f=1-s,d=S(1/C(c)),p=f+l*c*d,h=(1-i)/p,v=C(h),x=h*c,_=C(x),w=v*f;if(0===e)return[0,-(w+l*_)];var M,k=o(t),T=1/k,A=2*i*k,L=(-p*k-(-3*l+d*u)*A*(1-i))/(p*p),P=-T*A,D=-T*(l*c*L+h*u*A),O=-2*T*(f*(.5*L/v)-2*l*v*A),R=4*e/y;if(e>.222*y||t.175*y){if(r=(w+l*C(x*(1+s)-w*w))/(1+s),e>y/4)return[r,r];var E=r,N=.5*r;r=.5*(N+E),a=50;do{var I=C(x-r*r),z=r*(O+P*I)+D*S(r/_)-R;if(!z)break;z<0?N=r:E=r,r=.5*(N+E)}while(n(E-N)>m&&--a>0)}else{r=m,a=25;do{var F=r*r,j=C(x-F),B=O+P*j,H=r*B+D*S(r/_)-R,Y=B+(D-P*F)/j;r-=M=j?H/Y:0}while(n(M)>m&&--a>0)}return[r,-w-l*C(x-r*r)]}(e>y/4?b-e:e,t);return e>y/4&&(u=f[0],f[0]=-f[1],f[1]=-u),f[0]*=r,f[1]*=-a,f}function je(e,t){var r,i,s,c,u,f;if(t=1-m)return r=(1-t)/4,s=1/(i=D(e)),[(c=((f=l(2*(f=e)))-1)/(f+1))+r*((u=i*P(e))-e)/(i*i),s-r*c*s*(u-e),s+r*c*s*(u+e),2*a(l(e))-b+r*(u-e)/i];var d=[1,0,0,0,0,0,0,0,0],p=[C(t),0,0,0,0,0,0,0,0],h=0;for(i=C(1-t),u=1;n(p[h]/d[h])>m&&h<8;)r=d[h++],p[h]=(r-i)/2,d[h]=(r+i)/2,i=C(r*i),u*=2;s=u*d[h]*e;do{s=(S(c=p[h]*g(i=s)/d[h])+s)/2}while(--h);return[g(s),c=o(s),c/o(s-i),s]}function Be(e,t){if(!t)return e;if(1===t)return c(v(e/2+x));for(var r=1,i=C(1-t),o=C(t),l=0;n(o)>m;l++){if(e%y){var s=a(i*v(e)/r);s<0&&(s+=y),e+=s+~~(e/y)*y}else e+=e;o=(r+i)/2,i=C(r*i),o=((r=o)-i)/2}return e/(d(2,l)*r)}function He(e,t){var r=(w-1)/(w+1),s=C(1-r*r),u=Be(b,s*s),f=c(v(y/4+n(t)/2)),d=l(-1*f)/C(r),p=function(e,t){var r=e*e,n=t+1,a=1-r-t*t;return[.5*((e>=0?b:-b)-i(a,2*e)),-.25*c(a*a+4*r)+.5*c(n*n+r)]}(d*o(-1*e),d*g(-1*e)),m=function(e,t,r){var i=n(e),o=P(n(t));if(i){var l=1/g(i),s=1/(v(i)*v(i)),c=-(s+r*(o*o*l*l)-1+r),u=(-c+C(c*c-4*((r-1)*s)))/2;return[Be(a(1/C(u)),r)*h(e),Be(a(C((u/s-1)/r)),1-r)*h(t)]}return[0,Be(a(o),1-r)*h(t)]}(p[0],p[1],s*s);return[-m[1],(t>=0?1:-1)*(.5*u-m[0])]}function Ye(e){var t=g(e),r=o(e),a=Ge(e);function l(e,i){var l=a(e,i);e=l[0],i=l[1];var s=g(i),c=o(i),u=o(e),f=L(t*s+r*c*u),d=g(f),p=n(d)>m?f/d:1;return[p*r*g(e),(n(e)>b?p:-p)*(t*c-r*s*u)]}return a.invert=Ge(-e),l.invert=function(e,r){var n=C(e*e+r*r),l=-g(n),s=o(n),c=n*s,u=-r*l,f=n*t,d=C(c*c+u*u-f*f),p=i(c*f+u*d,u*f-c*d),h=(n>b?-1:1)*i(e*l,n*o(p)*s+r*g(p)*l);return a.invert(h,p)},l}function Ge(e){var t=g(e),r=o(e);return function(e,n){var a=o(n),l=o(e)*a,s=g(e)*a,c=g(n);return[i(s,l*r-c*t),S(c*r+l*t)]}}Fe.invert=function(e,t){n(e)>1&&(e=2*h(e)-e),n(t)>1&&(t=2*h(t)-t);var r=h(e),a=h(t),l=-r*e,s=-a*t,c=s/l<1,u=function(e,t){var r=0,a=1,i=.5,l=50;for(;;){var s=i*i,c=C(i),u=S(1/C(1+s)),f=1-s+i*(1+s)*u,d=(1-c)/f,p=C(d),h=d*(1+s),g=p*(1-s),v=C(h-e*e),m=t+g+i*v;if(n(a-r)<1e-12||0==--l||0===m)break;m>0?r=i:a=i,i=.5*(r+a)}if(!l)return null;var b=S(c),x=o(b),_=1/x,w=2*c*x,M=(-f*x-(-3*i+u*(1+3*s))*w*(1-c))/(f*f);return[y/4*(e*(-2*_*(.5*M/p*(1-s)-2*i*p*w)+-_*w*v)+-_*(i*(1+s)*M+d*(1+3*s)*w)*S(e/C(h))),b]}(c?s:l,c?l:s),f=u[0],d=u[1],p=o(d);return c&&(f=-b-f),[r*(i(g(f)*p,-g(d))+y),a*S(o(f)*p)]},He.invert=function(e,t){var r,n,o,s,u,f,d=(w-1)/(w+1),p=C(1-d*d),h=Be(b,p*p),g=(n=-e,o=p*p,(r=.5*h-t)?(s=je(r,o),n?(f=(u=je(n,1-o))[1]*u[1]+o*s[0]*s[0]*u[0]*u[0],[[s[0]*u[2]/f,s[1]*s[2]*u[0]*u[1]/f],[s[1]*u[1]/f,-s[0]*s[2]*u[0]*u[2]/f],[s[2]*u[1]*u[2]/f,-o*s[0]*s[1]*u[0]/f]]):[[s[0],0],[s[1],0],[s[2],0]]):[[0,(u=je(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),v=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(g[0],g[1]);return[i(v[1],v[0])/-1,2*a(l(-.5*c(d*v[0]*v[0]+d*v[1]*v[1])))-b]};var Ue=S(1-1/3)*T,qe=de(0);function Ve(e){var t=Ue*A,r=se(y,t)[0]-se(-y,t)[0],a=qe(0,t)[1],i=se(0,t)[1],o=M-i,l=k/e,c=4/k,d=a+o*o*4/k;function p(p,h){var g,v=n(h);if(v>t){var m=f(e-1,u(0,s((p+y)/l)));(g=se(p+=y*(e-1)/e-m*l,v))[0]=g[0]*k/r-k*(e-1)/(2*e)+m*k/e,g[1]=a+4*(g[1]-i)*o/k,h<0&&(g[1]=-g[1])}else g=qe(p,h);return g[0]*=c,g[1]/=d,g}return p.invert=function(t,p){t/=c;var h=n(p*=d);if(h>a){var g=f(e-1,u(0,s((t+y)/l)));t=(t+y*(e-1)/e-g*l)*r/k;var v=se.invert(t,.25*(h-a)*k/o+i);return v[0]-=y*(e-1)/e-g*l,p<0&&(v[1]=-v[1]),v}return qe.invert(t,p)},p}function Ze(e,t){return[e,1&t?90-m:Ue]}function We(e,t){return[e,1&t?-90+m:-Ue]}function Je(e){return[e[0]*(1-m),e[1]]}function Xe(e){var t,r=1+e,a=S(g(1/r)),l=2*C(y/(t=y+4*a*r)),s=.5*l*(r+C(e*(2+e))),c=e*e,u=r*r;function f(f,d){var p,h,v=1-g(d);if(v&&v<2){var m,x=b-d,_=25;do{var w=g(x),M=o(x),k=a+i(w,r-M),T=1+u-2*r*M;x-=m=(x-c*a-r*w+T*k-.5*v*t)/(2*r*w*k)}while(n(m)>1e-12&&--_>0);p=l*C(T),h=f*k/y}else p=l*(e+v),h=f*a/y;return[p*g(h),s-p*o(h)]}return f.invert=function(e,n){var o=e*e+(n-=s)*n,f=(1+u-o/(l*l))/(2*r),d=L(f),p=g(d),h=a+i(p,r-f);return[S(e/C(o))*y/h,S(1-2*(d-c*a-r*p+(1+u-2*r*f)*h)/t)]},f}function Ke(e,t){return t>-.7109889596207567?((e=Z(e,t))[1]+=.0528035274542,e):Q(e,t)}function Qe(e,t){return n(t)>.7109889596207567?((e=Z(e,t))[1]-=t>0?.0528035274542:-.0528035274542,e):Q(e,t)}function $e(e,t,r,n){var a=C(4*y/(2*r+(1+e-t/2)*g(2*r)+(e+t)/2*g(4*r)+t/2*g(6*r))),i=C(n*g(r)*C((1+e*o(2*r)+t*o(4*r))/(1+e+t))),l=r*c(1);function s(r){return C(1+e*o(2*r)+t*o(4*r))}function c(n){var a=n*r;return(2*a+(1+e-t/2)*g(2*a)+(e+t)/2*g(4*a)+t/2*g(6*a))/r}function u(e){return s(e)*g(e)}var f=function(e,t){var n=r*Y(c,l*g(t)/r,t/y);isNaN(n)&&(n=r*h(t));var u=a*s(n);return[u*i*e/y*o(n),u/i*g(n)]};return f.invert=function(e,t){var n=Y(u,t*i/a);return[e*y/(o(n)*a*i*s(n)),S(r*c(n/r)/l)]},0===r&&(a=C(n/y),(f=function(e,t){return[e*a,g(t)/a]}).invert=function(e,t){return[e/a,S(t*a)]}),f}function et(e,t,r,n,a){void 0===n&&(n=1e-8),void 0===a&&(a=20);var i=e(t),o=e(.5*(t+r)),l=e(r);return function e(t,r,n,a,i,o,l,s,c,u,f){if(f.nanEncountered)return NaN;var d,p,h,g,v,m,y,b,x,_;if(p=t(r+.25*(d=n-r)),h=t(n-.25*d),isNaN(p))f.nanEncountered=!0;else{if(!isNaN(h))return _=((m=(g=d*(a+4*p+i)/12)+(v=d*(i+4*h+o)/12))-l)/15,u>c?(f.maxDepthCount++,m+_):Math.abs(_)e?r=n:t=n,n=t+r>>1}while(n>t);var a=c[n+1]-c[n];return a&&(a=(e-c[n+1])/a),(n+1+a)/l}var p=2*f(1)/y*o/r,v=function(e,t){var r=f(n(g(t))),i=a(r)*e;return r/=p,[i,t>=0?r:-r]};return v.invert=function(e,t){var r;return n(t*=p)<1&&(r=h(t)*S(i(n(t))*o)),[e/a(n(t)),r]},v}function rt(e,t){return n(e[0]-t[0])=0;--s)n=(t=e[1][s])[0][0],a=t[0][1],i=t[1][1],o=t[2][0],l=t[2][1],c.push(nt([[o-m,l-m],[o-m,i+m],[n+m,i+m],[n+m,a-m]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}function it(e,r,n){var a,i;function o(t,n){for(var a=n<0?-1:1,i=r[+(n<0)],o=0,l=i.length-1;oi[o][2][0];++o);var s=e(t-i[o][1][0],n);return s[0]+=e(i[o][1][0],a*n>a*i[o][0][1]?i[o][0][1]:n)[0],s}n?o.invert=n(o):e.invert&&(o.invert=function(t,n){for(var a=i[+(n<0)],l=r[+(n<0)],s=0,c=a.length;so&&(r=i,i=o,o=r),[[n,i],[a,o]]}))})),l):r.map((function(e){return e.map((function(e){return[[e[0][0]*T,e[0][1]*T],[e[1][0]*T,e[1][1]*T],[e[2][0]*T,e[2][1]*T]]}))}))},null!=r&&l.lobes(r),l}Ke.invert=function(e,t){return t>-.7109889596207567?Z.invert(e,t-.0528035274542):Q.invert(e,t)},Qe.invert=function(e,t){return n(t)>.7109889596207567?Z.invert(e,t+(t>0?.0528035274542:-.0528035274542)):Q.invert(e,t)};var ot=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var lt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var st=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var ct=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];var ut=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];var ft=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function dt(e,t){return[3/k*e*C(y*y/3-t*t),t]}function pt(e){function t(t,r){if(n(n(r)-b)2)return null;var o=(t/=2)*t,l=(r/=2)*r,s=2*r/(1+o+l);return s=d((1+s)/(1-s),1/e),[i(2*t,1-o-l)/e,S((s-1)/(s+1))]},t}dt.invert=function(e,t){return[k/3*e/C(y*y/3-t*t),t]};var ht=y/w;function gt(e,t){return[e*(1+C(o(t)))/2,t/(o(t/2)*o(e/6))]}function vt(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function mt(e,t){return[g(e)/o(t),v(t)*o(e)]}function yt(e){var t=o(e),r=v(x+e/2);function a(a,i){var o=i-e,l=n(o)=0;)d=(f=e[u])[0]+s*(a=d)-c*p,p=f[1]+s*p+c*a;return[d=s*(a=d)-c*p,p=s*p+c*a]}return r.invert=function(r,l){var s=20,c=r,u=l;do{for(var f,d=t,p=e[d],h=p[0],v=p[1],m=0,y=0;--d>=0;)m=h+c*(f=m)-u*y,y=v+c*y+u*f,h=(p=e[d])[0]+c*(f=h)-u*v,v=p[1]+c*v+u*f;var b,x,_=(m=h+c*(f=m)-u*y)*m+(y=v+c*y+u*f)*y;c-=b=((h=c*(f=h)-u*v-r)*m+(v=c*v+u*f-l)*y)/_,u-=x=(v*m-h*y)/_}while(n(b)+n(x)>1e-12&&--s>0);if(s){var w=C(c*c+u*u),M=2*a(.5*w),k=g(M);return[i(c*k,w*o(M)),w?S(u*k/w):0]}},r}gt.invert=function(e,t){var r=n(e),a=n(t),i=m,l=b;am||n(x)>m)&&--i>0);return i&&[r,a]},mt.invert=function(e,t){var r=e*e,n=t*t+1,a=r+n,i=e?_*C((a-C(a*a-4*r))/r):1/C(n);return[S(e*i),h(t)*L(i)]},bt.invert=function(e,t){return[e,2.5*a(l(.8*t))-.625*y]};var _t=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],wt=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Mt=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],kt=[[.9245,0],[0,0],[.01943,0]],Tt=[[.721316,0],[0,0],[-.00881625,-.00617325]];function At(e,r){var n=t.geoProjection(xt(e)).rotate(r).clipAngle(90),a=t.geoRotation(r),i=n.center;return delete n.rotate,n.center=function(e){return arguments.length?i(a(e)):a.invert(i())},n}var St=C(6),Lt=C(7);function Ct(e,t){var r=S(7*g(t)/(3*St));return[St*e*(2*o(2*r/3)-1)/Lt,9*g(r/3)/Lt]}function Pt(e,t){for(var r,a=(1+_)*g(t),i=t,l=0;l<25&&(i-=r=(g(i/2)+g(i)-a)/(.5*o(i/2)+o(i)),!(n(r)1e-12&&--s>0);return[e/(.84719-.13063*(a=l*l)+(o=a*(i=a*a))*o*(.05494*a-.04515-.02326*i+.00331*o)),l]},Rt.invert=function(e,t){for(var r=t/2,a=0,i=1/0;a<10&&n(i)>m;++a){var l=o(t/2);t-=i=(t-v(t/2)-r)/(1-.5/(l*l))}return[2*e/(1+o(t)),t]};var Et=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Nt(e,t){var r=g(t),a=o(t),i=h(e);if(0===e||n(t)===b)return[0,t];if(0===t)return[e,0];if(n(e)===b)return[e*a,b*r];var l=y/(2*e)-2*e/y,s=2*t/y,c=(1-s*s)/(r-s),u=l*l,f=c*c,d=1+u/f,p=1+f/u,v=(l*r/c-l/2)/d,m=(f*r/u+c/2)/p,x=m*m-(f*r*r/u+c*r-1)/p;return[b*(v+C(v*v+a*a/d)*i),b*(m+C(x<0?0:x)*h(-t*l)*i)]}Nt.invert=function(e,t){var r=(e/=b)*e,n=r+(t/=b)*t,a=y*y;return[e?(n-1+C((1-n)*(1-n)+4*r))/(2*e)*b:0,Y((function(e){return n*(y*g(e)-2*e)*y+4*e*e*(t-g(e))+2*y*e-a*t}),0)]};function It(e,t){var r=t*t;return[e,t*(1.0148+r*r*(.23185+r*(.02406*r-.14499)))]}function zt(e,t){if(n(t)=0;)if(n=t[l],r[0]===n[0]&&r[1]===n[1]){if(i)return[i,r];i=r}}}(t.face,r.face),a=Ft(n.map(r.project),n.map(t.project));t.transform=r.transform?jt(r.transform,a):a;for(var i=r.edges,o=0,l=i.length;o1.790857183?t=1.790857183:t<-1.790857183&&(t=-1.790857183);var r,a=t;do{var i=a*a;a-=r=(a*(1.0148+i*i*(.23185+i*(.02406*i-.14499)))-t)/(1.0148+i*i*(5*.23185+i*(.21654*i-1.01493)))}while(n(r)>m);return[e,a]},zt.invert=function(e,t){if(n(t)m&&--l>0);return s=v(i),[(n(t)n^p>n&&r<(d-c)*(n-u)/(p-u)+c&&(a=!a)}return a}(e[0],r))return e.push(t),!0}))||e.push([t])})),nr=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function lr(e){var r=e(b,0)[0]-e(-b,0)[0];function a(t,a){var i=n(t)0?t-y:t+y,a),l=(o[0]-o[1])*_,s=(o[0]+o[1])*_;if(i)return[l,s];var c=r*_,u=l>0^s>0?-1:1;return[u*l-h(s)*c,u*s-h(l)*c]}return e.invert&&(a.invert=function(t,a){var i=(t+a)*_,o=(a-t)*_,l=n(i)<.5*r&&n(o)<.5*r;if(!l){var s=r*_,c=i>0^o>0?-1:1,u=-c*t+(o>0?1:-1)*s,f=-c*a+(i>0?1:-1)*s;i=(-u-f)*_,o=(u-f)*_}var d=e.invert(i,o);return l||(d[0]+=i>0?y:-y),d}),t.geoProjection(a).rotate([-90,-90,45]).clipAngle(179.999)}function sr(){return lr(He).scale(111.48)}function cr(e){var t=g(e);function r(r,n){var i=t?v(r*t/2)/t:r/2;if(!n)return[2*i,-e];var l=2*a(i*g(n)),s=1/v(n);return[g(l)*s,n+(1-o(l))*s-e]}return r.invert=function(r,i){if(n(i+=e)m&&--u>0);var h=r*(f=v(c)),b=v(n(i)0?b:-b)*(d+o*(h-c)/2+o*o*(h-2*d+c)/2)]}function dr(e,t){var r=function(e){function t(t,r){var n=o(r),a=(e-1)/(e-n*o(t));return[a*n*g(t),a*g(r)]}return t.invert=function(t,r){var n=t*t+r*r,a=C(n),o=(e-C(1-n*(e+1)/(e-1)))/((e-1)/a+a/(e-1));return[i(t*o,a*C(1-o*o)),a?S(r*o/a):0]},t}(e);if(!t)return r;var n=o(t),a=g(t);function l(t,i){var o=r(t,i),l=o[1],s=l*a/(e-1)+n;return[o[0]*n/s,l/s]}return l.invert=function(t,i){var o=(e-1)/(e-1-i*a);return r.invert(o*t,o*i*n)},l}ur.forEach((function(e){e[1]*=1.0144})),fr.invert=function(e,t){var r=t/b,a=90*r,i=f(18,n(a/5)),o=u(0,s(i));do{var l=ur[o][1],c=ur[o+1][1],d=ur[f(19,o+2)][1],p=d-l,h=d-2*c+l,g=2*(n(r)-c)/p,v=h/p,m=g*(1-v*g*(1-2*v*g));if(m>=0||1===o){a=(t>=0?5:-5)*(m+i);var y,x=50;do{m=(i=f(18,n(a)/5))-(o=s(i)),l=ur[o][1],c=ur[o+1][1],d=ur[f(19,o+2)][1],a-=(y=(t>=0?b:-b)*(c+m*(d-l)/2+m*m*(d-2*c+l)/2)-t)*T}while(n(y)>1e-12&&--x>0);break}}while(--o>=0);var _=ur[o][0],w=ur[o+1][0],M=ur[f(19,o+2)][0];return[e/(w+m*(M-_)/2+m*m*(M-2*w+_)/2),a*A]};var pr=-179.9999,hr=179.9999,gr=-89.9999;function vr(e){return e.length>0}function mr(e){return-90===e||90===e?[0,e]:[-180,(t=e,Math.floor(1e4*t)/1e4)];var t}function yr(e){var t=e[0],r=e[1],n=!1;return t<=pr?(t=-180,n=!0):t>=hr&&(t=180,n=!0),r<=gr?(r=-90,n=!0):r>=89.9999&&(r=90,n=!0),n?[t,r]:e}function br(e){return e.map(yr)}function xr(e,t,r){for(var n=0,a=e.length;n=hr||u<=gr||u>=89.9999){i[o]=yr(s);for(var f=o+1;fpr&&pgr&&h<89.9999)break}if(f===o+1)continue;if(o){var g={index:-1,polygon:t,ring:i.slice(0,o+1)};g.ring[g.ring.length-1]=mr(u),r[r.length-1]=g}else r.pop();if(f>=l)break;r.push({index:-1,polygon:t,ring:i=i.slice(f-1)}),i[0]=mr(i[0][1]),o=-1,l=i.length}}}}function _r(e){var t,r,n,a,i,o,l=e.length,s={},c={};for(t=0;t0?y-s:s)*T],u=t.geoProjection(e(l)).rotate(c),f=t.geoRotation(c),d=u.center;return delete u.rotate,u.center=function(e){return arguments.length?d(f(e)):f.invert(d())},u.clipAngle(90)}function Ar(e){var r=o(e);function n(e,n){var a=t.geoGnomonicRaw(e,n);return a[0]*=r,a}return n.invert=function(e,n){return t.geoGnomonicRaw.invert(e/r,n)},n}function Sr(e,t){return Tr(Ar,e,t)}function Lr(e){if(!(e*=2))return t.geoAzimuthalEquidistantRaw;var r=-e/2,n=-r,a=e*e,l=v(n),s=.5/g(n);function c(t,i){var l=L(o(i)*o(t-r)),s=L(o(i)*o(t-n));return[((l*=l)-(s*=s))/(2*e),(i<0?-1:1)*C(4*a*s-(a-l+s)*(a-l+s))/(2*e)]}return c.invert=function(e,t){var a,c,u=t*t,f=o(C(u+(a=e+r)*a)),d=o(C(u+(a=e+n)*a));return[i(c=f-d,a=(f+d)*l),(t<0?-1:1)*L(C(a*a+c*c)*s)]},c}function Cr(e,t){return Tr(Lr,e,t)}function Pr(e,t){if(n(t)m&&--s>0);return[h(e)*(C(i*i+4)+i)*y/4,b*l]};var Ir=4*y+3*C(3),zr=2*C(2*y*C(3)/Ir),Fr=V(zr*C(3)/y,zr,Ir/6);function jr(e,t){return[e*C(1-3*t*t/(y*y)),t]}function Br(e,t){var r=o(t),n=o(e)*r,a=1-n,l=o(e=i(g(e)*r,-g(t))),s=g(e);return[s*(r=C(1-n*n))-l*a,-l*r-s*a]}function Hr(e,t){var r=R(e,t);return[(r[0]+e/b)/2,(r[1]+t)/2]}jr.invert=function(e,t){return[e/C(1-3*t*t/(y*y)),t]},Br.invert=function(e,t){var r=(e*e+t*t)/-2,n=C(-r*(2+r)),a=t*r+e*n,o=e*r-t*n,l=C(o*o+a*a);return[i(n*a,l*(1+r)),l?-S(n*o/l):0]},Hr.invert=function(e,t){var r=e,a=t,i=25;do{var l,s=o(a),c=g(a),u=g(2*a),f=c*c,d=s*s,p=g(r),h=o(r/2),v=g(r/2),y=v*v,x=1-d*h*h,_=x?L(s*h)*C(l=1/x):l=0,w=.5*(2*_*s*v+r/b)-e,M=.5*(_*c+a)-t,k=.5*l*(d*y+_*s*h*f)+.5/b,T=l*(p*u/4-_*c*v),A=.125*l*(u*v-_*c*d*p),S=.5*l*(f*h+_*y*s)+.5,P=T*A-S*k,D=(M*T-w*S)/P,O=(w*A-M*k)/P;r-=D,a-=O}while((n(D)>m||n(O)>m)&&--i>0);return[r,a]},e.geoNaturalEarth=t.geoNaturalEarth1,e.geoNaturalEarthRaw=t.geoNaturalEarth1Raw,e.geoAiry=function(){var e=b,r=t.geoProjectionMutator(O),n=r(e);return n.radius=function(t){return arguments.length?r(e=t*A):e*T},n.scale(179.976).clipAngle(147)},e.geoAiryRaw=O,e.geoAitoff=function(){return t.geoProjection(R).scale(152.63)},e.geoAitoffRaw=R,e.geoArmadillo=function(){var e=20*A,r=e>=0?1:-1,n=v(r*e),a=t.geoProjectionMutator(E),l=a(e),s=l.stream;return l.parallel=function(t){return arguments.length?(n=v((r=(e=t*A)>=0?1:-1)*e),a(e)):e*T},l.stream=function(t){var a=l.rotate(),c=s(t),u=(l.rotate([0,0]),s(t)),f=l.precision();return l.rotate(a),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=-180*r;r*t<180;t+=90*r)u.point(t,90*r);if(e)for(;r*(t-=3*r*f)>=-180;)u.point(t,r*-i(o(t*A/2),n)*T);u.lineEnd(),u.polygonEnd()},c},l.scale(218.695).center([0,28.0974])},e.geoArmadilloRaw=E,e.geoAugust=function(){return t.geoProjection(N).scale(66.1603)},e.geoAugustRaw=N,e.geoBaker=function(){return t.geoProjection(F).scale(112.314)},e.geoBakerRaw=F,e.geoBerghaus=function(){var e=5,r=t.geoProjectionMutator(j),n=r(e),a=n.stream,l=-o(.01*A),s=g(.01*A);return n.lobes=function(t){return arguments.length?r(e=+t):e},n.stream=function(t){var r=n.rotate(),c=a(t),u=(n.rotate([0,0]),a(t));return n.rotate(r),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=0,r=360/e,n=2*y/e,a=90-180/e,c=b;t=0;)e.point((t=r[a])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},n.scale(79.4187).parallel(45).clipAngle(179.999)},e.geoHammerRetroazimuthalRaw=Ye,e.geoHealpix=function(){var e=4,n=t.geoProjectionMutator(Ve),a=n(e),i=a.stream;return a.lobes=function(t){return arguments.length?n(e=+t):e},a.stream=function(n){var o=a.rotate(),l=i(n),s=(a.rotate([0,0]),i(n));return a.rotate(o),l.sphere=function(){var n,a;t.geoStream((n=180/e,a=[].concat(r.range(-180,180+n/2,n).map(Ze),r.range(180,-180-n/2,-n).map(We)),{type:"Polygon",coordinates:[180===n?a.map(Je):a]}),s)},l},a.scale(239.75)},e.geoHealpixRaw=Ve,e.geoHill=function(){var e=1,r=t.geoProjectionMutator(Xe),n=r(e);return n.ratio=function(t){return arguments.length?r(e=+t):e},n.scale(167.774).center([0,18.67])},e.geoHillRaw=Xe,e.geoHomolosine=function(){return t.geoProjection(Qe).scale(152.63)},e.geoHomolosineRaw=Qe,e.geoHufnagel=function(){var e=1,r=0,n=45*A,a=2,i=t.geoProjectionMutator($e),o=i(e,r,n,a);return o.a=function(t){return arguments.length?i(e=+t,r,n,a):e},o.b=function(t){return arguments.length?i(e,r=+t,n,a):r},o.psiMax=function(t){return arguments.length?i(e,r,n=+t*A,a):n*T},o.ratio=function(t){return arguments.length?i(e,r,n,a=+t):a},o.scale(180.739)},e.geoHufnagelRaw=$e,e.geoHyperelliptical=function(){var e=0,r=2.5,n=1.183136,a=t.geoProjectionMutator(tt),i=a(e,r,n);return i.alpha=function(t){return arguments.length?a(e=+t,r,n):e},i.k=function(t){return arguments.length?a(e,r=+t,n):r},i.gamma=function(t){return arguments.length?a(e,r,n=+t):n},i.scale(152.63)},e.geoHyperellipticalRaw=tt,e.geoInterrupt=it,e.geoInterruptedBoggs=function(){return it(X,ot).scale(160.857)},e.geoInterruptedHomolosine=function(){return it(Qe,lt).scale(152.63)},e.geoInterruptedMollweide=function(){return it(Z,st).scale(169.529)},e.geoInterruptedMollweideHemispheres=function(){return it(Z,ct).scale(169.529).rotate([20,0])},e.geoInterruptedSinuMollweide=function(){return it(Ke,ut,G).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoInterruptedSinusoidal=function(){return it(Q,ft).scale(152.63).rotate([-20,0])},e.geoKavrayskiy7=function(){return t.geoProjection(dt).scale(158.837)},e.geoKavrayskiy7Raw=dt,e.geoLagrange=function(){var e=.5,r=t.geoProjectionMutator(pt),n=r(e);return n.spacing=function(t){return arguments.length?r(e=+t):e},n.scale(124.75)},e.geoLagrangeRaw=pt,e.geoLarrivee=function(){return t.geoProjection(gt).scale(97.2672)},e.geoLarriveeRaw=gt,e.geoLaskowski=function(){return t.geoProjection(vt).scale(139.98)},e.geoLaskowskiRaw=vt,e.geoLittrow=function(){return t.geoProjection(mt).scale(144.049).clipAngle(89.999)},e.geoLittrowRaw=mt,e.geoLoximuthal=function(){return K(yt).parallel(40).scale(158.837)},e.geoLoximuthalRaw=yt,e.geoMiller=function(){return t.geoProjection(bt).scale(108.318)},e.geoMillerRaw=bt,e.geoModifiedStereographic=At,e.geoModifiedStereographicRaw=xt,e.geoModifiedStereographicAlaska=function(){return At(_t,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},e.geoModifiedStereographicGs48=function(){return At(wt,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},e.geoModifiedStereographicGs50=function(){return At(Mt,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},e.geoModifiedStereographicMiller=function(){return At(kt,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},e.geoModifiedStereographicLee=function(){return At(Tt,[165,10]).scale(250).clipAngle(130).center([-165,-10])},e.geoMollweide=function(){return t.geoProjection(Z).scale(169.529)},e.geoMollweideRaw=Z,e.geoMtFlatPolarParabolic=function(){return t.geoProjection(Ct).scale(164.859)},e.geoMtFlatPolarParabolicRaw=Ct,e.geoMtFlatPolarQuartic=function(){return t.geoProjection(Pt).scale(188.209)},e.geoMtFlatPolarQuarticRaw=Pt,e.geoMtFlatPolarSinusoidal=function(){return t.geoProjection(Dt).scale(166.518)},e.geoMtFlatPolarSinusoidalRaw=Dt,e.geoNaturalEarth2=function(){return t.geoProjection(Ot).scale(175.295)},e.geoNaturalEarth2Raw=Ot,e.geoNellHammer=function(){return t.geoProjection(Rt).scale(152.63)},e.geoNellHammerRaw=Rt,e.geoInterruptedQuarticAuthalic=function(){return it(B(1/0),Et).rotate([20,0]).scale(152.63)},e.geoNicolosi=function(){return t.geoProjection(Nt).scale(127.267)},e.geoNicolosiRaw=Nt,e.geoPatterson=function(){return t.geoProjection(It).scale(139.319)},e.geoPattersonRaw=It,e.geoPolyconic=function(){return t.geoProjection(zt).scale(103.74)},e.geoPolyconicRaw=zt,e.geoPolyhedral=Yt,e.geoPolyhedralButterfly=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=Vt.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Yt(r[0],(function(e,t){return r[e<-y/2?t<0?6:4:e<0?t<0?2:0:e0?[-r[0],0]:[180-r[0],180])};var r=Vt.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Yt(r[0],(function(e,t){return r[e<-y/2?t<0?6:4:e<0?t<0?2:0:e2||i[0]!=t[0]||i[1]!=t[1])&&(n.push(i),t=i)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function i(e){return e.map(a)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(i)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function l(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return l(e);case"FeatureCollection":var s={type:"FeatureCollection",features:e.features.map(l)};return null!=e.bbox&&(s.bbox=e.bbox),s;default:return o(e)}return e},e.geoQuincuncial=lr,e.geoRectangularPolyconic=function(){return K(cr).scale(131.215)},e.geoRectangularPolyconicRaw=cr,e.geoRobinson=function(){return t.geoProjection(fr).scale(152.63)},e.geoRobinsonRaw=fr,e.geoSatellite=function(){var e=2,r=0,n=t.geoProjectionMutator(dr),a=n(e,r);return a.distance=function(t){return arguments.length?n(e=+t,r):e},a.tilt=function(t){return arguments.length?n(e,r=t*A):r*T},a.scale(432.147).clipAngle(L(1/e)*T-1e-6)},e.geoSatelliteRaw=dr,e.geoSinuMollweide=function(){return t.geoProjection(Ke).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoSinuMollweideRaw=Ke,e.geoSinusoidal=function(){return t.geoProjection(Q).scale(152.63)},e.geoSinusoidalRaw=Q,e.geoStitch=function(e){if(null==e)return e;switch(e.type){case"Feature":return wr(e);case"FeatureCollection":var t={type:"FeatureCollection",features:e.features.map(wr)};return null!=e.bbox&&(t.bbox=e.bbox),t;default:return Mr(e)}},e.geoTimes=function(){return t.geoProjection(kr).scale(146.153)},e.geoTimesRaw=kr,e.geoTwoPointAzimuthal=Sr,e.geoTwoPointAzimuthalRaw=Ar,e.geoTwoPointAzimuthalUsa=function(){return Sr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},e.geoTwoPointEquidistant=Cr,e.geoTwoPointEquidistantRaw=Lr,e.geoTwoPointEquidistantUsa=function(){return Cr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},e.geoVanDerGrinten=function(){return t.geoProjection(Pr).scale(79.4183)},e.geoVanDerGrintenRaw=Pr,e.geoVanDerGrinten2=function(){return t.geoProjection(Dr).scale(79.4183)},e.geoVanDerGrinten2Raw=Dr,e.geoVanDerGrinten3=function(){return t.geoProjection(Or).scale(79.4183)},e.geoVanDerGrinten3Raw=Or,e.geoVanDerGrinten4=function(){return t.geoProjection(Rr).scale(127.16)},e.geoVanDerGrinten4Raw=Rr,e.geoWagner=Nr,e.geoWagner7=function(){return Nr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},e.geoWagnerRaw=Er,e.geoWagner4=function(){return t.geoProjection(Fr).scale(176.84)},e.geoWagner4Raw=Fr,e.geoWagner6=function(){return t.geoProjection(jr).scale(152.63)},e.geoWagner6Raw=jr,e.geoWiechel=function(){return t.geoProjection(Br).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},e.geoWiechelRaw=Br,e.geoWinkel3=function(){return t.geoProjection(Hr).scale(158.837)},e.geoWinkel3Raw=Hr,Object.defineProperty(e,"__esModule",{value:!0})}))},{"d3-array":23,"d3-geo":26}],26:[function(e,t,r){!function(n,a){"object"==typeof r&&void 0!==t?a(r,e("d3-array")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(e,t){"use strict";function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(e){i(a,e,this.t),i(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new n;function i(e,t,r){var n=e.s=t+r,a=n-t,i=n-a;e.t=t-i+(r-a)}var o=1e-6,l=Math.PI,s=l/2,c=l/4,u=2*l,f=180/l,d=l/180,p=Math.abs,h=Math.atan,g=Math.atan2,v=Math.cos,m=Math.ceil,y=Math.exp,b=Math.log,x=Math.pow,_=Math.sin,w=Math.sign||function(e){return e>0?1:e<0?-1:0},M=Math.sqrt,k=Math.tan;function T(e){return e>1?0:e<-1?l:Math.acos(e)}function A(e){return e>1?s:e<-1?-s:Math.asin(e)}function S(e){return(e=_(e/2))*e}function L(){}function C(e,t){e&&D.hasOwnProperty(e.type)&&D[e.type](e,t)}var P={Feature:function(e,t){C(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,a=r.length;++n=0?1:-1,a=n*r,i=v(t=(t*=d)/2+c),o=_(t),l=j*o,s=F*i+l*v(a),u=l*n*_(a);B.add(g(u,s)),z=e,F=i,j=o}function Z(e){return[g(e[1],e[0]),A(e[2])]}function W(e){var t=e[0],r=e[1],n=v(r);return[n*v(t),n*_(t),_(r)]}function J(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function X(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function K(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Q(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function $(e){var t=M(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var ee,te,re,ne,ae,ie,oe,le,se,ce,ue,fe,de,pe,he,ge,ve,me,ye,be,xe,_e,we,Me,ke,Te,Ae=r(),Se={point:Le,lineStart:Pe,lineEnd:De,polygonStart:function(){Se.point=Oe,Se.lineStart=Re,Se.lineEnd=Ee,Ae.reset(),Y.polygonStart()},polygonEnd:function(){Y.polygonEnd(),Se.point=Le,Se.lineStart=Pe,Se.lineEnd=De,B<0?(ee=-(re=180),te=-(ne=90)):Ae>o?ne=90:Ae<-o&&(te=-90),ce[0]=ee,ce[1]=re},sphere:function(){ee=-(re=180),te=-(ne=90)}};function Le(e,t){se.push(ce=[ee=e,re=e]),tne&&(ne=t)}function Ce(e,t){var r=W([e*d,t*d]);if(le){var n=X(le,r),a=X([n[1],-n[0],0],n);$(a),a=Z(a);var i,o=e-ae,l=o>0?1:-1,s=a[0]*f*l,c=p(o)>180;c^(l*aene&&(ne=i):c^(l*ae<(s=(s+360)%360-180)&&sne&&(ne=t)),c?eNe(ee,re)&&(re=e):Ne(e,re)>Ne(ee,re)&&(ee=e):re>=ee?(ere&&(re=e)):e>ae?Ne(ee,e)>Ne(ee,re)&&(re=e):Ne(e,re)>Ne(ee,re)&&(ee=e)}else se.push(ce=[ee=e,re=e]);tne&&(ne=t),le=r,ae=e}function Pe(){Se.point=Ce}function De(){ce[0]=ee,ce[1]=re,Se.point=Le,le=null}function Oe(e,t){if(le){var r=e-ae;Ae.add(p(r)>180?r+(r>0?360:-360):r)}else ie=e,oe=t;Y.point(e,t),Ce(e,t)}function Re(){Y.lineStart()}function Ee(){Oe(ie,oe),Y.lineEnd(),p(Ae)>o&&(ee=-(re=180)),ce[0]=ee,ce[1]=re,le=null}function Ne(e,t){return(t-=e)<0?t+360:t}function Ie(e,t){return e[0]-t[0]}function ze(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tl?e+Math.round(-e/u)*u:e,t]}function Qe(e,t,r){return(e%=u)?t||r?Xe(et(e),tt(t,r)):et(e):t||r?tt(t,r):Ke}function $e(e){return function(t,r){return[(t+=e)>l?t-u:t<-l?t+u:t,r]}}function et(e){var t=$e(e);return t.invert=$e(-e),t}function tt(e,t){var r=v(e),n=_(e),a=v(t),i=_(t);function o(e,t){var o=v(t),l=v(e)*o,s=_(e)*o,c=_(t),u=c*r+l*n;return[g(s*a-u*i,l*r-c*n),A(u*a+s*i)]}return o.invert=function(e,t){var o=v(t),l=v(e)*o,s=_(e)*o,c=_(t),u=c*a-s*i;return[g(s*a+c*i,l*r+u*n),A(u*r-l*n)]},o}function rt(e){function t(t){return(t=e(t[0]*d,t[1]*d))[0]*=f,t[1]*=f,t}return e=Qe(e[0]*d,e[1]*d,e.length>2?e[2]*d:0),t.invert=function(t){return(t=e.invert(t[0]*d,t[1]*d))[0]*=f,t[1]*=f,t},t}function nt(e,t,r,n,a,i){if(r){var o=v(t),l=_(t),s=n*r;null==a?(a=t+n*u,i=t-s/2):(a=at(o,a),i=at(o,i),(n>0?ai)&&(a+=n*u));for(var c,f=a;n>0?f>i:f1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}function ot(e,t){return p(e[0]-t[0])=0;--i)a.point((f=u[i])[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 ct(e){if(t=e.length){for(var t,r,n=0,a=e[0];++n=0?1:-1,E=R*O,N=E>l,I=M*P;if(ut.add(g(I*R*_(E),k*D+I*v(E))),f+=N?O+R*u:O,N^x>=r^L>=r){var z=X(W(b),W(S));$(z);var F=X(i,z);$(F);var j=(N^O>=0?-1:1)*A(F[2]);(n>j||n===j&&(z[0]||z[1]))&&(d+=N^O>=0?1:-1)}}return(f<-o||f0){for(d||(i.polygonStart(),d=!0),i.lineStart(),e=0;e1&&2&a&&c.push(c.pop().concat(c.shift())),l.push(c.filter(ht))}return p}}function ht(e){return e.length>1}function gt(e,t){return((e=e.x)[0]<0?e[1]-s-o:s-e[1])-((t=t.x)[0]<0?t[1]-s-o:s-t[1])}var vt=pt((function(){return!0}),(function(e){var t,r=NaN,n=NaN,a=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,c){var u=i>0?l:-l,f=p(i-r);p(f-l)0?s:-s),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(i,n),t=0):a!==u&&f>=l&&(p(r-a)o?h((_(t)*(i=v(n))*_(r)-_(n)*(a=v(t))*_(e))/(a*i*l)):(t+n)/2}(r,n,i,c),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(u,n),t=0),e.point(r=i,n=c),a=u},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var a;if(null==e)a=r*s,n.point(-l,a),n.point(0,a),n.point(l,a),n.point(l,0),n.point(l,-a),n.point(0,-a),n.point(-l,-a),n.point(-l,0),n.point(-l,a);else if(p(e[0]-t[0])>o){var i=e[0]0,a=p(t)>o;function i(e,r){return v(e)*v(r)>t}function s(e,r,n){var a=[1,0,0],i=X(W(e),W(r)),s=J(i,i),c=i[0],u=s-c*c;if(!u)return!n&&e;var f=t*s/u,d=-t*c/u,h=X(a,i),g=Q(a,f);K(g,Q(i,d));var v=h,m=J(g,v),y=J(v,v),b=m*m-y*(J(g,g)-1);if(!(b<0)){var x=M(b),_=Q(v,(-m-x)/y);if(K(_,g),_=Z(_),!n)return _;var w,k=e[0],T=r[0],A=e[1],S=r[1];T0^_[1]<(p(_[0]-k)l^(k<=_[0]&&_[0]<=T)){var P=Q(v,(-m+x)/y);return K(P,g),[_,Z(P)]}}}function c(t,r){var a=n?e:l-e,i=0;return t<-a?i|=1:t>a&&(i|=2),r<-a?i|=4:r>a&&(i|=8),i}return pt(i,(function(e){var t,r,o,u,f;return{lineStart:function(){u=o=!1,f=1},point:function(d,p){var h,g=[d,p],v=i(d,p),m=n?v?0:c(d,p):v?c(d+(d<0?l:-l),p):0;if(!t&&(u=o=v)&&e.lineStart(),v!==o&&(!(h=s(t,g))||ot(t,h)||ot(g,h))&&(g[2]=1),v!==o)f=0,v?(e.lineStart(),h=s(g,t),e.point(h[0],h[1])):(h=s(t,g),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(a&&t&&n^v){var y;m&r||!(y=s(g,t,!0))||(f=0,n?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!v||t&&ot(t,g)||e.point(g[0],g[1]),t=g,o=v,r=m},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return f|(u&&o)<<1}}}),(function(t,n,a,i){nt(i,e,r,a,t,n)}),n?[0,-e]:[-l,e-l])}function yt(e,r,n,a){function i(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function l(t,i,o,l){var c=0,f=0;if(null==t||(c=s(t,o))!==(f=s(i,o))||u(t,i)<0^o>0)do{l.point(0===c||3===c?e:n,c>1?a:r)}while((c=(c+o+4)%4)!==f);else l.point(i[0],i[1])}function s(t,a){return p(t[0]-e)0?0:3:p(t[0]-n)0?2:1:p(t[1]-r)0?1:0:a>0?3:2}function c(e,t){return u(e.x,t.x)}function u(e,t){var r=s(e,1),n=s(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(o){var s,u,f,d,p,h,g,v,m,y,b,x=o,_=it(),w={point:M,lineStart:function(){w.point=k,u&&u.push(f=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){s&&(k(d,p),h&&m&&_.rejoin(),s.push(_.result()));w.point=M,m&&x.lineEnd()},polygonStart:function(){x=_,s=[],u=[],b=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,n=u.length;ra&&(d-i)*(a-o)>(p-o)*(e-i)&&++t:p<=a&&(d-i)*(a-o)<(p-o)*(e-i)&&--t;return t}(),n=b&&r,i=(s=t.merge(s)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),l(null,null,1,o),o.lineEnd()),i&&st(s,c,r,l,o),o.polygonEnd());x=o,s=u=f=null}};function M(e,t){i(e,t)&&x.point(e,t)}function k(t,o){var l=i(t,o);if(u&&f.push([t,o]),y)d=t,p=o,h=l,y=!1,l&&(x.lineStart(),x.point(t,o));else if(l&&m)x.point(t,o);else{var s=[g=Math.max(-1e9,Math.min(1e9,g)),v=Math.max(-1e9,Math.min(1e9,v))],c=[t=Math.max(-1e9,Math.min(1e9,t)),o=Math.max(-1e9,Math.min(1e9,o))];!function(e,t,r,n,a,i){var o,l=e[0],s=e[1],c=0,u=1,f=t[0]-l,d=t[1]-s;if(o=r-l,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=d,d<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,d||!(o<0)){if(o/=d,d<0){if(o>u)return;o>c&&(c=o)}else if(d>0){if(o0&&(e[0]=l+c*f,e[1]=s+c*d),u<1&&(t[0]=l+u*f,t[1]=s+u*d),!0}}}}}(s,c,e,r,n,a)?l&&(x.lineStart(),x.point(t,o),b=!1):(m||(x.lineStart(),x.point(s[0],s[1])),x.point(c[0],c[1]),l||x.lineEnd(),b=!1)}g=t,v=o,m=l}return w}}var bt,xt,_t,wt=r(),Mt={sphere:L,point:L,lineStart:function(){Mt.point=Tt,Mt.lineEnd=kt},lineEnd:L,polygonStart:L,polygonEnd:L};function kt(){Mt.point=Mt.lineEnd=L}function Tt(e,t){bt=e*=d,xt=_(t*=d),_t=v(t),Mt.point=At}function At(e,t){e*=d;var r=_(t*=d),n=v(t),a=p(e-bt),i=v(a),o=n*_(a),l=_t*r-xt*n*i,s=xt*r+_t*n*i;wt.add(g(M(o*o+l*l),s)),bt=e,xt=r,_t=n}function St(e){return wt.reset(),E(e,Mt),+wt}var Lt=[null,null],Ct={type:"LineString",coordinates:Lt};function Pt(e,t){return Lt[0]=e,Lt[1]=t,St(Ct)}var Dt={Feature:function(e,t){return Rt(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,a=r.length;++n0&&(a=Pt(e[i],e[i-1]))>0&&r<=a&&n<=a&&(r+n-a)*(1-Math.pow((r-n)/a,2))<1e-12*a)return!0;r=n}return!1}function It(e,t){return!!dt(e.map(zt),Ft(t))}function zt(e){return(e=e.map(Ft)).pop(),e}function Ft(e){return[e[0]*d,e[1]*d]}function jt(e,r,n){var a=t.range(e,r-o,n).concat(r);return function(e){return a.map((function(t){return[e,t]}))}}function Bt(e,r,n){var a=t.range(e,r-o,n).concat(r);return function(e){return a.map((function(t){return[t,e]}))}}function Ht(){var e,r,n,a,i,l,s,c,u,f,d,h,g=10,v=g,y=90,b=360,x=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return t.range(m(a/y)*y,n,y).map(d).concat(t.range(m(c/b)*b,s,b).map(h)).concat(t.range(m(r/g)*g,e,g).filter((function(e){return p(e%y)>o})).map(u)).concat(t.range(m(l/v)*v,i,v).filter((function(e){return p(e%b)>o})).map(f))}return _.lines=function(){return w().map((function(e){return{type:"LineString",coordinates:e}}))},_.outline=function(){return{type:"Polygon",coordinates:[d(a).concat(h(s).slice(1),d(n).reverse().slice(1),h(c).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(a=+e[0][0],n=+e[1][0],c=+e[0][1],s=+e[1][1],a>n&&(e=a,a=n,n=e),c>s&&(e=c,c=s,s=e),_.precision(x)):[[a,c],[n,s]]},_.extentMinor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],l=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),l>i&&(t=l,l=i,i=t),_.precision(x)):[[r,l],[e,i]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(y=+e[0],b=+e[1],_):[y,b]},_.stepMinor=function(e){return arguments.length?(g=+e[0],v=+e[1],_):[g,v]},_.precision=function(t){return arguments.length?(x=+t,u=jt(l,i,90),f=Bt(r,e,x),d=jt(c,s,90),h=Bt(a,n,x),_):x},_.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Yt(e){return e}var Gt,Ut,qt,Vt,Zt=r(),Wt=r(),Jt={point:L,lineStart:L,lineEnd:L,polygonStart:function(){Jt.lineStart=Xt,Jt.lineEnd=$t},polygonEnd:function(){Jt.lineStart=Jt.lineEnd=Jt.point=L,Zt.add(p(Wt)),Wt.reset()},result:function(){var e=Zt/2;return Zt.reset(),e}};function Xt(){Jt.point=Kt}function Kt(e,t){Jt.point=Qt,Gt=qt=e,Ut=Vt=t}function Qt(e,t){Wt.add(Vt*e-qt*t),qt=e,Vt=t}function $t(){Qt(Gt,Ut)}var er=1/0,tr=er,rr=-er,nr=rr,ar={point:function(e,t){err&&(rr=e);tnr&&(nr=t)},lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var e=[[er,tr],[rr,nr]];return rr=nr=-(tr=er=1/0),e}};var ir,or,lr,sr,cr=0,ur=0,fr=0,dr=0,pr=0,hr=0,gr=0,vr=0,mr=0,yr={point:br,lineStart:xr,lineEnd:Mr,polygonStart:function(){yr.lineStart=kr,yr.lineEnd=Tr},polygonEnd:function(){yr.point=br,yr.lineStart=xr,yr.lineEnd=Mr},result:function(){var e=mr?[gr/mr,vr/mr]:hr?[dr/hr,pr/hr]:fr?[cr/fr,ur/fr]:[NaN,NaN];return cr=ur=fr=dr=pr=hr=gr=vr=mr=0,e}};function br(e,t){cr+=e,ur+=t,++fr}function xr(){yr.point=_r}function _r(e,t){yr.point=wr,br(lr=e,sr=t)}function wr(e,t){var r=e-lr,n=t-sr,a=M(r*r+n*n);dr+=a*(lr+e)/2,pr+=a*(sr+t)/2,hr+=a,br(lr=e,sr=t)}function Mr(){yr.point=br}function kr(){yr.point=Ar}function Tr(){Sr(ir,or)}function Ar(e,t){yr.point=Sr,br(ir=lr=e,or=sr=t)}function Sr(e,t){var r=e-lr,n=t-sr,a=M(r*r+n*n);dr+=a*(lr+e)/2,pr+=a*(sr+t)/2,hr+=a,gr+=(a=sr*e-lr*t)*(lr+e),vr+=a*(sr+t),mr+=3*a,br(lr=e,sr=t)}function Lr(e){this._context=e}Lr.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,u)}},result:L};var Cr,Pr,Dr,Or,Rr,Er=r(),Nr={point:L,lineStart:function(){Nr.point=Ir},lineEnd:function(){Cr&&zr(Pr,Dr),Nr.point=L},polygonStart:function(){Cr=!0},polygonEnd:function(){Cr=null},result:function(){var e=+Er;return Er.reset(),e}};function Ir(e,t){Nr.point=zr,Pr=Or=e,Dr=Rr=t}function zr(e,t){Or-=e,Rr-=t,Er.add(M(Or*Or+Rr*Rr)),Or=e,Rr=t}function Fr(){this._string=[]}function jr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Br(e){return function(t){var r=new Hr;for(var n in e)r[n]=e[n];return r.stream=t,r}}function Hr(){}function Yr(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=n&&e.clipExtent(null),E(r,e.stream(ar)),t(ar.result()),null!=n&&e.clipExtent(n),e}function Gr(e,t,r){return Yr(e,(function(r){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],i=Math.min(n/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+t[0][0]+(n-i*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(a-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([o,l])}),r)}function Ur(e,t,r){return Gr(e,[[0,0],t],r)}function qr(e,t,r){return Yr(e,(function(r){var n=+t,a=n/(r[1][0]-r[0][0]),i=(n-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];e.scale(150*a).translate([i,o])}),r)}function Vr(e,t,r){return Yr(e,(function(r){var n=+t,a=n/(r[1][1]-r[0][1]),i=-a*r[0][0],o=(n-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([i,o])}),r)}Fr.prototype={_radius:4.5,_circle:jr(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=jr(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}},Hr.prototype={constructor:Hr,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Zr=v(30*d);function Wr(e,t){return+t?function(e,t){function r(n,a,i,l,s,c,u,f,d,h,v,m,y,b){var x=u-n,_=f-a,w=x*x+_*_;if(w>4*t&&y--){var k=l+h,T=s+v,S=c+m,L=M(k*k+T*T+S*S),C=A(S/=L),P=p(p(S)-1)t||p((x*E+_*N)/w-.5)>.3||l*h+s*v+c*m2?e[2]%360*d:0,O()):[y*f,b*f,x*f]},P.angle=function(e){return arguments.length?(_=e%360*d,O()):_*f},P.reflectX=function(e){return arguments.length?(w=e?-1:1,O()):w<0},P.reflectY=function(e){return arguments.length?(k=e?-1:1,O()):k<0},P.precision=function(e){return arguments.length?(o=Wr(l,C=e*e),R()):M(C)},P.fitExtent=function(e,t){return Gr(P,e,t)},P.fitSize=function(e,t){return Ur(P,e,t)},P.fitWidth=function(e,t){return qr(P,e,t)},P.fitHeight=function(e,t){return Vr(P,e,t)},function(){return t=e.apply(this,arguments),P.invert=t.invert&&D,O()}}function en(e){var t=0,r=l/3,n=$r(e),a=n(t,r);return a.parallels=function(e){return arguments.length?n(t=e[0]*d,r=e[1]*d):[t*f,r*f]},a}function tn(e,t){var r=_(e),n=(r+_(t))/2;if(p(n)0?t<-s+o&&(t=-s+o):t>s-o&&(t=s-o);var r=a/x(fn(t),n);return[r*_(n*e),a-r*v(n*e)]}return i.invert=function(e,t){var r=a-t,i=w(n)*M(e*e+r*r),o=g(e,p(r))*w(r);return r*n<0&&(o-=l*w(e)*w(r)),[o/n,2*h(x(a/i,1/n))-s]},i}function pn(e,t){return[e,t]}function hn(e,t){var r=v(e),n=e===t?_(e):(r-v(t))/(t-e),a=r/n+e;if(p(n)o&&--a>0);return[e/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},Mn.invert=on(A),kn.invert=on((function(e){return 2*h(e)})),Tn.invert=function(e,t){return[-t,2*h(y(e))-s]},e.geoAlbers=nn,e.geoAlbersUsa=function(){var e,t,r,n,a,i,l=nn(),s=rn().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rn().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){i=[e,t]}};function f(e){var t=e[0],o=e[1];return i=null,r.point(t,o),i||(n.point(t,o),i)||(a.point(t,o),i)}function d(){return e=t=null,f}return f.invert=function(e){var t=l.scale(),r=l.translate(),n=(e[0]-r[0])/t,a=(e[1]-r[1])/t;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?s:a>=.166&&a<.234&&n>=-.214&&n<-.115?c:l).invert(e)},f.stream=function(r){return e&&t===r?e:(n=[l.stream(t=r),s.stream(r),c.stream(r)],a=n.length,e={point:function(e,t){for(var r=-1;++rNe(n[0],n[1])&&(n[1]=a[1]),Ne(a[0],n[1])>Ne(n[0],n[1])&&(n[0]=a[0])):i.push(n=a);for(o=-1/0,t=0,n=i[r=i.length-1];t<=r;n=a,++t)a=i[t],(l=Ne(n[1],a[0]))>o&&(o=l,ee=a[0],re=n[1])}return se=ce=null,ee===1/0||te===1/0?[[NaN,NaN],[NaN,NaN]]:[[ee,te],[re,ne]]},e.geoCentroid=function(e){ue=fe=de=pe=he=ge=ve=me=ye=be=xe=0,E(e,Fe);var t=ye,r=be,n=xe,a=t*t+r*r+n*n;return a<1e-12&&(t=ge,r=ve,n=me,fe2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)},e.geoTransverseMercatorRaw=Tn,Object.defineProperty(e,"__esModule",{value:!0})}))},{"d3-array":23}],27:[function(e,t,r){!function(n,a){"object"==typeof r&&void 0!==t?a(r,e("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(e,t){"use strict";function r(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function n(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function a(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function i(e){var i=e.dateTime,o=e.date,s=e.time,c=e.periods,u=e.days,f=e.shortDays,d=e.months,ye=e.shortMonths,be=p(c),xe=h(c),_e=p(u),we=h(u),Me=p(f),ke=h(f),Te=p(d),Ae=h(d),Se=p(ye),Le=h(ye),Ce={a:function(e){return f[e.getDay()]},A:function(e){return u[e.getDay()]},b:function(e){return ye[e.getMonth()]},B:function(e){return d[e.getMonth()]},c:null,d:N,e:N,f:B,H:I,I:z,j:F,L:j,m:H,M:Y,p:function(e){return c[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ve,s:me,S:G,u:U,U:q,V:V,w:Z,W:W,x:null,X:null,y:J,Y:X,Z:K,"%":ge},Pe={a:function(e){return f[e.getUTCDay()]},A:function(e){return u[e.getUTCDay()]},b:function(e){return ye[e.getUTCMonth()]},B:function(e){return d[e.getUTCMonth()]},c:null,d:Q,e:Q,f:ne,H:$,I:ee,j:te,L:re,m:ae,M:ie,p:function(e){return c[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ve,s:me,S:oe,u:le,U:se,V:ce,w:ue,W:fe,x:null,X:null,y:de,Y:pe,Z:he,"%":ge},De={a:function(e,t,r){var n=Me.exec(t.slice(r));return n?(e.w=ke[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=_e.exec(t.slice(r));return n?(e.w=we[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Se.exec(t.slice(r));return n?(e.m=Le[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Te.exec(t.slice(r));return n?(e.m=Ae[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,t,r){return Ee(e,i,t,r)},d:T,e:T,f:D,H:S,I:S,j:A,L:P,m:k,M:L,p:function(e,t,r){var n=be.exec(t.slice(r));return n?(e.p=xe[n[0].toLowerCase()],r+n[0].length):-1},q:M,Q:R,s:E,S:C,u:v,U:m,V:y,w:g,W:b,x:function(e,t,r){return Ee(e,o,t,r)},X:function(e,t,r){return Ee(e,s,t,r)},y:_,Y:x,Z:w,"%":O};function Oe(e,t){return function(r){var n,a,i,o=[],s=-1,c=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++s53)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?t.utcMonday.ceil(l):t.utcMonday(l),l=t.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?t.timeMonday.ceil(l):t.timeMonday(l),l=t.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 Ee(e,t,r,n){for(var a,i,o=0,s=t.length,c=r.length;o=c)return-1;if(37===(a=t.charCodeAt(o++))){if(a=t.charAt(o++),!(i=De[a in l?t.charAt(o++):a])||(n=i(e,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Ce.x=Oe(o,Ce),Ce.X=Oe(s,Ce),Ce.c=Oe(i,Ce),Pe.x=Oe(o,Pe),Pe.X=Oe(s,Pe),Pe.c=Oe(i,Pe),{format:function(e){var t=Oe(e+="",Ce);return t.toString=function(){return e},t},parse:function(e){var t=Re(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Oe(e+="",Pe);return t.toString=function(){return e},t},utcParse:function(e){var t=Re(e+="",!0);return t.toString=function(){return e},t}}}var o,l={"-":"",_:" ",0:"0"},s=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function M(e,t,r){var n=s.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function k(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function T(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function A(e,t,r){var n=s.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function S(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function L(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function C(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function P(e,t,r){var n=s.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function D(e,t,r){var n=s.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function O(e,t,r){var n=c.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function R(e,t,r){var n=s.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function E(e,t,r){var n=s.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function N(e,t){return f(e.getDate(),t,2)}function I(e,t){return f(e.getHours(),t,2)}function z(e,t){return f(e.getHours()%12||12,t,2)}function F(e,r){return f(1+t.timeDay.count(t.timeYear(e),e),r,3)}function j(e,t){return f(e.getMilliseconds(),t,3)}function B(e,t){return j(e,t)+"000"}function H(e,t){return f(e.getMonth()+1,t,2)}function Y(e,t){return f(e.getMinutes(),t,2)}function G(e,t){return f(e.getSeconds(),t,2)}function U(e){var t=e.getDay();return 0===t?7:t}function q(e,r){return f(t.timeSunday.count(t.timeYear(e)-1,e),r,2)}function V(e,r){var n=e.getDay();return e=n>=4||0===n?t.timeThursday(e):t.timeThursday.ceil(e),f(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),r,2)}function Z(e){return e.getDay()}function W(e,r){return f(t.timeMonday.count(t.timeYear(e)-1,e),r,2)}function J(e,t){return f(e.getFullYear()%100,t,2)}function X(e,t){return f(e.getFullYear()%1e4,t,4)}function K(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+f(t/60|0,"0",2)+f(t%60,"0",2)}function Q(e,t){return f(e.getUTCDate(),t,2)}function $(e,t){return f(e.getUTCHours(),t,2)}function ee(e,t){return f(e.getUTCHours()%12||12,t,2)}function te(e,r){return f(1+t.utcDay.count(t.utcYear(e),e),r,3)}function re(e,t){return f(e.getUTCMilliseconds(),t,3)}function ne(e,t){return re(e,t)+"000"}function ae(e,t){return f(e.getUTCMonth()+1,t,2)}function ie(e,t){return f(e.getUTCMinutes(),t,2)}function oe(e,t){return f(e.getUTCSeconds(),t,2)}function le(e){var t=e.getUTCDay();return 0===t?7:t}function se(e,r){return f(t.utcSunday.count(t.utcYear(e)-1,e),r,2)}function ce(e,r){var n=e.getUTCDay();return e=n>=4||0===n?t.utcThursday(e):t.utcThursday.ceil(e),f(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),r,2)}function ue(e){return e.getUTCDay()}function fe(e,r){return f(t.utcMonday.count(t.utcYear(e)-1,e),r,2)}function de(e,t){return f(e.getUTCFullYear()%100,t,2)}function pe(e,t){return f(e.getUTCFullYear()%1e4,t,4)}function he(){return"+0000"}function ge(){return"%"}function ve(e){return+e}function me(e){return Math.floor(+e/1e3)}function ye(t){return o=i(t),e.timeFormat=o.format,e.timeParse=o.parse,e.utcFormat=o.utcFormat,e.utcParse=o.utcParse,o}ye({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 be=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xe=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");e.isoFormat=be,e.isoParse=xe,e.timeFormatDefaultLocale=ye,e.timeFormatLocale=i,Object.defineProperty(e,"__esModule",{value:!0})}))},{"d3-time":28}],28:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):n((e=e||self).d3=e.d3||{})}(this,(function(e){"use strict";var t=new Date,r=new Date;function n(e,a,i,o){function l(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return l.floor=function(t){return e(t=new Date(+t)),t},l.ceil=function(t){return e(t=new Date(t-1)),a(t,1),e(t),t},l.round=function(e){var t=l(e),r=l.ceil(e);return e-t0))return o;do{o.push(i=new Date(+t)),a(t,n),e(t)}while(i=r)for(;e(r),!t(r);)r.setTime(r-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;a(e,-1),!t(e););else for(;--r>=0;)for(;a(e,1),!t(e););}))},i&&(l.count=function(n,a){return t.setTime(+n),r.setTime(+a),e(t),e(r),Math.floor(i(t,r))},l.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?l.filter(o?function(t){return o(t)%e==0}:function(t){return l.count(0,t)%e==0}):l:null}),l}var a=n((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));a.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?n((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):a:null};var i=a.range,o=n((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),l=o.range,s=n((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),c=s.range,u=n((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})),f=u.range,d=n((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1})),p=d.range;function h(e){return n((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var g=h(0),v=h(1),m=h(2),y=h(3),b=h(4),x=h(5),_=h(6),w=g.range,M=v.range,k=m.range,T=y.range,A=b.range,S=x.range,L=_.range,C=n((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),P=C.range,D=n((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));D.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var O=D.range,R=n((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),E=R.range,N=n((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()})),I=N.range,z=n((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1})),F=z.range;function j(e){return n((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var B=j(0),H=j(1),Y=j(2),G=j(3),U=j(4),q=j(5),V=j(6),Z=B.range,W=H.range,J=Y.range,X=G.range,K=U.range,Q=q.range,$=V.range,ee=n((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),te=ee.range,re=n((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));re.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var ne=re.range;e.timeDay=d,e.timeDays=p,e.timeFriday=x,e.timeFridays=S,e.timeHour=u,e.timeHours=f,e.timeInterval=n,e.timeMillisecond=a,e.timeMilliseconds=i,e.timeMinute=s,e.timeMinutes=c,e.timeMonday=v,e.timeMondays=M,e.timeMonth=C,e.timeMonths=P,e.timeSaturday=_,e.timeSaturdays=L,e.timeSecond=o,e.timeSeconds=l,e.timeSunday=g,e.timeSundays=w,e.timeThursday=b,e.timeThursdays=A,e.timeTuesday=m,e.timeTuesdays=k,e.timeWednesday=y,e.timeWednesdays=T,e.timeWeek=g,e.timeWeeks=w,e.timeYear=D,e.timeYears=O,e.utcDay=z,e.utcDays=F,e.utcFriday=q,e.utcFridays=Q,e.utcHour=N,e.utcHours=I,e.utcMillisecond=a,e.utcMilliseconds=i,e.utcMinute=R,e.utcMinutes=E,e.utcMonday=H,e.utcMondays=W,e.utcMonth=ee,e.utcMonths=te,e.utcSaturday=V,e.utcSaturdays=$,e.utcSecond=o,e.utcSeconds=l,e.utcSunday=B,e.utcSundays=Z,e.utcThursday=U,e.utcThursdays=K,e.utcTuesday=Y,e.utcTuesdays=J,e.utcWednesday=G,e.utcWednesdays=X,e.utcWeek=B,e.utcWeeks=Z,e.utcYear=re,e.utcYears=ne,Object.defineProperty(e,"__esModule",{value:!0})}))},{}],29:[function(e,t,r){arguments[4][28][0].apply(r,arguments)},{dup:28}],30:[function(e,t,r){"use strict";var n=e("is-string-blank");t.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0===(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},{"is-string-blank":65}],31:[function(e,t,r){t.exports=function(e,t){var r=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],g=t[13],v=t[14],m=t[15];return e[0]=l*(d*m-p*v)-f*(s*m-c*v)+g*(s*p-c*d),e[1]=-(n*(d*m-p*v)-f*(a*m-i*v)+g*(a*p-i*d)),e[2]=n*(s*m-c*v)-l*(a*m-i*v)+g*(a*c-i*s),e[3]=-(n*(s*p-c*d)-l*(a*p-i*d)+f*(a*c-i*s)),e[4]=-(o*(d*m-p*v)-u*(s*m-c*v)+h*(s*p-c*d)),e[5]=r*(d*m-p*v)-u*(a*m-i*v)+h*(a*p-i*d),e[6]=-(r*(s*m-c*v)-o*(a*m-i*v)+h*(a*c-i*s)),e[7]=r*(s*p-c*d)-o*(a*p-i*d)+u*(a*c-i*s),e[8]=o*(f*m-p*g)-u*(l*m-c*g)+h*(l*p-c*f),e[9]=-(r*(f*m-p*g)-u*(n*m-i*g)+h*(n*p-i*f)),e[10]=r*(l*m-c*g)-o*(n*m-i*g)+h*(n*c-i*l),e[11]=-(r*(l*p-c*f)-o*(n*p-i*f)+u*(n*c-i*l)),e[12]=-(o*(f*v-d*g)-u*(l*v-s*g)+h*(l*d-s*f)),e[13]=r*(f*v-d*g)-u*(n*v-a*g)+h*(n*d-a*f),e[14]=-(r*(l*v-s*g)-o*(n*v-a*g)+h*(n*s-a*l)),e[15]=r*(l*d-s*f)-o*(n*d-a*f)+u*(n*s-a*l),e}},{}],32:[function(e,t,r){t.exports=function(e){var t=new Float32Array(16);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}},{}],33:[function(e,t,r){t.exports=function(e,t){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}},{}],34:[function(e,t,r){t.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],35:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2],a=e[3],i=e[4],o=e[5],l=e[6],s=e[7],c=e[8],u=e[9],f=e[10],d=e[11],p=e[12],h=e[13],g=e[14],v=e[15];return(t*o-r*i)*(f*v-d*g)-(t*l-n*i)*(u*v-d*h)+(t*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)}},{}],36:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,l=n+n,s=a+a,c=r*o,u=n*o,f=n*l,d=a*o,p=a*l,h=a*s,g=i*o,v=i*l,m=i*s;return e[0]=1-f-h,e[1]=u+m,e[2]=d-v,e[3]=0,e[4]=u-m,e[5]=1-c-h,e[6]=p+g,e[7]=0,e[8]=d+v,e[9]=p-g,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],37:[function(e,t,r){t.exports=function(e,t,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(t),a=Math.cos(t),i=1-a,e[0]=o*o*i+a,e[1]=l*o*i+s*n,e[2]=s*o*i-l*n,e[3]=0,e[4]=o*l*i-s*n,e[5]=l*l*i+a,e[6]=s*l*i+o*n,e[7]=0,e[8]=o*s*i+l*n,e[9]=l*s*i-o*n,e[10]=s*s*i+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],38:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[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 e[0]=1-(p+g),e[1]=f+y,e[2]=d-m,e[3]=0,e[4]=f-y,e[5]=1-(u+g),e[6]=h+v,e[7]=0,e[8]=d+m,e[9]=h-v,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},{}],39:[function(e,t,r){t.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],40:[function(e,t,r){t.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},{}],41:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],42:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],43:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],44:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var l=1/(r-t),s=1/(a-n),c=1/(i-o);return e[0]=2*i*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*i*s,e[6]=0,e[7]=0,e[8]=(r+t)*l,e[9]=(a+n)*s,e[10]=(o+i)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*i*2*c,e[15]=0,e}},{}],45:[function(e,t,r){t.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],46:[function(e,t,r){t.exports={create:e("./create"),clone:e("./clone"),copy:e("./copy"),identity:e("./identity"),transpose:e("./transpose"),invert:e("./invert"),adjoint:e("./adjoint"),determinant:e("./determinant"),multiply:e("./multiply"),translate:e("./translate"),scale:e("./scale"),rotate:e("./rotate"),rotateX:e("./rotateX"),rotateY:e("./rotateY"),rotateZ:e("./rotateZ"),fromRotation:e("./fromRotation"),fromRotationTranslation:e("./fromRotationTranslation"),fromScaling:e("./fromScaling"),fromTranslation:e("./fromTranslation"),fromXRotation:e("./fromXRotation"),fromYRotation:e("./fromYRotation"),fromZRotation:e("./fromZRotation"),fromQuat:e("./fromQuat"),frustum:e("./frustum"),perspective:e("./perspective"),perspectiveFromFieldOfView:e("./perspectiveFromFieldOfView"),ortho:e("./ortho"),lookAt:e("./lookAt"),str:e("./str")}},{"./adjoint":31,"./clone":32,"./copy":33,"./create":34,"./determinant":35,"./fromQuat":36,"./fromRotation":37,"./fromRotationTranslation":38,"./fromScaling":39,"./fromTranslation":40,"./fromXRotation":41,"./fromYRotation":42,"./fromZRotation":43,"./frustum":44,"./identity":45,"./invert":47,"./lookAt":48,"./multiply":49,"./ortho":50,"./perspective":51,"./perspectiveFromFieldOfView":52,"./rotate":53,"./rotateX":54,"./rotateY":55,"./rotateZ":56,"./scale":57,"./str":58,"./translate":59,"./transpose":60}],47:[function(e,t,r){t.exports=function(e,t){var r=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],g=t[13],v=t[14],m=t[15],y=r*l-n*o,b=r*s-a*o,x=r*c-i*o,_=n*s-a*l,w=n*c-i*l,M=a*c-i*s,k=u*g-f*h,T=u*v-d*h,A=u*m-p*h,S=f*v-d*g,L=f*m-p*g,C=d*m-p*v,P=y*C-b*L+x*S+_*A-w*T+M*k;if(!P)return null;return P=1/P,e[0]=(l*C-s*L+c*S)*P,e[1]=(a*L-n*C-i*S)*P,e[2]=(g*M-v*w+m*_)*P,e[3]=(d*w-f*M-p*_)*P,e[4]=(s*A-o*C-c*T)*P,e[5]=(r*C-a*A+i*T)*P,e[6]=(v*x-h*M-m*b)*P,e[7]=(u*M-d*x+p*b)*P,e[8]=(o*L-l*A+c*k)*P,e[9]=(n*A-r*L-i*k)*P,e[10]=(h*w-g*x+m*y)*P,e[11]=(f*x-u*w-p*y)*P,e[12]=(l*T-o*S-s*k)*P,e[13]=(r*S-n*T+a*k)*P,e[14]=(g*b-h*_-v*y)*P,e[15]=(u*_-f*b+d*y)*P,e}},{}],48:[function(e,t,r){var n=e("./identity");t.exports=function(e,t,r,a){var i,o,l,s,c,u,f,d,p,h,g=t[0],v=t[1],m=t[2],y=a[0],b=a[1],x=a[2],_=r[0],w=r[1],M=r[2];if(Math.abs(g-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(m-M)<1e-6)return n(e);f=g-_,d=v-w,p=m-M,h=1/Math.sqrt(f*f+d*d+p*p),i=b*(p*=h)-x*(d*=h),o=x*(f*=h)-y*p,l=y*d-b*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 e[0]=i,e[1]=s,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=d,e[7]=0,e[8]=l,e[9]=u,e[10]=p,e[11]=0,e[12]=-(i*g+o*v+l*m),e[13]=-(s*g+c*v+u*m),e[14]=-(f*g+d*v+p*m),e[15]=1,e}},{"./identity":45}],49:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],l=t[4],s=t[5],c=t[6],u=t[7],f=t[8],d=t[9],p=t[10],h=t[11],g=t[12],v=t[13],m=t[14],y=t[15],b=r[0],x=r[1],_=r[2],w=r[3];return e[0]=b*n+x*l+_*f+w*g,e[1]=b*a+x*s+_*d+w*v,e[2]=b*i+x*c+_*p+w*m,e[3]=b*o+x*u+_*h+w*y,b=r[4],x=r[5],_=r[6],w=r[7],e[4]=b*n+x*l+_*f+w*g,e[5]=b*a+x*s+_*d+w*v,e[6]=b*i+x*c+_*p+w*m,e[7]=b*o+x*u+_*h+w*y,b=r[8],x=r[9],_=r[10],w=r[11],e[8]=b*n+x*l+_*f+w*g,e[9]=b*a+x*s+_*d+w*v,e[10]=b*i+x*c+_*p+w*m,e[11]=b*o+x*u+_*h+w*y,b=r[12],x=r[13],_=r[14],w=r[15],e[12]=b*n+x*l+_*f+w*g,e[13]=b*a+x*s+_*d+w*v,e[14]=b*i+x*c+_*p+w*m,e[15]=b*o+x*u+_*h+w*y,e}},{}],50:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var l=1/(t-r),s=1/(n-a),c=1/(i-o);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*l,e[13]=(a+n)*s,e[14]=(o+i)*c,e[15]=1,e}},{}],51:[function(e,t,r){t.exports=function(e,t,r,n,a){var i=1/Math.tan(t/2),o=1/(n-a);return e[0]=i/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(a+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*a*n*o,e[15]=0,e}},{}],52:[function(e,t,r){t.exports=function(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),l=Math.tan(t.rightDegrees*Math.PI/180),s=2/(o+l),c=2/(a+i);return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(o-l)*s*.5,e[9]=(a-i)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}},{}],53:[function(e,t,r){t.exports=function(e,t,r,n){var a,i,o,l,s,c,u,f,d,p,h,g,v,m,y,b,x,_,w,M,k,T,A,S,L=n[0],C=n[1],P=n[2],D=Math.sqrt(L*L+C*C+P*P);if(Math.abs(D)<1e-6)return null;L*=D=1/D,C*=D,P*=D,a=Math.sin(r),i=Math.cos(r),o=1-i,l=t[0],s=t[1],c=t[2],u=t[3],f=t[4],d=t[5],p=t[6],h=t[7],g=t[8],v=t[9],m=t[10],y=t[11],b=L*L*o+i,x=C*L*o+P*a,_=P*L*o-C*a,w=L*C*o-P*a,M=C*C*o+i,k=P*C*o+L*a,T=L*P*o+C*a,A=C*P*o-L*a,S=P*P*o+i,e[0]=l*b+f*x+g*_,e[1]=s*b+d*x+v*_,e[2]=c*b+p*x+m*_,e[3]=u*b+h*x+y*_,e[4]=l*w+f*M+g*k,e[5]=s*w+d*M+v*k,e[6]=c*w+p*M+m*k,e[7]=u*w+h*M+y*k,e[8]=l*T+f*A+g*S,e[9]=s*T+d*A+v*S,e[10]=c*T+p*A+m*S,e[11]=u*T+h*A+y*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e}},{}],54:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[4],o=t[5],l=t[6],s=t[7],c=t[8],u=t[9],f=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[4]=i*a+c*n,e[5]=o*a+u*n,e[6]=l*a+f*n,e[7]=s*a+d*n,e[8]=c*a-i*n,e[9]=u*a-o*n,e[10]=f*a-l*n,e[11]=d*a-s*n,e}},{}],55:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],l=t[2],s=t[3],c=t[8],u=t[9],f=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[0]=i*a-c*n,e[1]=o*a-u*n,e[2]=l*a-f*n,e[3]=s*a-d*n,e[8]=i*n+c*a,e[9]=o*n+u*a,e[10]=l*n+f*a,e[11]=s*n+d*a,e}},{}],56:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],l=t[2],s=t[3],c=t[4],u=t[5],f=t[6],d=t[7];t!==e&&(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]);return e[0]=i*a+c*n,e[1]=o*a+u*n,e[2]=l*a+f*n,e[3]=s*a+d*n,e[4]=c*a-i*n,e[5]=u*a-o*n,e[6]=f*a-l*n,e[7]=d*a-s*n,e}},{}],57:[function(e,t,r){t.exports=function(e,t,r){var n=r[0],a=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],58:[function(e,t,r){t.exports=function(e){return"mat4("+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]+")"}},{}],59:[function(e,t,r){t.exports=function(e,t,r){var n,a,i,o,l,s,c,u,f,d,p,h,g=r[0],v=r[1],m=r[2];t===e?(e[12]=t[0]*g+t[4]*v+t[8]*m+t[12],e[13]=t[1]*g+t[5]*v+t[9]*m+t[13],e[14]=t[2]*g+t[6]*v+t[10]*m+t[14],e[15]=t[3]*g+t[7]*v+t[11]*m+t[15]):(n=t[0],a=t[1],i=t[2],o=t[3],l=t[4],s=t[5],c=t[6],u=t[7],f=t[8],d=t[9],p=t[10],h=t[11],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]=n*g+l*v+f*m+t[12],e[13]=a*g+s*v+d*m+t[13],e[14]=i*g+c*v+p*m+t[14],e[15]=o*g+u*v+h*m+t[15]);return e}},{}],60:[function(e,t,r){t.exports=function(e,t){if(e===t){var r=t[1],n=t[2],a=t[3],i=t[6],o=t[7],l=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=i,e[11]=t[14],e[12]=a,e[13]=o,e[14]=l}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},{}],61:[function(e,t,r){(function(r){(function(){"use strict";var n,a=e("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,t.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":63}],62:[function(e,t,r){"use strict";var n=e("is-browser");t.exports=n&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return e}()},{"is-browser":63}],63:[function(e,t,r){t.exports=!0},{}],64:[function(e,t,r){"use strict";t.exports=i,t.exports.isMobile=i,t.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(e){e||(e={});var t=e.ua;if(t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;var r=e.tablet?a.test(t):n.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(r=!0),r}},{}],65:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},{}],66:[function(e,t,r){var n={left:0,top:0};t.exports=function(e,t,r){t=t||e.currentTarget||e.srcElement,Array.isArray(r)||(r=[0,0]);var a=e.clientX||0,i=e.clientY||0,o=(l=t,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],67:[function(e,t,r){(function(e,r){(function(){ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=e()}}((function(){return function e(t,r,n){function a(o,l){if(!r[o]){if(!t[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:{}};t[o][0].call(u.exports,(function(e){return a(t[o][1][e]||e)}),u,u.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .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:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;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 rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",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,.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:.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":260}],2:[function(e,t,r){"use strict";t.exports=e("../src/transforms/aggregate")},{"../src/transforms/aggregate":411}],3:[function(e,t,r){"use strict";t.exports=e("../src/components/calendars")},{"../src/components/calendars":115}],4:[function(e,t,r){"use strict";t.exports=e("../src/traces/choropleth")},{"../src/traces/choropleth":365}],5:[function(e,t,r){"use strict";t.exports=e("../src/core")},{"../src/core":240}],6:[function(e,t,r){"use strict";t.exports=e("../src/transforms/filter")},{"../src/transforms/filter":412}],7:[function(e,t,r){"use strict";t.exports=e("../src/transforms/groupby")},{"../src/transforms/groupby":413}],8:[function(e,t,r){"use strict";var n=e("./core");n.register([e("./scattergeo"),e("./choropleth"),e("./aggregate"),e("./filter"),e("./groupby"),e("./sort"),e("./calendars")]),t.exports=n},{"./aggregate":2,"./calendars":3,"./choropleth":4,"./core":5,"./filter":6,"./groupby":7,"./scattergeo":9,"./sort":10}],9:[function(e,t,r){"use strict";t.exports=e("../src/traces/scattergeo")},{"../src/traces/scattergeo":407}],10:[function(e,t,r){"use strict";t.exports=e("../src/transforms/sort")},{"../src/transforms/sort":415}],11:[function(e,t,r){(function(){var e={version:"3.8.0"},r=[].slice,n=function(e){return r.call(e)},a=self.document;function i(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(e){n=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var l=this.Element.prototype,s=l.setAttribute,c=l.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;l.setAttribute=function(e,t){s.call(this,e,t+"")},l.setAttributeNS=function(e,t,r){c.call(this,e,t,r+"")},u.setProperty=function(e,t,r){f.call(this,e,t+"",r)}}function d(e,t){return et?1:e>=t?0:NaN}function p(e){return null===e?NaN:+e}function h(e){return!isNaN(e)}function g(e){return{left:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=t.length);n>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}e.ascending=d,e.descending=function(e,t){return te?1:t>=e?0:NaN},e.min=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},e.max=function(e,t){var r,n,a=-1,i=e.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},e.extent=function(e,t){var r,n,a,i=-1,o=e.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(s-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var v=g(d);function m(e){return e.length}e.bisectLeft=v.left,e.bisect=e.bisectRight=v.right,e.bisector=function(e){return g(1===e.length?function(t,r){return d(e(t),r)}:e)},e.shuffle=function(e,t,r){(i=arguments.length)<3&&(r=e.length,i<2&&(t=0));for(var n,a,i=r-t;i;)a=Math.random()*i--|0,n=e[i+t],e[i+t]=e[a+t],e[a+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],a=new Array(r<0?0:r);t=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r};var y=Math.abs;function b(e){for(var t=1;e*t%1;)t*=10;return t}function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function _(){this._=Object.create(null)}e.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("infinite range");var n,a=[],i=b(y(r)),o=-1;if(e*=i,t*=i,(r*=i)<0)for(;(n=e+r*++o)>t;)a.push(n/i);else for(;(n=e+r*++o)=a.length)return r?r.call(n,i):t?i.sort(t):i;for(var s,c,u,f,d=-1,p=i.length,h=a[l++],g=new _;++d=a.length)return t;var n=[],o=i[r++];return t.forEach((function(t,a){n.push({key:t,values:e(a,r)})})),o?n.sort((function(e,t){return o(e.key,t.key)})):n}(o(e.map,t,0),0)},n.key=function(e){return a.push(e),n},n.sortKeys=function(e){return i[a.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new P;if(e)for(var r=0,n=e.length;r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(B,"\\$&")};var B=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,H={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function Y(e){return H(e,V),e}var G=function(e,t){return t.querySelector(e)},U=function(e,t){return t.querySelectorAll(e)},q=function(e,t){var r=e.matches||e[O(e,"matchesSelector")];return(q=function(e,t){return r.call(e,t)})(e,t)};"function"==typeof Sizzle&&(G=function(e,t){return Sizzle(e,t)[0]||null},U=Sizzle,q=Sizzle.matchesSelector),e.selection=function(){return e.select(a.documentElement)};var V=e.selection.prototype=[];function Z(e){return"function"==typeof e?e:function(){return G(e,this)}}function W(e){return"function"==typeof e?e:function(){return U(e,this)}}V.select=function(e){var t,r,n,a,i=[];e=Z(e);for(var o=-1,l=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),X.hasOwnProperty(r)?{space:X[r],local:e}:e}},V.attr=function(t,r){if(arguments.length<2){if("string"==typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each(K(r,t[r]));return this}return this.each(K(t,r))},V.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var r=this.node(),n=(e=ee(e)).length,a=-1;if(t=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},V.sort=function(e){e=ce.apply(this,arguments);for(var t=-1,r=this.length;++t=t&&(t=a+1);!(o=l[t])&&++t0&&(t=t.slice(0,o));var s=ge.get(t);function c(){var e=this[i];e&&(this.removeEventListener(t,e,e.$),delete this[i])}return s&&(t=s,l=me),o?r?function(){var e=l(r,n(arguments));c.call(this),this.addEventListener(t,this[i]=e,e.$=a),e._=r}:c:r?E:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}e.selection.enter=fe,e.selection.enter.prototype=de,de.append=V.append,de.empty=V.empty,de.node=V.node,de.call=V.call,de.size=V.size,de.select=function(e){for(var t,r,n,a,i,o=[],l=-1,s=this.length;++l1?Le:e<-1?-Le:Math.asin(e)}function Oe(e){return((e=Math.exp(e))+1/e)/2}var Re=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,a=e[0],i=e[1],o=e[2],l=t[0],s=t[1],c=t[2],u=l-a,f=s-i,d=u*u+f*f;if(d<1e-12)n=Math.log(c/o)/Re,r=function(e){return[a+e*u,i+e*f,o*Math.exp(Re*e*n)]};else{var p=Math.sqrt(d),h=(c*c-o*o+4*d)/(2*o*2*p),g=(c*c-o*o-4*d)/(2*c*2*p),v=Math.log(Math.sqrt(h*h+1)-h),m=Math.log(Math.sqrt(g*g+1)-g);n=(m-v)/Re,r=function(e){var t,r=e*n,l=Oe(v),s=o/(2*p)*(l*(t=Re*r+v,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+s*u,i+s*f,o*l/Oe(Re*r+v)]}}return r.duration=1e3*n,r},e.behavior.zoom=function(){var t,r,n,i,l,s,c,u,f,d={x:0,y:0,k:1},p=[960,500],h=Ie,g=250,v=0,m="mousedown.zoom",y="mousemove.zoom",b="mouseup.zoom",x="touchstart.zoom",_=j(w,"zoomstart","zoom","zoomend");function w(e){e.on(m,D).on(Ne+".zoom",R).on("dblclick.zoom",E).on(x,O)}function M(e){return[(e[0]-d.x)/d.k,(e[1]-d.y)/d.k]}function k(e){d.k=Math.max(h[0],Math.min(h[1],e))}function T(e,t){t=function(e){return[e[0]*d.k+d.x,e[1]*d.k+d.y]}(t),d.x+=e[0]-t[0],d.y+=e[1]-t[1]}function A(t,n,a,i){t.__chart__={x:d.x,y:d.y,k:d.k},k(Math.pow(2,i)),T(r=n,a),t=e.select(t),g>0&&(t=t.transition().duration(g)),t.call(w.event)}function S(){c&&c.domain(s.range().map((function(e){return(e-d.x)/d.k})).map(s.invert)),f&&f.domain(u.range().map((function(e){return(e-d.y)/d.k})).map(u.invert))}function L(e){v++||e({type:"zoomstart"})}function P(e){S(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function C(e){--v||(e({type:"zoomend"}),r=null)}function D(){var t=this,r=_.of(t,arguments),n=0,a=e.select(o(t)).on(y,s).on(b,c),i=M(e.mouse(t)),l=xe(t);function s(){n=1,T(e.mouse(t),i),P(r)}function c(){a.on(y,null).on(b,null),l(n),C(r)}Na.call(t),L(r)}function O(){var t,r=this,n=_.of(r,arguments),a={},i=0,o=".zoom-"+e.event.changedTouches[0].identifier,s="touchmove"+o,c="touchend"+o,u=[],f=e.select(r),p=xe(r);function h(){var n=e.touches(r);return t=d.k,n.forEach((function(e){e.identifier in a&&(a[e.identifier]=M(e))})),n}function g(){var t=e.event.target;e.select(t).on(s,v).on(c,y),u.push(t);for(var n=e.event.changedTouches,o=0,f=n.length;o1){m=p[0];var b=p[1],x=m[0]-b[0],_=m[1]-b[1];i=x*x+_*_}}function v(){var o,s,c,u,f=e.touches(r);Na.call(r);for(var d=0,p=f.length;d360?e-=360:e<0&&(e+=360),e<60?n+(a-n)*e/60:e<180?a:e<240?n+(a-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+t):r+t-r*t),new Qe(i(e+120),i(e),i(e-120))}function He(t,r,n){return this instanceof He?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof He?new He(t.h,t.c,t.l):We(t instanceof Ue?t.l:(t=it((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new He(t,r,n)}je.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Fe(this.h,this.s,this.l/e)},je.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Fe(this.h,this.s,e*this.l)},je.rgb=function(){return Be(this.h,this.s,this.l)},e.hcl=He;var Ye=He.prototype=new ze;function Ge(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ue(r,Math.cos(e*=Pe)*t,Math.sin(e)*t)}function Ue(e,t,r){return this instanceof Ue?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof Ue?new Ue(e.l,e.a,e.b):e instanceof He?Ge(e.h,e.c,e.l):it((e=Qe(e)).r,e.g,e.b):new Ue(e,t,r)}Ye.brighter=function(e){return new He(this.h,this.c,Math.min(100,this.l+qe*(arguments.length?e:1)))},Ye.darker=function(e){return new He(this.h,this.c,Math.max(0,this.l-qe*(arguments.length?e:1)))},Ye.rgb=function(){return Ge(this.h,this.c,this.l).rgb()},e.lab=Ue;var qe=18,Ve=Ue.prototype=new ze;function Ze(e,t,r){var n=(e+16)/116,a=n+t/500,i=n-r/200;return new Qe(Ke(3.2404542*(a=.95047*Je(a))-1.5371385*(n=1*Je(n))-.4985314*(i=1.08883*Je(i))),Ke(-.969266*a+1.8760108*n+.041556*i),Ke(.0556434*a-.2040259*n+1.0572252*i))}function We(e,t,r){return e>0?new He(Math.atan2(r,t)*Ce,Math.sqrt(t*t+r*r),e):new He(NaN,NaN,e)}function Je(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function Xe(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Ke(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function Qe(e,t,r){return this instanceof Qe?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof Qe?new Qe(e.r,e.g,e.b):nt(""+e,Qe,Be):new Qe(e,t,r)}function $e(e){return new Qe(e>>16,e>>8&255,255&e)}function et(e){return $e(e)+""}Ve.brighter=function(e){return new Ue(Math.min(100,this.l+qe*(arguments.length?e:1)),this.a,this.b)},Ve.darker=function(e){return new Ue(Math.max(0,this.l-qe*(arguments.length?e:1)),this.a,this.b)},Ve.rgb=function(){return Ze(this.l,this.a,this.b)},e.rgb=Qe;var tt=Qe.prototype=new ze;function rt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function nt(e,t,r){var n,a,i,o=0,l=0,s=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return t(lt(a[0]),lt(a[1]),lt(a[2]))}return(i=st.get(e))?t(i.r,i.g,i.b):(null==e||"#"!==e.charAt(0)||isNaN(i=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&i)>>4,o|=o>>4,l=240&i,l|=l>>4,s=15&i,s|=s<<4):7===e.length&&(o=(16711680&i)>>16,l=(65280&i)>>8,s=255&i)),t(o,l,s))}function at(e,t,r){var n,a,i=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),l=o-i,s=(o+i)/2;return l?(a=s<.5?l/(o+i):l/(2-o-i),n=e==o?(t-r)/l+(t0&&s<1?0:n),new Fe(n,a,s)}function it(e,t,r){var n=Xe((.4124564*(e=ot(e))+.3575761*(t=ot(t))+.1804375*(r=ot(r)))/.95047),a=Xe((.2126729*e+.7151522*t+.072175*r)/1);return Ue(116*a-16,500*(n-a),200*(a-Xe((.0193339*e+.119192*t+.9503041*r)/1.08883)))}function ot(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function lt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}tt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,a=30;return t||r||n?(t&&t=200&&t<300||304===t){try{e=a.call(o,c)}catch(e){return void l.error.call(o,e)}l.load.call(o,e)}else l.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=f:c.onreadystatechange=function(){c.readyState>3&&f()},c.onprogress=function(t){var r=e.event;e.event=t;try{l.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(null==t?delete s[e]:s[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return a=e,o},["get","post"].forEach((function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}})),o.send=function(e,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),c.open(e,t,!0),null==r||"accept"in s||(s.accept=r+",*/*"),c.setRequestHeader)for(var i in s)c.setRequestHeader(i,s[i]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=a&&o.on("error",a).on("load",(function(e){a(null,e)})),l.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},e.rebind(o,l,"on"),null==i?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(i))}st.forEach((function(e,t){st.set(e,$e(t))})),e.functor=ct,e.xhr=ut(C),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function a(e,r,n){arguments.length<3&&(n=r,r=null);var a=ft(e,t,null==r?i:o(r),n);return a.row=function(e){return arguments.length?a.response(null==(r=e)?i:o(e)):r},a}function i(e){return a.parse(e.responseText)}function o(e){return function(t){return a.parse(t.responseText,e)}}function l(t){return t.map(s).join(e)}function s(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return a.parse=function(e,t){var r;return a.parseRows(e,(function(e,n){if(r)return r(e,n-1);var a=function(t){for(var r={},n=e.length,a=0;a=s)return o;if(a)return a=!1,i;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(gt),gt=setTimeout(yt,t)),ht=0):(ht=1,vt(yt))}function bt(){for(var e=Date.now(),t=dt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function xt(){for(var e,t=dt,r=1/0;t;)t.c?(t.t1&&(t=e[i[o-2]],r=e[i[o-1]],n=e[l],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;i[o++]=l}return i.slice(0,o)}function kt(e,t){return e[0]-t[0]||e[1]-t[1]}e.timer=function(){mt.apply(this,arguments)},e.timer.flush=function(){bt(),xt()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},e.geom={},e.geom.hull=function(e){var t=_t,r=wt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,a=ct(t),i=ct(r),o=e.length,l=[],s=[];for(n=0;n=0;--n)p.push(e[l[c[n]][2]]);for(n=+f;nke)l=l.L;else{if(!((a=i-Yt(l,o))>ke)){n>-ke?(t=l.P,r=l):a>-ke?(t=l,r=l.N):t=r=l;break}if(!l.R){t=l;break}l=l.R}var s=zt(e);if(Dt.insert(t,s),t||r){if(t===r)return Zt(t),r=zt(t.site),Dt.insert(s,r),s.edge=r.edge=Xt(t.site,s.site),Vt(t),void Vt(r);if(r){Zt(t),Zt(r);var c=t.site,u=c.x,f=c.y,d=e.x-u,p=e.y-f,h=r.site,g=h.x-u,v=h.y-f,m=2*(d*v-p*g),y=d*d+p*p,b=g*g+v*v,x={x:(v*y-p*b)/m+u,y:(d*b-g*y)/m+f};Qt(r.edge,c,h,x),s.edge=Xt(c,e,null,x),r.edge=Xt(e,h,null,x),Vt(t),Vt(r)}else s.edge=Xt(t.site,s.site)}}function Ht(e,t){var r=e.site,n=r.x,a=r.y,i=a-t;if(!i)return n;var o=e.P;if(!o)return-1/0;var l=(r=o.site).x,s=r.y,c=s-t;if(!c)return l;var u=l-n,f=1/i-1/c,d=u/c;return f?(-d+Math.sqrt(d*d-2*f*(u*u/(-2*c)-s+c/2+a-i/2)))/f+n:(n+l)/2}function Yt(e,t){var r=e.N;if(r)return Ht(r,t);var n=e.site;return n.y===t?n.x:1/0}function Gt(e){this.site=e,this.edges=[]}function Ut(e,t){return t.angle-e.angle}function qt(){tr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vt(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,a=e.site,i=r.site;if(n!==i){var o=a.x,l=a.y,s=n.x-o,c=n.y-l,u=i.x-o,f=2*(s*(v=i.y-l)-c*u);if(!(f>=-1e-12)){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=Nt.pop()||new qt;m.arc=e,m.site=a,m.x=h+o,m.y=v+Math.sqrt(h*h+g*g),m.cy=v,e.circle=m;for(var y=null,b=Rt._;b;)if(m.y=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.y1)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=l)return}else i={x:o,y:n*o+a};r={x:l,y:n*l+a}}else{if(i){if(i.x0)){if(t/=d,d<0){if(t0){if(t>f)return;t>u&&(u=t)}if(t=a-s,d||!(t<0)){if(t/=d,d<0){if(t>f)return;t>u&&(u=t)}else if(d>0){if(t0)){if(t/=p,p<0){if(t0){if(t>f)return;t>u&&(u=t)}if(t=i-c,p||!(t<0)){if(t/=p,p<0){if(t>f)return;t>u&&(u=t)}else if(p>0){if(t0&&(e.a={x:s+u*d,y:c+u*p}),f<1&&(e.b={x:s+f*d,y:c+f*p}),e}}}}}),s=o.length;s--;)(!Wt(t=o[s],e)||!l(t)||y(t.a.x-t.b.x)ke||y(a-r)>ke)&&(l.splice(o,0,new $t(Kt(i.site,u,y(n-f)ke?{x:f,y:y(t-f)ke?{x:y(r-h)ke?{x:d,y:y(t-d)ke?{x:y(r-p)=r&&c.x<=a&&c.y>=n&&c.y<=o?[[r,o],[a,o],[a,n],[r,n]]:[]).point=e[l]})),t}function l(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/ke)*ke,y:Math.round(a(e,t)/ke)*ke,i:t}}))}return o.links=function(e){return ir(l(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return ir(l(e)).cells.forEach((function(r,n){for(var a,i,o,l,s=r.site,c=r.edges.sort(Ut),u=-1,f=c.length,d=c[f-1].edge,p=d.l===s?d.r:d.l;++ui||f>o||d=_)<<1|t>=x,M=w+4;wi&&(a=t.slice(i,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(n=n[0])?l[o]?l[o]+=n:l[++o]=n:(l[++o]=null,s.push({i:o,x:hr(r,n)})),i=mr.lastIndex;return ig&&(g=s.x),s.y>v&&(v=s.y),c.push(s.x),u.push(s.y);else for(f=0;fg&&(g=x),_>v&&(v=_),c.push(x),u.push(_)}var w=g-p,M=v-h;function k(e,t,r,n,a,i,o,l){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var s=e.x,c=e.y;if(null!=s)if(y(s-r)+y(c-n)<.01)T(e,t,r,n,a,i,o,l);else{var u=e.point;e.x=e.y=e.point=null,T(e,u,s,c,a,i,o,l),T(e,t,r,n,a,i,o,l)}else e.x=r,e.y=n,e.point=t}else T(e,t,r,n,a,i,o,l)}function T(e,t,r,n,a,i,o,l){var s=.5*(a+o),c=.5*(i+l),u=r>=s,f=n>=c,d=f<<1|u;e.leaf=!1,u?a=s:o=s,f?i=c:l=c,k(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,a,i,o,l)}w>M?v=h+w:g=p+M;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){k(A,e,+m(e,++f),+b(e,f),p,h,g,v)},visit:function(e){ur(e,A,p,h,g,v)},find:function(e){return fr(A,e[0],e[1],p,h,g,v)}};if(f=-1,null==t){for(;++f=0&&!(n=e.interpolators[a](t,r)););return n}function br(e,t){var r,n=[],a=[],i=e.length,o=t.length,l=Math.min(e.length,t.length);for(r=0;r=1?1:e(t)}}function kr(e){return function(t){return 1-e(1-t)}}function Tr(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Ar(e){return e*e}function Sr(e){return e*e*e}function Lr(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Pr(e){return 1-Math.cos(e*Le)}function Cr(e){return Math.pow(2,10*(e-1))}function Dr(e){return 1-Math.sqrt(1-e*e)}function Or(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Rr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Er(e){var t,r,n,a=[e.a,e.b],i=[e.c,e.d],o=Ir(a),l=Nr(a,i),s=Ir(((t=i)[0]+=(n=-l)*(r=a)[0],t[1]+=n*r[1],t))||0;a[0]*i[1]=0?e.slice(0,t):e,a=t>=0?e.slice(t+1):"in";return n=_r.get(n)||xr,Mr((a=wr.get(a)||C)(n.apply(null,r.call(arguments,1))))},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,a=t.c,i=t.l,o=r.h-n,l=r.c-a,s=r.l-i;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(e){return Ge(n+o*e,a+l*e,i+s*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,a=t.s,i=t.l,o=r.h-n,l=r.s-a,s=r.l-i;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(e){return Be(n+o*e,a+l*e,i+s*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,a=t.a,i=t.b,o=r.l-n,l=r.a-a,s=r.b-i;return function(e){return Ze(n+o*e,a+l*e,i+s*e)+""}},e.interpolateRound=Rr,e.transform=function(t){var r=a.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new Er(t?t.matrix:zr)})(t)},Er.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var zr={a:1,b:0,c:0,d:1,e:0,f:0};function Fr(e){return e.length?e.pop()+",":""}function jr(t,r){var n=[],a=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push("translate(",null,",",null,")");n.push({i:a-4,x:hr(e[0],t[0])},{i:a-2,x:hr(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,a),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Fr(r)+"rotate(",null,")")-2,x:hr(e,t)})):t&&r.push(Fr(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,a),function(e,t,r,n){e!==t?n.push({i:r.push(Fr(r)+"skewX(",null,")")-2,x:hr(e,t)}):t&&r.push(Fr(r)+"skewX("+t+")")}(t.skew,r.skew,n,a),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var a=r.push(Fr(r)+"scale(",null,",",null,")");n.push({i:a-4,x:hr(e[0],t[0])},{i:a-2,x:hr(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Fr(r)+"scale("+t+")")}(t.scale,r.scale,n,a),t=r=null,function(e){for(var t,r=-1,i=a.length;++r0?n=e:(t.c=null,t.t=NaN,t=null,s.end({type:"end",alpha:n=0})):e>0&&(s.start({type:"start",alpha:n=e}),t=mt(l.tick)),l):n},l.start=function(){var e,t,r,n=m.length,s=y.length,u=c[0],h=c[1];for(e=0;e=0;)r.push(a[n])}function $r(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(i=e.children)&&(a=i.length))for(var a,i,o=-1;++o=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 $r(a,(function(t){var n,a;e&&(n=t.children)&&n.sort(e),r&&(a=t.parent)&&(a.value+=t.value)})),l}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(Qr(e,(function(e){e.children&&(e.value=0)})),$r(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,n){var a=t.call(this,e,n);return function e(t,r,n,a){var i=t.children;if(t.x=r,t.y=t.depth*a,t.dx=n,t.dy=a,i&&(o=i.length)){var o,l,s,c=-1;for(n=t.value?n/t.value:0;++cl&&(l=n),o.push(n)}for(r=0;ra&&(n=r,a=t);return n}function hn(e){return e.reduce(gn,0)}function gn(e,t){return e+t[1]}function vn(e,t){return mn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function mn(e,t){for(var r=-1,n=+e[0],a=(e[1]-n)/t,i=[];++r<=t;)i[r]=a*r+n;return i}function yn(t){return[e.min(t),e.max(t)]}function bn(e,t){return e.value-t.value}function xn(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function _n(e,t){e._pack_next=t,t._pack_prev=e}function wn(e,t){var r=t.x-e.x,n=t.y-e.y,a=e.r+t.r;return.999*a*a>r*r+n*n}function Mn(e){if((t=e.children)&&(s=t.length)){var t,r,n,a,i,o,l,s,c=1/0,u=-1/0,f=1/0,d=-1/0;if(t.forEach(kn),(r=t[0]).x=-r.r,r.y=0,b(r),s>1&&((n=t[1]).x=n.r,n.y=0,b(n),s>2))for(An(r,n,a=t[2]),b(a),xn(r,a),r._pack_prev=a,xn(a,n),n=r._pack_next,i=3;i0)for(o=-1;++o=f[0]&&s<=f[1]&&((l=c[e.bisect(d,s,1,h)-1]).y+=g,l.push(i[o]));return c}return i.value=function(e){return arguments.length?(r=e,i):r},i.range=function(e){return arguments.length?(n=ct(e),i):n},i.bins=function(e){return arguments.length?(a="number"==typeof e?function(t){return mn(t,e)}:ct(e),i):a},i.frequency=function(e){return arguments.length?(t=!!e,i):t},i},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(bn),n=0,a=[1,1];function i(e,i){var o=r.call(this,e,i),l=o[0],s=a[0],c=a[1],u=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(l.x=l.y=0,$r(l,(function(e){e.r=+u(e.value)})),$r(l,Mn),n){var f=n*(t?1:Math.max(2*l.r/s,2*l.r/c))/2;$r(l,(function(e){e.r+=f})),$r(l,Mn),$r(l,(function(e){e.r-=f}))}return function e(t,r,n,a){var i=t.children;if(t.x=r+=a*t.x,t.y=n+=a*t.y,t.r*=a,i)for(var o=-1,l=i.length;++op.x&&(p=e),e.depth>h.depth&&(h=e)}));var g=r(d,p)/2-d.x,v=n[0]/(p.x+r(p,d)/2+g),m=n[1]/(h.depth||1);Qr(u,(function(e){e.x=(e.x+g)*v,e.y=e.depth*m}))}return c}function o(e){var t=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(t.length){!function(e){var t,r=0,n=0,a=e.children,i=a.length;for(;--i>=0;)(t=a[i]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var i=(t[0].z+t[t.length-1].z)/2;a?(e.z=a.z+r(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+r(e._,a._));e.parent.A=function(e,t,n){if(t){for(var a,i=e,o=e,l=t,s=i.parent.children[0],c=i.m,u=o.m,f=l.m,d=s.m;l=Pn(l),i=Ln(i),l&&i;)s=Ln(s),(o=Pn(o)).a=e,(a=l.z+f-i.z-c+r(l._,i._))>0&&(Cn(Dn(l,e,n),e,a),c+=a,u+=a),f+=l.m,c+=i.m,d+=s.m,u+=o.m;l&&!Pn(o)&&(o.t=l,o.m+=f-u),i&&!Ln(s)&&(s.t=i,s.m+=c-d,n=e)}return n}(e,a,e.parent.A||n[0])}function l(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e)?s:null,i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null==(n=e)?null:s,i):a?n:null},Kr(i,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Sn,n=[1,1],a=!1;function i(i,o){var l,s=t.call(this,i,o),c=s[0],u=0;$r(c,(function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),t.y=function(t){return 1+e.max(t,(function(e){return e.y}))}(n)):(t.x=l?u+=r(t,l):0,t.y=0,l=t)}));var f=function e(t){var r=t.children;return r&&r.length?e(r[0]):t}(c),d=function e(t){var r,n=t.children;return n&&(r=n.length)?e(n[r-1]):t}(c),p=f.x-r(f,d)/2,h=d.x+r(d,f)/2;return $r(c,a?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-p)/(h-p)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),s}return i.separation=function(e){return arguments.length?(r=e,i):r},i.size=function(e){return arguments.length?(a=null==(n=e),i):a?null:n},i.nodeSize=function(e){return arguments.length?(a=null!=(n=e),i):a?n:null},Kr(i,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,a=[1,1],i=null,o=On,l=!1,s="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,a=-1,i=e.length;++a0;)l.push(r=c[a-1]),l.area+=r.area,"squarify"!==s||(n=p(l,g))<=d?(c.pop(),d=n):(l.area-=l.pop().area,h(l,g,i,!1),g=Math.min(i.dx,i.dy),l.length=l.area=0,d=1/0);l.length&&(h(l,g,i,!0),l.length=l.area=0),t.forEach(f)}}function d(e){var t=e.children;if(t&&t.length){var r,n=o(e),a=t.slice(),i=[];for(u(a,n.dx*n.dy/e.value),i.area=0;r=a.pop();)i.push(r),i.area+=r.area,null!=r.z&&(h(i,r.z?n.dx:n.dy,n,!a.length),i.length=i.area=0);t.forEach(d)}}function p(e,t){for(var r,n=e.area,a=0,i=1/0,o=-1,l=e.length;++oa&&(a=r));return t*=t,(n*=n)?Math.max(t*a*c/n,n/(t*i*c)):1/0}function h(e,t,r,a){var i,o=-1,l=e.length,s=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((a||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return e+t*r*Math.sqrt(-2*Math.log(a)/a)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?Bn:In,l=a?Hr:Br;return i=e(t,r,l,n),o=e(r,t,l,yr),s}function s(e){return i(e)}return s.invert=function(e){return o(e)},s.domain=function(e){return arguments.length?(t=e.map(Number),l()):t},s.range=function(e){return arguments.length?(r=e,l()):r},s.rangeRound=function(e){return s.range(e).interpolate(Rr)},s.clamp=function(e){return arguments.length?(a=e,l()):a},s.interpolate=function(e){return arguments.length?(n=e,l()):n},s.ticks=function(e){return Un(t,e)},s.tickFormat=function(e,r){return d3_scale_linearTickFormat(t,e,r)},s.nice=function(e){return Yn(t,e),l()},s.copy=function(){return e(t,r,n,a)},l()}([0,1],[0,1],yr,!1)};e.scale.log=function(){return function e(t,r,n,a){function i(e){return(n?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(r)}function o(e){return n?Math.pow(r,e):-Math.pow(r,-e)}function l(e){return t(i(e))}return l.invert=function(e){return o(t.invert(e))},l.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((a=e.map(Number)).map(i)),l):a},l.base=function(e){return arguments.length?(r=+e,t.domain(a.map(i)),l):r},l.nice=function(){var e=zn(a.map(i),n?Math:qn);return t.domain(e),a=e.map(o),l},l.ticks=function(){var e=En(a),t=[],l=e[0],s=e[1],c=Math.floor(i(l)),u=Math.ceil(i(s)),f=r%1?2:r;if(isFinite(u-c)){if(n){for(;c0;d--)t.push(o(c)*d);for(c=0;t[c]s;u--);t=t.slice(c,u)}return t},l.copy=function(){return e(t.copy(),r,n,a)},Hn(l,t)}(e.scale.linear().domain([0,1]),10,!0,[1,10])};var qn={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Vn(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}e.scale.pow=function(){return function e(t,r,n){var a=Vn(r),i=Vn(1/r);function o(e){return t(a(e))}return o.invert=function(e){return i(t.invert(e))},o.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(a)),o):n},o.ticks=function(e){return Un(n,e)},o.tickFormat=function(e,t){return d3_scale_linearTickFormat(n,e,t)},o.nice=function(e){return o.domain(Yn(n,e))},o.exponent=function(e){return arguments.length?(a=Vn(r=e),i=Vn(1/r),t.domain(n.map(a)),o):r},o.copy=function(){return e(t.copy(),r,n)},Hn(o,t)}(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return function t(r,n){var a,i,o;function l(e){return i[((a.get(e)||("range"===n.t?a.set(e,r.push(e)):NaN))-1)%i.length]}function s(t,n){return e.range(r.length).map((function(e){return t+n*e}))}return l.domain=function(e){if(!arguments.length)return r;r=[],a=new _;for(var t,i=-1,o=e.length;++i0?a[e-1]:r[0],ef?0:1;if(c=Se)return s(c,p)+(l?s(l,1-p):"")+"Z";var h,g,v,m,y,b,x,_,w,M,k,T,A=0,S=0,L=[];if((m=(+o.apply(this,arguments)||0)/2)&&(v=n===Qn?Math.sqrt(l*l+c*c):+n.apply(this,arguments),p||(S*=-1),c&&(S=De(v/c*Math.sin(m))),l&&(A=De(v/l*Math.sin(m)))),c){y=c*Math.cos(u+S),b=c*Math.sin(u+S),x=c*Math.cos(f-S),_=c*Math.sin(f-S);var P=Math.abs(f-u-2*S)<=Te?0:1;if(S&&aa(y,b,x,_)===p^P){var C=(u+f)/2;y=c*Math.cos(C),b=c*Math.sin(C),x=_=null}}else y=b=0;if(l){w=l*Math.cos(f-A),M=l*Math.sin(f-A),k=l*Math.cos(u+A),T=l*Math.sin(u+A);var D=Math.abs(u-f+2*A)<=Te?0:1;if(A&&aa(w,M,k,T)===1-p^D){var O=(u+f)/2;w=l*Math.cos(O),M=l*Math.sin(O),k=T=null}}else w=M=0;if(d>ke&&(h=Math.min(Math.abs(c-l)/2,+r.apply(this,arguments)))>.001){g=l0?0:1}function ia(e,t,r,n,a){var i=e[0]-t[0],o=e[1]-t[1],l=(a?n:-n)/Math.sqrt(i*i+o*o),s=l*o,c=-l*i,u=e[0]+s,f=e[1]+c,d=t[0]+s,p=t[1]+c,h=(u+d)/2,g=(f+p)/2,v=d-u,m=p-f,y=v*v+m*m,b=r-n,x=u*p-d*f,_=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*m-v*_)/y,M=(-x*v-m*_)/y,k=(x*m+v*_)/y,T=(-x*v+m*_)/y,A=w-h,S=M-g,L=k-h,P=T-g;return A*A+S*S>L*L+P*P&&(w=k,M=T),[[w-s,M-c],[w*r/b,M*r/b]]}function oa(){return!0}function la(e){var t=_t,r=wt,n=oa,a=ca,i=a.key,o=.7;function l(i){var l,s=[],c=[],u=-1,f=i.length,d=ct(t),p=ct(r);function h(){s.push("M",a(e(c),o))}for(;++u1&&a.push("H",n[0]);return a.join("")},"step-before":fa,"step-after":da,basis:ga,"basis-open":function(e){if(e.length<4)return ca(e);var t,r=[],n=-1,a=e.length,i=[0],o=[0];for(;++n<3;)t=e[n],i.push(t[0]),o.push(t[1]);r.push(va(ba,i)+","+va(ba,o)),--n;for(;++n9&&(a=3*t/Math.sqrt(a),o[l]=a*r,o[l+1]=a*n));l=-1;for(;++l<=s;)a=(e[Math.min(s,l+1)][0]-e[Math.max(0,l-1)][0])/(6*(1+o[l]*o[l])),i.push([a||0,o[l]*a||0]);return i}(e))}});function ca(e){return e.length>1?e.join("L"):e+"Z"}function ua(e){return e.join("L")+"Z"}function fa(e){for(var t=0,r=e.length,n=e[0],a=[n[0],",",n[1]];++t1){l=t[1],i=e[s],s++,n+="C"+(a[0]+o[0])+","+(a[1]+o[1])+","+(i[0]-l[0])+","+(i[1]-l[1])+","+i[0]+","+i[1];for(var c=2;cTe)+",1 "+t}function s(e,t,r,n){return"Q 0,0 "+n}return i.radius=function(e){return arguments.length?(r=ct(e),i):r},i.source=function(t){return arguments.length?(e=ct(t),i):e},i.target=function(e){return arguments.length?(t=ct(e),i):t},i.startAngle=function(e){return arguments.length?(n=ct(e),i):n},i.endAngle=function(e){return arguments.length?(a=ct(e),i):a},i},e.svg.diagonal=function(){var e=ka,t=Ta,r=Sa;function n(n,a){var i=e.call(this,n,a),o=t.call(this,n,a),l=(i.y+o.y)/2,s=[i,{x:i.x,y:l},{x:o.x,y:l},o];return"M"+(s=s.map(r))[0]+"C"+s[1]+" "+s[2]+" "+s[3]}return n.source=function(t){return arguments.length?(e=ct(t),n):e},n.target=function(e){return arguments.length?(t=ct(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=Sa,n=t.projection;return t.projection=function(e){return arguments.length?n(La(r=e)):r},t},e.svg.symbol=function(){var e=Ca,t=Pa;function r(r,n){return(Oa.get(e.call(this,r,n))||Da)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=ct(t),r):e},r.size=function(e){return arguments.length?(t=ct(e),r):t},r};var Oa=e.map({circle:Da,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Ea)),r=t*Ea;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Ra),r=t*Ra/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ra),r=t*Ra/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=Oa.keys();var Ra=Math.sqrt(3),Ea=Math.tan(30*Pe);V.transition=function(e){for(var t,r,n=Fa||++Ha,a=Ua(e),i=[],o=ja||{time:Date.now(),ease:Lr,delay:0,duration:250},l=-1,s=this.length;++l0;)c[--d].call(e,o);if(i>=1)return f.event&&f.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}f||(i=a.time,o=mt((function(e){var t=f.delay;if(o.t=t+i,t<=e)return d(e-t);o.c=d}),0,i),f=u[n]={tween:new _,time:i,timer:o,delay:a.delay,duration:a.duration,ease:a.ease,index:t},a=null,++u.count)}Ba.call=V.call,Ba.empty=V.empty,Ba.node=V.node,Ba.size=V.size,e.transition=function(t,r){return t&&t.transition?Fa?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=Ba,Ba.select=function(e){var t,r,n,a=this.id,i=this.namespace,o=[];e=Z(e);for(var l=-1,s=this.length;++lrect,.s>rect").attr("width",l[1]-l[0])}function g(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function v(){var f,v,m=this,y=e.select(e.event.target),b=n.of(m,arguments),x=e.select(m),_=y.datum(),w=!/^(n|s)$/.test(_)&&a,M=!/^(e|w)$/.test(_)&&i,k=y.classed("extent"),T=xe(m),A=e.mouse(m),S=e.select(o(m)).on("keydown.brush",C).on("keyup.brush",D);if(e.event.changedTouches?S.on("touchmove.brush",O).on("touchend.brush",E):S.on("mousemove.brush",O).on("mouseup.brush",E),x.interrupt().selectAll("*").interrupt(),k)A[0]=l[0]-A[0],A[1]=s[0]-A[1];else if(_){var L=+/w$/.test(_),P=+/^n/.test(_);v=[l[1-L]-A[0],s[1-P]-A[1]],A[0]=l[L],A[1]=s[P]}else e.event.altKey&&(f=A.slice());function C(){32==e.event.keyCode&&(k||(f=null,A[0]-=l[1],A[1]-=s[1],k=2),z())}function D(){32==e.event.keyCode&&2==k&&(A[0]+=l[1],A[1]+=s[1],k=0,z())}function O(){var t=e.mouse(m),r=!1;v&&(t[0]+=v[0],t[1]+=v[1]),k||(e.event.altKey?(f||(f=[(l[0]+l[1])/2,(s[0]+s[1])/2]),A[0]=l[+(t[0]0){t+=Math.abs(i(e[0]));for(var r=1;r2){for(l=0;l=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},r.radiansToLength=f,r.lengthToRadians=d,r.lengthToDegrees=function(e,t){return p(d(e,t))},r.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},r.radiansToDegrees=p,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(d(e,t),r)},r.convertArea=function(e,t,n){if(void 0===t&&(t="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var a=r.areaFactors[t];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return e/a*i},r.isNumber=h,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!h(e))throw new Error("bbox must only contain numbers")}))},r.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}},{}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/helpers");function a(e,t,r){if(null!==e)for(var n,i,o,l,s,c,u,f,d=0,p=0,h=e.type,g="FeatureCollection"===h,v="Feature"===h,m=g?e.features.length:1,y=0;yc||p>u||h>f)return s=a,c=r,u=p,f=h,void(o=0);var g=n.lineString([s,a],e.properties);if(!1===t(g,r,i,h,o))return!1;o++,s=a}))&&void 0}}}))}function u(e,t){if(!e)throw new Error("geojson is required");s(e,(function(e,r,a){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,r,a,0,0))return!1;break;case"Polygon":for(var l=0;le[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]=0))throw new Error("precision must be a positive number");var r=Math.pow(10,t||0);return Math.round(e*r)/r},r.radiansToLength=f,r.lengthToRadians=d,r.lengthToDegrees=function(e,t){return p(d(e,t))},r.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},r.radiansToDegrees=p,r.degreesToRadians=function(e){return e%360*Math.PI/180},r.convertLength=function(e,t,r){if(void 0===t&&(t="kilometers"),void 0===r&&(r="kilometers"),!(e>=0))throw new Error("length must be a positive number");return f(d(e,t),r)},r.convertArea=function(e,t,n){if(void 0===t&&(t="meters"),void 0===n&&(n="kilometers"),!(e>=0))throw new Error("area must be a positive number");var a=r.areaFactors[t];if(!a)throw new Error("invalid original units");var i=r.areaFactors[n];if(!i)throw new Error("invalid final units");return e/a*i},r.isNumber=h,r.isObject=function(e){return!!e&&e.constructor===Object},r.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!h(e))throw new Error("bbox must only contain numbers")}))},r.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")},r.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},r.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},r.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},r.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},r.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},r.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},r.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e("@turf/helpers");function a(e,t,r){if(null!==e)for(var n,i,o,l,s,c,u,f,d=0,p=0,h=e.type,g="FeatureCollection"===h,v="Feature"===h,m=g?e.features.length:1,y=0;yc||p>u||h>f)return s=a,c=r,u=p,f=h,void(o=0);var g=n.lineString([s,a],e.properties);if(!1===t(g,r,i,h,o))return!1;o++,s=a}))&&void 0}}}))}function u(e,t){if(!e)throw new Error("geojson is required");s(e,(function(e,r,a){if(null!==e.geometry){var i=e.geometry.type,o=e.geometry.coordinates;switch(i){case"LineString":if(!1===t(e,r,a,0,0))return!1;break;case"Polygon":for(var l=0;l0&&o.length>a&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,l=s,console&&console.warn&&console.warn(l)}return e}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(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=d.bind(n);return a.listener=r,n.wrapFn=a,a}function h(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var s=a[e];if(void 0===s)return!1;if("function"==typeof s)i(s,this,t);else{var c=s.length,u=v(s,c);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},l.prototype.listeners=function(e){return h(this,e,!0)},l.prototype.rawListeners=function(e){return h(this,e,!1)},l.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},l.prototype.listenerCount=g,l.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],22:[function(e,t,r){t.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],23:[function(e,t,r){!function(e,n){n("object"==typeof r&&void 0!==t?r:e.d3=e.d3||{})}(this,(function(e){"use strict";function t(e,t){return et?1:e>=t?0:NaN}function r(e){var r;return 1===e.length&&(r=e,e=function(e,n){return t(r(e),n)}),{left:function(t,r,n,a){for(null==n&&(n=0),null==a&&(a=t.length);n>>1;e(t[i],r)<0?n=i+1:a=i}return n},right:function(t,r,n,a){for(null==n&&(n=0),null==a&&(a=t.length);n>>1;e(t[i],r)>0?a=i:n=i+1}return n}}}var n=r(t),a=n.right,i=n.left;function o(e,t){return[e,t]}function l(e){return null===e?NaN:+e}function s(e,t){var r,n,a=e.length,i=0,o=-1,s=0,c=0;if(null==t)for(;++o1)return c/(i-1)}function c(e,t){var r=s(e,t);return r?Math.sqrt(r):r}function u(e,t){var r,n,a,i=e.length,o=-1;if(null==t){for(;++o=r)for(n=a=r;++or&&(n=r),a=r)for(n=a=r;++or&&(n=r),a=0?(i>=m?10:i>=y?5:i>=b?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=m?10:i>=y?5:i>=b?2:1)}function _(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),i=n/a;return i>=m?a*=10:i>=y?a*=5:i>=b&&(a*=2),t=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e);return o+(+r(e[i+1],i+1,e)-o)*(a-i)}}function k(e,t){var r,n,a=e.length,i=-1;if(null==t){for(;++i=r)for(n=r;++ir&&(n=r)}else for(;++i=r)for(n=r;++ir&&(n=r);return n}function T(e){if(!(a=e.length))return[];for(var t=-1,r=k(e,A),n=new Array(r);++te?1:t>=e?0:NaN},e.deviation=c,e.extent=u,e.histogram=function(){var e=g,t=u,r=w;function n(n){var i,o,l=n.length,s=new Array(l);for(i=0;if;)d.pop(),--p;var h,g=new Array(p+1);for(i=0;i<=p;++i)(h=g[i]=[]).x0=i>0?d[i-1]:u,h.x1=i=r)for(n=r;++in&&(n=r)}else for(;++i=r)for(n=r;++in&&(n=r);return n},e.mean=function(e,t){var r,n=e.length,a=n,i=-1,o=0;if(null==t)for(;++i=0;)for(t=(n=e[a]).length;--t>=0;)r[--o]=n[t];return r},e.min=k,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,n=e.length-1,a=e[0],i=new Array(n<0?0:n);r0)return[e];if((n=t0)for(e=Math.ceil(e/o),t=Math.floor(t/o),i=new Array(a=Math.ceil(t-e+1));++l1?n[0]+n.slice(2):n,+e.slice(r+1)]}function r(e){return(e=t(Math.abs(e)))?e[1]:NaN}var n,a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(e){if(!(t=a.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function l(e,r){var n=t(e,r);if(!n)return e+"";var a=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+a:a.length>i+1?a.slice(0,i+1)+"."+a.slice(i+1):a+new Array(i-a.length+2).join("0")}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var s={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return l(100*e,t)},r:l,s:function(e,r){var a=t(e,r);if(!a)return e+"";var i=a[0],o=a[1],l=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,s=i.length;return l===s?i:l>s?i+new Array(l-s+1).join("0"):l>0?i.slice(0,l)+"."+i.slice(l):"0."+new Array(1-l).join("0")+t(e,Math.max(0,r+l-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var u,f=Array.prototype.map,d=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function p(e){var t,a,o=void 0===e.grouping||void 0===e.thousands?c:(t=f.call(e.grouping,Number),a=e.thousands+"",function(e,r){for(var n=e.length,i=[],o=0,l=t[0],s=0;n>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),i.push(e.substring(n-=l,n+l)),!((s+=l+1)>r));)l=t[o=(o+1)%t.length];return i.reverse().join(a)}),l=void 0===e.currency?"":e.currency[0]+"",u=void 0===e.currency?"":e.currency[1]+"",p=void 0===e.decimal?".":e.decimal+"",h=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(f.call(e.numerals,String)),g=void 0===e.percent?"%":e.percent+"",v=void 0===e.minus?"-":e.minus+"",m=void 0===e.nan?"NaN":e.nan+"";function y(e){var t=(e=i(e)).fill,r=e.align,a=e.sign,c=e.symbol,f=e.zero,y=e.width,b=e.comma,x=e.precision,_=e.trim,w=e.type;"n"===w?(b=!0,w="g"):s[w]||(void 0===x&&(x=12),_=!0,w="g"),(f||"0"===t&&"="===r)&&(f=!0,t="0",r="=");var M="$"===c?l:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",k="$"===c?u:/[%p]/.test(w)?g:"",T=s[w],A=/[defgprs%]/.test(w);function S(e){var i,l,s,c=M,u=k;if("c"===w)u=T(e)+u,e="";else{var g=(e=+e)<0||1/e<0;if(e=isNaN(e)?m:T(Math.abs(e),x),_&&(e=function(e){e:for(var t,r=e.length,n=1,a=-1;n0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),g&&0==+e&&"+"!==a&&(g=!1),c=(g?"("===a?a:v:"-"===a||"("===a?"":a)+c,u=("s"===w?d[8+n/3]:"")+u+(g&&"("===a?")":""),A)for(i=-1,l=e.length;++i(s=e.charCodeAt(i))||s>57){u=(46===s?p+e.slice(i+1):e.slice(i))+u,e=e.slice(0,i);break}}b&&!f&&(e=o(e,1/0));var S=c.length+e.length+u.length,L=S>1)+c+e+u+L.slice(S);break;default:e=L+c+e+u}return h(e)}return x=void 0===x?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x)),S.toString=function(){return e+""},S}return{format:y,formatPrefix:function(e,t){var n=y(((e=i(e)).type="f",e)),a=3*Math.max(-8,Math.min(8,Math.floor(r(t)/3))),o=Math.pow(10,-a),l=d[8+a/3];return function(e){return n(o*e)+l}}}}function h(t){return u=p(t),e.format=u.format,e.formatPrefix=u.formatPrefix,u}h({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),e.FormatSpecifier=o,e.formatDefaultLocale=h,e.formatLocale=p,e.formatSpecifier=i,e.precisionFixed=function(e){return Math.max(0,-r(Math.abs(e)))},e.precisionPrefix=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(t)/3)))-r(Math.abs(e)))},e.precisionRound=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r(t)-r(e))+1},Object.defineProperty(e,"__esModule",{value:!0})}))},{}],25:[function(e,t,r){!function(n,a){"object"==typeof r&&void 0!==t?a(r,e("d3-geo"),e("d3-array")):a(n.d3=n.d3||{},n.d3,n.d3)}(this,(function(e,t,r){"use strict";var n=Math.abs,a=Math.atan,i=Math.atan2,o=Math.cos,l=Math.exp,s=Math.floor,c=Math.log,u=Math.max,f=Math.min,d=Math.pow,p=Math.round,h=Math.sign||function(e){return e>0?1:e<0?-1:0},g=Math.sin,v=Math.tan,m=1e-6,y=Math.PI,b=y/2,x=y/4,_=Math.SQRT1_2,w=P(2),M=P(y),k=2*y,T=180/y,A=y/180;function S(e){return e>1?b:e<-1?-b:Math.asin(e)}function L(e){return e>1?0:e<-1?y:Math.acos(e)}function P(e){return e>0?Math.sqrt(e):0}function C(e){return(l(e)-l(-e))/2}function D(e){return(l(e)+l(-e))/2}function O(e){var t=v(e/2),r=2*c(o(e/2))/(t*t);function a(e,t){var n=o(e),a=o(t),i=g(t),l=a*n,s=-((1-l?c((1+l)/2)/(1-l):-.5)+r/(1+l));return[s*a*g(e),s*i]}return a.invert=function(t,a){var l,s=P(t*t+a*a),u=-e/2,f=50;if(!s)return[0,0];do{var d=u/2,p=o(d),h=g(d),v=h/p,y=-c(n(p));u-=l=(2/v*y-r*v-s)/(-y/(h*h)+1-r/(2*p*p))*(p<0?.7:1)}while(n(l)>m&&--f>0);var b=g(u);return[i(t*b,s*o(u)),S(a*b/s)]},a}function R(e,t){var r=o(t),n=function(e){return e?e/Math.sin(e):1}(L(r*o(e/=2)));return[2*r*g(e)*n,g(t)*n]}function E(e){var t=g(e),r=o(e),a=e>=0?1:-1,l=v(a*e),s=(1+t-r)/2;function c(e,n){var c=o(n),u=o(e/=2);return[(1+c)*g(e),(a*n>-i(u,l)-.001?0:10*-a)+s+g(n)*r-(1+c)*t*u]}return c.invert=function(e,c){var u=0,f=0,d=50;do{var p=o(u),h=g(u),v=o(f),y=g(f),b=1+v,x=b*h-e,_=s+y*r-b*t*p-c,w=b*p/2,M=-h*y,k=t*b*h/2,T=r*v+t*p*y,A=M*k-T*w,S=(_*M-x*T)/A/2,L=(x*k-_*w)/A;n(L)>2&&(L/=2),u-=S,f-=L}while((n(S)>m||n(L)>m)&&--d>0);return a*f>-i(o(u),l)-.001?[2*u,f]:null},c}function N(e,t){var r=v(t/2),n=P(1-r*r),a=1+n*o(e/=2),i=g(e)*n/a,l=r/a,s=i*i,c=l*l;return[4/3*i*(3+s-3*c),4/3*l*(3+3*s-c)]}R.invert=function(e,t){if(!(e*e+4*t*t>y*y+m)){var r=e,a=t,i=25;do{var l,s=g(r),c=g(r/2),u=o(r/2),f=g(a),d=o(a),p=g(2*a),h=f*f,v=d*d,b=c*c,x=1-v*u*u,_=x?L(d*u)*P(l=1/x):l=0,w=2*_*d*c-e,M=_*f-t,k=l*(v*b+_*d*u*h),T=l*(.5*s*p-2*_*f*c),A=.25*l*(p*c-_*f*v*s),S=l*(h*u+_*b*d),C=T*A-S*k;if(!C)break;var D=(M*T-w*S)/C,O=(w*A-M*k)/C;r-=D,a-=O}while((n(D)>m||n(O)>m)&&--i>0);return[r,a]}},N.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&n(t)>1)return null;var r=1+e*e+t*t,a=P((r-P(r*r-4*t*t))/2),l=S(a)/3,s=a?function(e){return c(e+P(e*e-1))}(n(t/a))/3:function(e){return c(e+P(e*e+1))}(n(e))/3,u=o(l),f=D(s),d=f*f-u*u;return[2*h(e)*i(C(s)*u,.25-d),2*h(t)*i(f*g(l),.25+d)]};var I=P(8),z=c(1+w);function F(e,t){var r=n(t);return rb){var s=i(l[1],l[0]),c=P(l[0]*l[0]+l[1]*l[1]),u=r*p((s-b)/r)+b,f=i(g(s-=u),2-o(s));s=u+S(y/c*g(f))-f,l[0]=c*o(s),l[1]=c*g(s)}return l}return l.invert=function(e,n){var l=P(e*e+n*n);if(l>b){var s=i(n,e),c=r*p((s-b)/r)+b,u=s>c?-1:1,f=l*o(c-s),d=1/v(u*L((f-y)/P(y*(y-2*f)+l*l)));s=c+2*a((d+u*P(d*d-3))/3),e=l*o(s),n=l*g(s)}return t.geoAzimuthalEquidistantRaw.invert(e,n)},l}function B(e,r){if(arguments.length<2&&(r=e),1===r)return t.geoAzimuthalEqualAreaRaw;if(r===1/0)return H;function n(n,a){var i=t.geoAzimuthalEqualAreaRaw(n/r,a);return i[0]*=e,i}return n.invert=function(n,a){var i=t.geoAzimuthalEqualAreaRaw.invert(n/e,a);return i[0]*=r,i},n}function H(e,t){return[e*o(t)/o(t/=2),2*g(t)]}function Y(e,t,r){var a,i,o,l=100;r=void 0===r?0:+r,t=+t;do{(i=e(r))===(o=e(r+m))&&(o=i+m),r-=a=-1*m*(i-t)/(i-o)}while(l-- >0&&n(a)>m);return l<0?NaN:r}function G(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=1e-12),function(a,i,o,l){var s,c,u;o=void 0===o?0:+o,l=void 0===l?0:+l;for(var f=0;fs)o-=c/=2,l-=u/=2;else{s=g;var v=(o>0?-1:1)*r,m=(l>0?-1:1)*r,y=e(o+v,l),b=e(o,l+m),x=(y[0]-d[0])/v,_=(y[1]-d[1])/v,w=(b[0]-d[0])/m,M=(b[1]-d[1])/m,k=M*x-_*w,T=(n(k)<.5?.5:1)/k;if(o+=c=(h*w-p*M)*T,l+=u=(p*_-h*x)*T,n(c)0&&(a[1]*=1+i/1.5*a[0]*a[0]),a}return t.invert=G(t),t}function q(e,t){var r,a=e*g(t),i=30;do{t-=r=(t+g(t)-a)/(1+o(t))}while(n(r)>m&&--i>0);return t/2}function V(e,t,r){function n(n,a){return[e*n*o(a=q(r,a)),t*g(a)]}return n.invert=function(n,a){return a=S(a/t),[n/(e*o(a)),S((2*a+g(2*a))/r)]},n}F.invert=function(e,t){if((i=n(t))1e-12&&--u>0);return[e/(o(s)*(I-1/g(s))),h(t)*s]},H.invert=function(e,t){var r=2*S(t/2);return[e*o(r/2)/o(r),r]};var Z=V(w/b,w,y);var W=2.00276,J=1.11072;function X(e,t){var r=q(y,t);return[W*e/(1/o(t)+J/o(r)),(t+w*g(r))/W]}function K(e){var r=0,n=t.geoProjectionMutator(e),a=n(r);return a.parallel=function(e){return arguments.length?n(r=e*A):r*T},a}function Q(e,t){return[e*o(t),t]}function $(e){if(!e)return Q;var t=1/v(e);function r(r,n){var a=t+e-n,i=a?r*o(n)/a:a;return[a*g(i),t-a*o(i)]}return r.invert=function(r,n){var a=P(r*r+(n=t-n)*n),l=t+e-a;return[a/o(l)*i(r,n),l]},r}function ee(e){function t(t,r){var n=b-r,a=n?t*e*g(n)/n:n;return[n*g(a)/e,b-n*o(a)]}return t.invert=function(t,r){var n=t*e,a=b-r,o=P(n*n+a*a),l=i(n,a);return[(o?o/g(o):1)*l/e,b-o]},t}X.invert=function(e,t){var r,a,i=W*t,l=t<0?-x:x,s=25;do{a=i-w*g(l),l-=r=(g(2*l)+2*l-y*g(a))/(2*o(2*l)+2+y*o(a)*w*o(l))}while(n(r)>m&&--s>0);return a=i-w*g(l),[e*(1/o(a)+J/o(l))/W,a]},Q.invert=function(e,t){return[e/o(t),t]};var te=V(1,4/y,y);function re(e,t,r,a,l,s){var c,u=o(s);if(n(e)>1||n(s)>1)c=L(r*l+t*a*u);else{var f=g(e/2),d=g(s/2);c=2*S(P(f*f+t*a*d*d))}return n(c)>m?[c,i(a*g(s),t*l-r*a*u)]:[0,0]}function ne(e,t,r){return L((e*e+t*t-r*r)/(2*e*t))}function ae(e){return e-2*y*s((e+y)/(2*y))}function ie(e,t,r){for(var n,a=[[e[0],e[1],g(e[1]),o(e[1])],[t[0],t[1],g(t[1]),o(t[1])],[r[0],r[1],g(r[1]),o(r[1])]],i=a[2],l=0;l<3;++l,i=n)n=a[l],i.v=re(n[1]-i[1],i[3],i[2],n[3],n[2],n[0]-i[0]),i.point=[0,0];var s=ne(a[0].v[0],a[2].v[0],a[1].v[0]),c=ne(a[0].v[0],a[1].v[0],a[2].v[0]),u=y-s;a[2].point[1]=0,a[0].point[0]=-(a[1].point[0]=a[0].v[0]/2);var f=[a[2].point[0]=a[0].point[0]+a[2].v[0]*o(s),2*(a[0].point[1]=a[1].point[1]=a[2].v[0]*g(s))];return function(e,t){var r,n=g(t),i=o(t),l=new Array(3);for(r=0;r<3;++r){var s=a[r];if(l[r]=re(t-s[1],s[3],s[2],i,n,e-s[0]),!l[r][0])return s.point;l[r][1]=ae(l[r][1]-s.v[1])}var d=f.slice();for(r=0;r<3;++r){var p=2==r?0:r+1,h=ne(a[r].v[0],l[r][0],l[p][0]);l[r][1]<0&&(h=-h),r?1==r?(h=c-h,d[0]-=l[r][0]*o(h),d[1]-=l[r][0]*g(h)):(h=u-h,d[0]+=l[r][0]*o(h),d[1]+=l[r][0]*g(h)):(d[0]+=l[r][0]*o(h),d[1]-=l[r][0]*g(h))}return d[0]/=3,d[1]/=3,d}}function oe(e){return e[0]*=A,e[1]*=A,e}function le(e,r,n){var a=t.geoCentroid({type:"MultiPoint",coordinates:[e,r,n]}),i=[-a[0],-a[1]],o=t.geoRotation(i),l=ie(oe(o(e)),oe(o(r)),oe(o(n)));l.invert=G(l);var s=t.geoProjection(l).rotate(i),c=s.center;return delete s.rotate,s.center=function(e){return arguments.length?c(o(e)):o.invert(c())},s.clipAngle(90)}function se(e,t){var r=P(1-g(t));return[2/M*e*r,M*(1-r)]}function ce(e){var t=v(e);function r(e,r){return[e,(e?e/g(e):1)*(g(r)*o(e)-t*o(r))]}return r.invert=t?function(e,r){e&&(r*=g(e)/e);var n=o(e);return[e,2*i(P(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,S(e?t*v(e)/e:t)]},r}se.invert=function(e,t){var r=(r=t/M-1)*r;return[r>0?e*P(y/r)/2:0,S(1-r)]};var ue=P(3);function fe(e,t){return[ue*e*(2*o(2*t/3)-1)/M,ue*M*g(t/3)]}function de(e){var t=o(e);function r(e,r){return[e*t,g(r)/t]}return r.invert=function(e,r){return[e/t,S(r*t)]},r}function pe(e){var t=o(e);function r(e,r){return[e*t,(1+t)*v(r/2)]}return r.invert=function(e,r){return[e/t,2*a(r/(1+t))]},r}function he(e,t){var r=P(8/(3*y));return[r*e*(1-n(t)/y),r*t]}function ge(e,t){var r=P(4-3*g(n(t)));return[2/P(6*y)*e*r,h(t)*P(2*y/3)*(2-r)]}function ve(e,t){var r=P(y*(4+y));return[2/r*e*(1+P(1-4*t*t/(y*y))),4/r*t]}function me(e,t){var r=(2+b)*g(t);t/=2;for(var a=0,i=1/0;a<10&&n(i)>m;a++){var l=o(t);t-=i=(t+g(t)*(l+2)-r)/(2*l*(1+l))}return[2/P(y*(4+y))*e*(1+o(t)),2*P(y/(4+y))*g(t)]}function ye(e,t){return[e*(1+o(t))/P(2+y),2*t/P(2+y)]}function be(e,t){for(var r=(1+b)*g(t),a=0,i=1/0;a<10&&n(i)>m;a++)t-=i=(t+g(t)-r)/(1+o(t));return r=P(2+y),[e*(1+o(t))/r,2*t/r]}fe.invert=function(e,t){var r=3*S(t/(ue*M));return[M*e/(ue*(2*o(2*r/3)-1)),r]},he.invert=function(e,t){var r=P(8/(3*y)),a=t/r;return[e/(r*(1-n(a)/y)),a]},ge.invert=function(e,t){var r=2-n(t)/P(2*y/3);return[e*P(6*y)/(2*r),h(t)*S((4-r*r)/3)]},ve.invert=function(e,t){var r=P(y*(4+y))/2;return[e*r/(1+P(1-t*t*(4+y)/(4*y))),t*r/2]},me.invert=function(e,t){var r=t*P((4+y)/y)/2,n=S(r),a=o(n);return[e/(2/P(y*(4+y))*(1+a)),S((n+r*(a+2))/(2+b))]},ye.invert=function(e,t){var r=P(2+y),n=t*r/2;return[r*e/(1+o(n)),n]},be.invert=function(e,t){var r=1+b,n=P(r/2);return[2*e*n/(1+o(t*=n)),S((t+g(t))/r)]};var xe=3+2*w;function _e(e,t){var r=g(e/=2),n=o(e),i=P(o(t)),l=o(t/=2),s=g(t)/(l+w*n*i),u=P(2/(1+s*s)),f=P((w*l+(n+r)*i)/(w*l+(n-r)*i));return[xe*(u*(f-1/f)-2*c(f)),xe*(u*s*(f+1/f)-2*a(s))]}_e.invert=function(e,t){if(!(r=N.invert(e/1.2,1.065*t)))return null;var r,i=r[0],l=r[1],s=20;e/=xe,t/=xe;do{var d=i/2,p=l/2,h=g(d),v=o(d),y=g(p),x=o(p),M=o(l),k=P(M),T=y/(x+w*v*k),A=T*T,S=P(2/(1+A)),L=(w*x+(v+h)*k)/(w*x+(v-h)*k),C=P(L),D=C-1/C,O=C+1/C,R=S*D-2*c(C)-e,E=S*T*O-2*a(T)-t,I=y&&_*k*h*A/y,z=(w*v*x+k)/(2*(x+w*v*k)*(x+w*v*k)*k),F=-.5*T*S*S*S,j=F*I,B=F*z,H=(H=2*x+w*k*(v-h))*H*C,Y=(w*v*x*k+M)/H,G=-w*h*y/(k*H),U=D*j-2*Y/C+S*(Y+Y/L),q=D*B-2*G/C+S*(G+G/L),V=T*O*j-2*I/(1+A)+S*O*I+S*T*(Y-Y/L),Z=T*O*B-2*z/(1+A)+S*O*z+S*T*(G-G/L),W=q*V-Z*U;if(!W)break;var J=(E*q-R*Z)/W,X=(R*V-E*U)/W;i-=J,l=u(-b,f(b,l-X))}while((n(J)>m||n(X)>m)&&--s>0);return n(n(l)-b)l){var h=P(d),v=i(f,u),x=a*p(v/a),_=v-x,w=e*o(_),M=(e*g(_)-_*g(w))/(b-w),k=Pe(_,M),T=(y-e)/Ce(k,w,y);u=h;var A,S=50;do{u-=A=(e+Ce(k,w,u)*T-h)/(k(u)*T)}while(n(A)>m&&--S>0);f=_*g(u),ul){var u=P(c),f=i(s,r),d=a*p(f/a),h=f-d;r=u*o(h),s=u*g(h);for(var v=r-b,m=g(r),x=s/m,_=rm||n(p)>m)&&--b>0);return[h,v]},u}Me.invert=function(e,t){var r=t/(1+we);return[e&&e/(we*P(1-r*r)),2*a(r)]},ke.invert=function(e,t){var r=a(t/M),n=o(r),i=2*r;return[e*M/2/(o(i)*n*n),i]};var Oe=De(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);var Re=De(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);var Ee=De(5/6*y,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Ne(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}Ne.invert=function(e,t){var r,a=e,i=t,o=50;do{var l=i*i;i-=r=(i*(1+l/12)-t)/(1+l/4)}while(n(r)>m&&--o>0);o=50,e/=1-.162388*l;do{var s=(s=a*a)*s;a-=r=(a*(.87-952426e-9*s)-e)/(.87-.00476213*s)}while(n(r)>m&&--o>0);return[a,i]};var Ie=De(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function ze(e){var t=e(b,0)[0]-e(-b,0)[0];function r(r,n){var a=r>0?-.5:.5,i=e(r+a*y,n);return i[0]-=a*t,i}return e.invert&&(r.invert=function(r,n){var a=r>0?-.5:.5,i=e.invert(r+a*t,n),o=i[0]-a*y;return o<-y?o+=2*y:o>y&&(o-=2*y),i[0]=o,i}),r}function Fe(e,t){var r=h(e),a=h(t),l=o(t),s=o(e)*l,c=g(e)*l,u=g(a*t);e=n(i(c,u)),t=S(s),n(e-b)>m&&(e%=b);var f=function(e,t){if(t===b)return[0,0];var r,a,i=g(t),l=i*i,s=l*l,c=1+s,u=1+3*s,f=1-s,d=S(1/P(c)),p=f+l*c*d,h=(1-i)/p,v=P(h),x=h*c,_=P(x),w=v*f;if(0===e)return[0,-(w+l*_)];var M,k=o(t),T=1/k,A=2*i*k,L=(-p*k-(-3*l+d*u)*A*(1-i))/(p*p),C=-T*A,D=-T*(l*c*L+h*u*A),O=-2*T*(f*(.5*L/v)-2*l*v*A),R=4*e/y;if(e>.222*y||t.175*y){if(r=(w+l*P(x*(1+s)-w*w))/(1+s),e>y/4)return[r,r];var E=r,N=.5*r;r=.5*(N+E),a=50;do{var I=P(x-r*r),z=r*(O+C*I)+D*S(r/_)-R;if(!z)break;z<0?N=r:E=r,r=.5*(N+E)}while(n(E-N)>m&&--a>0)}else{r=m,a=25;do{var F=r*r,j=P(x-F),B=O+C*j,H=r*B+D*S(r/_)-R,Y=B+(D-C*F)/j;r-=M=j?H/Y:0}while(n(M)>m&&--a>0)}return[r,-w-l*P(x-r*r)]}(e>y/4?b-e:e,t);return e>y/4&&(u=f[0],f[0]=-f[1],f[1]=-u),f[0]*=r,f[1]*=-a,f}function je(e,t){var r,i,s,c,u,f;if(t=1-m)return r=(1-t)/4,s=1/(i=D(e)),[(c=((f=l(2*(f=e)))-1)/(f+1))+r*((u=i*C(e))-e)/(i*i),s-r*c*s*(u-e),s+r*c*s*(u+e),2*a(l(e))-b+r*(u-e)/i];var d=[1,0,0,0,0,0,0,0,0],p=[P(t),0,0,0,0,0,0,0,0],h=0;for(i=P(1-t),u=1;n(p[h]/d[h])>m&&h<8;)r=d[h++],p[h]=(r-i)/2,d[h]=(r+i)/2,i=P(r*i),u*=2;s=u*d[h]*e;do{s=(S(c=p[h]*g(i=s)/d[h])+s)/2}while(--h);return[g(s),c=o(s),c/o(s-i),s]}function Be(e,t){if(!t)return e;if(1===t)return c(v(e/2+x));for(var r=1,i=P(1-t),o=P(t),l=0;n(o)>m;l++){if(e%y){var s=a(i*v(e)/r);s<0&&(s+=y),e+=s+~~(e/y)*y}else e+=e;o=(r+i)/2,i=P(r*i),o=((r=o)-i)/2}return e/(d(2,l)*r)}function He(e,t){var r=(w-1)/(w+1),s=P(1-r*r),u=Be(b,s*s),f=c(v(y/4+n(t)/2)),d=l(-1*f)/P(r),p=function(e,t){var r=e*e,n=t+1,a=1-r-t*t;return[.5*((e>=0?b:-b)-i(a,2*e)),-.25*c(a*a+4*r)+.5*c(n*n+r)]}(d*o(-1*e),d*g(-1*e)),m=function(e,t,r){var i=n(e),o=C(n(t));if(i){var l=1/g(i),s=1/(v(i)*v(i)),c=-(s+r*(o*o*l*l)-1+r),u=(-c+P(c*c-4*((r-1)*s)))/2;return[Be(a(1/P(u)),r)*h(e),Be(a(P((u/s-1)/r)),1-r)*h(t)]}return[0,Be(a(o),1-r)*h(t)]}(p[0],p[1],s*s);return[-m[1],(t>=0?1:-1)*(.5*u-m[0])]}function Ye(e){var t=g(e),r=o(e),a=Ge(e);function l(e,i){var l=a(e,i);e=l[0],i=l[1];var s=g(i),c=o(i),u=o(e),f=L(t*s+r*c*u),d=g(f),p=n(d)>m?f/d:1;return[p*r*g(e),(n(e)>b?p:-p)*(t*c-r*s*u)]}return a.invert=Ge(-e),l.invert=function(e,r){var n=P(e*e+r*r),l=-g(n),s=o(n),c=n*s,u=-r*l,f=n*t,d=P(c*c+u*u-f*f),p=i(c*f+u*d,u*f-c*d),h=(n>b?-1:1)*i(e*l,n*o(p)*s+r*g(p)*l);return a.invert(h,p)},l}function Ge(e){var t=g(e),r=o(e);return function(e,n){var a=o(n),l=o(e)*a,s=g(e)*a,c=g(n);return[i(s,l*r-c*t),S(c*r+l*t)]}}Fe.invert=function(e,t){n(e)>1&&(e=2*h(e)-e),n(t)>1&&(t=2*h(t)-t);var r=h(e),a=h(t),l=-r*e,s=-a*t,c=s/l<1,u=function(e,t){var r=0,a=1,i=.5,l=50;for(;;){var s=i*i,c=P(i),u=S(1/P(1+s)),f=1-s+i*(1+s)*u,d=(1-c)/f,p=P(d),h=d*(1+s),g=p*(1-s),v=P(h-e*e),m=t+g+i*v;if(n(a-r)<1e-12||0==--l||0===m)break;m>0?r=i:a=i,i=.5*(r+a)}if(!l)return null;var b=S(c),x=o(b),_=1/x,w=2*c*x,M=(-f*x-(-3*i+u*(1+3*s))*w*(1-c))/(f*f);return[y/4*(e*(-2*_*(.5*M/p*(1-s)-2*i*p*w)+-_*w*v)+-_*(i*(1+s)*M+d*(1+3*s)*w)*S(e/P(h))),b]}(c?s:l,c?l:s),f=u[0],d=u[1],p=o(d);return c&&(f=-b-f),[r*(i(g(f)*p,-g(d))+y),a*S(o(f)*p)]},He.invert=function(e,t){var r,n,o,s,u,f,d=(w-1)/(w+1),p=P(1-d*d),h=Be(b,p*p),g=(n=-e,o=p*p,(r=.5*h-t)?(s=je(r,o),n?(f=(u=je(n,1-o))[1]*u[1]+o*s[0]*s[0]*u[0]*u[0],[[s[0]*u[2]/f,s[1]*s[2]*u[0]*u[1]/f],[s[1]*u[1]/f,-s[0]*s[2]*u[0]*u[2]/f],[s[2]*u[1]*u[2]/f,-o*s[0]*s[1]*u[0]/f]]):[[s[0],0],[s[1],0],[s[2],0]]):[[0,(u=je(n,1-o))[0]/u[1]],[1/u[1],0],[u[2]/u[1],0]]),v=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(g[0],g[1]);return[i(v[1],v[0])/-1,2*a(l(-.5*c(d*v[0]*v[0]+d*v[1]*v[1])))-b]};var Ue=S(1-1/3)*T,qe=de(0);function Ve(e){var t=Ue*A,r=se(y,t)[0]-se(-y,t)[0],a=qe(0,t)[1],i=se(0,t)[1],o=M-i,l=k/e,c=4/k,d=a+o*o*4/k;function p(p,h){var g,v=n(h);if(v>t){var m=f(e-1,u(0,s((p+y)/l)));(g=se(p+=y*(e-1)/e-m*l,v))[0]=g[0]*k/r-k*(e-1)/(2*e)+m*k/e,g[1]=a+4*(g[1]-i)*o/k,h<0&&(g[1]=-g[1])}else g=qe(p,h);return g[0]*=c,g[1]/=d,g}return p.invert=function(t,p){t/=c;var h=n(p*=d);if(h>a){var g=f(e-1,u(0,s((t+y)/l)));t=(t+y*(e-1)/e-g*l)*r/k;var v=se.invert(t,.25*(h-a)*k/o+i);return v[0]-=y*(e-1)/e-g*l,p<0&&(v[1]=-v[1]),v}return qe.invert(t,p)},p}function Ze(e,t){return[e,1&t?90-m:Ue]}function We(e,t){return[e,1&t?-90+m:-Ue]}function Je(e){return[e[0]*(1-m),e[1]]}function Xe(e){var t,r=1+e,a=S(g(1/r)),l=2*P(y/(t=y+4*a*r)),s=.5*l*(r+P(e*(2+e))),c=e*e,u=r*r;function f(f,d){var p,h,v=1-g(d);if(v&&v<2){var m,x=b-d,_=25;do{var w=g(x),M=o(x),k=a+i(w,r-M),T=1+u-2*r*M;x-=m=(x-c*a-r*w+T*k-.5*v*t)/(2*r*w*k)}while(n(m)>1e-12&&--_>0);p=l*P(T),h=f*k/y}else p=l*(e+v),h=f*a/y;return[p*g(h),s-p*o(h)]}return f.invert=function(e,n){var o=e*e+(n-=s)*n,f=(1+u-o/(l*l))/(2*r),d=L(f),p=g(d),h=a+i(p,r-f);return[S(e/P(o))*y/h,S(1-2*(d-c*a-r*p+(1+u-2*r*f)*h)/t)]},f}function Ke(e,t){return t>-.7109889596207567?((e=Z(e,t))[1]+=.0528035274542,e):Q(e,t)}function Qe(e,t){return n(t)>.7109889596207567?((e=Z(e,t))[1]-=t>0?.0528035274542:-.0528035274542,e):Q(e,t)}function $e(e,t,r,n){var a=P(4*y/(2*r+(1+e-t/2)*g(2*r)+(e+t)/2*g(4*r)+t/2*g(6*r))),i=P(n*g(r)*P((1+e*o(2*r)+t*o(4*r))/(1+e+t))),l=r*c(1);function s(r){return P(1+e*o(2*r)+t*o(4*r))}function c(n){var a=n*r;return(2*a+(1+e-t/2)*g(2*a)+(e+t)/2*g(4*a)+t/2*g(6*a))/r}function u(e){return s(e)*g(e)}var f=function(e,t){var n=r*Y(c,l*g(t)/r,t/y);isNaN(n)&&(n=r*h(t));var u=a*s(n);return[u*i*e/y*o(n),u/i*g(n)]};return f.invert=function(e,t){var n=Y(u,t*i/a);return[e*y/(o(n)*a*i*s(n)),S(r*c(n/r)/l)]},0===r&&(a=P(n/y),(f=function(e,t){return[e*a,g(t)/a]}).invert=function(e,t){return[e/a,S(t*a)]}),f}function et(e,t,r,n,a){void 0===n&&(n=1e-8),void 0===a&&(a=20);var i=e(t),o=e(.5*(t+r)),l=e(r);return function e(t,r,n,a,i,o,l,s,c,u,f){if(f.nanEncountered)return NaN;var d,p,h,g,v,m,y,b,x,_;if(p=t(r+.25*(d=n-r)),h=t(n-.25*d),isNaN(p))f.nanEncountered=!0;else{if(!isNaN(h))return _=((m=(g=d*(a+4*p+i)/12)+(v=d*(i+4*h+o)/12))-l)/15,u>c?(f.maxDepthCount++,m+_):Math.abs(_)e?r=n:t=n,n=t+r>>1}while(n>t);var a=c[n+1]-c[n];return a&&(a=(e-c[n+1])/a),(n+1+a)/l}var p=2*f(1)/y*o/r,v=function(e,t){var r=f(n(g(t))),i=a(r)*e;return r/=p,[i,t>=0?r:-r]};return v.invert=function(e,t){var r;return n(t*=p)<1&&(r=h(t)*S(i(n(t))*o)),[e/a(n(t)),r]},v}function rt(e,t){return n(e[0]-t[0])=0;--s)n=(t=e[1][s])[0][0],a=t[0][1],i=t[1][1],o=t[2][0],l=t[2][1],c.push(nt([[o-m,l-m],[o-m,i+m],[n+m,i+m],[n+m,a-m]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}function it(e,r,n){var a,i;function o(t,n){for(var a=n<0?-1:1,i=r[+(n<0)],o=0,l=i.length-1;oi[o][2][0];++o);var s=e(t-i[o][1][0],n);return s[0]+=e(i[o][1][0],a*n>a*i[o][0][1]?i[o][0][1]:n)[0],s}n?o.invert=n(o):e.invert&&(o.invert=function(t,n){for(var a=i[+(n<0)],l=r[+(n<0)],s=0,c=a.length;so&&(r=i,i=o,o=r),[[n,i],[a,o]]}))})),l):r.map((function(e){return e.map((function(e){return[[e[0][0]*T,e[0][1]*T],[e[1][0]*T,e[1][1]*T],[e[2][0]*T,e[2][1]*T]]}))}))},null!=r&&l.lobes(r),l}Ke.invert=function(e,t){return t>-.7109889596207567?Z.invert(e,t-.0528035274542):Q.invert(e,t)},Qe.invert=function(e,t){return n(t)>.7109889596207567?Z.invert(e,t+(t>0?.0528035274542:-.0528035274542)):Q.invert(e,t)};var ot=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var lt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var st=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];var ct=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];var ut=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];var ft=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function dt(e,t){return[3/k*e*P(y*y/3-t*t),t]}function pt(e){function t(t,r){if(n(n(r)-b)2)return null;var o=(t/=2)*t,l=(r/=2)*r,s=2*r/(1+o+l);return s=d((1+s)/(1-s),1/e),[i(2*t,1-o-l)/e,S((s-1)/(s+1))]},t}dt.invert=function(e,t){return[k/3*e/P(y*y/3-t*t),t]};var ht=y/w;function gt(e,t){return[e*(1+P(o(t)))/2,t/(o(t/2)*o(e/6))]}function vt(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function mt(e,t){return[g(e)/o(t),v(t)*o(e)]}function yt(e){var t=o(e),r=v(x+e/2);function a(a,i){var o=i-e,l=n(o)=0;)d=(f=e[u])[0]+s*(a=d)-c*p,p=f[1]+s*p+c*a;return[d=s*(a=d)-c*p,p=s*p+c*a]}return r.invert=function(r,l){var s=20,c=r,u=l;do{for(var f,d=t,p=e[d],h=p[0],v=p[1],m=0,y=0;--d>=0;)m=h+c*(f=m)-u*y,y=v+c*y+u*f,h=(p=e[d])[0]+c*(f=h)-u*v,v=p[1]+c*v+u*f;var b,x,_=(m=h+c*(f=m)-u*y)*m+(y=v+c*y+u*f)*y;c-=b=((h=c*(f=h)-u*v-r)*m+(v=c*v+u*f-l)*y)/_,u-=x=(v*m-h*y)/_}while(n(b)+n(x)>1e-12&&--s>0);if(s){var w=P(c*c+u*u),M=2*a(.5*w),k=g(M);return[i(c*k,w*o(M)),w?S(u*k/w):0]}},r}gt.invert=function(e,t){var r=n(e),a=n(t),i=m,l=b;am||n(x)>m)&&--i>0);return i&&[r,a]},mt.invert=function(e,t){var r=e*e,n=t*t+1,a=r+n,i=e?_*P((a-P(a*a-4*r))/r):1/P(n);return[S(e*i),h(t)*L(i)]},bt.invert=function(e,t){return[e,2.5*a(l(.8*t))-.625*y]};var _t=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],wt=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Mt=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],kt=[[.9245,0],[0,0],[.01943,0]],Tt=[[.721316,0],[0,0],[-.00881625,-.00617325]];function At(e,r){var n=t.geoProjection(xt(e)).rotate(r).clipAngle(90),a=t.geoRotation(r),i=n.center;return delete n.rotate,n.center=function(e){return arguments.length?i(a(e)):a.invert(i())},n}var St=P(6),Lt=P(7);function Pt(e,t){var r=S(7*g(t)/(3*St));return[St*e*(2*o(2*r/3)-1)/Lt,9*g(r/3)/Lt]}function Ct(e,t){for(var r,a=(1+_)*g(t),i=t,l=0;l<25&&(i-=r=(g(i/2)+g(i)-a)/(.5*o(i/2)+o(i)),!(n(r)1e-12&&--s>0);return[e/(.84719-.13063*(a=l*l)+(o=a*(i=a*a))*o*(.05494*a-.04515-.02326*i+.00331*o)),l]},Rt.invert=function(e,t){for(var r=t/2,a=0,i=1/0;a<10&&n(i)>m;++a){var l=o(t/2);t-=i=(t-v(t/2)-r)/(1-.5/(l*l))}return[2*e/(1+o(t)),t]};var Et=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Nt(e,t){var r=g(t),a=o(t),i=h(e);if(0===e||n(t)===b)return[0,t];if(0===t)return[e,0];if(n(e)===b)return[e*a,b*r];var l=y/(2*e)-2*e/y,s=2*t/y,c=(1-s*s)/(r-s),u=l*l,f=c*c,d=1+u/f,p=1+f/u,v=(l*r/c-l/2)/d,m=(f*r/u+c/2)/p,x=m*m-(f*r*r/u+c*r-1)/p;return[b*(v+P(v*v+a*a/d)*i),b*(m+P(x<0?0:x)*h(-t*l)*i)]}Nt.invert=function(e,t){var r=(e/=b)*e,n=r+(t/=b)*t,a=y*y;return[e?(n-1+P((1-n)*(1-n)+4*r))/(2*e)*b:0,Y((function(e){return n*(y*g(e)-2*e)*y+4*e*e*(t-g(e))+2*y*e-a*t}),0)]};function It(e,t){var r=t*t;return[e,t*(1.0148+r*r*(.23185+r*(.02406*r-.14499)))]}function zt(e,t){if(n(t)=0;)if(n=t[l],r[0]===n[0]&&r[1]===n[1]){if(i)return[i,r];i=r}}}(t.face,r.face),a=Ft(n.map(r.project),n.map(t.project));t.transform=r.transform?jt(r.transform,a):a;for(var i=r.edges,o=0,l=i.length;o1.790857183?t=1.790857183:t<-1.790857183&&(t=-1.790857183);var r,a=t;do{var i=a*a;a-=r=(a*(1.0148+i*i*(.23185+i*(.02406*i-.14499)))-t)/(1.0148+i*i*(5*.23185+i*(.21654*i-1.01493)))}while(n(r)>m);return[e,a]},zt.invert=function(e,t){if(n(t)m&&--l>0);return s=v(i),[(n(t)n^p>n&&r<(d-c)*(n-u)/(p-u)+c&&(a=!a)}return a}(e[0],r))return e.push(t),!0}))||e.push([t])})),nr=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function lr(e){var r=e(b,0)[0]-e(-b,0)[0];function a(t,a){var i=n(t)0?t-y:t+y,a),l=(o[0]-o[1])*_,s=(o[0]+o[1])*_;if(i)return[l,s];var c=r*_,u=l>0^s>0?-1:1;return[u*l-h(s)*c,u*s-h(l)*c]}return e.invert&&(a.invert=function(t,a){var i=(t+a)*_,o=(a-t)*_,l=n(i)<.5*r&&n(o)<.5*r;if(!l){var s=r*_,c=i>0^o>0?-1:1,u=-c*t+(o>0?1:-1)*s,f=-c*a+(i>0?1:-1)*s;i=(-u-f)*_,o=(u-f)*_}var d=e.invert(i,o);return l||(d[0]+=i>0?y:-y),d}),t.geoProjection(a).rotate([-90,-90,45]).clipAngle(179.999)}function sr(){return lr(He).scale(111.48)}function cr(e){var t=g(e);function r(r,n){var i=t?v(r*t/2)/t:r/2;if(!n)return[2*i,-e];var l=2*a(i*g(n)),s=1/v(n);return[g(l)*s,n+(1-o(l))*s-e]}return r.invert=function(r,i){if(n(i+=e)m&&--u>0);var h=r*(f=v(c)),b=v(n(i)0?b:-b)*(d+o*(h-c)/2+o*o*(h-2*d+c)/2)]}function dr(e,t){var r=function(e){function t(t,r){var n=o(r),a=(e-1)/(e-n*o(t));return[a*n*g(t),a*g(r)]}return t.invert=function(t,r){var n=t*t+r*r,a=P(n),o=(e-P(1-n*(e+1)/(e-1)))/((e-1)/a+a/(e-1));return[i(t*o,a*P(1-o*o)),a?S(r*o/a):0]},t}(e);if(!t)return r;var n=o(t),a=g(t);function l(t,i){var o=r(t,i),l=o[1],s=l*a/(e-1)+n;return[o[0]*n/s,l/s]}return l.invert=function(t,i){var o=(e-1)/(e-1-i*a);return r.invert(o*t,o*i*n)},l}ur.forEach((function(e){e[1]*=1.0144})),fr.invert=function(e,t){var r=t/b,a=90*r,i=f(18,n(a/5)),o=u(0,s(i));do{var l=ur[o][1],c=ur[o+1][1],d=ur[f(19,o+2)][1],p=d-l,h=d-2*c+l,g=2*(n(r)-c)/p,v=h/p,m=g*(1-v*g*(1-2*v*g));if(m>=0||1===o){a=(t>=0?5:-5)*(m+i);var y,x=50;do{m=(i=f(18,n(a)/5))-(o=s(i)),l=ur[o][1],c=ur[o+1][1],d=ur[f(19,o+2)][1],a-=(y=(t>=0?b:-b)*(c+m*(d-l)/2+m*m*(d-2*c+l)/2)-t)*T}while(n(y)>1e-12&&--x>0);break}}while(--o>=0);var _=ur[o][0],w=ur[o+1][0],M=ur[f(19,o+2)][0];return[e/(w+m*(M-_)/2+m*m*(M-2*w+_)/2),a*A]};var pr=-179.9999,hr=179.9999,gr=-89.9999;function vr(e){return e.length>0}function mr(e){return-90===e||90===e?[0,e]:[-180,(t=e,Math.floor(1e4*t)/1e4)];var t}function yr(e){var t=e[0],r=e[1],n=!1;return t<=pr?(t=-180,n=!0):t>=hr&&(t=180,n=!0),r<=gr?(r=-90,n=!0):r>=89.9999&&(r=90,n=!0),n?[t,r]:e}function br(e){return e.map(yr)}function xr(e,t,r){for(var n=0,a=e.length;n=hr||u<=gr||u>=89.9999){i[o]=yr(s);for(var f=o+1;fpr&&pgr&&h<89.9999)break}if(f===o+1)continue;if(o){var g={index:-1,polygon:t,ring:i.slice(0,o+1)};g.ring[g.ring.length-1]=mr(u),r[r.length-1]=g}else r.pop();if(f>=l)break;r.push({index:-1,polygon:t,ring:i=i.slice(f-1)}),i[0]=mr(i[0][1]),o=-1,l=i.length}}}}function _r(e){var t,r,n,a,i,o,l=e.length,s={},c={};for(t=0;t0?y-s:s)*T],u=t.geoProjection(e(l)).rotate(c),f=t.geoRotation(c),d=u.center;return delete u.rotate,u.center=function(e){return arguments.length?d(f(e)):f.invert(d())},u.clipAngle(90)}function Ar(e){var r=o(e);function n(e,n){var a=t.geoGnomonicRaw(e,n);return a[0]*=r,a}return n.invert=function(e,n){return t.geoGnomonicRaw.invert(e/r,n)},n}function Sr(e,t){return Tr(Ar,e,t)}function Lr(e){if(!(e*=2))return t.geoAzimuthalEquidistantRaw;var r=-e/2,n=-r,a=e*e,l=v(n),s=.5/g(n);function c(t,i){var l=L(o(i)*o(t-r)),s=L(o(i)*o(t-n));return[((l*=l)-(s*=s))/(2*e),(i<0?-1:1)*P(4*a*s-(a-l+s)*(a-l+s))/(2*e)]}return c.invert=function(e,t){var a,c,u=t*t,f=o(P(u+(a=e+r)*a)),d=o(P(u+(a=e+n)*a));return[i(c=f-d,a=(f+d)*l),(t<0?-1:1)*L(P(a*a+c*c)*s)]},c}function Pr(e,t){return Tr(Lr,e,t)}function Cr(e,t){if(n(t)m&&--s>0);return[h(e)*(P(i*i+4)+i)*y/4,b*l]};var Ir=4*y+3*P(3),zr=2*P(2*y*P(3)/Ir),Fr=V(zr*P(3)/y,zr,Ir/6);function jr(e,t){return[e*P(1-3*t*t/(y*y)),t]}function Br(e,t){var r=o(t),n=o(e)*r,a=1-n,l=o(e=i(g(e)*r,-g(t))),s=g(e);return[s*(r=P(1-n*n))-l*a,-l*r-s*a]}function Hr(e,t){var r=R(e,t);return[(r[0]+e/b)/2,(r[1]+t)/2]}jr.invert=function(e,t){return[e/P(1-3*t*t/(y*y)),t]},Br.invert=function(e,t){var r=(e*e+t*t)/-2,n=P(-r*(2+r)),a=t*r+e*n,o=e*r-t*n,l=P(o*o+a*a);return[i(n*a,l*(1+r)),l?-S(n*o/l):0]},Hr.invert=function(e,t){var r=e,a=t,i=25;do{var l,s=o(a),c=g(a),u=g(2*a),f=c*c,d=s*s,p=g(r),h=o(r/2),v=g(r/2),y=v*v,x=1-d*h*h,_=x?L(s*h)*P(l=1/x):l=0,w=.5*(2*_*s*v+r/b)-e,M=.5*(_*c+a)-t,k=.5*l*(d*y+_*s*h*f)+.5/b,T=l*(p*u/4-_*c*v),A=.125*l*(u*v-_*c*d*p),S=.5*l*(f*h+_*y*s)+.5,C=T*A-S*k,D=(M*T-w*S)/C,O=(w*A-M*k)/C;r-=D,a-=O}while((n(D)>m||n(O)>m)&&--i>0);return[r,a]},e.geoNaturalEarth=t.geoNaturalEarth1,e.geoNaturalEarthRaw=t.geoNaturalEarth1Raw,e.geoAiry=function(){var e=b,r=t.geoProjectionMutator(O),n=r(e);return n.radius=function(t){return arguments.length?r(e=t*A):e*T},n.scale(179.976).clipAngle(147)},e.geoAiryRaw=O,e.geoAitoff=function(){return t.geoProjection(R).scale(152.63)},e.geoAitoffRaw=R,e.geoArmadillo=function(){var e=20*A,r=e>=0?1:-1,n=v(r*e),a=t.geoProjectionMutator(E),l=a(e),s=l.stream;return l.parallel=function(t){return arguments.length?(n=v((r=(e=t*A)>=0?1:-1)*e),a(e)):e*T},l.stream=function(t){var a=l.rotate(),c=s(t),u=(l.rotate([0,0]),s(t)),f=l.precision();return l.rotate(a),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=-180*r;r*t<180;t+=90*r)u.point(t,90*r);if(e)for(;r*(t-=3*r*f)>=-180;)u.point(t,r*-i(o(t*A/2),n)*T);u.lineEnd(),u.polygonEnd()},c},l.scale(218.695).center([0,28.0974])},e.geoArmadilloRaw=E,e.geoAugust=function(){return t.geoProjection(N).scale(66.1603)},e.geoAugustRaw=N,e.geoBaker=function(){return t.geoProjection(F).scale(112.314)},e.geoBakerRaw=F,e.geoBerghaus=function(){var e=5,r=t.geoProjectionMutator(j),n=r(e),a=n.stream,l=-o(.01*A),s=g(.01*A);return n.lobes=function(t){return arguments.length?r(e=+t):e},n.stream=function(t){var r=n.rotate(),c=a(t),u=(n.rotate([0,0]),a(t));return n.rotate(r),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=0,r=360/e,n=2*y/e,a=90-180/e,c=b;t=0;)e.point((t=r[a])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},n.scale(79.4187).parallel(45).clipAngle(179.999)},e.geoHammerRetroazimuthalRaw=Ye,e.geoHealpix=function(){var e=4,n=t.geoProjectionMutator(Ve),a=n(e),i=a.stream;return a.lobes=function(t){return arguments.length?n(e=+t):e},a.stream=function(n){var o=a.rotate(),l=i(n),s=(a.rotate([0,0]),i(n));return a.rotate(o),l.sphere=function(){var n,a;t.geoStream((n=180/e,a=[].concat(r.range(-180,180+n/2,n).map(Ze),r.range(180,-180-n/2,-n).map(We)),{type:"Polygon",coordinates:[180===n?a.map(Je):a]}),s)},l},a.scale(239.75)},e.geoHealpixRaw=Ve,e.geoHill=function(){var e=1,r=t.geoProjectionMutator(Xe),n=r(e);return n.ratio=function(t){return arguments.length?r(e=+t):e},n.scale(167.774).center([0,18.67])},e.geoHillRaw=Xe,e.geoHomolosine=function(){return t.geoProjection(Qe).scale(152.63)},e.geoHomolosineRaw=Qe,e.geoHufnagel=function(){var e=1,r=0,n=45*A,a=2,i=t.geoProjectionMutator($e),o=i(e,r,n,a);return o.a=function(t){return arguments.length?i(e=+t,r,n,a):e},o.b=function(t){return arguments.length?i(e,r=+t,n,a):r},o.psiMax=function(t){return arguments.length?i(e,r,n=+t*A,a):n*T},o.ratio=function(t){return arguments.length?i(e,r,n,a=+t):a},o.scale(180.739)},e.geoHufnagelRaw=$e,e.geoHyperelliptical=function(){var e=0,r=2.5,n=1.183136,a=t.geoProjectionMutator(tt),i=a(e,r,n);return i.alpha=function(t){return arguments.length?a(e=+t,r,n):e},i.k=function(t){return arguments.length?a(e,r=+t,n):r},i.gamma=function(t){return arguments.length?a(e,r,n=+t):n},i.scale(152.63)},e.geoHyperellipticalRaw=tt,e.geoInterrupt=it,e.geoInterruptedBoggs=function(){return it(X,ot).scale(160.857)},e.geoInterruptedHomolosine=function(){return it(Qe,lt).scale(152.63)},e.geoInterruptedMollweide=function(){return it(Z,st).scale(169.529)},e.geoInterruptedMollweideHemispheres=function(){return it(Z,ct).scale(169.529).rotate([20,0])},e.geoInterruptedSinuMollweide=function(){return it(Ke,ut,G).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoInterruptedSinusoidal=function(){return it(Q,ft).scale(152.63).rotate([-20,0])},e.geoKavrayskiy7=function(){return t.geoProjection(dt).scale(158.837)},e.geoKavrayskiy7Raw=dt,e.geoLagrange=function(){var e=.5,r=t.geoProjectionMutator(pt),n=r(e);return n.spacing=function(t){return arguments.length?r(e=+t):e},n.scale(124.75)},e.geoLagrangeRaw=pt,e.geoLarrivee=function(){return t.geoProjection(gt).scale(97.2672)},e.geoLarriveeRaw=gt,e.geoLaskowski=function(){return t.geoProjection(vt).scale(139.98)},e.geoLaskowskiRaw=vt,e.geoLittrow=function(){return t.geoProjection(mt).scale(144.049).clipAngle(89.999)},e.geoLittrowRaw=mt,e.geoLoximuthal=function(){return K(yt).parallel(40).scale(158.837)},e.geoLoximuthalRaw=yt,e.geoMiller=function(){return t.geoProjection(bt).scale(108.318)},e.geoMillerRaw=bt,e.geoModifiedStereographic=At,e.geoModifiedStereographicRaw=xt,e.geoModifiedStereographicAlaska=function(){return At(_t,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},e.geoModifiedStereographicGs48=function(){return At(wt,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},e.geoModifiedStereographicGs50=function(){return At(Mt,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},e.geoModifiedStereographicMiller=function(){return At(kt,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},e.geoModifiedStereographicLee=function(){return At(Tt,[165,10]).scale(250).clipAngle(130).center([-165,-10])},e.geoMollweide=function(){return t.geoProjection(Z).scale(169.529)},e.geoMollweideRaw=Z,e.geoMtFlatPolarParabolic=function(){return t.geoProjection(Pt).scale(164.859)},e.geoMtFlatPolarParabolicRaw=Pt,e.geoMtFlatPolarQuartic=function(){return t.geoProjection(Ct).scale(188.209)},e.geoMtFlatPolarQuarticRaw=Ct,e.geoMtFlatPolarSinusoidal=function(){return t.geoProjection(Dt).scale(166.518)},e.geoMtFlatPolarSinusoidalRaw=Dt,e.geoNaturalEarth2=function(){return t.geoProjection(Ot).scale(175.295)},e.geoNaturalEarth2Raw=Ot,e.geoNellHammer=function(){return t.geoProjection(Rt).scale(152.63)},e.geoNellHammerRaw=Rt,e.geoInterruptedQuarticAuthalic=function(){return it(B(1/0),Et).rotate([20,0]).scale(152.63)},e.geoNicolosi=function(){return t.geoProjection(Nt).scale(127.267)},e.geoNicolosiRaw=Nt,e.geoPatterson=function(){return t.geoProjection(It).scale(139.319)},e.geoPattersonRaw=It,e.geoPolyconic=function(){return t.geoProjection(zt).scale(103.74)},e.geoPolyconicRaw=zt,e.geoPolyhedral=Yt,e.geoPolyhedralButterfly=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=Vt.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Yt(r[0],(function(e,t){return r[e<-y/2?t<0?6:4:e<0?t<0?2:0:e0?[-r[0],0]:[180-r[0],180])};var r=Vt.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Yt(r[0],(function(e,t){return r[e<-y/2?t<0?6:4:e<0?t<0?2:0:e2||i[0]!=t[0]||i[1]!=t[1])&&(n.push(i),t=i)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function i(e){return e.map(a)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(i)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function l(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return l(e);case"FeatureCollection":var s={type:"FeatureCollection",features:e.features.map(l)};return null!=e.bbox&&(s.bbox=e.bbox),s;default:return o(e)}return e},e.geoQuincuncial=lr,e.geoRectangularPolyconic=function(){return K(cr).scale(131.215)},e.geoRectangularPolyconicRaw=cr,e.geoRobinson=function(){return t.geoProjection(fr).scale(152.63)},e.geoRobinsonRaw=fr,e.geoSatellite=function(){var e=2,r=0,n=t.geoProjectionMutator(dr),a=n(e,r);return a.distance=function(t){return arguments.length?n(e=+t,r):e},a.tilt=function(t){return arguments.length?n(e,r=t*A):r*T},a.scale(432.147).clipAngle(L(1/e)*T-1e-6)},e.geoSatelliteRaw=dr,e.geoSinuMollweide=function(){return t.geoProjection(Ke).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoSinuMollweideRaw=Ke,e.geoSinusoidal=function(){return t.geoProjection(Q).scale(152.63)},e.geoSinusoidalRaw=Q,e.geoStitch=function(e){if(null==e)return e;switch(e.type){case"Feature":return wr(e);case"FeatureCollection":var t={type:"FeatureCollection",features:e.features.map(wr)};return null!=e.bbox&&(t.bbox=e.bbox),t;default:return Mr(e)}},e.geoTimes=function(){return t.geoProjection(kr).scale(146.153)},e.geoTimesRaw=kr,e.geoTwoPointAzimuthal=Sr,e.geoTwoPointAzimuthalRaw=Ar,e.geoTwoPointAzimuthalUsa=function(){return Sr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},e.geoTwoPointEquidistant=Pr,e.geoTwoPointEquidistantRaw=Lr,e.geoTwoPointEquidistantUsa=function(){return Pr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},e.geoVanDerGrinten=function(){return t.geoProjection(Cr).scale(79.4183)},e.geoVanDerGrintenRaw=Cr,e.geoVanDerGrinten2=function(){return t.geoProjection(Dr).scale(79.4183)},e.geoVanDerGrinten2Raw=Dr,e.geoVanDerGrinten3=function(){return t.geoProjection(Or).scale(79.4183)},e.geoVanDerGrinten3Raw=Or,e.geoVanDerGrinten4=function(){return t.geoProjection(Rr).scale(127.16)},e.geoVanDerGrinten4Raw=Rr,e.geoWagner=Nr,e.geoWagner7=function(){return Nr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},e.geoWagnerRaw=Er,e.geoWagner4=function(){return t.geoProjection(Fr).scale(176.84)},e.geoWagner4Raw=Fr,e.geoWagner6=function(){return t.geoProjection(jr).scale(152.63)},e.geoWagner6Raw=jr,e.geoWiechel=function(){return t.geoProjection(Br).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},e.geoWiechelRaw=Br,e.geoWinkel3=function(){return t.geoProjection(Hr).scale(158.837)},e.geoWinkel3Raw=Hr,Object.defineProperty(e,"__esModule",{value:!0})}))},{"d3-array":23,"d3-geo":26}],26:[function(e,t,r){!function(n,a){"object"==typeof r&&void 0!==t?a(r,e("d3-array")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(e,t){"use strict";function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(e){i(a,e,this.t),i(this,a.s,this.s),this.s?this.t+=a.t:this.s=a.t},valueOf:function(){return this.s}};var a=new n;function i(e,t,r){var n=e.s=t+r,a=n-t,i=n-a;e.t=t-i+(r-a)}var o=1e-6,l=Math.PI,s=l/2,c=l/4,u=2*l,f=180/l,d=l/180,p=Math.abs,h=Math.atan,g=Math.atan2,v=Math.cos,m=Math.ceil,y=Math.exp,b=Math.log,x=Math.pow,_=Math.sin,w=Math.sign||function(e){return e>0?1:e<0?-1:0},M=Math.sqrt,k=Math.tan;function T(e){return e>1?0:e<-1?l:Math.acos(e)}function A(e){return e>1?s:e<-1?-s:Math.asin(e)}function S(e){return(e=_(e/2))*e}function L(){}function P(e,t){e&&D.hasOwnProperty(e.type)&&D[e.type](e,t)}var C={Feature:function(e,t){P(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,a=r.length;++n=0?1:-1,a=n*r,i=v(t=(t*=d)/2+c),o=_(t),l=j*o,s=F*i+l*v(a),u=l*n*_(a);B.add(g(u,s)),z=e,F=i,j=o}function Z(e){return[g(e[1],e[0]),A(e[2])]}function W(e){var t=e[0],r=e[1],n=v(r);return[n*v(t),n*_(t),_(r)]}function J(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function X(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function K(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Q(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function $(e){var t=M(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var ee,te,re,ne,ae,ie,oe,le,se,ce,ue,fe,de,pe,he,ge,ve,me,ye,be,xe,_e,we,Me,ke,Te,Ae=r(),Se={point:Le,lineStart:Ce,lineEnd:De,polygonStart:function(){Se.point=Oe,Se.lineStart=Re,Se.lineEnd=Ee,Ae.reset(),Y.polygonStart()},polygonEnd:function(){Y.polygonEnd(),Se.point=Le,Se.lineStart=Ce,Se.lineEnd=De,B<0?(ee=-(re=180),te=-(ne=90)):Ae>o?ne=90:Ae<-o&&(te=-90),ce[0]=ee,ce[1]=re},sphere:function(){ee=-(re=180),te=-(ne=90)}};function Le(e,t){se.push(ce=[ee=e,re=e]),tne&&(ne=t)}function Pe(e,t){var r=W([e*d,t*d]);if(le){var n=X(le,r),a=X([n[1],-n[0],0],n);$(a),a=Z(a);var i,o=e-ae,l=o>0?1:-1,s=a[0]*f*l,c=p(o)>180;c^(l*aene&&(ne=i):c^(l*ae<(s=(s+360)%360-180)&&sne&&(ne=t)),c?eNe(ee,re)&&(re=e):Ne(e,re)>Ne(ee,re)&&(ee=e):re>=ee?(ere&&(re=e)):e>ae?Ne(ee,e)>Ne(ee,re)&&(re=e):Ne(e,re)>Ne(ee,re)&&(ee=e)}else se.push(ce=[ee=e,re=e]);tne&&(ne=t),le=r,ae=e}function Ce(){Se.point=Pe}function De(){ce[0]=ee,ce[1]=re,Se.point=Le,le=null}function Oe(e,t){if(le){var r=e-ae;Ae.add(p(r)>180?r+(r>0?360:-360):r)}else ie=e,oe=t;Y.point(e,t),Pe(e,t)}function Re(){Y.lineStart()}function Ee(){Oe(ie,oe),Y.lineEnd(),p(Ae)>o&&(ee=-(re=180)),ce[0]=ee,ce[1]=re,le=null}function Ne(e,t){return(t-=e)<0?t+360:t}function Ie(e,t){return e[0]-t[0]}function ze(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tl?e+Math.round(-e/u)*u:e,t]}function Qe(e,t,r){return(e%=u)?t||r?Xe(et(e),tt(t,r)):et(e):t||r?tt(t,r):Ke}function $e(e){return function(t,r){return[(t+=e)>l?t-u:t<-l?t+u:t,r]}}function et(e){var t=$e(e);return t.invert=$e(-e),t}function tt(e,t){var r=v(e),n=_(e),a=v(t),i=_(t);function o(e,t){var o=v(t),l=v(e)*o,s=_(e)*o,c=_(t),u=c*r+l*n;return[g(s*a-u*i,l*r-c*n),A(u*a+s*i)]}return o.invert=function(e,t){var o=v(t),l=v(e)*o,s=_(e)*o,c=_(t),u=c*a-s*i;return[g(s*a+c*i,l*r+u*n),A(u*r-l*n)]},o}function rt(e){function t(t){return(t=e(t[0]*d,t[1]*d))[0]*=f,t[1]*=f,t}return e=Qe(e[0]*d,e[1]*d,e.length>2?e[2]*d:0),t.invert=function(t){return(t=e.invert(t[0]*d,t[1]*d))[0]*=f,t[1]*=f,t},t}function nt(e,t,r,n,a,i){if(r){var o=v(t),l=_(t),s=n*r;null==a?(a=t+n*u,i=t-s/2):(a=at(o,a),i=at(o,i),(n>0?ai)&&(a+=n*u));for(var c,f=a;n>0?f>i:f1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}function ot(e,t){return p(e[0]-t[0])=0;--i)a.point((f=u[i])[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 ct(e){if(t=e.length){for(var t,r,n=0,a=e[0];++n=0?1:-1,E=R*O,N=E>l,I=M*C;if(ut.add(g(I*R*_(E),k*D+I*v(E))),f+=N?O+R*u:O,N^x>=r^L>=r){var z=X(W(b),W(S));$(z);var F=X(i,z);$(F);var j=(N^O>=0?-1:1)*A(F[2]);(n>j||n===j&&(z[0]||z[1]))&&(d+=N^O>=0?1:-1)}}return(f<-o||f0){for(d||(i.polygonStart(),d=!0),i.lineStart(),e=0;e1&&2&a&&c.push(c.pop().concat(c.shift())),l.push(c.filter(ht))}return p}}function ht(e){return e.length>1}function gt(e,t){return((e=e.x)[0]<0?e[1]-s-o:s-e[1])-((t=t.x)[0]<0?t[1]-s-o:s-t[1])}var vt=pt((function(){return!0}),(function(e){var t,r=NaN,n=NaN,a=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(i,c){var u=i>0?l:-l,f=p(i-r);p(f-l)0?s:-s),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(i,n),t=0):a!==u&&f>=l&&(p(r-a)o?h((_(t)*(i=v(n))*_(r)-_(n)*(a=v(t))*_(e))/(a*i*l)):(t+n)/2}(r,n,i,c),e.point(a,n),e.lineEnd(),e.lineStart(),e.point(u,n),t=0),e.point(r=i,n=c),a=u},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var a;if(null==e)a=r*s,n.point(-l,a),n.point(0,a),n.point(l,a),n.point(l,0),n.point(l,-a),n.point(0,-a),n.point(-l,-a),n.point(-l,0),n.point(-l,a);else if(p(e[0]-t[0])>o){var i=e[0]0,a=p(t)>o;function i(e,r){return v(e)*v(r)>t}function s(e,r,n){var a=[1,0,0],i=X(W(e),W(r)),s=J(i,i),c=i[0],u=s-c*c;if(!u)return!n&&e;var f=t*s/u,d=-t*c/u,h=X(a,i),g=Q(a,f);K(g,Q(i,d));var v=h,m=J(g,v),y=J(v,v),b=m*m-y*(J(g,g)-1);if(!(b<0)){var x=M(b),_=Q(v,(-m-x)/y);if(K(_,g),_=Z(_),!n)return _;var w,k=e[0],T=r[0],A=e[1],S=r[1];T0^_[1]<(p(_[0]-k)l^(k<=_[0]&&_[0]<=T)){var C=Q(v,(-m+x)/y);return K(C,g),[_,Z(C)]}}}function c(t,r){var a=n?e:l-e,i=0;return t<-a?i|=1:t>a&&(i|=2),r<-a?i|=4:r>a&&(i|=8),i}return pt(i,(function(e){var t,r,o,u,f;return{lineStart:function(){u=o=!1,f=1},point:function(d,p){var h,g=[d,p],v=i(d,p),m=n?v?0:c(d,p):v?c(d+(d<0?l:-l),p):0;if(!t&&(u=o=v)&&e.lineStart(),v!==o&&(!(h=s(t,g))||ot(t,h)||ot(g,h))&&(g[2]=1),v!==o)f=0,v?(e.lineStart(),h=s(g,t),e.point(h[0],h[1])):(h=s(t,g),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(a&&t&&n^v){var y;m&r||!(y=s(g,t,!0))||(f=0,n?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!v||t&&ot(t,g)||e.point(g[0],g[1]),t=g,o=v,r=m},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return f|(u&&o)<<1}}}),(function(t,n,a,i){nt(i,e,r,a,t,n)}),n?[0,-e]:[-l,e-l])}function yt(e,r,n,a){function i(t,i){return e<=t&&t<=n&&r<=i&&i<=a}function l(t,i,o,l){var c=0,f=0;if(null==t||(c=s(t,o))!==(f=s(i,o))||u(t,i)<0^o>0)do{l.point(0===c||3===c?e:n,c>1?a:r)}while((c=(c+o+4)%4)!==f);else l.point(i[0],i[1])}function s(t,a){return p(t[0]-e)0?0:3:p(t[0]-n)0?2:1:p(t[1]-r)0?1:0:a>0?3:2}function c(e,t){return u(e.x,t.x)}function u(e,t){var r=s(e,1),n=s(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(o){var s,u,f,d,p,h,g,v,m,y,b,x=o,_=it(),w={point:M,lineStart:function(){w.point=k,u&&u.push(f=[]);y=!0,m=!1,g=v=NaN},lineEnd:function(){s&&(k(d,p),h&&m&&_.rejoin(),s.push(_.result()));w.point=M,m&&x.lineEnd()},polygonStart:function(){x=_,s=[],u=[],b=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,n=u.length;ra&&(d-i)*(a-o)>(p-o)*(e-i)&&++t:p<=a&&(d-i)*(a-o)<(p-o)*(e-i)&&--t;return t}(),n=b&&r,i=(s=t.merge(s)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),l(null,null,1,o),o.lineEnd()),i&&st(s,c,r,l,o),o.polygonEnd());x=o,s=u=f=null}};function M(e,t){i(e,t)&&x.point(e,t)}function k(t,o){var l=i(t,o);if(u&&f.push([t,o]),y)d=t,p=o,h=l,y=!1,l&&(x.lineStart(),x.point(t,o));else if(l&&m)x.point(t,o);else{var s=[g=Math.max(-1e9,Math.min(1e9,g)),v=Math.max(-1e9,Math.min(1e9,v))],c=[t=Math.max(-1e9,Math.min(1e9,t)),o=Math.max(-1e9,Math.min(1e9,o))];!function(e,t,r,n,a,i){var o,l=e[0],s=e[1],c=0,u=1,f=t[0]-l,d=t[1]-s;if(o=r-l,f||!(o>0)){if(o/=f,f<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=d,d<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,d||!(o<0)){if(o/=d,d<0){if(o>u)return;o>c&&(c=o)}else if(d>0){if(o0&&(e[0]=l+c*f,e[1]=s+c*d),u<1&&(t[0]=l+u*f,t[1]=s+u*d),!0}}}}}(s,c,e,r,n,a)?l&&(x.lineStart(),x.point(t,o),b=!1):(m||(x.lineStart(),x.point(s[0],s[1])),x.point(c[0],c[1]),l||x.lineEnd(),b=!1)}g=t,v=o,m=l}return w}}var bt,xt,_t,wt=r(),Mt={sphere:L,point:L,lineStart:function(){Mt.point=Tt,Mt.lineEnd=kt},lineEnd:L,polygonStart:L,polygonEnd:L};function kt(){Mt.point=Mt.lineEnd=L}function Tt(e,t){bt=e*=d,xt=_(t*=d),_t=v(t),Mt.point=At}function At(e,t){e*=d;var r=_(t*=d),n=v(t),a=p(e-bt),i=v(a),o=n*_(a),l=_t*r-xt*n*i,s=xt*r+_t*n*i;wt.add(g(M(o*o+l*l),s)),bt=e,xt=r,_t=n}function St(e){return wt.reset(),E(e,Mt),+wt}var Lt=[null,null],Pt={type:"LineString",coordinates:Lt};function Ct(e,t){return Lt[0]=e,Lt[1]=t,St(Pt)}var Dt={Feature:function(e,t){return Rt(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,a=r.length;++n0&&(a=Ct(e[i],e[i-1]))>0&&r<=a&&n<=a&&(r+n-a)*(1-Math.pow((r-n)/a,2))<1e-12*a)return!0;r=n}return!1}function It(e,t){return!!dt(e.map(zt),Ft(t))}function zt(e){return(e=e.map(Ft)).pop(),e}function Ft(e){return[e[0]*d,e[1]*d]}function jt(e,r,n){var a=t.range(e,r-o,n).concat(r);return function(e){return a.map((function(t){return[e,t]}))}}function Bt(e,r,n){var a=t.range(e,r-o,n).concat(r);return function(e){return a.map((function(t){return[t,e]}))}}function Ht(){var e,r,n,a,i,l,s,c,u,f,d,h,g=10,v=g,y=90,b=360,x=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return t.range(m(a/y)*y,n,y).map(d).concat(t.range(m(c/b)*b,s,b).map(h)).concat(t.range(m(r/g)*g,e,g).filter((function(e){return p(e%y)>o})).map(u)).concat(t.range(m(l/v)*v,i,v).filter((function(e){return p(e%b)>o})).map(f))}return _.lines=function(){return w().map((function(e){return{type:"LineString",coordinates:e}}))},_.outline=function(){return{type:"Polygon",coordinates:[d(a).concat(h(s).slice(1),d(n).reverse().slice(1),h(c).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(a=+e[0][0],n=+e[1][0],c=+e[0][1],s=+e[1][1],a>n&&(e=a,a=n,n=e),c>s&&(e=c,c=s,s=e),_.precision(x)):[[a,c],[n,s]]},_.extentMinor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],l=+t[0][1],i=+t[1][1],r>e&&(t=r,r=e,e=t),l>i&&(t=l,l=i,i=t),_.precision(x)):[[r,l],[e,i]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(y=+e[0],b=+e[1],_):[y,b]},_.stepMinor=function(e){return arguments.length?(g=+e[0],v=+e[1],_):[g,v]},_.precision=function(t){return arguments.length?(x=+t,u=jt(l,i,90),f=Bt(r,e,x),d=jt(c,s,90),h=Bt(a,n,x),_):x},_.extentMajor([[-180,-90+o],[180,90-o]]).extentMinor([[-180,-80-o],[180,80+o]])}function Yt(e){return e}var Gt,Ut,qt,Vt,Zt=r(),Wt=r(),Jt={point:L,lineStart:L,lineEnd:L,polygonStart:function(){Jt.lineStart=Xt,Jt.lineEnd=$t},polygonEnd:function(){Jt.lineStart=Jt.lineEnd=Jt.point=L,Zt.add(p(Wt)),Wt.reset()},result:function(){var e=Zt/2;return Zt.reset(),e}};function Xt(){Jt.point=Kt}function Kt(e,t){Jt.point=Qt,Gt=qt=e,Ut=Vt=t}function Qt(e,t){Wt.add(Vt*e-qt*t),qt=e,Vt=t}function $t(){Qt(Gt,Ut)}var er=1/0,tr=er,rr=-er,nr=rr,ar={point:function(e,t){err&&(rr=e);tnr&&(nr=t)},lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var e=[[er,tr],[rr,nr]];return rr=nr=-(tr=er=1/0),e}};var ir,or,lr,sr,cr=0,ur=0,fr=0,dr=0,pr=0,hr=0,gr=0,vr=0,mr=0,yr={point:br,lineStart:xr,lineEnd:Mr,polygonStart:function(){yr.lineStart=kr,yr.lineEnd=Tr},polygonEnd:function(){yr.point=br,yr.lineStart=xr,yr.lineEnd=Mr},result:function(){var e=mr?[gr/mr,vr/mr]:hr?[dr/hr,pr/hr]:fr?[cr/fr,ur/fr]:[NaN,NaN];return cr=ur=fr=dr=pr=hr=gr=vr=mr=0,e}};function br(e,t){cr+=e,ur+=t,++fr}function xr(){yr.point=_r}function _r(e,t){yr.point=wr,br(lr=e,sr=t)}function wr(e,t){var r=e-lr,n=t-sr,a=M(r*r+n*n);dr+=a*(lr+e)/2,pr+=a*(sr+t)/2,hr+=a,br(lr=e,sr=t)}function Mr(){yr.point=br}function kr(){yr.point=Ar}function Tr(){Sr(ir,or)}function Ar(e,t){yr.point=Sr,br(ir=lr=e,or=sr=t)}function Sr(e,t){var r=e-lr,n=t-sr,a=M(r*r+n*n);dr+=a*(lr+e)/2,pr+=a*(sr+t)/2,hr+=a,gr+=(a=sr*e-lr*t)*(lr+e),vr+=a*(sr+t),mr+=3*a,br(lr=e,sr=t)}function Lr(e){this._context=e}Lr.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,u)}},result:L};var Pr,Cr,Dr,Or,Rr,Er=r(),Nr={point:L,lineStart:function(){Nr.point=Ir},lineEnd:function(){Pr&&zr(Cr,Dr),Nr.point=L},polygonStart:function(){Pr=!0},polygonEnd:function(){Pr=null},result:function(){var e=+Er;return Er.reset(),e}};function Ir(e,t){Nr.point=zr,Cr=Or=e,Dr=Rr=t}function zr(e,t){Or-=e,Rr-=t,Er.add(M(Or*Or+Rr*Rr)),Or=e,Rr=t}function Fr(){this._string=[]}function jr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Br(e){return function(t){var r=new Hr;for(var n in e)r[n]=e[n];return r.stream=t,r}}function Hr(){}function Yr(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=n&&e.clipExtent(null),E(r,e.stream(ar)),t(ar.result()),null!=n&&e.clipExtent(n),e}function Gr(e,t,r){return Yr(e,(function(r){var n=t[1][0]-t[0][0],a=t[1][1]-t[0][1],i=Math.min(n/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),o=+t[0][0]+(n-i*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(a-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([o,l])}),r)}function Ur(e,t,r){return Gr(e,[[0,0],t],r)}function qr(e,t,r){return Yr(e,(function(r){var n=+t,a=n/(r[1][0]-r[0][0]),i=(n-a*(r[1][0]+r[0][0]))/2,o=-a*r[0][1];e.scale(150*a).translate([i,o])}),r)}function Vr(e,t,r){return Yr(e,(function(r){var n=+t,a=n/(r[1][1]-r[0][1]),i=-a*r[0][0],o=(n-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([i,o])}),r)}Fr.prototype={_radius:4.5,_circle:jr(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=jr(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}},Hr.prototype={constructor:Hr,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Zr=v(30*d);function Wr(e,t){return+t?function(e,t){function r(n,a,i,l,s,c,u,f,d,h,v,m,y,b){var x=u-n,_=f-a,w=x*x+_*_;if(w>4*t&&y--){var k=l+h,T=s+v,S=c+m,L=M(k*k+T*T+S*S),P=A(S/=L),C=p(p(S)-1)t||p((x*E+_*N)/w-.5)>.3||l*h+s*v+c*m2?e[2]%360*d:0,O()):[y*f,b*f,x*f]},C.angle=function(e){return arguments.length?(_=e%360*d,O()):_*f},C.reflectX=function(e){return arguments.length?(w=e?-1:1,O()):w<0},C.reflectY=function(e){return arguments.length?(k=e?-1:1,O()):k<0},C.precision=function(e){return arguments.length?(o=Wr(l,P=e*e),R()):M(P)},C.fitExtent=function(e,t){return Gr(C,e,t)},C.fitSize=function(e,t){return Ur(C,e,t)},C.fitWidth=function(e,t){return qr(C,e,t)},C.fitHeight=function(e,t){return Vr(C,e,t)},function(){return t=e.apply(this,arguments),C.invert=t.invert&&D,O()}}function en(e){var t=0,r=l/3,n=$r(e),a=n(t,r);return a.parallels=function(e){return arguments.length?n(t=e[0]*d,r=e[1]*d):[t*f,r*f]},a}function tn(e,t){var r=_(e),n=(r+_(t))/2;if(p(n)0?t<-s+o&&(t=-s+o):t>s-o&&(t=s-o);var r=a/x(fn(t),n);return[r*_(n*e),a-r*v(n*e)]}return i.invert=function(e,t){var r=a-t,i=w(n)*M(e*e+r*r),o=g(e,p(r))*w(r);return r*n<0&&(o-=l*w(e)*w(r)),[o/n,2*h(x(a/i,1/n))-s]},i}function pn(e,t){return[e,t]}function hn(e,t){var r=v(e),n=e===t?_(e):(r-v(t))/(t-e),a=r/n+e;if(p(n)o&&--a>0);return[e/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},Mn.invert=on(A),kn.invert=on((function(e){return 2*h(e)})),Tn.invert=function(e,t){return[-t,2*h(y(e))-s]},e.geoAlbers=nn,e.geoAlbersUsa=function(){var e,t,r,n,a,i,l=nn(),s=rn().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rn().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){i=[e,t]}};function f(e){var t=e[0],o=e[1];return i=null,r.point(t,o),i||(n.point(t,o),i)||(a.point(t,o),i)}function d(){return e=t=null,f}return f.invert=function(e){var t=l.scale(),r=l.translate(),n=(e[0]-r[0])/t,a=(e[1]-r[1])/t;return(a>=.12&&a<.234&&n>=-.425&&n<-.214?s:a>=.166&&a<.234&&n>=-.214&&n<-.115?c:l).invert(e)},f.stream=function(r){return e&&t===r?e:(n=[l.stream(t=r),s.stream(r),c.stream(r)],a=n.length,e={point:function(e,t){for(var r=-1;++rNe(n[0],n[1])&&(n[1]=a[1]),Ne(a[0],n[1])>Ne(n[0],n[1])&&(n[0]=a[0])):i.push(n=a);for(o=-1/0,t=0,n=i[r=i.length-1];t<=r;n=a,++t)a=i[t],(l=Ne(n[1],a[0]))>o&&(o=l,ee=a[0],re=n[1])}return se=ce=null,ee===1/0||te===1/0?[[NaN,NaN],[NaN,NaN]]:[[ee,te],[re,ne]]},e.geoCentroid=function(e){ue=fe=de=pe=he=ge=ve=me=ye=be=xe=0,E(e,Fe);var t=ye,r=be,n=xe,a=t*t+r*r+n*n;return a<1e-12&&(t=ge,r=ve,n=me,fe2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)},e.geoTransverseMercatorRaw=Tn,Object.defineProperty(e,"__esModule",{value:!0})}))},{"d3-array":23}],27:[function(e,t,r){!function(n,a){"object"==typeof r&&void 0!==t?a(r,e("d3-time")):a((n=n||self).d3=n.d3||{},n.d3)}(this,(function(e,t){"use strict";function r(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function n(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function a(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function i(e){var i=e.dateTime,o=e.date,s=e.time,c=e.periods,u=e.days,f=e.shortDays,d=e.months,ye=e.shortMonths,be=p(c),xe=h(c),_e=p(u),we=h(u),Me=p(f),ke=h(f),Te=p(d),Ae=h(d),Se=p(ye),Le=h(ye),Pe={a:function(e){return f[e.getDay()]},A:function(e){return u[e.getDay()]},b:function(e){return ye[e.getMonth()]},B:function(e){return d[e.getMonth()]},c:null,d:N,e:N,f:B,H:I,I:z,j:F,L:j,m:H,M:Y,p:function(e){return c[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ve,s:me,S:G,u:U,U:q,V:V,w:Z,W:W,x:null,X:null,y:J,Y:X,Z:K,"%":ge},Ce={a:function(e){return f[e.getUTCDay()]},A:function(e){return u[e.getUTCDay()]},b:function(e){return ye[e.getUTCMonth()]},B:function(e){return d[e.getUTCMonth()]},c:null,d:Q,e:Q,f:ne,H:$,I:ee,j:te,L:re,m:ae,M:ie,p:function(e){return c[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ve,s:me,S:oe,u:le,U:se,V:ce,w:ue,W:fe,x:null,X:null,y:de,Y:pe,Z:he,"%":ge},De={a:function(e,t,r){var n=Me.exec(t.slice(r));return n?(e.w=ke[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=_e.exec(t.slice(r));return n?(e.w=we[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Se.exec(t.slice(r));return n?(e.m=Le[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Te.exec(t.slice(r));return n?(e.m=Ae[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,t,r){return Ee(e,i,t,r)},d:T,e:T,f:D,H:S,I:S,j:A,L:C,m:k,M:L,p:function(e,t,r){var n=be.exec(t.slice(r));return n?(e.p=xe[n[0].toLowerCase()],r+n[0].length):-1},q:M,Q:R,s:E,S:P,u:v,U:m,V:y,w:g,W:b,x:function(e,t,r){return Ee(e,o,t,r)},X:function(e,t,r){return Ee(e,s,t,r)},y:_,Y:x,Z:w,"%":O};function Oe(e,t){return function(r){var n,a,i,o=[],s=-1,c=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++s53)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?t.utcMonday.ceil(l):t.utcMonday(l),l=t.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?t.timeMonday.ceil(l):t.timeMonday(l),l=t.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 Ee(e,t,r,n){for(var a,i,o=0,s=t.length,c=r.length;o=c)return-1;if(37===(a=t.charCodeAt(o++))){if(a=t.charAt(o++),!(i=De[a in l?t.charAt(o++):a])||(n=i(e,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return Pe.x=Oe(o,Pe),Pe.X=Oe(s,Pe),Pe.c=Oe(i,Pe),Ce.x=Oe(o,Ce),Ce.X=Oe(s,Ce),Ce.c=Oe(i,Ce),{format:function(e){var t=Oe(e+="",Pe);return t.toString=function(){return e},t},parse:function(e){var t=Re(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Oe(e+="",Ce);return t.toString=function(){return e},t},utcParse:function(e){var t=Re(e+="",!0);return t.toString=function(){return e},t}}}var o,l={"-":"",_:" ",0:"0"},s=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i68?1900:2e3),r+n[0].length):-1}function w(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function M(e,t,r){var n=s.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function k(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function T(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function A(e,t,r){var n=s.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function S(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function L(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function P(e,t,r){var n=s.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function C(e,t,r){var n=s.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function D(e,t,r){var n=s.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function O(e,t,r){var n=c.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function R(e,t,r){var n=s.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function E(e,t,r){var n=s.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function N(e,t){return f(e.getDate(),t,2)}function I(e,t){return f(e.getHours(),t,2)}function z(e,t){return f(e.getHours()%12||12,t,2)}function F(e,r){return f(1+t.timeDay.count(t.timeYear(e),e),r,3)}function j(e,t){return f(e.getMilliseconds(),t,3)}function B(e,t){return j(e,t)+"000"}function H(e,t){return f(e.getMonth()+1,t,2)}function Y(e,t){return f(e.getMinutes(),t,2)}function G(e,t){return f(e.getSeconds(),t,2)}function U(e){var t=e.getDay();return 0===t?7:t}function q(e,r){return f(t.timeSunday.count(t.timeYear(e)-1,e),r,2)}function V(e,r){var n=e.getDay();return e=n>=4||0===n?t.timeThursday(e):t.timeThursday.ceil(e),f(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),r,2)}function Z(e){return e.getDay()}function W(e,r){return f(t.timeMonday.count(t.timeYear(e)-1,e),r,2)}function J(e,t){return f(e.getFullYear()%100,t,2)}function X(e,t){return f(e.getFullYear()%1e4,t,4)}function K(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+f(t/60|0,"0",2)+f(t%60,"0",2)}function Q(e,t){return f(e.getUTCDate(),t,2)}function $(e,t){return f(e.getUTCHours(),t,2)}function ee(e,t){return f(e.getUTCHours()%12||12,t,2)}function te(e,r){return f(1+t.utcDay.count(t.utcYear(e),e),r,3)}function re(e,t){return f(e.getUTCMilliseconds(),t,3)}function ne(e,t){return re(e,t)+"000"}function ae(e,t){return f(e.getUTCMonth()+1,t,2)}function ie(e,t){return f(e.getUTCMinutes(),t,2)}function oe(e,t){return f(e.getUTCSeconds(),t,2)}function le(e){var t=e.getUTCDay();return 0===t?7:t}function se(e,r){return f(t.utcSunday.count(t.utcYear(e)-1,e),r,2)}function ce(e,r){var n=e.getUTCDay();return e=n>=4||0===n?t.utcThursday(e):t.utcThursday.ceil(e),f(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),r,2)}function ue(e){return e.getUTCDay()}function fe(e,r){return f(t.utcMonday.count(t.utcYear(e)-1,e),r,2)}function de(e,t){return f(e.getUTCFullYear()%100,t,2)}function pe(e,t){return f(e.getUTCFullYear()%1e4,t,4)}function he(){return"+0000"}function ge(){return"%"}function ve(e){return+e}function me(e){return Math.floor(+e/1e3)}function ye(t){return o=i(t),e.timeFormat=o.format,e.timeParse=o.parse,e.utcFormat=o.utcFormat,e.utcParse=o.utcParse,o}ye({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 be=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var xe=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");e.isoFormat=be,e.isoParse=xe,e.timeFormatDefaultLocale=ye,e.timeFormatLocale=i,Object.defineProperty(e,"__esModule",{value:!0})}))},{"d3-time":28}],28:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):n((e=e||self).d3=e.d3||{})}(this,(function(e){"use strict";var t=new Date,r=new Date;function n(e,a,i,o){function l(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return l.floor=function(t){return e(t=new Date(+t)),t},l.ceil=function(t){return e(t=new Date(t-1)),a(t,1),e(t),t},l.round=function(e){var t=l(e),r=l.ceil(e);return e-t0))return o;do{o.push(i=new Date(+t)),a(t,n),e(t)}while(i=r)for(;e(r),!t(r);)r.setTime(r-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;a(e,-1),!t(e););else for(;--r>=0;)for(;a(e,1),!t(e););}))},i&&(l.count=function(n,a){return t.setTime(+n),r.setTime(+a),e(t),e(r),Math.floor(i(t,r))},l.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?l.filter(o?function(t){return o(t)%e==0}:function(t){return l.count(0,t)%e==0}):l:null}),l}var a=n((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));a.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?n((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):a:null};var i=a.range,o=n((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),l=o.range,s=n((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getMinutes()})),c=s.range,u=n((function(e){e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getHours()})),f=u.range,d=n((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5}),(function(e){return e.getDate()-1})),p=d.range;function h(e){return n((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5}))}var g=h(0),v=h(1),m=h(2),y=h(3),b=h(4),x=h(5),_=h(6),w=g.range,M=v.range,k=m.range,T=y.range,A=b.range,S=x.range,L=_.range,P=n((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),C=P.range,D=n((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));D.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var O=D.range,R=n((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),E=R.range,N=n((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+36e5*t)}),(function(e,t){return(t-e)/36e5}),(function(e){return e.getUTCHours()})),I=N.range,z=n((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1})),F=z.range;function j(e){return n((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}var B=j(0),H=j(1),Y=j(2),G=j(3),U=j(4),q=j(5),V=j(6),Z=B.range,W=H.range,J=Y.range,X=G.range,K=U.range,Q=q.range,$=V.range,ee=n((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),te=ee.range,re=n((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));re.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var ne=re.range;e.timeDay=d,e.timeDays=p,e.timeFriday=x,e.timeFridays=S,e.timeHour=u,e.timeHours=f,e.timeInterval=n,e.timeMillisecond=a,e.timeMilliseconds=i,e.timeMinute=s,e.timeMinutes=c,e.timeMonday=v,e.timeMondays=M,e.timeMonth=P,e.timeMonths=C,e.timeSaturday=_,e.timeSaturdays=L,e.timeSecond=o,e.timeSeconds=l,e.timeSunday=g,e.timeSundays=w,e.timeThursday=b,e.timeThursdays=A,e.timeTuesday=m,e.timeTuesdays=k,e.timeWednesday=y,e.timeWednesdays=T,e.timeWeek=g,e.timeWeeks=w,e.timeYear=D,e.timeYears=O,e.utcDay=z,e.utcDays=F,e.utcFriday=q,e.utcFridays=Q,e.utcHour=N,e.utcHours=I,e.utcMillisecond=a,e.utcMilliseconds=i,e.utcMinute=R,e.utcMinutes=E,e.utcMonday=H,e.utcMondays=W,e.utcMonth=ee,e.utcMonths=te,e.utcSaturday=V,e.utcSaturdays=$,e.utcSecond=o,e.utcSeconds=l,e.utcSunday=B,e.utcSundays=Z,e.utcThursday=U,e.utcThursdays=K,e.utcTuesday=Y,e.utcTuesdays=J,e.utcWednesday=G,e.utcWednesdays=X,e.utcWeek=B,e.utcWeeks=Z,e.utcYear=re,e.utcYears=ne,Object.defineProperty(e,"__esModule",{value:!0})}))},{}],29:[function(e,t,r){arguments[4][28][0].apply(r,arguments)},{dup:28}],30:[function(e,t,r){"use strict";var n=e("is-string-blank");t.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0===(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},{"is-string-blank":65}],31:[function(e,t,r){t.exports=function(e,t){var r=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],g=t[13],v=t[14],m=t[15];return e[0]=l*(d*m-p*v)-f*(s*m-c*v)+g*(s*p-c*d),e[1]=-(n*(d*m-p*v)-f*(a*m-i*v)+g*(a*p-i*d)),e[2]=n*(s*m-c*v)-l*(a*m-i*v)+g*(a*c-i*s),e[3]=-(n*(s*p-c*d)-l*(a*p-i*d)+f*(a*c-i*s)),e[4]=-(o*(d*m-p*v)-u*(s*m-c*v)+h*(s*p-c*d)),e[5]=r*(d*m-p*v)-u*(a*m-i*v)+h*(a*p-i*d),e[6]=-(r*(s*m-c*v)-o*(a*m-i*v)+h*(a*c-i*s)),e[7]=r*(s*p-c*d)-o*(a*p-i*d)+u*(a*c-i*s),e[8]=o*(f*m-p*g)-u*(l*m-c*g)+h*(l*p-c*f),e[9]=-(r*(f*m-p*g)-u*(n*m-i*g)+h*(n*p-i*f)),e[10]=r*(l*m-c*g)-o*(n*m-i*g)+h*(n*c-i*l),e[11]=-(r*(l*p-c*f)-o*(n*p-i*f)+u*(n*c-i*l)),e[12]=-(o*(f*v-d*g)-u*(l*v-s*g)+h*(l*d-s*f)),e[13]=r*(f*v-d*g)-u*(n*v-a*g)+h*(n*d-a*f),e[14]=-(r*(l*v-s*g)-o*(n*v-a*g)+h*(n*s-a*l)),e[15]=r*(l*d-s*f)-o*(n*d-a*f)+u*(n*s-a*l),e}},{}],32:[function(e,t,r){t.exports=function(e){var t=new Float32Array(16);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}},{}],33:[function(e,t,r){t.exports=function(e,t){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}},{}],34:[function(e,t,r){t.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],35:[function(e,t,r){t.exports=function(e){var t=e[0],r=e[1],n=e[2],a=e[3],i=e[4],o=e[5],l=e[6],s=e[7],c=e[8],u=e[9],f=e[10],d=e[11],p=e[12],h=e[13],g=e[14],v=e[15];return(t*o-r*i)*(f*v-d*g)-(t*l-n*i)*(u*v-d*h)+(t*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)}},{}],36:[function(e,t,r){t.exports=function(e,t){var r=t[0],n=t[1],a=t[2],i=t[3],o=r+r,l=n+n,s=a+a,c=r*o,u=n*o,f=n*l,d=a*o,p=a*l,h=a*s,g=i*o,v=i*l,m=i*s;return e[0]=1-f-h,e[1]=u+m,e[2]=d-v,e[3]=0,e[4]=u-m,e[5]=1-c-h,e[6]=p+g,e[7]=0,e[8]=d+v,e[9]=p-g,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],37:[function(e,t,r){t.exports=function(e,t,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(t),a=Math.cos(t),i=1-a,e[0]=o*o*i+a,e[1]=l*o*i+s*n,e[2]=s*o*i-l*n,e[3]=0,e[4]=o*l*i-s*n,e[5]=l*l*i+a,e[6]=s*l*i+o*n,e[7]=0,e[8]=o*s*i+l*n,e[9]=l*s*i-o*n,e[10]=s*s*i+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],38:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[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 e[0]=1-(p+g),e[1]=f+y,e[2]=d-m,e[3]=0,e[4]=f-y,e[5]=1-(u+g),e[6]=h+v,e[7]=0,e[8]=d+m,e[9]=h-v,e[10]=1-(u+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},{}],39:[function(e,t,r){t.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],40:[function(e,t,r){t.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}},{}],41:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],42:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],43:[function(e,t,r){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],44:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var l=1/(r-t),s=1/(a-n),c=1/(i-o);return e[0]=2*i*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*i*s,e[6]=0,e[7]=0,e[8]=(r+t)*l,e[9]=(a+n)*s,e[10]=(o+i)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*i*2*c,e[15]=0,e}},{}],45:[function(e,t,r){t.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},{}],46:[function(e,t,r){t.exports={create:e("./create"),clone:e("./clone"),copy:e("./copy"),identity:e("./identity"),transpose:e("./transpose"),invert:e("./invert"),adjoint:e("./adjoint"),determinant:e("./determinant"),multiply:e("./multiply"),translate:e("./translate"),scale:e("./scale"),rotate:e("./rotate"),rotateX:e("./rotateX"),rotateY:e("./rotateY"),rotateZ:e("./rotateZ"),fromRotation:e("./fromRotation"),fromRotationTranslation:e("./fromRotationTranslation"),fromScaling:e("./fromScaling"),fromTranslation:e("./fromTranslation"),fromXRotation:e("./fromXRotation"),fromYRotation:e("./fromYRotation"),fromZRotation:e("./fromZRotation"),fromQuat:e("./fromQuat"),frustum:e("./frustum"),perspective:e("./perspective"),perspectiveFromFieldOfView:e("./perspectiveFromFieldOfView"),ortho:e("./ortho"),lookAt:e("./lookAt"),str:e("./str")}},{"./adjoint":31,"./clone":32,"./copy":33,"./create":34,"./determinant":35,"./fromQuat":36,"./fromRotation":37,"./fromRotationTranslation":38,"./fromScaling":39,"./fromTranslation":40,"./fromXRotation":41,"./fromYRotation":42,"./fromZRotation":43,"./frustum":44,"./identity":45,"./invert":47,"./lookAt":48,"./multiply":49,"./ortho":50,"./perspective":51,"./perspectiveFromFieldOfView":52,"./rotate":53,"./rotateX":54,"./rotateY":55,"./rotateZ":56,"./scale":57,"./str":58,"./translate":59,"./transpose":60}],47:[function(e,t,r){t.exports=function(e,t){var r=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],g=t[13],v=t[14],m=t[15],y=r*l-n*o,b=r*s-a*o,x=r*c-i*o,_=n*s-a*l,w=n*c-i*l,M=a*c-i*s,k=u*g-f*h,T=u*v-d*h,A=u*m-p*h,S=f*v-d*g,L=f*m-p*g,P=d*m-p*v,C=y*P-b*L+x*S+_*A-w*T+M*k;if(!C)return null;return C=1/C,e[0]=(l*P-s*L+c*S)*C,e[1]=(a*L-n*P-i*S)*C,e[2]=(g*M-v*w+m*_)*C,e[3]=(d*w-f*M-p*_)*C,e[4]=(s*A-o*P-c*T)*C,e[5]=(r*P-a*A+i*T)*C,e[6]=(v*x-h*M-m*b)*C,e[7]=(u*M-d*x+p*b)*C,e[8]=(o*L-l*A+c*k)*C,e[9]=(n*A-r*L-i*k)*C,e[10]=(h*w-g*x+m*y)*C,e[11]=(f*x-u*w-p*y)*C,e[12]=(l*T-o*S-s*k)*C,e[13]=(r*S-n*T+a*k)*C,e[14]=(g*b-h*_-v*y)*C,e[15]=(u*_-f*b+d*y)*C,e}},{}],48:[function(e,t,r){var n=e("./identity");t.exports=function(e,t,r,a){var i,o,l,s,c,u,f,d,p,h,g=t[0],v=t[1],m=t[2],y=a[0],b=a[1],x=a[2],_=r[0],w=r[1],M=r[2];if(Math.abs(g-_)<1e-6&&Math.abs(v-w)<1e-6&&Math.abs(m-M)<1e-6)return n(e);f=g-_,d=v-w,p=m-M,h=1/Math.sqrt(f*f+d*d+p*p),i=b*(p*=h)-x*(d*=h),o=x*(f*=h)-y*p,l=y*d-b*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 e[0]=i,e[1]=s,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=d,e[7]=0,e[8]=l,e[9]=u,e[10]=p,e[11]=0,e[12]=-(i*g+o*v+l*m),e[13]=-(s*g+c*v+u*m),e[14]=-(f*g+d*v+p*m),e[15]=1,e}},{"./identity":45}],49:[function(e,t,r){t.exports=function(e,t,r){var n=t[0],a=t[1],i=t[2],o=t[3],l=t[4],s=t[5],c=t[6],u=t[7],f=t[8],d=t[9],p=t[10],h=t[11],g=t[12],v=t[13],m=t[14],y=t[15],b=r[0],x=r[1],_=r[2],w=r[3];return e[0]=b*n+x*l+_*f+w*g,e[1]=b*a+x*s+_*d+w*v,e[2]=b*i+x*c+_*p+w*m,e[3]=b*o+x*u+_*h+w*y,b=r[4],x=r[5],_=r[6],w=r[7],e[4]=b*n+x*l+_*f+w*g,e[5]=b*a+x*s+_*d+w*v,e[6]=b*i+x*c+_*p+w*m,e[7]=b*o+x*u+_*h+w*y,b=r[8],x=r[9],_=r[10],w=r[11],e[8]=b*n+x*l+_*f+w*g,e[9]=b*a+x*s+_*d+w*v,e[10]=b*i+x*c+_*p+w*m,e[11]=b*o+x*u+_*h+w*y,b=r[12],x=r[13],_=r[14],w=r[15],e[12]=b*n+x*l+_*f+w*g,e[13]=b*a+x*s+_*d+w*v,e[14]=b*i+x*c+_*p+w*m,e[15]=b*o+x*u+_*h+w*y,e}},{}],50:[function(e,t,r){t.exports=function(e,t,r,n,a,i,o){var l=1/(t-r),s=1/(n-a),c=1/(i-o);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*l,e[13]=(a+n)*s,e[14]=(o+i)*c,e[15]=1,e}},{}],51:[function(e,t,r){t.exports=function(e,t,r,n,a){var i=1/Math.tan(t/2),o=1/(n-a);return e[0]=i/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(a+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*a*n*o,e[15]=0,e}},{}],52:[function(e,t,r){t.exports=function(e,t,r,n){var a=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),l=Math.tan(t.rightDegrees*Math.PI/180),s=2/(o+l),c=2/(a+i);return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(o-l)*s*.5,e[9]=(a-i)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}},{}],53:[function(e,t,r){t.exports=function(e,t,r,n){var a,i,o,l,s,c,u,f,d,p,h,g,v,m,y,b,x,_,w,M,k,T,A,S,L=n[0],P=n[1],C=n[2],D=Math.sqrt(L*L+P*P+C*C);if(Math.abs(D)<1e-6)return null;L*=D=1/D,P*=D,C*=D,a=Math.sin(r),i=Math.cos(r),o=1-i,l=t[0],s=t[1],c=t[2],u=t[3],f=t[4],d=t[5],p=t[6],h=t[7],g=t[8],v=t[9],m=t[10],y=t[11],b=L*L*o+i,x=P*L*o+C*a,_=C*L*o-P*a,w=L*P*o-C*a,M=P*P*o+i,k=C*P*o+L*a,T=L*C*o+P*a,A=P*C*o-L*a,S=C*C*o+i,e[0]=l*b+f*x+g*_,e[1]=s*b+d*x+v*_,e[2]=c*b+p*x+m*_,e[3]=u*b+h*x+y*_,e[4]=l*w+f*M+g*k,e[5]=s*w+d*M+v*k,e[6]=c*w+p*M+m*k,e[7]=u*w+h*M+y*k,e[8]=l*T+f*A+g*S,e[9]=s*T+d*A+v*S,e[10]=c*T+p*A+m*S,e[11]=u*T+h*A+y*S,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e}},{}],54:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[4],o=t[5],l=t[6],s=t[7],c=t[8],u=t[9],f=t[10],d=t[11];t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[4]=i*a+c*n,e[5]=o*a+u*n,e[6]=l*a+f*n,e[7]=s*a+d*n,e[8]=c*a-i*n,e[9]=u*a-o*n,e[10]=f*a-l*n,e[11]=d*a-s*n,e}},{}],55:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],l=t[2],s=t[3],c=t[8],u=t[9],f=t[10],d=t[11];t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e[0]=i*a-c*n,e[1]=o*a-u*n,e[2]=l*a-f*n,e[3]=s*a-d*n,e[8]=i*n+c*a,e[9]=o*n+u*a,e[10]=l*n+f*a,e[11]=s*n+d*a,e}},{}],56:[function(e,t,r){t.exports=function(e,t,r){var n=Math.sin(r),a=Math.cos(r),i=t[0],o=t[1],l=t[2],s=t[3],c=t[4],u=t[5],f=t[6],d=t[7];t!==e&&(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]);return e[0]=i*a+c*n,e[1]=o*a+u*n,e[2]=l*a+f*n,e[3]=s*a+d*n,e[4]=c*a-i*n,e[5]=u*a-o*n,e[6]=f*a-l*n,e[7]=d*a-s*n,e}},{}],57:[function(e,t,r){t.exports=function(e,t,r){var n=r[0],a=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},{}],58:[function(e,t,r){t.exports=function(e){return"mat4("+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]+")"}},{}],59:[function(e,t,r){t.exports=function(e,t,r){var n,a,i,o,l,s,c,u,f,d,p,h,g=r[0],v=r[1],m=r[2];t===e?(e[12]=t[0]*g+t[4]*v+t[8]*m+t[12],e[13]=t[1]*g+t[5]*v+t[9]*m+t[13],e[14]=t[2]*g+t[6]*v+t[10]*m+t[14],e[15]=t[3]*g+t[7]*v+t[11]*m+t[15]):(n=t[0],a=t[1],i=t[2],o=t[3],l=t[4],s=t[5],c=t[6],u=t[7],f=t[8],d=t[9],p=t[10],h=t[11],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]=n*g+l*v+f*m+t[12],e[13]=a*g+s*v+d*m+t[13],e[14]=i*g+c*v+p*m+t[14],e[15]=o*g+u*v+h*m+t[15]);return e}},{}],60:[function(e,t,r){t.exports=function(e,t){if(e===t){var r=t[1],n=t[2],a=t[3],i=t[6],o=t[7],l=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=i,e[11]=t[14],e[12]=a,e[13]=o,e[14]=l}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},{}],61:[function(e,t,r){(function(r){(function(){"use strict";var n,a=e("is-browser");n="function"==typeof r.matchMedia?!r.matchMedia("(hover: none)").matches:a,t.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"is-browser":63}],62:[function(e,t,r){"use strict";var n=e("is-browser");t.exports=n&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return e}()},{"is-browser":63}],63:[function(e,t,r){t.exports=!0},{}],64:[function(e,t,r){"use strict";t.exports=i,t.exports.isMobile=i,t.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(e){e||(e={});var t=e.ua;if(t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!=typeof t)return!1;var r=e.tablet?a.test(t):n.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(r=!0),r}},{}],65:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},{}],66:[function(e,t,r){var n={left:0,top:0};t.exports=function(e,t,r){t=t||e.currentTarget||e.srcElement,Array.isArray(r)||(r=[0,0]);var a=e.clientX||0,i=e.clientY||0,o=(l=t,l===window||l===document||l===document.body?n:l.getBoundingClientRect());var l;return r[0]=a-o.left,r[1]=i-o.top,r}},{}],67:[function(e,t,r){(function(e,r){(function(){ /*! Native Promise Only v0.8.1 (c) Kyle Simpson MIT License: http://getify.mit-license.org @@ -21,4 +21,4 @@ object-assign * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,a=e("./lib/build-log"),i=e("./lib/epsilon"),o=e("./lib/intersecter"),l=e("./lib/segment-chainer"),s=e("./lib/segment-selector"),c=e("./lib/geojson"),u=!1,f=i();function d(e,t,r){var a=n.segments(e),i=n.segments(t),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(e){return!0===e?u=a():!1===e&&(u=!1),!1!==u&&u.list},epsilon:function(e){return f.epsilon(e)},segments:function(e){var t=o(!0,f,u);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:o(!1,f,u).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,u),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,u),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,u),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,u),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,u),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:l(e.segments,f,u),inverted:e.inverted}},polygonFromGeoJSON:function(e){return c.toPolygon(n,e)},polygonToGeoJSON:function(e){return c.fromPolygon(n,f,e)},union:function(e,t){return d(e,t,n.selectUnion)},intersect:function(e,t){return d(e,t,n.selectIntersect)},difference:function(e,t){return d(e,t,n.selectDifference)},differenceRev:function(e,t){return d(e,t,n.selectDifferenceRev)},xor:function(e,t){return d(e,t,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),t.exports=n},{"./lib/build-log":72,"./lib/epsilon":73,"./lib/geojson":74,"./lib/intersecter":75,"./lib/segment-chainer":77,"./lib/segment-selector":78}],72:[function(e,t,r){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}},{}],73:[function(e,t,r){t.exports=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var a=r[0],i=r[1],o=n[0],l=n[1],s=t[0];return(o-a)*(t[1]-i)-(l-i)*(s-a)>=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],74:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(e)(b=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(e)b=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=b?!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 x=d.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(x.prev)&&l.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":79,timers:80}],81:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(S[e])e=S[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:I(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,g=t.b,a={r:255*P(p,255),g:255*P(h,255),b:255*P(g,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=E(t.s),c=E(t.v),a=function(t,r,n){t=6*P(t,360),r=P(r,100),n=P(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=E(t.s),u=E(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=P(e,360),t=P(t,100),r=P(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=C(i),{ok:f,format:t.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}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=P(e,255),t=P(t,255),r=P(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[R(i(e).toString(16)),R(i(t).toString(16)),R(i(r).toString(16)),R(N(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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*P(this._r,255))+"%",g:i(100*P(this._g,255))+"%",b:i(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%)":"rgba("+i(100*P(this._r,255))+"%, "+i(100*P(this._g,255))+"%, "+i(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,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(x,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,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(M,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=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"},L=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function D(e){return o(1,l(0,e))}function O(e){return parseInt(e,16)}function R(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function N(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return O(e)/255}var z,F,j,B=(F="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",j="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],82:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):n((e=e||self).topojson=e.topojson||{})}(this,(function(e){"use strict";function t(e){return e}function r(e){if(null==e)return t;var r,n,a=e.scale[0],i=e.scale[1],o=e.translate[0],l=e.translate[1];return function(e,t){t||(r=n=0);var s=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*a+o,u[1]=(n+=e[1])*i+l;so&&(o=e[0]),e[1]l&&(l=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":s(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(s)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,s=e.length;++ro&&(o=t[0]),t[1]l&&(l=t[1])})),e.objects)c(e.objects[t]);return[a,i,o,l]}function a(e,t){var r=t.id,n=t.bbox,a=null==t.properties?{}:t.properties,o=i(e,t);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(e,t){var n=r(e.transform),a=e.arcs;function i(e,t){t.length&&t.pop();for(var r=a[e<0?~e:e],i=0,o=r.length;i1)n=s(e,t,r);else for(a=0,n=new Array(i=e.arcs.length);a1)for(var i,l,c=1,u=s(a[0]);cu&&(l=a[0],a[0]=a[c],a[c]=l,u=i);return a})).filter((function(e){return e.length>0}))}}function u(e,t){for(var r=0,n=e.length;r>>1;e[a]=2))throw new Error("n must be \u22652");var r,a=(s=e.bbox||n(e))[0],i=s[1],o=s[2],l=s[3];t={scale:[o-a?(o-a)/(r-1):1,l-i?(l-i)/(r-1):1],translate:[a,i]}}var s,c,u=f(t),d=e.objects,p={};function h(e){return u(e)}function g(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(g)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in d)p[c]=g(d[c]);return{type:"Topology",bbox:s,transform:t,objects:p,arcs:e.arcs.map((function(e){var t,r=0,n=1,a=e.length,i=new Array(a);for(i[0]=u(e[0],0);++r2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(g>>5&15)-1,(31&g)+l);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var g=h&1<<12-p?30:29;if(s>13;!v||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":97,"object-assign":68}],86:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":97,"object-assign":68}],87:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":97,"object-assign":68}],88:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":97,"object-assign":68}],89:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":97,"object-assign":68}],90:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":97,"object-assign":68}],91:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":97,"object-assign":68}],92:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":97,"object-assign":68}],94:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":97,"object-assign":68}],95:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":97,"object-assign":68}],96:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":97,"object-assign":68}],97:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":68}],98:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},b=function(e,r){var n=y(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(T).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=l[0].length,parseInt(l[0],10)},x=this,_=function(){if("function"==typeof s){y("m");var e=s.call(x,t.substring(T));return T+=e.length,e}return b("m")},w=function(e,r,n,i){for(var o=y(e,i)?n:r,l=0;l-1){p=1,h=g;for(var L=this.daysInMonth(d,p);h>L;L=this.daysInMonth(d,p))p++,h-=L}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":97,"object-assign":68}],99:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],100:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":234,"../../plot_api/plot_template":297,"../../plots/cartesian/constants":315,"../../plots/font_attributes":336,"./arrow_paths":99}],101:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var b=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),x=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":260,"../../plots/cartesian/axes":308,"./draw":106}],102:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,W=["x","y"],J=0;J1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),X=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===de;"x"===te?(Q=t[te],X=he?ae._offset+ae._length*Q:X=M.l+M.w*Q):(Q=1-t[te],X=he?ae._offset+ae._length*Q:X=M.t+M.h*Q),$=t.showarrow?.5:Q}if(t.showarrow){fe.head=X;var ge=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var ve=s.getRefType(ne);"domain"===ve?("y"===te&&(ge=1-ge),fe.tail=ae._offset+ae._length*ge):"paper"===ve?"y"===te?(ge=1-ge,fe.tail=M.t+M.h*ge):fe.tail=M.l+M.w*ge:fe.tail=ae._offset+ae.r2p(ge),K=ee}else fe.tail=X+ge,K=ee+ge;fe.text=fe.tail+ee;var me=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,me-1)),"pixel"===ne){var ye=-Math.max(fe.tail-3,fe.text),be=Math.min(fe.tail+3,fe.text)-me;ye>0?(fe.tail+=ye,fe.text+=ye):be>0&&(fe.tail-=be,fe.text-=be)}fe.tail+=ue,fe.head+=ue}else K=ee=se*U($,ce),fe.text=X+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)I.remove();else{var xe=0,_e=0;if("left"!==t.align&&(xe=(T-x)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(N-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+xe-1,y:j+_e}).call(u.setClipUrl,H?C:null,e);else{var we=j+_e-g.top,Me=j+xe-g.left;q.call(d.positionText,Me,we).call(u.setClipUrl,H?C:null,e)}Y.select("rect").call(u.setRect,j,j,T,N),B.call(u.setRect,z/2,z/2,F-z,G-z),I.call(u.setTranslate,Math.round(P.x.text-F/2),Math.round(P.y.text-G/2)),R.attr({transform:"rotate("+D+","+P.x.text+","+P.y.text+")"});var ke,Te=function(r,n){O.selectAll(".annotation-arrow-g").remove();var s=P.x.head,f=P.y.head,d=P.x.tail+r,p=P.y.tail+n,g=P.x.text+r,x=P.y.text+n,_=o.rotationXYMatrix(D,g,x),w=o.apply2DTransform(_),T=o.apply2DTransform2(_),C=+B.attr("width"),E=+B.attr("height"),N=g-.5*C,z=N+C,F=x-.5*E,j=F+E,H=[[N,F,N,j],[N,j,z,j],[z,j,z,F],[z,F,N,F]].map(T);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var Y=t.arrowwidth,G=t.arrowcolor,U=t.arrowside,q=O.append("g").style({opacity:c.opacity(G)}).classed("annotation-arrow-g",!0),V=q.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",Y+"px").call(c.stroke,c.rgb(G));if(v(V,U,t),k.annotationPosition&&V.node().parentNode&&!i){var Z=s,W=f;if(t.standoff){var J=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Z+=t.standoff*(d-s)/J,W+=t.standoff*(p-f)/J}var X,K,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Z)+","+(p-W),transform:l(Z,W)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:Q.node(),gd:e,prepFn:function(){var e=u.getTranslate(I);X=e.x,K=e.y,m&&m.autorange&&A(m._name+".autorange",!0),b&&b.autorange&&A(b._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,K),a=n[0]+e,i=n[1]+r;I.call(u.setTranslate,a,i),S("x",y(m,e,"x",M,t)),S("y",y(b,r,"y",M,t)),t.axref===t.xref&&S("ax",y(m,e,"ax",M,t)),t.ayref===t.yref&&S("ay",y(b,r,"ay",M,t)),q.attr("transform",l(e,r)),R.attr({transform:"rotate("+D+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,L());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&Te(0,0),E)h.init({element:I.node(),gd:e,prepFn:function(){ke=R.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?S("ax",y(m,e,"ax",M,t)):S("ax",t.ax+e),t.ayref===t.yref?S("ay",y(b,r,"ay",M.w,t)):S("ay",t.ay+r),Te(e,r);else{if(i)return;var a,o;if(m)a=y(m,e,"x",M,t);else{var s=t._xsize/M.w,c=t.x+(t._xshift-t.xshift)/M.w-s/2;a=h.align(c+e/M.w,s,0,1,t.xanchor)}if(b)o=y(b,r,"y",M,t);else{var u=t._ysize/M.h,f=t.y-(t._yshift+t.yshift)/M.h-u/2;o=h.align(f-r/M.h,u,0,1,t.yanchor)}S("x",a),S("y",o),m&&b||(n=h.getCursor(m?.5:a,b?.5:o,t.xanchor,t.yanchor))}R.attr({transform:l(e,r)+ke}),p(I,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",V(n))},doneFn:function(){p(I),a.call("_guiRelayout",e,L());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=t.indexOf("end")>=0,x=h.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,M=o.y-u.y;if(d=(f=Math.atan2(M,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+M*M))return void E();if(x){if(x*x>w*w+M*M)return void E();var k=x*Math.cos(f),T=x*Math.sin(f);u.x+=k,u.y+=T,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+M*M)return void E();var A=_*Math.cos(f),S=_*Math.sin(f);o.x-=A,o.y-=S,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var L=p.getTotalLength(),C="";if(L1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":345,"../annotations/draw":106}],113:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).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()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var ce=Math.pow(10,Math.floor(Math.log(se)/Math.LN10));oe*=ce*c.roundUp(se/ce,[2,5,10]),(Math.abs(U.start)/U.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+O/I.h,re+K-O/I.h]:[re+D/I.w,re+K-D/I.w],ae.setScale(),e.attr("transform",u(Math.round(I.l),Math.round(I.t)));var ue,fe=e.select("."+T.cbtitleunshift).attr("transform",u(-Math.round(I.l),-Math.round(I.t))),de=ae.ticklabelposition,pe=ae.title.font.size,he=e.select("."+T.cbaxis),ge=0,ve=0;function me(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:N._dfltTitle.colorbar,containerGroup:e.select("."+T.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===B&&(e=D+I.l+I.w*R,t=O+I.t+I.h*(1-re-K)+3+.75*pe),"bottom"===B&&(e=D+I.l+I.w*R,t=O+I.t+I.h*(1-re)-3-.25*pe),"right"===B&&(t=O+I.t+I.h*E+3+.75*pe,e=D+I.l+I.w*re),me(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,s=e.select("."+T.cbtitle),f=s.select("text"),d=[-A/2,A/2],h=s.select(".h"+ae._id+"title-math-group").node(),g=15.6;if(f.node()&&(g=parseInt(f.node().style.fontSize,10)*w),h?(i=p.bBox(h),ve=i.width,(ge=i.height)>g&&(d[1]-=(ge-g)/2)):f.node()&&!f.classed(T.jsPlaceholder)&&(i=p.bBox(f.node()),ve=i.width,ge=i.height),o){if(ge){if(ge+=5,"top"===B)ae.domain[1]-=ge/I.h,d[1]*=-1;else{ae.domain[0]+=ge/I.h;var m=v.lineCount(f);d[1]+=(1-m)*g}s.attr("transform",u(d[0],d[1])),ae.setScale()}}else ve&&("right"===B&&(ae.domain[0]+=(ve+pe/2)/I.w),s.attr("transform",u(d[0],d[1])),ae.setScale())}e.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",o?u(0,Math.round(I.h*(1-ae.domain[1]))):u(Math.round(I.w*ae.domain[0]),0)),he.attr("transform",o?u(0,Math.round(-I.t)):u(Math.round(-I.l),0));var y=e.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(V);y.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),y.exit().remove();var b=H.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var l=[0===i?H[0]:(V[i]+V[i-1])/2,i===V.length-1?H[1]:(V[i]+V[i+1])/2].map(ae.c2p).map(Math.round);o&&(l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,b[0],b[1]));var s=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(l)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(l)-n.min(l),2));if(t._fillgradient)p.gradient(s,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=G(e).replace("e-","");s.attr("fill",a(u).toHexString())}}));var x=e.select("."+T.cblines).selectAll("path."+T.cbline).data(F.color&&F.width?Z:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(e){var t=Q,r=Math.round(ae.c2p(e))+F.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+W).call(p.lineGroupStyle,F.width,Y(e),F.dash)})),he.selectAll("g."+ae._id+"tick,path").remove();var _=Q+W+(A||0)/2-("outside"===t.ticks?1:0),M=l.calcTicks(ae),k=l.getTickSigns(ae)[2];return l.drawTicks(r,ae,{vals:"inside"===ae.ticks?l.clipEnds(ae,M):M,layer:he,path:l.makeTickPath(ae,_,k),transFn:l.makeTransTickFn(ae)}),l.drawLabels(r,ae,{vals:M,layer:he,transFn:l.makeTransTickLabelFn(ae),labelFns:l.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,l=ae._offset+ae._length/2;if("right"===B)a=l,e=I.l+I.w*i+10+pe*(ae.showticklabels?1:.5);else if(e=l,"bottom"===B&&(a=I.t+I.h*i+10+(-1===de.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===B){var s=j.text.split("
").length;a=I.t+I.h*i+10-W-w*pe*s}me((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:B,offsetTop:o?0:I.t,offsetLeft:o?I.l:0,maxShift:o?N.width:N.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,l=W+A/2;-1===de.indexOf("inside")&&(n=p.bBox(he.node()),l+=o?n.width:n.height),ue=fe.select("text");var c=0,f=o&&"top"===B,g=!o&&"right"===B,v=0;if(ue.node()&&!ue.classed(T.jsPlaceholder)){var y,b=fe.select(".h"+ae._id+"title-math-group").node();b&&(o&&ie||!o&&!ie)?(c=(n=p.bBox(b)).width,y=n.height):(c=(n=p.bBox(fe.node())).right-I.l-(o?Q:ne),y=n.bottom-I.t-(o?ne:Q),o||"top"!==B||(l+=n.height,v=n.height)),g&&(ue.attr("transform",u(c/2+pe/2,0)),c*=2),l=Math.max(l,o?c:y)}var x=2*(o?D:O)+l+S+A/2,w=0;!o&&j.text&&"bottom"===P&&E<=0&&(x+=w=x/2,v+=w),N._hColorbarMoveTitle=w,N._hColorbarMoveCBTitle=v;var z=S+A;e.select("."+T.cbbg).attr("x",(o?Q:ne)-z/2-(o?D:0)).attr("y",(o?ne:Q)-(o?X:O+v-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(X+z,2)).call(h.fill,L).call(h.stroke,t.bordercolor).style("stroke-width",S);var F=g?Math.max(c-10,0):0;if(e.selectAll("."+T.cboutline).attr("x",(o?Q:ne+D)+F).attr("y",(o?ne+O-X:Q)+(f?ge:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(X-(o?2*O+ge:2*D+F),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(I.l-(o?$*x:0),I.t-(o?0:(1-ee)*x-v))),!o&&(S||a(L).getAlpha()&&!a.equals(N.paper_bgcolor,L))){var H=he.selectAll("text"),Y=H[0].length,G=e.select("."+T.cbbg).node(),U=p.bBox(G),q=p.getTranslate(e);H.each((function(e,t){var r=Y-1;if(0===t||t===r){var n,a=p.bBox(this),i=p.getTranslate(this);if(t===r){var o=a.right+i.x;(n=U.right+q.x+ne-S-2+R-o)>0&&(n=0)}else if(0===t){var l=a.left+i.x;(n=U.left+q.x+ne+S+2-l)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var V={},Z=M[C],J=k[C],K=M[P],te=k[P],re=x-W;o?("pixels"===d?(V.y=E,V.t=X*K,V.b=X*te):(V.t=V.b=0,V.yt=E+s*K,V.yb=E-s*te),"pixels"===_?(V.x=R,V.l=x*Z,V.r=x*J):(V.l=re*Z,V.r=re*J,V.xl=R-m*Z,V.xr=R+m*J)):("pixels"===d?(V.x=R,V.l=X*Z,V.r=X*J):(V.l=V.r=0,V.xl=R+s*Z,V.xr=R-s*J),"pixels"===_?(V.y=1-E,V.t=x*K,V.b=x*te):(V.t=re*K,V.b=re*te,V.yt=E-m*K,V.yb=E+m*te)),i.autoMargin(r,t._id,V)}],r)}(r,t,e);m&&m.then&&(e._promises||[]).push(m),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l="v"===t.orientation,c=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align((l?t._uFrac:t._vFrac)+r/c.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=s.align((l?t._vFrac:1-t._uFrac)-o/c.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var f=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,f)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":233,"../../lib":260,"../../lib/extend":252,"../../lib/setcursor":280,"../../lib/svg_text_utils":283,"../../plots/cartesian/axes":308,"../../plots/cartesian/axis_defaults":310,"../../plots/cartesian/layout_attributes":321,"../../plots/cartesian/position_defaults":324,"../../plots/plots":348,"../../registry":351,"../color":117,"../colorscale/helpers":128,"../dragelement":136,"../drawing":139,"../titles":226,"./constants":119,"@plotly/d3":11,tinycolor2:81}],122:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":260}],123:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":118,"./defaults":120,"./draw":121,"./has_colorbar":122}],124:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",g=i+"max",v=i+"mid",m=(l(d+p),l(d+h),l(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(b.color.anim=!0)),b[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),t.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":276,"../../lib/sort_object_keys":281,"../colorbar/attributes":118,"./scales.js":132}],125:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":260,"./helpers":128,"fast-isnumeric":30}],126:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],134:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":260}],135:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],136:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,b=e.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":260,"../../plots/cartesian/constants":315,"./align":133,"./cursor":134,"./unhover":137,"has-hover":61,"has-passive-events":62,"mouse-event-offset":66}],137:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":250,"../../lib/events":251,"../../lib/throttle":284,"../fx/constants":151}],138:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],139:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,g=e("../../constants/interactions").DESELECTDIM,v=e("../../traces/scatter/subtypes"),m=e("../../traces/scatter/make_bubble_size_func"),y=e("../../components/fx/helpers").appendArrayPointValue,b=t.exports={};function x(e,t,r){var n=t.fillpattern,a=n&&b.getPatternAttr(n.shape,0,"");if(a){var i=b.getPatternAttr(n.bgcolor,0,null),o=b.getPatternAttr(n.fgcolor,0,null),l=n.fgopacity,s=b.getPatternAttr(n.size,0,8),u=b.getPatternAttr(n.solidity,0,.3),f=t.uid;b.pattern(e,"point",r,f,a,s,u,void 0,n.fillmode,i,o,l)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}b.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},b.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},b.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},b.setRect=function(e,t,r,n,a){e.call(b.setPosition,t,r).call(b.setSize,n,a)},b.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},b.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);b.translatePoint(e,a,t,r)}))},b.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},b.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){b.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},b.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},b.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),b.dashLine(t,l,o)},b.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(b.dashLine,l,o)}))},b.dashLine=function(e,t,r){r=+r||0,t=b.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},b.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},b.singleFillStyle=function(e,t){var r=n.select(e.node());x(e,((r.data()[0]||[])[0]||{}).trace||{},t)},b.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&x(r,e[0].trace,t)}))};var _=e("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolBackOffs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;b.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),b.symbolNames[r]=e,b.symbolFuncs[r]=t.f,b.symbolBackOffs[r]=t.backoff||0,t.needLine&&(b.symbolNeedLines[r]=!0),t.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(b.symbolNoFill[r]=!0)}));var w=b.symbolNames.length;function M(e,t,r,n){var a=e%100;return b.symbolFuncs[a](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=b.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var k={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},A=i("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=S[i],d=new Array(u),p=0;p=100;var f=re(e,r),d=q(e,r);t.attr("d",M(u,s,f,d))}var p,h,g,v=!1;if(e.so)g=l.outlierwidth,h=l.outliercolor,p=o.outliercolor;else{var m=(l||{}).width;g=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,v=!0),p="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,p).style({"stroke-width":(g||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:g)+"px");var y=o.gradient,x=e.mgt;x?v=!0:x=y&&y.type,a.isArrayOrTypedArray(x)&&(x=x[0],S[x]||(x=0));var _=o.pattern,w=_&&b.getPatternAttr(_.shape,e.i,"");if(x&&"none"!==x){var k=e.mgc;k?v=!0:k=y.color;var T=r.uid;v&&(T+="-"+e.i),b.gradient(t,i,T,x,[[0,k],[1,p]],"fill")}else if(w){var A=b.getPatternAttr(_.bgcolor,e.i,null),L=b.getPatternAttr(_.fgcolor,e.i,null),C=_.fgopacity,P=b.getPatternAttr(_.size,e.i,8),D=b.getPatternAttr(_.solidity,e.i,.3),O=e.mcc||a.isArrayOrTypedArray(_.shape)||a.isArrayOrTypedArray(_.bgcolor)||a.isArrayOrTypedArray(_.size)||a.isArrayOrTypedArray(_.solidity),R=r.uid;O&&(R+="-"+e.i),b.pattern(t,"point",i,R,w,P,D,e.mcc,_.fillmode,A,L,C)}else c.fill(t,p);g&&c.stroke(t,h)}},b.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=b.tryColorscale(r,""),t.lineScale=b.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=v.isBubble(e)?m(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,b.makeSelectedPointStyleFns(e)),t},b.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:g*t});var h=i.color,v=o.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?v||t:m||t});var y=i.size,b=o.size,x=l.size,_=void 0!==b,w=void 0!==x;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?b/2:t:w?x/2:t}),t},b.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,g))},t},b.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);e.attr("d",M(b.symbolNumber(i),o,re(n,t),q(n,t))),n.mrc2=o})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}b.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=b.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};y(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var g=e.tp||t.textposition,v=P(e,t),m=i?i(e):e.tc||t.textfont.color;o.call(b.font,e.tf||t.textfont.family,v,m).text(c).call(d.convertToTspans,r).call(C,g,v,e.mrc)}else o.remove()}))}},b.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=P(e,t);c.fill(a,i);var u=s.traceIs(t,"bar-like");C(a,o,l,e.mrc2||e.mrc,u)}))}};var D,O;function R(e,t,r){return r&&(e=j(e)),t?N(e[1]):E(e[0])}function E(e){var t=n.round(e,2);return D=t,t}function N(e){var t=n.round(e,2);return O=t,t}function I(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],l=r[1]-t[1],s=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+l*l,.25),u=(c*c*a-s*s*o)*n,f=(c*c*i-s*s*l)*n,d=3*c*(s+c),p=3*s*(s+c);return[[E(t[0]+(d&&u/d)),N(t[1]+(d&&f/d))],[E(t[0]-(p&&u/p)),N(t[1]-(p&&f/p))]]}b.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=c||x>=f&&x<=c)&&(_<=d&&_>=u||_>=d&&_<=u)&&(e=[x,_])}return e}b.steps=function(e){var t=z[e]||F;return function(e){for(var r="M"+E(e[0][0])+","+N(e[0][1]),n=e.length,a=1;a=1e4&&(b.savedBBoxes={},B=0),r&&(b.savedBBoxes[r]=v),B++,a.extendFlat({},v)},b.setClipUrl=function(e,t,r){e.attr("clip-path",Y(t,r))},b.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},b.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},b.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},b.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var G=/\s*sc.*/;b.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(G,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var U=/translate\([^)]*\)\s*$/;function q(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}b.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(U);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))},b.getMarkerStandoff=q;var V,Z,W,J,X,K,Q=Math.atan2,$=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*$(e)-n*ee(e),r*ee(e)+n*$(e)]}function re(e,t){var r,n,a=e.ma;void 0===a&&(a=t.marker.angle||0);var i=t.marker.angleref;if("previous"===i||"north"===i){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var s=t._xA,c=t._yA;if(!s||!c)return 90;r=s.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,f=e.lonlat[0],d=e.lonlat[1],p=t._geo.project([f,d+1e-5]),h=t._geo.project([f+1e-5,d]),g=Q(h[1]-n,h[0]-r),v=Q(p[1]-n,p[0]-r);if("north"===i)u=a/180*Math.PI;else if("previous"===i){var m=f/180*Math.PI,y=d/180*Math.PI,b=V/180*Math.PI,x=Z/180*Math.PI,_=b-m,w=$(x)*ee(_),M=ee(x)*$(y)-$(x)*ee(y)*$(_);u=-Q(w,M)-Math.PI,V=f,Z=d}var k=te(g,[$(u),0]),T=te(v,[ee(u),0]);a=Q(k[1]+T[1],k[0]+T[0])/Math.PI*180,"previous"!==i||K===t.uid&&e.i===X+1||(a=null)}if("previous"===i&&!t._geo)if(K===t.uid&&e.i===X+1&&o(r)&&o(n)){var A=r-W,S=n-J,L=t.line&&t.line.shape||"",C=L.slice(L.length-1);"h"===C&&(S=0),"v"===C&&(A=0),a+=Q(S,A)/Math.PI*180+90}else a=null}return W=r,J=n,X=e.i,K=t.uid,a}b.getMarkerAngle=re},{"../../components/fx/helpers":153,"../../constants/alignment":233,"../../constants/interactions":237,"../../constants/xmlns_namespaces":239,"../../lib":260,"../../lib/svg_text_utils":283,"../../registry":351,"../../traces/scatter/make_bubble_size_func":390,"../../traces/scatter/subtypes":398,"../color":117,"../colorscale":129,"./symbol_defs":140,"@plotly/d3":11,"fast-isnumeric":30,tinycolor2:81}],140:[function(e,t,r){"use strict";var n,a,i,o,l=e("parse-svg-path"),s=e("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,d=Math.cos,p=Math.sin;function h(e){return null===e}function g(e,t,r){if(!(e&&e%360!=0||t))return r;if(i===e&&o===t&&n===r)return a;function s(e,r){var n=d(e),a=p(e),i=r[0],o=r[1]+(t||0);return[i*n-o*a,i*a+o*n]}i=e,o=t,n=r;for(var c=e/180*f,u=0,h=0,g=l(r),v="",m=0;m0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.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=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.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":398,"../drawing":139,"@plotly/d3":11,"fast-isnumeric":30}],147:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":117,"@plotly/d3":11}],148:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":252,"../../plots/font_attributes":336,"./layout_attributes":158}],149:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||oe<0||oe>w[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,Y="xval"in t?m.flat(s,t.xval):m.p2c(_,ie),G="yval"in t?m.flat(s,t.yval):m.p2c(w,oe),!a(Y[0])||!a(G[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(q=0;qee&&(te.splice(0,ee),ce=te[0].distance),y&&0!==F&&0===te.length){$.distance=F,$.index=!1;var f=Z._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=F}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var g=h[0];a(g.x0)&&a(g.y0)&&(d=de(g),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>d.spikeDistance)&&(ne.vLinePoint=d))}var v=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(v.length){var b=v[0];a(b.x0)&&a(b.y0)&&(d=de(b),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>d.spikeDistance)&&(ne.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Me-1;Ae--)Pe(te[Ae]);te=Se,ve()}var De=e._hoverdata,Oe=[],Re=B(e),Ee=H(e);for(U=0;U1||te.length>1)||"closest"===D&&ae&&te.length>1,Ze=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),We=O(te,{gd:e,hovermode:D,rotateLabels:Ve,bgColor:Ze,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});m.isUnifiedHover(D)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?M:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var x=p[o];for(l=x.length-1;l>=0;l--){var _=x[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(We,Ve?"xa":"ya",u),E(We,Ve,u._invScaleX,u._invScaleY));if(l&&l.tagName){var Je=v.getComponentMethod("annotations","hasClickToShow")(e,Oe);f(n.select(l),Je?"pointer":"")}if(!l||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,De))return;De&&e.emit("plotly_unhover",{event:t,points:De});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:Y,yvals:G})}(e,t,r,i,l)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=B(a),o=H(a),l=O(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),g=e.trace;if(v.traceIs(g,"gl3d")){var m=a._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;u+=y,f+=y,d+=b,h+=b}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function O(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,g=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var M=t.fontFamily||y.HOVERFONT,k=t.fontSize||y.HOVERFONTSIZE,T=e[0],L=T.xa,C=T.ya,D=i.charAt(0),O=D+"Label",E=T[O];if(void 0===E&&"multicategory"===L.type)for(var N=0;Na.width-x?(v=a.width-x,t.attr("d","M"+(x-A)+",0L"+x+","+b+A+"v"+b+(2*S+y.height)+"H-"+x+"V"+b+A+"H"+(x-2*A)+"Z")):t.attr("d","M0,0L"+A+","+b+A+"H"+(S+y.width/2)+"v"+b+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+b+A+"H-"+A+"Z")}else{var _,P,D;"right"===C.side?(_="start",P=1,D="",v=L._offset+L._length):(_="end",P=-1,D="-",v=L._offset),m=C._offset+(T.y0+T.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+D+A+","+A+"V"+(S+y.height/2)+"h"+D+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+D+A+"V-"+A+"Z");var O,R=y.height/2,N=z-y.top-R,I="clip"+a._uid+"commonlabel"+C._id;if(v=0?le:se+fe=0?se:be+fe=0?ie:oe+de=0?oe:xe+de=0,"top"!==e.idealAlign&&q||!V?q?(O+=I/2,e.anchor="start"):e.anchor="middle":(O-=I/2,e.anchor="end");else if(e.pos=O,q=D+N/2+Z<=F,V=D-N/2-Z>=0,"left"!==e.idealAlign&&q||!V)if(q)D+=N/2,e.anchor="start";else{e.anchor="middle";var W=Z/2,J=D+W-F,X=D-W;J>0&&(D-=J),X<0&&(D+=-X)}else D-=N/2,e.anchor="end";w.attr("text-anchor",e.anchor),L&&T.attr("text-anchor",e.anchor),t.attr("transform",l(D,O)+(c?s(_):""))})),_e}function R(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=F(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(D,(function(t,r){return l=F(r,e.nameLength),""}))}return[s,l]}function E(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+S),p=f+c*(e.txwidth+S),h=0,g=e.offset,v="middle"===l;v&&(f-=e.tx2width/2,p+=e.txwidth/2+S),t&&(g*=-T,h=e.offset*k),r.select("path").attr("d",v?"M-"+i(e.bx/2+e.tx2width/2)+","+o(g-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+g)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(g-A)+"Z");var m=h+f,y=g+e.ty0-e.by/2+S,b=e.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==l?(a.attr("text-anchor","start"),m=v?-e.bx/2-e.tx2width/2+S:-e.bx-S):"right"===b&&"end"!==l&&(a.attr("text-anchor","end"),m=v?e.bx/2-e.tx2width/2-S:e.bx+S)),a.call(u.positionText,i(m),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*S+h),o(g+e.ty0-e.by/2+S)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(g-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function N(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:g.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:g.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=g.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+g.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=g.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+g.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function I(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,h)<1.5?p.contrast(h):y.color,w=a.spikemode,M=a.spikethickness,k=a.spikecolor||_,T=g.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),b=s.l+A*s.w,x=s.l+S*s.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:k,"stroke-dasharray":d.dashStyle(a.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==a.side?M:-M),cy:m,r:M,fill:k}).classed("spikeline",!0)}if(f){var L,C,P=t.vLinePoint;n=P&&P.xa,a=P&&P.ya,"cursor"===n.spikesnap?(L=c.pointerX,C=c.pointerY):(L=n._offset+P.x,C=a._offset+P.y);var D,O,R=i.readability(P.color,h)<1.5?p.contrast(h):P.color,E=n.spikemode,N=n.spikethickness,I=n.spikecolor||R,z=g.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(D=z,O=C),-1!==E.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),D=s.t+(1-j)*s.h,O=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:L,x2:L,y1:D,y2:O,"stroke-width":N,stroke:I,"stroke-dasharray":d.dashStyle(n.spikedash,N)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:L,x2:L,y1:D,y2:O,"stroke-width":N+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:L,cy:z-("top"!==n.side?N:-N),r:N,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function F(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),f=c[0],d=c[1],p=u[0],h=u[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},{"../../lib":260,"../../lib/events":251,"../../lib/override_cursor":271,"../../lib/svg_text_utils":283,"../../plots/cartesian/axes":308,"../../registry":351,"../color":117,"../dragelement":136,"../drawing":139,"../legend/defaults":169,"../legend/draw":170,"./constants":151,"./helpers":153,"@plotly/d3":11,"fast-isnumeric":30,tinycolor2:81}],155:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var l=t.legend;function s(e){o.font[e]||(o.font[e]=l?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),l?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":260,"../color":117,"./helpers":153}],156:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":260,"./layout_attributes":158}],157:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":260,"../dragelement":136,"./attributes":148,"./calc":149,"./click":150,"./constants":151,"./defaults":152,"./helpers":153,"./hover":154,"./layout_attributes":158,"./layout_defaults":159,"./layout_global_defaults":160,"@plotly/d3":11}],158:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":336,"./constants":151}],159:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":260,"./hoverlabel_defaults":155,"./hovermode_defaults":156,"./layout_attributes":158}],160:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":260,"./hoverlabel_defaults":155,"./layout_attributes":158}],161:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===k("pattern")&&(d=!0);v._hasSubplotGrid=d;var b,x,_="top to bottom"===k("roworder"),w=d?.2:.1,M=d?.3:.1;g&&t._splomGridDflt&&(b=t._splomGridDflt.xside,x=t._splomGridDflt.yside),v._domains={x:u("x",k,w,b,y),y:u("y",k,M,x,m,_)}}else delete t.grid}function k(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var b=d.subplots||[];s=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1===_&&(t.legend=void 0),(!1!==_||f.uirevision)&&(p("uirevision",t.uirevision),!1!==_)){p("bgcolor",t.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,M,k,T=a.coerceFont(p,"font",t.font),A="h"===p("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(M=1.1,k="bottom"):(M=-.1,k="top")):(w=1.02,M=1,k="auto"),p("traceorder",b),c.isGrouped(t.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",M),p("yanchor",k),p("valign"),a.noneOrAll(f,d,["x","y"]),p("title.text")){p("title.side",A?"left":"top");var S=a.extendFlat({},T,{size:a.bigFont(T.size)});a.coerceFont(p,"title.font",S)}}}},{"../../lib":260,"../../plot_api/plot_template":297,"../../plots/attributes":304,"../../plots/layout_attributes":346,"../../registry":351,"./attributes":167,"./helpers":173}],170:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),b=e("./style"),x=e("./helpers");function _(e,t,r){var n=e[0],a=n.width,i=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===i?t._maxWidth*o:r+(o||a)}function w(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function M(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").call(c.font,i).text(d?k(n,h):n);var v=r.itemwidth+2*p.itemGap;f.positionText(g,v,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(A,e,t,r).on("edit",(function(n){this.text(k(n,h)).call(A,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):A(g,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function T(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(t,r,e,o,n.event)}})))}function A(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*g;if(o){var v=c.bBox(o);u=v.height,d=v.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var m=e.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(u=h*y,d=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(m,s+p.titlePad,s+h);else{var x=2*p.itemGap+r.itemwidth;a.groupTitle&&(x=p.itemGap,d-=r.itemwidth),f.positionText(m,x,-h*((y-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function S(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=y(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&y(e.calcdata,t)}var g=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var k=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),C=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),P=a.ensureSingle(k,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));P.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var D=a.ensureSingle(k,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var R=a.ensureSingle(D,"text","legendtitletext");R.attr("text-anchor","start").call(c.font,O.font).text(O.text),A(R,D,e,t,1)}else D.selectAll(".legendtitletext").remove();var E=a.ensureSingle(k,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),N=D.selectAll("g.groups").data(l);N.enter().append("g").attr("class","groups"),N.exit().remove();var I=N.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==g.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(M,e,t)})).call(b,e,t).each((function(){h||n.select(this).call(T,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=x.isVertical(a),s=x.isGrouped(a),u="fraction"===a.entrywidthmode,f=a.borderwidth,d=2*f,h=p.itemGap,g=a.itemwidth+2*h,v=2*(f+h),m=L(a),y=a.y<0||0===a.y&&"top"===m,b=a.y>1||1===a.y&&"bottom"===m,w=a.tracegroupgap,M={};a._maxHeight=Math.max(y||b?i.height/2:o.h,30);var k=0;a._width=0,a._height=0;var T=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,f+T[0],f+T[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),k=g+a._width,a._width+=h+g+d,a._height+=v,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=S(a),C=a.x<0||0===a.x&&"right"===A,P=a.x>1||1===a.x&&"left"===A,D=b||y,O=i.width/2;a._maxWidth=Math.max(C?D&&"left"===A?o.l+o.w:O:P?D&&"right"===A?o.r+o.w:O:o.w,2*g);var R=0,E=0;r.each((function(e){var t=_(e,a,g);R=Math.max(R,t),E+=t})),k=null;var N=0;if(s){var I=0,z=0,F=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,a,g),i=r[0].height;c.setTranslate(this,T[0],T[1]+f+h+i/2+t),t+=i,e=Math.max(e,n),M[r[0].trace.legendgroup]=e}));var r=e+h;z>0&&r+f+z>a._maxWidth?(N=Math.max(N,z),z=0,F+=I+w,I=t):I=Math.max(I,t),c.setTranslate(this,z,F),z+=r})),a._width=Math.max(N,z)+f,a._height=F+I+v}else{var j=r.size(),B=E+d+(j-1)*h=a._maxWidth&&(N=Math.max(N,U),Y=0,G+=H,a._height+=H,H=0),c.setTranslate(this,T[0]+f+Y,T[1]+f+G+t/2+h),U=Y+r+h,Y+=n,H=Math.max(H,t)})),B?(a._width=Y+d,a._height=H+v):(a._width=Math.max(N,U)+d,a._height+=H+v)}}a._width=Math.ceil(Math.max(a._width+T[0],a._titleWidth+2*(f+p.titlePad))),a._height=Math.ceil(Math.max(a._height+T[1],a._titleHeight+2*(f+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var q=e._context.edits,V=q.legendText||q.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,i=e[0].trace.legendgroup,o=_(e,a,g);s&&""!==i&&(o=M[i]);var f=V?g:k||o;l||u||(f+=h/2),c.setRect(t,0,-r/2,f,r)}))}(e,N,I,t)},function(){var l,u,g,y,b=f._size,x=t.borderwidth;if(!h){if(function(e){var t=e._fullLayout.legend,r=S(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e))return;var _=b.l+b.w*t.x-v[S(t)]*t._width,M=b.t+b.h*(1-t.y)-v[L(t)]*t._effHeight;if(f.margin.autoexpand){var T=_,A=M;_=a.constrain(_,0,f.width-t._width),M=a.constrain(M,0,f.height-t._effHeight),_!==T&&a.log("Constrain legend.x to make legend fit inside graph"),M!==A&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(k,_,M)}if(E.on(".drag",null),k.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var O=t._effHeight;h&&(O=t._height),P.attr({width:t._width-x,height:O-x,x:x/2,y:x/2}),c.setTranslate(D,0,0),C.select("rect").attr({width:t._width-2*x,height:O-2*x,x:x,y:x}),c.setClipUrl(D,d,e),c.setRect(E,0,0,0,0),delete t._scrollY}else{var R,N,I,z=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-z-2*p.scrollBarMargin,j=t._height-t._effHeight,B=F/j,H=Math.min(t._scrollY||0,j);P.attr({width:t._width-2*x+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-x,x:x/2,y:x/2}),C.select("rect").attr({width:t._width-2*x+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*x,x:x,y:x+H}),c.setClipUrl(D,d,e),U(H,z,B),k.on("wheel",(function(){U(H=a.constrain(t._scrollY+n.event.deltaY/F*j,0,j),z,B),0!==H&&H!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(N="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,j)}(I,R,N),z,B))}));E.call(Y);var G=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(N=e.changedTouches[0].clientY,U(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,j)}(I,R,N),z,B))}));D.call(G)}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(D,0,-r),c.setRect(E,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),C.select("rect").attr("y",x+r)}e._context.edits.legendPosition&&(k.classed("cursor-move",!0),s.init({element:k.node(),gd:e,prepFn:function(){var e=c.getTranslate(k);g=e.x,y=e.y},moveFn:function(e,r){var n=g+e,a=y+r;c.setTranslate(k,n,a),l=s.align(n,0,b.l,b.l+b.w,t.xanchor),u=s.align(a,0,b.t+b.h,b.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&w(e,k,a,t,n)}}))}],e)}(e,t)}},{"../../constants/alignment":233,"../../lib":260,"../../lib/events":251,"../../lib/svg_text_utils":283,"../../plots/plots":348,"../../registry":351,"../color":117,"../dragelement":136,"../drawing":139,"./constants":168,"./get_legend_data":171,"./handle_click":172,"./helpers":173,"./style":175,"@plotly/d3":11}],171:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function g(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rT&&(k=T)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var m=t._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*p.itemGap)/2,_=o(x,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return y?n:Math.min(a,r)};function M(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),g=h.mid;void 0===g&&(g=(h.max+h.min)/2),p=l.tryColorscale(f,"")(g)}var m=p||i.mc||f.color,y=f.pattern,b=y&&l.getPatternAttr(y.shape,0,"");if(b){var x=l.getPatternAttr(y.bgcolor,0,null),_=l.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,k=v(y.size,8,10),T=v(y.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,b,k,T,p,y.fillmode,x,_,M)}else a.call(s.fill,m);o&&s.stroke(a,i.mlc||d.color)}))}function k(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(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)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,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",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,M(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){M(e,this,"funnel")})).each((function(e){M(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){k(e,this,"funnelarea")})).each((function(e){k(e,this,"pie")})).each((function(e){var r,a,o=g(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=e[0],x=y.trace,_=c(x),M=_.colorscale,k=_.reversescale,T=u.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",T+"h"+b+"v6h-"+b+"z").call((function(e){if(e.size())if(s)l.fillGroupStyle(e,t);else{var r="legendfill-"+x.uid;l.gradient(e,t,r,h(k),M,"fill")}})),f||d){var L=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:L}}),r=[i.minExtend(y,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",T+(d?"l"+b+",0.0001":"h"+b)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+x.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(k),M,"stroke")}})})).each((function(e){var r,a,o=g(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,v=!d&&!c&&!s&&u.hasText(h);function m(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||v||f){var x={},w={};if(d){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",i.mean,[2,16],12);x.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[i.minExtend(p,x)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var k=n.select(this).select("g.legendpoints"),T=k.selectAll("path.scatterpts").data(d?r:[]);T.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),T.exit().remove(),T.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(v?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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":260,"../../registry":351,"../../traces/pie/helpers":370,"../../traces/pie/style_one":371,"../../traces/scatter/subtypes":398,"../color":117,"../colorscale/helpers":128,"../drawing":139,"./constants":168,"@plotly/d3":11}],176:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":178}],177:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(O=["toggleHover"],R=["resetViews"]):m?(D=["zoomInGeo","zoomOutGeo"],O=["hoverClosestGeo"],R=["resetGeo"]):v?(O=["hoverClosest3d"],R=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(D=["zoomInMapbox","zoomOutMapbox"],O=["toggleHover"],R=["resetViewMapbox"]):x?O=["hoverClosestGl2d"]:y?O=["hoverClosestPie"]:T?(O=["hoverClosestCartesian","hoverCompareCartesian"],R=["resetViewSankey"]):O=["toggleHover"];g&&(O=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=z[r+1];else if(e=n.pmax)t=z[r+1];else if(e=0;k--){var T=r.append("path").attr(v).style("opacity",k?.1:m).call(o.stroke,b).call(o.fill,y).call(l.dashLine,k?"solid":_,k?4+x:x);if(h(T,e,i),w){var A=s(e.layout,"selections",i);T.style({cursor:"move"});var S={element:T.node(),plotinfo:p,gd:e,editHelpers:A,isActiveSelection:!0},L=n(c,e);a(L,T,S)}else T.style("pointer-events",k?"all":"none");M[k]=T}var C=M[0];M[1].node().addEventListener("click",(function(){return function(e,t){if(!d(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void g(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=g,f(e)}}(e,C)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;l.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function g(e){d(e)&&(e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,f(e)))}t.exports={draw:f,drawOne:p,activateLastSelection:function(e){if(!d(e))return;var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=g,f(e)}}},{"../../plot_api/plot_template":297,"../color":117,"../drawing":139,"../shapes/display_outlines":211,"../shapes/draw_newshape/helpers":216,"../shapes/handle_outline":218,"../shapes/helpers":219}],201:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":252,"../../drawing/attributes":138}],202:[function(e,t,r){"use strict";t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],203:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers").selectMode,a=e("../../shapes/handle_outline").clearOutline,i=e("../../shapes/draw_newshape/helpers"),o=i.readPaths,l=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var i=r.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,f=t.plotinfo,d=f.xaxis,p=f.yaxis,h=t.isActiveSelection,g=t.dragmode,v=(c.layout||{}).selections||[];if(!n(g)&&void 0!==h){var m=c._fullLayout._activeSelectionIndex;if(m-1,x=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(m)){V(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=K(_))){for(o&&o.remove(),v=0;v=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,l=p(r),s=g(r);if(l||s){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&a._fullLayout._outlining)l&&(c=M(f,e)),c&&i.call("_guiRelayout",a,{shapes:c}),s&&!H(e)&&(u=k(f,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&T(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function W(e){return e._id}function J(e,t,r,n){if(!e.calcdata)return[];var a,i,o,l=[],s=t.map(W),c=r.map(W);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function Q(e,t,r){var n,a;for(n=0;n-1&&t;if(!i&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ce(te);ue([P(e,ne,"x"),P(e,pe,"y")])($,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&fe(e,$),d._reselect=!1}if(!i&&d._deselect){var ge=d._deselect;(function(e,t,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!b){var r=T.clickmode;C.done(Te).then((function(){if(C.clear(Te),2===e){for(xe.remove(),K=0;K-1&&Y(t,k,n.xaxes,n.yaxes,n.subplot,n,xe),"event"===r&&fe(k,void 0);s.click(k,t)})).catch(A.error)}},n.doneFn=function(){ke.remove(),C.done(Te).then((function(){C.clear(Te),!S&&X&&n.selectionDefs&&(X.subtract=be,n.selectionDefs.push(X),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,W)),(S||b)&&Z(n,S),n.doneFnCompleted&&n.doneFnCompleted(Ae),x&&fe(k,ie)})).catch(A.error)}},clearOutline:b,clearSelectionsCache:Z,selectOnClick:Y}},{"../../lib":260,"../../lib/clear_gl_canvases":246,"../../lib/polygon":272,"../../lib/throttle":284,"../../plot_api/subroutines":298,"../../plots/cartesian/axis_ids":312,"../../registry":351,"../color":117,"../dragelement/helpers":135,"../drawing":139,"../fx":157,"../fx/helpers":153,"../shapes/constants":209,"../shapes/display_outlines":211,"../shapes/draw_newshape/helpers":216,"../shapes/draw_newshape/newshapes":217,"../shapes/handle_outline":218,"../shapes/helpers":219,"./constants":198,"./draw":200,"./draw_newselection/newselections":203,"./helpers":204,"point-in-polygon/nested":70,polybooljs:71}],207:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":234,"../../lib/extend":252,"../../plot_api/plot_template":297,"../../traces/scatter/attributes":373,"../annotations/attributes":100,"../drawing/attributes":138}],208:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,g=d>0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o1&&(2!==e.length||"Z"!==e[1][0])&&(0===L&&(e[0][0]="M"),t[S]=e,M(),k())}}()}}function F(e,r){!function(e,r){if(t.length)for(var n=0;nb?(k=f,L="y0",T=b,C="y1"):(k=b,L="y1",T=f,C="y0");J(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===R?X:K,W.altKey=n.altKey},doneFn:function(){if(y(e))return;p(t),$(l),_(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(y(e))return;$(l)}};function J(r){if(y(e))R=null;else if(I)R="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=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!z&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),R=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?F("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(G(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),N?F("yanchor",r.yanchor=V(M+a)):(s=function(e){return V(U(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),F("path",r.path=w(O,o,s))}else E?F("xanchor",r.xanchor=q(x+n)):(F("x0",r.x0=q(c+n)),F("x1",r.x1=q(m+n))),N?F("yanchor",r.yanchor=V(M+a)):(F("y0",r.y0=V(f+a)),F("y1",r.y1=V(b+a)));t.attr("d",v(e,r)),Q(l,r)}function K(n,a){if(z){var i=function(e){return e},o=i,s=i;E?F("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(G(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),N?F("yanchor",r.yanchor=V(M+a)):(s=function(e){return V(U(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),F("path",r.path=w(O,o,s))}else if(I){if("resize-over-start-point"===R){var u=c+n,d=N?f-a:f+a;F("x0",r.x0=E?u:q(u)),F("y0",r.y0=N?d:V(d))}else if("resize-over-end-point"===R){var p=m+n,h=N?b-a:b+a;F("x1",r.x1=E?p:q(p)),F("y1",r.y1=N?h:V(h))}}else{var y=function(e){return-1!==R.indexOf(e)},_=y("n"),B=y("s"),Y=y("w"),Z=y("e"),W=_?k+a:k,J=B?T+a:T,X=Y?A+n:A,K=Z?S+n:S;N&&(_&&(W=k-a),B&&(J=T-a)),(!N&&J-W>10||N&&W-J>10)&&(F(L,r[L]=N?W:V(W)),F(C,r[C]=N?J:V(J))),K-X>10&&(F(P,r[P]=E?X:q(X)),F(D,r[D]=E?K:q(K)))}t.attr("d",v(e,r)),Q(l,r)}function Q(e,t){(E||N)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=G(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=U(N?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&N){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(W),Z.node().onmousemove=J}(e,E,s,t,r,R):!0===s.editable&&E.style("pointer-events",D||c.opacity(S)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!b(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void M(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=M,m(e)}}(e,E)}))}}function _(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function M(e){b(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,m(e)))}t.exports={draw:m,drawOne:x,eraseActiveShape:function(e){if(!b(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&sp&&(e="X"),e}));return i>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),u+h}))}(t,l,c);if("pixel"===t.xsizemode){var x=l(t.xanchor);u=x+t.x0,f=x+t.x1}else u=l(t.x0),f=l(t.x1);if("pixel"===t.ysizemode){var _=c(t.yanchor);d=_-t.y0,p=_-t.y1}else d=c(t.y0),p=c(t.y1);if("line"===h)return"M"+u+","+d+"L"+f+","+p;if("rect"===h)return"M"+u+","+d+"H"+f+"V"+p+"H"+u+"Z";var w=(u+f)/2,M=(d+p)/2,k=Math.abs(w-u),T=Math.abs(M-d),A="A"+k+","+T,S=w+k+","+M;return"M"+S+A+" 0 1,1 "+(w+","+(M-T))+A+" 0 0,1 "+S+"Z"}},{"../../lib":260,"../../plots/cartesian/axes":308,"./constants":209}],220:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":319,"./attributes":207,"./calc_autorange":208,"./defaults":210,"./draw":212,"./draw_newshape/defaults":215}],221:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":252,"../../plot_api/edit_types":290,"../../plot_api/plot_template":297,"../../plots/animation_attributes":302,"../../plots/font_attributes":336,"../../plots/pad_attributes":347,"./constants":222}],222:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],223:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function L(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function C(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function P(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(T,t,e,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(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,v(t))}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;c0||d<0){var m={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[x.side];t.attr("transform",s(m[0],m[1]))}}}return I.call(z),R&&(L?I.on(".opacity",null):(T=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:e}).on("edit",(function(t){void 0!==b?o.call("_guiRestyle",e,m,t,b):o.call("_guiRelayout",e,m,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(z)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),I.classed("js-placeholder",A),M}}},{"../../constants/alignment":233,"../../constants/interactions":237,"../../lib":260,"../../lib/svg_text_utils":283,"../../plots/plots":348,"../../registry":351,"../color":117,"../drawing":139,"@plotly/d3":11,"fast-isnumeric":30}],227:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":252,"../../plot_api/edit_types":290,"../../plot_api/plot_template":297,"../../plots/font_attributes":336,"../../plots/pad_attributes":347,"../color/attributes":116}],228:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],229:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":260,"../../plots/array_container_defaults":303,"./attributes":227,"./constants":228}],230:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.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(S,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(M,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?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 x={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,x),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(M,o),u.call(_,o)}))})),u.call(_,o),b?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,T=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,S=h,L=v+m;L+A>c&&(L=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:S,y:L,width:T,height:A}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=m>M,D=l.barWidth+2*l.barPad,O=l.barLength+2*l.barPad,R=h+g,E=v;R+D>s&&(R=s-D);var N=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),P?(this.vbar=N.attr({rx:l.barRadius,ry:l.barRadius,x:R,y:E,width:D,height:O}),this._vbarYMin=E+O/2,this._vbarTranslateMax=M-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,z=u-.5,F=P?f+D+.5:f+.5,j=d-.5,B=k?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(k||P?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),k||P?(this._clipRect=H.select("rect").attr({x:Math.floor(z),y:Math.floor(j),width:Math.ceil(F)-Math.floor(z),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||P){var Y=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(Y);var G=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(G),P&&this.vbar.on(".drag",null).call(G)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":260,"../color":117,"../drawing":139,"@plotly/d3":11}],233:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],234:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"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",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],235:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],236:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],237:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],238:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],239:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],240:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],242:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],243:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":267}],244:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),M=e.match(w?b:y);if(!M)return u;var k=M[1],T=M[3]||"1",A=Number(M[5]||1),S=Number(M[7]||0),L=Number(M[9]||0),C=Number(M[11]||0);if(c){if(2===k.length)return u;var P;k=Number(k);try{var D=v.getComponentMethod("calendars","getCal")(t);if(w){var O="i"===T.charAt(T.length-1);T=parseInt(T,10),P=D.newDate(k,D.toMonthIndex(k,T,O),A)}else P=D.newDate(k,Number(T),A)}catch(e){return u}return P?(P.toJD()-g)*f+S*d+L*p+C*h:u}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),T-=1;var R=new Date(Date.UTC(2e3,T,A,S,L));return R.setUTCFullYear(k),R.getUTCMonth()!==T||R.getUTCDate()!==A?u:R.getTime()+C*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var M=90*f,k=3*d,T=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,b,x=Math.floor(10*s(e+.05,1)),w=Math.round(e-x/10);if(_(r)){var S=Math.floor(w/f)+g,L=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var S=/%\d?f/g,L=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function P(e,t,r,n){e=e.replace(S,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(L,(function(){return C[r("%q")(a)]})),_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var D=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),D[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+P(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return P(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===l||"FJI"===l?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),a=0;at?r[n++]=[e[a][0]+360,e[a][1]]:a===t?(r[n++]=e[a],r[n++]=[e[a][0],-90]):r[n++]=e[a];var i=d.tester(r);i.pts.pop(),s.push(i)}:function(e){s.push(d.tester(e))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,t=s)}else t=r;return o.default(t).geometry.coordinates}(u),n.fIn=e,n.fOut=u,l.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+e)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},r.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":267}],258:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],259:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],260:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var g=e("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=e("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=e("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var y=e("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=e("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=e("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=e("./extend");f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var k=e("./loggers");f.log=k.log,f.warn=k.warn,f.error=k.error;var T=e("./regex");f.counterRegex=T.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var S=e("./dom");function L(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?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},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var E=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return E.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var N={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(N,arguments)};var I={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(I,arguments)};var z=/^[:|\|]/;function F(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,g="xother_"===l||"yother_"===l,v="xother"===l||"yother"===l||p||g||h,m=l;if((p||h)&&(m=m.substring(1)),(g||h)&&(m=m.substring(0,m.length-1)),v){if(void 0===(c=t[m]))return""}else for(d=3;d=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 j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(e,t){e.attr("transform",f.getTextTransform(t)),e.style("display",t.scale?null:"none")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var B=f.getFirefoxVersion(),H=null!==B&&B<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":238,"./anchor_utils":242,"./angles":243,"./array":244,"./clean_number":245,"./clear_responsive":247,"./coerce":248,"./dates":249,"./dom":250,"./extend":252,"./filter_unique":253,"./filter_visible":254,"./geometry2d":257,"./identity":258,"./increment":259,"./is_plain_object":261,"./keyed_container":262,"./localize":263,"./loggers":264,"./make_trace_groups":265,"./matrix":266,"./mod":267,"./nested_property":268,"./noop":269,"./notifier":270,"./preserve_drawing_buffer":273,"./push_unique":274,"./regex":276,"./relative_attr":277,"./relink_private":278,"./search":279,"./sort_object_keys":281,"./stats":282,"./throttle":284,"./to_log_range":285,"@plotly/d3":11,"d3-format":24,"d3-time-format":27,"fast-isnumeric":30}],261:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],262:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":295,"./notifier":270}],265:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":11}],266:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],268:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":238,"./matrix":266}],273:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-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":30,"is-mobile":64}],274:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":244,"fast-isnumeric":30}],283:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,g){var A=e.text(),S=!e.attr("data-notex")&&t&&t._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(s),P=n.select(e.node().parentNode);if(!P.empty()){var D=e.attr("class")?e.attr("class").split(" ")[0]:"text";return D+="-math",P.selectAll("svg."+D).remove(),P.selectAll("g."+D+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s,d=parseInt((MathJax.version||"").split(".")[0]);if(2!==d&&3!==d)return void a.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+a.randstr({},64),i=(s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(i):MathJax.typeset([i])},h=function(){var t=s.select(2===d?".MathJax_SVG":".MathJax"),i=!t.empty()&&s.select("svg").node();if(i){var o,l=i.getBoundingClientRect();o=2===d?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,l)}else a.log("There was an error in the tex syntax.",e),r();s.remove()};2===d?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:f},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,h,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})):3===d&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),h(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(S[2],o,(function(n,a,o){P.selectAll("svg."+D).remove(),P.selectAll("g."+D+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return O(),void t();var s=P.append("g").classed(D+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild);var c=o.width,u=o.height;l.attr({class:D,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=e.node().style.fill||"black",d=l.select("g");d.attr({fill:f,stroke:f});var p=d.node().getBoundingClientRect(),h=p.width,v=p.height;(h>c||v>u)&&(l.style("overflow","hidden"),h=(p=l.node().getBoundingClientRect()).width,v=p.height);var m=+e.attr("x"),y=+e.attr("y"),b=-(r||e.node().getBoundingClientRect().height)/4;if("y"===D[0])s.attr({transform:"rotate("+[-90,m,y]+")"+i(-h/2,b-v/2)});else if("l"===D[0])y=b-v/2;else if("a"===D[0]&&0!==D.indexOf("atitle"))m=0,y=b;else{var x=e.attr("text-anchor");m-=h*("middle"===x?.5:"end"===x?1:0),y=y+b-v/2}l.attr({x:m,y:y}),g&&g.call(e,s),t(s)}))}))):O(),e}function O(){P.empty()||(D=e.attr("class")+"-math",P.select("svg."+D).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(v," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}b.test(t)?u():(r=e,s=[{node:e}]);for(var S=t.split(m),P=0;P|>|>)/g;var f=[["$","$"],["\\(","\\)"]];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,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var T=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(m),o=[],l="",s=0,c=0;ca?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"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(S,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function C(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==g.indexOf(a)&&-1!==g.indexOf(i)?t:""}function P(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.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 e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(v," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(m),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],285:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":30}],286:[function(e,t,r){"use strict";var n=t.exports={},a=e("../plots/geo/constants").locationmodeToLayer,i=e("topojson-client").feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=a[e.locationmode],n=t.objects[r];return i(t,n).features}},{"../plots/geo/constants":338,"topojson-client":82}],287:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],288:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],289:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=x(t);r;){if(r in e)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var b,x,_,w,M,k,T,A,S=Object.keys(r).map(Number).sort(o),L=t.get(),C=L||[],P=u(m,f).get(),D=[],O=-1,R=C.length;for(b=0;bC.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?D.push(_):T?("add"===k&&(k={}),C.splice(_,0,k),P&&P.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===O&&(O=_);else for(x=0;x=0;b--)C.splice(D[b],1),P&&P.splice(D[b],1);if(C.length?L||t.set(C):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===O)E=S;else{for(R=Math.max(C.length,R),E=[],b=0;b=O);b++)E.push(_);for(b=O;b=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),D(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&D(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in D(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=P(r,e.data.length-1),t)for(var g=0;g-1&&-1===r.indexOf("grouptitlefont")?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function H(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag,d.reselect),c.add(e,H,[e,a.undoit],H,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.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[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[];for(var n in t){var a=p.getFromId(e,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)t[i]||r.push(i)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,V=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=z(s._preGUI,c),h=Object.keys(t),g=p.list(e),v=o.extendDeepAll({},t),m={};for(B(t),h=Object.keys(t),n=0;n0&&"string"!=typeof R.parts[N];)N--;var F=R.parts[N],j=R.parts[N-1]+"."+F,H=R.parts.slice(0,N).join("."),Y=l(e.layout,H).get(),G=l(s,H).get(),Z=R.get();if(void 0!==E){A[O]=E,S[O]="reverse"===F?E:I(Z);var J=f.getLayoutValObject(s,R.parts);if(J&&J.impliedEdits&&null!==E)for(var X in J.impliedEdits)L(o.relativeAttr(O,X),J.impliedEdits[X]);if(-1!==["width","height"].indexOf(O))if(E){L("autosize",null);var K="height"===O?"width":"height";L(K,s[K])}else s[O]=e._initialAutoSize[O];else if("autosize"===O)L("width",E?null:s.width),L("height",E?null:s.height);else if(j.match(U))D(j),l(s,H+"._inputRange").set(null);else if(j.match(q)){D(j),l(s,H+"._inputRange").set(null);var Q=l(s,H).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(V)&&l(s,H+"._inputDomain").set(null);if("type"===F){C=Y;var $="linear"===G.type&&"log"===E,ee="log"===G.type&&"linear"===E;if($||ee){if(C&&C.range)if(G.autorange)$&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var te=C.range[0],re=C.range[1];$?(te<=0&&re<=0&&L(H+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),L(H+".range[0]",Math.log(te)/Math.LN10),L(H+".range[1]",Math.log(re)/Math.LN10)):(L(H+".range[0]",Math.pow(10,te)),L(H+".range[1]",Math.pow(10,re)))}else L(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete s[R.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,G,E,L),u.getComponentMethod("images","convertCoords")(e,G,E,L)}else L(H+".autorange",!0),L(H+".range",null);l(s,H+"._inputRange").set(null)}else if(F.match(k)){var ne=l(s,O).get(),ae=(E||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,L),u.getComponentMethod("images","convertCoords")(e,ne,ae,L)}var ie=x.containerArrayMatch(O);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=J||{editType:"calc"};""!==n&&""===oe&&(x.isAddVal(E)?S[O]=null:x.isRemoveVal(E)?S[O]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(T,le),m[r]||(m[r]={});var se=m[r][n];se||(se=m[r][n]={}),se[oe]=E,delete t[O]}else"reverse"===F?(Y.range?Y.range.reverse():(L(H+".autorange",!0),Y.range=[1,0]),G.autorange?T.calc=!0:T.plot=!0):("dragmode"===O&&(!1===E&&!1!==Z||!1!==E&&!1===Z)||s._has("scatter-like")&&s._has("regl")&&"dragmode"===O&&("lasso"===E||"select"===E)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?T.plot=!0:J?M.update(T,J):T.calc=!0,R.set(E))}}for(r in m){x.applyContainerArrayChanges(e,d(i,r),m[r],T,d)||(T.plot=!0)}for(var ce in P){var ue=(C=p.getFromId(e,ce))&&C._constraintGroup;if(ue)for(var fe in T.calc=!0,ue)P[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(T.plot=!0),(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:P,undoit:S,redoit:A,eventData:v}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),Y(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&G(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag,d.reselect),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function X(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{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 $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],b=null==t,x=Array.isArray(t);if(!b&&!x&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(b||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&kk)&&T.push(g);y=T}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&T<5&&(T++,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===T&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!y(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function y(e){return e===Math.round(e)&&e>=0}function b(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return m(a,t,l)},r.getLayoutValObject=function(e,t){return m(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":260,"../plots/attributes":304}],298:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function b(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,b=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function M(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-b-n:t._offset+t._length+b+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+b+n:t._offset-b-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var k=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=M(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?M(u,k,p.OPPOSITE_SIDE[u.side]):null}var T=[],A=[],S=[],L=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,P=l.yaxis.domain,D=l.plotgroup;if(y(C,P,S)){var O=D.node(),R=l.bg=o.ensureSingle(D,"rect","bg");O.insertBefore(R.node(),O.childNodes[0]),A.push(a)}else D.select("rect.bg").remove(),S.push([C,P]),L||(T.push(a),A.push(a))}var E,N,I,z,F,j,B,H,Y,G,U,q,V,Z=v._bgLayer.selectAll(".bg").data(T);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tM?u.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":260,"../plots/attributes":304,"../plots/plots":348,"./plot_config":295,"./plot_schema":296,"./plot_template":297}],300:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var T=o.extendFlat({},d);b?T.width=b:null===t.width&&n(h.width)&&(T.width=h.width),x?T.height=x:null===t.height&&n(h.height)&&(T.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=l.getRedrawFunc(k);function L(){return new Promise((function(e){setTimeout(e,l.getDelay(k._fullLayout))}))}function C(){return new Promise((function(e,t){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(),e(M?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(M?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(k,r,T,A).then(S).then(L).then(C).then((function(t){e(function(e){return M?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":260,"../plots/plots":348,"../snapshot/helpers":355,"../snapshot/svgtoimg":357,"../snapshot/tosvg":359,"../version":416,"./plot_api":294,"fast-isnumeric":30}],301:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;db.length&&a.push(h("unused",i,m.concat(b.length)));var T,A,S,L,C,P=b.length,D=Array.isArray(k);if(D&&(P=Math.min(P,k.length)),2===x.dimensions)for(A=0;Ab[A].length&&a.push(h("unused",i,m.concat(A,b[A].length)));var O=b[A].length;for(T=0;T<(D?Math.min(O,k[A].length):O);T++)S=D?k[A][T]:k,L=y[A][T],C=b[A][T],n.validate(L,S)?C!==L&&C!==+L&&a.push(h("dynamic",i,m.concat(A,T),L,C)):a.push(h("value",i,m.concat(A,T),L))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,g=e[r+"period0"],v=i(g,d)||0,m=[],y=[],b=[],x=a.length,_=0;_T;)k=o(k,-c,d);for(;k<=T;)k=o(k,c,d);M=o(k,-c,d)}else{for(k=v+(w=Math.round((T-v)/u))*u;k>T;)k-=u;for(;k<=T;)k+=u;M=k-u}m[_]=p?M:h?k:(M+k)/2,y[_]=M,b[_]=k}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":238,"../../lib":260,"fast-isnumeric":30}],306:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],307:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=g(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,v=f[0].val;for(r=1;r0&&((M=L-l(b)-s(x))>C?k/M>P&&(_=b,w=x,P=k/M):k/L>P&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},P=k/L));if(d===v){var D=d-1,O=d+1;if(A)if(0===d)a=[0,1];else{var R=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),E=d/(1-Math.min(.5,R/L));a=d>0?[0,E]:[E,0]}else a=S?[Math.max(0,D),Math.max(1,O)]:[D,O]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-P*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),P=(w.val-_.val-p(t,b.val,x.val))/(L-l(_)-s(w)),a=[_.val-P*l(_),w.val+P*s(w)];return m&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=T((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=T(r.vpadplus||r.vpad),C=T(r.vpadminus||r.vpad);if(!M){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=O;n--)D(n);return{min:h,max:g,opts:r}},concatExtremes:g};function g(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function b(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":139,"../../constants/numerical":238,"../../lib":260,"../../registry":351,"./axis_ids":312,"@plotly/d3":11,"fast-isnumeric":30}],308:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),g=e("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,M=g.ONEAVGMONTH,k=g.ONEMINMONTH,T=g.ONEWEEK,A=g.ONEDAY,S=A/2,L=g.ONEHOUR,C=g.ONEMIN,P=g.ONESEC,D=g.MINUS_SIGN,O=g.BADNUM,R={K:"zeroline"},E={K:"gridline",L:"path"},N={K:"minor-gridline",L:"path"},I={K:"tick",L:"path"},z={K:"tick",L:"text"},F={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j=e("../../constants/alignment"),B=j.MID_SHIFT,H=j.CAP_SHIFT,Y=j.LINE_SPACING,G=j.OPPOSITE_SIDE,U=t.exports={};U.setConvert=e("./set_convert");var q=e("./axis_autotype"),V=e("./axis_ids"),Z=V.idSort,W=V.isLinked;U.id2name=V.id2name,U.name2id=V.name2id,U.cleanId=V.cleanId,U.list=V.list,U.listIds=V.listIds,U.getFromId=V.getFromId,U.getFromTrace=V.getFromTrace;var J=e("./autorange");U.getAutoRange=J.getAutoRange,U.findExtremes=J.findExtremes;function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}U.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},U.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},U.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==U.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=U.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},U.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:U.getFromId(t,r).cleanPos)(e)},U.redrawComponents=function(e,t){t=t||U.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;ur&&f2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},U.saveRangeInitial=function(e,t){for(var r=U.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=U.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=U.tickIncrement(e,"M1","reverse")+15.5*A:e-=S;var s=U.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,m,c,i)),v=y,0;v<=u;)v=U.tickIncrement(v,m,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(v,0,i),size:m,_dataSpan:u-c}},U.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,i=t.dtick&&a(t._tmin);if(i){var o=U.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var s=l.simpleMap(t.range,t.r2l);n=[s[0],.8*s[0]+.2*s[1]]}if(e.range=l.simpleMap(n,t.l2r),e._isMinor=!0,U.prepTicks(e,r),i){var c=a(t.dtick),u=a(e.dtick),f=c?t.dtick:+t.dtick.substring(1),d=u?e.dtick:+e.dtick.substring(1);c&&u?ee(f,d)?f===2*T&&d===2*A&&(e.dtick=T):f===2*T&&d===3*A?e.dtick=T:f!==T||(t._input.minor||{}).nticks?te(f/d,2.5)?e.dtick=f/2:e.dtick=f:e.dtick=A:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ee(f,d)?f>=12&&2===d&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ee(f,d)||(e.dtick=te(f/d,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},U.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,U.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=U.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=L,o&&!n&&e.dtick=(R?0:1);E--){var N=!E;E?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var I=E?e:l.extendFlat({},e,e.minor);if(N?U.prepMinorTicks(I,e,t):U.prepTicks(I,t),"array"!==I.tickmode){var z=X(u),F=z[0],j=z[1],B=a(I.dtick),H="log"===i&&!(B||"L"===I.dtick.charAt(0)),Y=U.tickFirst(I,t);if(E){if(e._tmin=Y,Y=j:Z<=j;Z=U.tickIncrement(Z,W,f,o)){if(E&&G++,I.rangebreaks&&!f){if(Z=p)break}if(P.length>h||Z===V)break;V=Z;var J={value:Z};E?(H&&Z!==(0|Z)&&(J.simpleLabel=!0),s>1&&G%s&&(J.skipLabel=!0),P.push(J)):(J.minor=!0,D.push(J))}}else E?(P=[],g=ne(e)):(D=[],C=ne(e))}if(R&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=P.map((function(e){return e.value})),Q=[],$=0;$0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=v?u:m:r===x&&f>=_?d=u>=_&&u<=b?u:x:f>=k?d=u>=k&&u<=w?u:M:r===T&&f>=T?d=T:f>=A?d=A:r===S&&f>=S?d=S:r===L&&f>=L&&(d=L),d>=u&&(d=u,l=!0);var p=a+d;if(t.rangebreaks&&d>0){for(var h=0,g=0;g<84;g++){var C=(g+.5)/84;t.maskBreaks(a*(1-C)+C*p)!==O&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>T&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(P,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),oe=1;"auto"===e.tickmode&&(oe=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=P.length-1;r>-1;r--)if(P[r].drop)P.splice(r,1);else{P[r].value=Oe(P[r].value,e);var se=e.c2p(P[r].value);(ie?le>se-oe:lep||uep&&(ce.periodX=p),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=C&&i<=16||t>=L)e._tickround="M";else if(t>=P&&i<=19||t>=C)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ge(e.exponentformat)&&!ve(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}U.autoTicks=function(e,t,r){var n;function i(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var o=2*t;if(o>m)t/=m,n=i(10),e.dtick="M"+12*fe(t,n,ae);else if(o>M)t/=M,e.dtick="M"+fe(t,1,ie);else if(o>A){if(e.dtick=fe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:le),!r){var s=U.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(s)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else o>L?e.dtick=fe(t,L,ie):o>C?e.dtick=fe(t,C,oe):o>P?e.dtick=fe(t,P,oe):(n=i(10),e.dtick=fe(t,n,ae))}else if("log"===e.type){e.tick0=0;var u=l.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=i(10),e.dtick="L"+fe(t,n,ae)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):De(e)?(e.tick0=0,n=1,e.dtick=fe(t,n,ue)):(e.tick0=0,n=i(10),e.dtick=fe(t,n,ae));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},U.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ce:se,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},U.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=me(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||ge(p)&&ve(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":D)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":D)+d:(t.text=me(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):De(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=me(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=me(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=D+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=me(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},U.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return U.hoverLabelText(e,n,r)+" - "+U.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=U.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":D+o:o};var he=["f","p","n","\u03bc","m","","k","M","G","T"];function ge(e){return"SI"===e||"B"===e}function ve(e){return e>14||e<-15}function me(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=U.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};de(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,D);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ge(s)&&(e+=he[c/3+5]));return i?D+e:e}function ye(e,t){if(e){var r=Object.keys(F).reduce((function(e,r){return-1!==t.indexOf(r)&&F[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function be(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var b=t._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=we(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ae&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ye(n,t.automargin),ye(a,t.automargin)),i.autoMargin(e,Te(t),n),i.autoMargin(e,Ae(t),a),i.autoMargin(e,Se(t),l)})),r.skipTitle||ae&&"bottom"===t.side||re.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+we(t);else{var l=Re(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,g=U.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?g-r:g+r):(p=t._offset+t._length/2,f="right"===t.side?g+r:g-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var v=t._selections[t._id+"tick"];if(h={selection:v,side:t.side},v&&v.node()&&v.node().parentNode){var m=d.getTranslate(v.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(re)}}function ie(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ke(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},U.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],a=e.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},U.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},U.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},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=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*H,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-H));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(xe(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(xe(t)))}},U.makeTickPath=function(e,t,r,n){n||(n={});var a=n.minor;if(a&&!e.minor)return"";var i=void 0!==n.len?n.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*r)+"v"+i*r:"M"+(t+l*r)+",0h"+i*r},U.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,g=d?e.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)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var m,y,b,x,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},M=0,k=e.side,T=e._id.charAt(0),A=e.tickangle;if("x"===T)x=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(x*=-1),m=h*x,y=t+p*x,b=_?1:-.2,90===Math.abs(A)&&(f?b+=B:b=-90===A&&"bottom"===k?H:90===A&&"top"===k?B:.5,M=B/2*(A/90)),w.xFn=function(e){return e.dx+m+M*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*b},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*x<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===T){if(x=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(x*=-1),m=p,y=h*x,b=0,f||90!==Math.abs(A)||(b=-90===A&&"left"===k||90===A&&"right"===k?H:.5),f){var S=a(A)?+A:0;if(0!==S){var L=l.deg2rad(S);M=Math.abs(Math.sin(L))*H*x,b=0}}w.xFn=function(e){return e.dx+t-(m+e.fontSize*b)*x+M*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*B},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},U.drawTicks=function(e,t,r){r=r||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,_e);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return d.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Ee(t,[I]),o.attr("transform",r.transFn)},U.drawGrid=function(e,t,r){r=r||{};var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?r.vals.filter((function(e){return e.minor})):[],l=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],s=r.counterAxis;if(s&&U.shouldShowZeroLine(e,t,s))for(var c="array"===t.tickmode,u=0;u=0;m--){var y=m?g:v;if(y){var b=y.selectAll("path."+a).data(m?l:o,_e);b.exit().remove(),b.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),b.attr("transform",r.transFn).attr("d",r.path).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return d.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"==typeof r.path&&b.attr("d",r.path)}}Ee(t,[E,N])},U.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=U.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return Z(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Ee(t,[R])},U.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,g=r.secondary?0:t.tickangle,v=(t._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(t.showticklabels?p:[],_e),y=[];function b(e,i){e.each((function(e){var o=n.select(this),l=o.select(".text-math-group"),u=h.anchorFn(e,i),f=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=c.lineCount(o),g=Y*e.fontSize,v=h.heightFn(e,a(i)?+i:0,(p-1)*g);if(v&&(f+=s(0,v)),l.empty()){var m=o.select("text");m.attr({transform:f,"text-anchor":u}),m.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var y=d.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr("transform",f+s(y,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(d.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?y.push(e._promises.pop().then((function(){b(r,g)}))):b(r,g)})),Ee(t,[z]),m.exit().remove(),r.repositionOnUpdate&&m.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),s=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=l.simpleMap(t.range,t.r2l);s=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var f=Math.min(s,c),p=Math.max(s,c),h=t.side,g=1/0,v=-1/0;for(var y in m.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=d.bBox(r.node()),l=0;o?(i.right>p||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;t._selections&&(t._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),p.length&&"x"===u&&!a(g)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=0;var e,n=0,i=[];if(m.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ke(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"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var v="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,v)?"category":function(e,t){for(var r=e.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=x(o[l])){u=v;break}var f=a("pattern",u);if(f===v)for(l=0;l<2;l++)(c=x(o[l]))&&(t.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case v:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case m:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":351,"./constants":315}],313:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function v(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*b)||M)for(r=0;rR&&zD&&(D=z);d/=(D-P)/(2*O),P=s.l2r(P),D=s.l2r(D),s.range=s._input.range=S=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function G(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){O&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,D)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function V(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(G(a),2!==e||me||Ue(),ve)o.indexOf("select")>-1&&S(r,a,X,K,t.id,De),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&me){var l=g?R:O,c="s"===g||"w"===m?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",v="middle";if(l.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===l.side&&(h="right")):"e"===m&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(xe).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:v}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Ee(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Se="",Me.r=Me.l,Me.t=Me.b,Ce.attr("d","M0,0Z")}if(Me.l=Math.min(_e,n),Me.r=Math.max(_e,n),Me.t=Math.min(we,a),Me.b=Math.max(we,a),re.isSubplotConstrained)i>D||o>D?(Se="xy",i/ee>o/te?(o=i*te/ee,we>a?Me.t=we-o:Me.b=we+o):(i=o*ee/te,_e>n?Me.l=_e-i:Me.r=_e+i),Ce.attr("d",q(Me))):l();else if(ne.isSubplotConstrained)if(i>D||o>D){Se="xy";var s=Math.min(Me.l/ee,(te-Me.b)/te),c=Math.max(Me.r/ee,(te-Me.t)/te);Me.l=s*ee,Me.r=c*ee,Me.b=(1-s)*te,Me.t=(1-c)*te,Ce.attr("d",q(Me))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;ug[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":260,"fast-isnumeric":30}],325:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,l=n(e);r("tickprefix")&&r("showtickprefix",l),r("ticksuffix",o)&&r("showticksuffix",l)}},{"./show_dflt":328}],326:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":233}],327:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,g=p.BADNUM,v=p.LOG_CLIP,m=p.ONEWEEK,y=p.ONEDAY,b=p.ONEHOUR,x=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),M=e("./constants"),k=M.HOUR_PATTERN,T=M.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function S(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function L(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*v*Math.abs(n-a))}return g}function C(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===g){if(!l(t))return g;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function P(t,r,n){return c(t,r,n||e.calendar)}function D(t){return e._categories[Math.round(t)]}function O(t){if(S(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return g}function R(t){if(e._categoriesMap)return e._categoriesMap[t]}function E(e){var t=R(e);return void 0!==t?t:l(e)?+e:void 0}function N(e){return l(e)?+e:R(e)}function I(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var F=function(t){return l(t)?I(t,e._m,e._b):g},j=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var B="y"===p;F=function(t){if(!l(t))return g;var r=e._rangebreaks.length;if(!r)return I(t,e._m,e._b);var n=B;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?I(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?L:f,e.l2c="log"===e.type?A:f,e.l2p=F,e.p2l=j,e.c2p="log"===e.type?function(e,t){return F(L(e,t))}:F,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return L(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=L,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=C,e.c2d=e.c2r=e.l2d=e.l2r=P,e.d2p=e.r2p=function(t,r,n){return e.l2p(C(t,0,n))},e.p2d=e.p2r=function(e,t,r){return P(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,g,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=O,e.r2d=e.c2d=e.l2d=D,e.d2r=e.d2l_noadd=E,e.r2c=function(t){var r=N(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return D(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=D,e.d2r=e.d2l_noadd=E,e.r2c=function(t){var r=E(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=R,e.l2r=e.c2r=f,e.r2l=E,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return D(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),b=i.simpleMap(t.yr1,s.r2l),x=y[1]-y[0],_=b[1]-b[0];p[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/x),s.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*b[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,M=d?u/p[3]:1,k=f?p[0]:0,T=d?p[1]:0,A=f?p[0]/p[2]*c:0,S=d?p[1]/p[3]*u:0,L=a._offset-A,C=s._offset-S;n.clipRect.call(o.setTranslate,k,T).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,L,C).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}l.redrawComponents(e)}},{"../../components/drawing":139,"../../lib":260,"../../registry":351,"./axes":308,"@plotly/d3":11}],333:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.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=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&a<0&&(a+=360);var l=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+l,o],[n+2*l,o],[n+3*l,o],[a,o],[a,i],[a-l,i],[a-2*l,i],[a-3*l,i],[n,i]]]}}t.exports=function(e){return new A(e)},S.plot=function(e,t,r,n){var a=this;if(n)return a.update(e,t,!0);a._geoCalcData=e,a._fullLayout=t;var i=t[this.id],o=[],l=!1;for(var s in w.layerNameToAdjective)if("frame"!==s&&i["show"+s]){l=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(i,t)}if(!r){if(this.updateProjection(e,t))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(t,n),this.updateDims(t,n),this.updateFx(t,n),h.generalUpdatePerTraceModule(this.graphDiv,this,e,n);var l=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=l.selectAll(".point"),this.dataPoints.text=l.selectAll("text"),this.dataPaths.line=l.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this._render()},S.updateProjection=function(e,t){var r=this.graphDiv,n=t[this.id],s=t._size,u=n.domain,f=n.projection,d=n.lonaxis,p=n.lataxis,h=d._ax,g=p._ax,m=this.projection=function(e){var t=e.projection,r=t.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var s=(a[n]||l[n])(),u=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],d=function(e){return e?s:[]},p=0;pu*Math.PI/180}return!1},s.getPath=function(){return i().projection(s)},s.getBounds=function(e){return s.getPath().bounds(e)},s.precision(w.precision),e._isSatellite&&s.tilt(t.tilt).distance(t.distance);u&&s.clipAngle(u-w.clipPad);return s}(n),y=[[s.l+s.w*u.x[0],s.t+s.h*(1-u.y[1])],[s.l+s.w*u.x[1],s.t+s.h*(1-u.y[0])]],b=n.center||{},x=f.rotation||{},_=d.range||[],M=p.range||[];if(n.fitbounds){h._length=y[1][0]-y[0][0],g._length=y[1][1]-y[0][1],h.range=v(r,h),g.range=v(r,g);var k=(h.range[0]+h.range[1])/2,T=(g.range[0]+g.range[1])/2;if(n._isScoped)b={lon:k,lat:T};else if(n._isClipped){b={lon:k,lat:T},x={lon:k,lat:T,roll:x.roll};var A=f.type,S=w.lonaxisSpan[A]/2||180,C=w.lataxisSpan[A]/2||90;_=[k-S,k+S],M=[T-C,T+C]}else b={lon:k,lat:T},x={lon:k,lat:x.lat,roll:x.roll}}m.center([b.lon-x.lon,b.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(f.parallels);var P=L(_,M);m.fitExtent(y,P);var D=this.bounds=m.getBounds(P),O=this.fitScale=m.scale(),R=m.translate();if(n.fitbounds){var E=m.getBounds(L(h.range,g.range)),N=Math.min((D[1][0]-D[0][0])/(E[1][0]-E[0][0]),(D[1][1]-D[0][1])/(E[1][1]-E[0][1]));isFinite(N)?m.scale(N*O):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else m.scale(f.scale*O);var I=this.midPt=[(D[0][0]+D[1][0])/2,(D[0][1]+D[1][1])/2];if(m.translate([R[0]+(I[0]-R[0]),R[1]+(I[1]-R[1])]).clipExtent(D),n._isAlbersUsa){var z=m([b.lon,b.lat]),F=m.translate();m.translate([F[0]-(z[0]-F[0]),F[1]-(z[1]-F[1])])}},S.updateBaseLayers=function(e,t){var r=this,a=r.topojson,i=r.layers,o=r.basePaths;function l(e){return"lonaxis"===e||"lataxis"===e}function s(e){return Boolean(w.lineLayers[e])}function c(e){return Boolean(w.fillLayers[e])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return s(e)||c(e)?t["show"+e]:!l(e)||t[e].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(e){delete i[e],delete o[e],n.select(this).remove()})),p.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=i[e]=n.select(this);"bg"===e?r.bgRect=t.append("rect").style("pointer-events","all"):l(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):s(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):c(e)&&(o[e]=t.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],i=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):s(r)||c(r)?n.datum(T(a,a.objects[r])):l(r)&&n.datum(function(e,t,r){var n,a,i,o=t[e],l=w.scopeDefaults[t.scope];"lonaxis"===e?(n=l.lonaxisRange,a=l.lataxisRange,i=function(e,t){return[e,t]}):"lataxis"===e&&(n=l.lataxisRange,a=l.lonaxisRange,i=function(e,t){return[t,e]});var s={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};g.setConvert(s,r);var c=g.calcTicks(s);t.isScoped||"lonaxis"!==e||c.pop();for(var u=c.length,f=new Array(u),d=0;d-1&&x(n.event,a,[r.xaxis],[r.yaxis],r.id,u),l.indexOf("event")>-1&&p.click(a,n.event))}))}function f(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},S.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,a="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",a),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(d.setClipUrl,a,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},g.setConvert(e.mockAxis,r)},S.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,a=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},c.extendFlat(this.viewInitial,t)},S.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?u(r[0],r[1]):null}function a(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",a).attr("transform",n)}},{"../../components/color":117,"../../components/dragelement":136,"../../components/drawing":139,"../../components/fx":157,"../../components/selections":205,"../../lib":260,"../../lib/geo_location_utils":255,"../../lib/topojson_utils":286,"../../registry":351,"../cartesian/autorange":307,"../cartesian/axes":308,"../plots":348,"./constants":338,"./zoom":343,"@plotly/d3":11,"d3-geo":26,"d3-geo-projection":25,"topojson-client":82}],340:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./geo"),o="geo",l=a(o),s={};s.geo={valType:"subplotid",dflt:o,editType:"calc"},t.exports={attr:o,name:o,idRoot:o,idRegex:l,attrRegex:l,attributes:s,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots.geo,l=0;l0&&D<0&&(D+=360);var O,R,E,N=(P+D)/2;if(!p){var I=h?f.projRotate:[N,0,0];O=r("projection.rotation.lon",I[0]),r("projection.rotation.lat",I[1]),r("projection.rotation.roll",I[2]),r("showcoastlines",!h&&b)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!b&&void 0)&&r("oceancolor")}(p?(R=-96.6,E=38.7):(R=h?N:O,E=(C[0]+C[1])/2),r("center.lon",R),r("center.lat",E),g&&(r("projection.tilt"),r("projection.distance")),v)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!b&&void 0)&&r("landcolor"),r("showlakes",!!b&&void 0)&&r("lakecolor"),r("showrivers",!!b&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==u&&b)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",b),r("subunitcolor"),r("subunitwidth")),h||r("showframe",b)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):m?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){a(e,t,r,{type:"geo",attributes:l,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":260,"../get_data":344,"../subplot_defaults":349,"./constants":338,"./layout_attributes":341}],343:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../registry"),o=Math.PI/180,l=180/Math.PI,s={cursor:"pointer"},c={cursor:"auto"};function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,l=o.layout,s=l[n],c=o._fullLayout,u=c[n],f={},d={};function p(e,t){f[n+"."+e]=a.nestedProperty(s,e).get(),i.call("_storeDirectGUIEdit",l,c._preGUI,f);var r=a.nestedProperty(u,e);r.get()!==t&&(r.set(t),a.nestedProperty(s,e).set(t),d[n+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function d(e,t){var r=u(0,t);function a(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(s)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render(!0);var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(e,t,a)})),r}function p(e,t){var r,a,i,o,l,d,p,h,g,v=u(0,t);function m(e){return t.invert(e)}function y(r){var n=t.rotate(),a=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return v.on("zoomstart",(function(){n.select(this).style(s),r=n.mouse(this),a=t.rotate(),i=t.translate(),o=a,l=m(r)})).on("zoom",(function(){if(d=n.mouse(this),function(e){var r=m(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(r))return v.scale(t.scale()),void v.translate(t.translate());t.scale(n.event.scale),t.translate([i[0],n.event.translate[1]]),l?m(d)&&(h=m(d),p=[o[0]+(h[0]-l[0]),a[1],a[2]],t.rotate(p),o=p):l=m(r=d),g=!0,e.render(!0);var s=t.rotate(),c=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&f(e,t,y)})),v}function h(e,t){var r,a={r:t.rotate(),k:t.scale()},i=u(0,t),o=function(e){var t=0,r=arguments.length,a=[];for(;++th?(i=(f>0?90:-90)-p,a=0):(i=Math.asin(f/h)*l-p,a=Math.sqrt(h*h-f*f));var g=180-i-2*p,v=(Math.atan2(d,u)-Math.atan2(c,a))*l,m=(Math.atan2(d,u)-Math.atan2(c,-a))*l;return x(r[0],r[1],i,v)<=x(r[0],r[1],g,m)?[i,v,r[2]]:[g,m,r[2]]}function x(e,t,r,n){var a=_(r-e),i=_(n-t);return Math.sqrt(a*a+i*i)}function _(e){return(e%360+540)%360-180}function w(e,t,r){var n=r*o,a=e.slice(),i=0===t?1:0,l=2===t?1:2,s=Math.cos(n),c=Math.sin(n);return a[i]=e[i]*s-e[l]*c,a[l]=e[l]*s+e[i]*c,a}function M(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*l,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*l,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*l]}function k(e,t){for(var r=0,n=0,a=e.length;n=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){x.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},x.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function T(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&E.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&E.length>15&&0===s.shapes.length&&0===s.images.length,x.linkSubplots(d,s,f,n),x.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),H=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||B;H&&!Y?n._bgLayer.remove():Y&&!H&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){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;n1,g=!t.height&&Math.abs(r.height-a)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var b=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,M=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:b,size:r.l+v},r:{val:_,size:r.r+v},b:{val:M,size:r.b+v},t:{val:w,size:r.t+v}},g[t]=1}else delete h[t],delete g[t];if(!n._replotting)return x.doAutoMargin(e)}},x.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),P(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,g=t._pushmargin,v=t._pushmarginIds,m=t.minreducedwidth,y=t.minreducedheight;if(!1!==t.margin.autoexpand){for(var b in g)v[b]||delete g[b];for(var _ in g.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},g){var w=g[_].l||{},M=g[_].b||{},k=w.val,T=w.size,A=M.val,S=M.size;for(var L in g){if(o(T)&&g[L].r){var C=g[L].r.val,D=g[L].r.size;if(C>k){var O=(T*C+(D-r)*k)/(C-k),R=(D*(1-k)+(T-r)*(1-C))/(C-k);O+R>c+f&&(c=O,f=R)}}if(o(S)&&g[L].t){var E=g[L].t.val,N=g[L].t.size;if(E>A){var I=(S*E+(N-n)*A)/(E-A),z=(N*(1-A)+(S-n)*(1-E))/(E-A);I+z>h+d&&(h=I,d=z)}}}}}var F=u.constrain(r-i.l-i.r,2,m),j=u.constrain(n-i.t-i.b,2,y),B=Math.max(0,r-F),H=Math.max(0,n-j);if(B){var Y=(c+f)/B;Y>1&&(c/=Y,f/=Y)}if(H){var G=(h+d)/H;G>1&&(h/=G,d/=G)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&x.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(v).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}x.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},x.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&x.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(E(o,c,f),a=0;a0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":117,"../components/drawing":139,"../constants/xmlns_namespaces":239,"../lib":260,"@plotly/d3":11}],360:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/attributes"),l=e("../../components/color/attributes").defaultLine,s=e("../../lib/extend").extendFlat,c=a.marker.line;t.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},a.geojson,{}),featureidkey:a.featureidkey,text:s({},a.text,{}),hovertext:s({},a.hovertext,{}),marker:{line:{color:s({},c.color,{dflt:l}),width:s({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":116,"../../components/colorscale/attributes":124,"../../lib/extend":252,"../../plots/attributes":304,"../../plots/template_attributes":350,"../scattergeo/attributes":401}],361:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../components/colorscale/calc"),o=e("../scatter/arrays_to_calcdata"),l=e("../scatter/calc_selection");function s(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,c=t._length,u=new Array(c);r=t.geojson?function(e){return s(e)||n(e)}:s;for(var f=0;f")}(e,f,o),[e]}},{"../../lib":260,"../../plots/cartesian/axes":308,"./attributes":360}],365:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":340,"../heatmap/colorbar":369,"./attributes":360,"./calc":361,"./defaults":362,"./event_data":363,"./hover":364,"./plot":366,"./select":367,"./style":368}],366:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../lib/topojson_utils").getTopojsonFeatures,l=e("../../plots/cartesian/autorange").findExtremes,s=e("./style").style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],a=n._subplot,s=r.locationmode,c=r._length,u="geojson-id"===s?i.extractTraceFeature(e):o(r,a.topojson),f=[],d=[],p=0;ps&&P[m].gap;)m--;for(b=P[m].s,g=P.length-1;g>m;g--)P[g].s=b;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],380:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),g=e("./fillcolor_defaults"),v=e("../../lib").coercePattern;t.exports=function(e,t,r,m){function y(r,a){return n.coerce(e,t,i,r,a)}var b=s(e,t,m,y);if(b||(t.visible=!1),t.visible){c(e,t,m,y),y("xhoverformat"),y("yhoverformat");var x=u(e,t,m,y),_=!x&&b=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&g<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-g);return iZ!=(j=E[O][1])>=Z&&(I=E[O-1][0],z=E[O][0],j-F&&(N=I+(z-I)*(Z-F)/(j-F),G=Math.min(G,N),U=Math.max(U,N)));G=Math.max(G,0),U=Math.min(U,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:G,x1:U,y0:Z,y1:Z,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":117,"../../components/fx":157,"../../lib":260,"../../registry":351,"./get_trace_color":383}],385:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":320,"./arrays_to_calcdata":372,"./attributes":373,"./calc":374,"./cross_trace_calc":378,"./cross_trace_defaults":379,"./defaults":380,"./format_labels":382,"./hover":384,"./marker_colorbar":391,"./plot":394,"./select":395,"./style":397,"./subtypes":398}],386:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){s||(s={});var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},{"../../components/colorscale/defaults":127,"../../components/colorscale/helpers":128,"../../lib":260}],387:[function(e,t,r){"use strict";var n=e("../../components/drawing"),a=e("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,c=e("../../lib"),u=c.segmentsIntersect,f=c.constrain,d=e("./constants");t.exports=function(e,t){var r,a,o,p,h,g,v,m,y,b,x,_,w,M,k,T,A,S,L=t.trace||{},C=t.xaxis,P=t.yaxis,D="log"===C.type,O="log"===P.type,R=C._length,E=P._length,N=t.backoff,I=L.marker,z=t.connectGaps,F=t.baseTolerance,j=t.shape,B="linear"===j,H=L.fill&&"none"!==L.fill,Y=[],G=d.minTolerance,U=e.length,q=new Array(U),V=0;function Z(r){var n=e[r];if(!n)return!1;var a=t.linearized?C.l2p(n.x):C.c2p(n.x),o=t.linearized?P.l2p(n.y):P.c2p(n.y);if(a===i){if(D&&(a=C.c2p(n.x,!0)),a===i)return!1;O&&o===i&&(a*=Math.abs(C._m*E*(C._m>0?l:s)/(P._m*R*(P._m>0?l:s)))),a*=1e3}if(o===i){if(O&&(o=P.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function W(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&coe||e[1]se)return[f(e[0],ie,oe),f(e[1],le,se)]}function fe(e,t){return e[0]===t[0]&&(e[0]===ie||e[0]===oe)||(e[1]===t[1]&&(e[1]===le||e[1]===se)||void 0)}function de(e,t,r){return function(n,a){var i=ue(n),o=ue(a),l=[];if(i&&o&&fe(i,o))return l;i&&l.push(i),o&&l.push(o);var s=2*c.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);s&&((i&&o?s>0==i[e]>o[e]?i:o:i||o)[e]+=s);return l}}function pe(e){var t=e[0],r=e[1],n=t===q[V-1][0],a=r===q[V-1][1];if(!n||!a)if(V>1){var i=t===q[V-2][0],o=r===q[V-2][1];n&&(t===ie||t===oe)&&i?o?V--:q[V-1]=e:a&&(r===le||r===se)&&o?i?V--:q[V-1]=e:q[V++]=e}else q[V++]=e}function he(e){q[V-1][0]!==e[0]&&q[V-1][1]!==e[1]&&pe([$,ee]),pe(e),te=null,$=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ce[a],o=u(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,e)oe?oe:0,Q=t[1]se?se:0,K||Q){if(V)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),q[V++]=n[1])}else re=ne(q[V-1],t)[0],q[V++]=re;else q[V++]=[K||t[0],Q||t[1]];var a=q[V-1];K&&Q&&(a[0]!==K||a[1]!==Q)?(te&&($!==K&&ee!==Q?pe($&&ee?(i=te,l=(o=t)[0]-i[0],s=(o[1]-i[1])/l,(i[1]*o[0]-o[1]*i[0])/l>0?[s>0?ie:oe,se]:[s>0?oe:ie,le]):[$||K,ee||Q]):$&&ee&&pe([$,ee])),pe([K,Q])):$-K&&ee-Q&&pe([K||$,Q||ee]),te=t,$=K,ee=Q}else te&&he(ne(te,t)[0]),q[V++]=t;var i,o,l,s}for(r=0;rJ(g,me))break;o=g,(w=y[0]*m[0]+y[1]*m[1])>x?(x=w,p=g,v=!1):w<_&&(_=w,h=g,v=!0)}if(v?(ve(p),o!==h&&ve(h)):(h!==a&&ve(h),o!==p&&ve(p)),ve(o),r>=e.length||!g)break;ve(g),a=g}}else ve(p)}te&&pe([$||te[0],ee||te[1]]),Y.push(q.slice(0,V))}var ye=j.slice(j.length-1);if(N&&"h"!==ye&&"v"!==ye){for(var be=!1,xe=-1,_e=[],we=0;we=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":30}],391:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],392:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),c.noAngle||(s("marker.angle"),c.noAngleRef||s("marker.angleref"),c.noStandOff||s("marker.standoff")),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":117,"../../components/colorscale/defaults":127,"../../components/colorscale/helpers":128,"./subtypes":398}],393:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":238,"../../lib":260}],394:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(h),k=o(M,"g","errorbars"),T=o(M,"g","lines"),A=o(M,"g","points"),S=o(M,"g","text");if(a.getComponentMethod("errorbars","plot")(e,k,r,g),!0===_.visible){var L,C;y(M).style("opacity",_.opacity);var P=_.fill.charAt(_.fill.length-1);"x"!==P&&"y"!==P&&(P=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var D,O,R="",E=[],N=_._prevtrace;N&&(R=N._prevRevpath||"",C=N._nextFill,E=N._polygons);var I,z,F,j,B,H,Y,G="",U="",q=[],V=i.noop;if(L=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(C&&C.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),z=s.steps(w.shape.split("").reverse().join(""))):I=z="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return z(e.reverse())},q=u(f,{xaxis:b,yaxis:x,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)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 Z=T.selectAll(".js-line").data(q);y(Z.exit()).style("opacity",0).remove(),Z.each(V(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(V(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(L?(L.datum(f),j&&H&&(P?("y"===P?j[1]=H[1]=x.c2p(0,!0):"x"===P&&(j[0]=H[0]=b.c2p(0,!0)),y(L).attr("d","M"+H+"L"+j+"L"+G.substr(1)).call(s.singleFillStyle,e)):y(L).attr("d",G+"Z").call(s.singleFillStyle,e))):C&&("tonext"===_.fill.substr(0,6)&&G&&R?("tonext"===_.fill?y(C).attr("d",G+"Z"+R+"Z").call(s.singleFillStyle,e):y(C).attr("d",G+"L"+R.substr(1)+"Z").call(s.singleFillStyle,e),_._polygons=_._polygons.concat(E)):(J(C),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(L?J(L):C&&J(C),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),S.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?K:X:_&&!w&&(v=Q),f&&(h=v),d&&(g=v)}var M,k=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,e).call(s.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,b,x)?(s.singlePointStyle(t,i,u,M,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,b,x,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,b,x)?r.layerClipId&&s.hideOutsideRangePoint(e,t,b,x,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=b.c2p(e.x),r=x.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,S,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(S,W,e)}function J(e){y(e).attr("d","M0,0Z")}function X(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":139,"../../lib":260,"../../lib/polygon":272,"../../registry":351,"./line_points":387,"./link_traces":389,"./subtypes":398,"@plotly/d3":11}],395:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")}(c,g,e,s[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}},{"../../components/fx":157,"../../constants/numerical":238,"../../lib":260,"../scatter/get_trace_color":383,"./attributes":401}],407:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":340,"../scatter/marker_colorbar":391,"../scatter/style":397,"./attributes":401,"./calc":402,"./defaults":403,"./event_data":404,"./format_labels":405,"./hover":406,"./plot":408,"./select":409,"./style":410}],408:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/topojson_utils").getTopojsonFeatures,o=e("../../lib/geojson_utils"),l=e("../../lib/geo_location_utils"),s=e("../../plots/cartesian/autorange").findExtremes,c=e("../../constants/numerical").BADNUM,u=e("../scatter/calc").calcMarkerSize,f=e("../scatter/subtypes"),d=e("./style");t.exports={calcGeoJSON:function(e,t){var r,n,a=e[0].trace,o=t[a.geo],f=o._subplot,d=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,h="geojson-id"===p?l.extractTraceFeature(e):i(a,f.topojson);for(r=0;ra&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),b={},x={},_=0;h?(v=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},m=function(e,t){var r=b[e.astr][t];e.get()[t]=r}):(v=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set([])},m=function(e,t){var r=b[e.astr][t];e.get().push(r)}),k(v);for(var w=o(t.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-e},pointBetween:function(t,r,n){var a=t[1]-r[1],i=n[0]-r[0],o=t[0]-r[0],l=n[1]-r[1],s=o*i+a*l;return!(s-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-a>e&&(i-c)*(a-u)/(o-u)+c-n>e&&(l=!l),i=c,o=u}return l}};return t}},{}],74:[function(e,t,r){var n={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),a=1;a0}))}function u(e,n){var a=e.seg,i=n.seg,o=a.start,l=a.end,c=i.start,u=i.end;r&&r.checkIntersection(a,i);var f=t.linesIntersect(o,l,c,u);if(!1===f){if(!t.pointsCollinear(o,l,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(l,c))return!1;var d=t.pointsSame(o,c),p=t.pointsSame(l,u);if(d&&p)return n;var h=!d&&t.pointBetween(o,c,u),g=!p&&t.pointBetween(l,c,u);if(d)return g?s(n,l):s(e,u),n;h&&(p||(g?s(n,l):s(e,u)),s(n,o))}else 0===f.alongA&&(-1===f.alongB?s(e,c):0===f.alongB?s(e,f.pt):1===f.alongB&&s(e,u)),0===f.alongB&&(-1===f.alongA?s(n,o):0===f.alongA?s(n,f.pt):1===f.alongA&&s(n,l));return!1}for(var f=[];!i.isEmpty();){var d=i.getHead();if(r&&r.vert(d.pt[0]),d.isStart){r&&r.segmentNew(d.seg,d.primary);var p=c(d),h=p.before?p.before.ev:null,g=p.after?p.after.ev:null;function v(){if(h){var e=u(d,h);if(e)return e}return!!g&&u(d,g)}r&&r.tempStatus(d.seg,!!h&&h.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(e)(b=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(e)b=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=b?!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 x=d.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(l.exists(x.prev)&&l.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!d.primary){var _=d.seg.myFill;d.seg.myFill=d.seg.otherFill,d.seg.otherFill=_}f.push(d.seg)}i.getHead().remove()}return r&&r.done(),f}return e?{addRegion:function(e){for(var n,a,i,o=e[e.length-1],s=0;s1)for(var r=1;r=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&o.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":79,timers:80}],81:[function(e,t,r){!function(e){var r=/^\s+/,n=/\s+$/,a=0,i=e.round,o=e.min,l=e.max,s=e.random;function c(t,s){if(s=s||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,s);var u=function(t){var a={r:0,g:0,b:0},i=1,s=null,c=null,u=null,f=!1,d=!1;"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,a=!1;if(S[e])e=S[e],a=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=B.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=B.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=B.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=B.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=B.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=B.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=B.hex8.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:I(t[4]),format:a?"name":"hex8"};if(t=B.hex6.exec(e))return{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:a?"name":"hex"};if(t=B.hex4.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:I(t[4]+""+t[4]),format:a?"name":"hex8"};if(t=B.hex3.exec(e))return{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:a?"name":"hex"};return!1}(t));"object"==typeof t&&(H(t.r)&&H(t.g)&&H(t.b)?(p=t.r,h=t.g,g=t.b,a={r:255*C(p,255),g:255*C(h,255),b:255*C(g,255)},f=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):H(t.h)&&H(t.s)&&H(t.v)?(s=E(t.s),c=E(t.v),a=function(t,r,n){t=6*C(t,360),r=C(r,100),n=C(n,100);var a=e.floor(t),i=t-a,o=n*(1-r),l=n*(1-i*r),s=n*(1-(1-i)*r),c=a%6;return{r:255*[n,l,o,o,s,n][c],g:255*[s,n,n,l,o,o][c],b:255*[o,o,s,n,n,l][c]}}(t.h,s,c),f=!0,d="hsv"):H(t.h)&&H(t.s)&&H(t.l)&&(s=E(t.s),u=E(t.l),a=function(e,t,r){var n,a,i;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=C(e,360),t=C(t,100),r=C(r,100),0===t)n=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;n=o(s,l,e+1/3),a=o(s,l,e),i=o(s,l,e-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,s,u),f=!0,d="hsl"),t.hasOwnProperty("a")&&(i=t.a));var p,h,g;return i=P(i),{ok:f,format:t.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}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=i(100*this._a)/100,this._format=s.format||u.format,this._gradientType=s.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=u.ok,this._tc_id=a++}function u(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,a,i=l(e,t,r),s=o(e,t,r),c=(i+s)/2;if(i==s)n=a=0;else{var u=i-s;switch(a=c>.5?u/(2-i-s):u/(i+s),i){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(c(n));return i}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/t;t--;)o.push(c({h:n,s:a,v:i})),i=(i+l)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,a=this.toRgb();return t=a.r/255,r=a.g/255,n=a.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=P(e),this._roundA=i(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=i(360*e.h),r=i(100*e.s),n=i(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,a){var o=[R(i(e).toString(16)),R(i(t).toString(16)),R(i(r).toString(16)),R(N(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,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(100*C(this._r,255))+"%",g:i(100*C(this._g,255))+"%",b:i(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%)":"rgba("+i(100*C(this._r,255))+"%, "+i(100*C(this._g,255))+"%, "+i(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(L[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+p(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=c(e);r="#"+p(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(m,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,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(x,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,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(M,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:E(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:s(),g:s(),b:s()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),a=c(t).toRgb(),i=r/100;return c({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},c.readability=function(t,r){var n=c(t),a=c(r);return(e.max(n.getLuminance(),a.getLuminance())+.05)/(e.min(n.getLuminance(),a.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,a,i=c.readability(e,t);switch(a=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},c.mostReadable=function(e,t,r){var n,a,i,o,l=null,s=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var u=0;us&&(s=n,l=c(t[u]));return c.isReadable(e,l,{level:i,size:o})||!a?l:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=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"},L=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function P(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function C(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,l(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function D(e){return o(1,l(0,e))}function O(e){return parseInt(e,16)}function R(e){return 1==e.length?"0"+e:""+e}function E(e){return e<=1&&(e=100*e+"%"),e}function N(t){return e.round(255*parseFloat(t)).toString(16)}function I(e){return O(e)/255}var z,F,j,B=(F="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",j="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+F),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function H(e){return!!B.CSS_UNIT.exec(e)}void 0!==t&&t.exports?t.exports=c:window.tinycolor=c}(Math)},{}],82:[function(e,t,r){!function(e,n){"object"==typeof r&&void 0!==t?n(r):n((e=e||self).topojson=e.topojson||{})}(this,(function(e){"use strict";function t(e){return e}function r(e){if(null==e)return t;var r,n,a=e.scale[0],i=e.scale[1],o=e.translate[0],l=e.translate[1];return function(e,t){t||(r=n=0);var s=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*a+o,u[1]=(n+=e[1])*i+l;so&&(o=e[0]),e[1]l&&(l=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":s(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(s)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,s=e.length;++ro&&(o=t[0]),t[1]l&&(l=t[1])})),e.objects)c(e.objects[t]);return[a,i,o,l]}function a(e,t){var r=t.id,n=t.bbox,a=null==t.properties?{}:t.properties,o=i(e,t);return null==r&&null==n?{type:"Feature",properties:a,geometry:o}:null==n?{type:"Feature",id:r,properties:a,geometry:o}:{type:"Feature",id:r,bbox:n,properties:a,geometry:o}}function i(e,t){var n=r(e.transform),a=e.arcs;function i(e,t){t.length&&t.pop();for(var r=a[e<0?~e:e],i=0,o=r.length;i1)n=s(e,t,r);else for(a=0,n=new Array(i=e.arcs.length);a1)for(var i,l,c=1,u=s(a[0]);cu&&(l=a[0],a[0]=a[c],a[c]=l,u=i);return a})).filter((function(e){return e.length>0}))}}function u(e,t){for(var r=0,n=e.length;r>>1;e[a]=2))throw new Error("n must be \u22652");var r,a=(s=e.bbox||n(e))[0],i=s[1],o=s[2],l=s[3];t={scale:[o-a?(o-a)/(r-1):1,l-i?(l-i)/(r-1):1],translate:[a,i]}}var s,c,u=f(t),d=e.objects,p={};function h(e){return u(e)}function g(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(g)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in d)p[c]=g(d[c]);return{type:"Topology",bbox:s,transform:t,objects:p,arcs:e.arcs.map((function(e){var t,r=0,n=1,a=e.length,i=new Array(a);for(i[0]=u(e[0],0);++r2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,t,r){var a=this.intercalaryMonth(e);if(r&&t!==a||t<1||t>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&t<=a?t-1:t:t-1},toChineseMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);if(t<0||t>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?t>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(e,t,r){var a,o=this._validateYear(e,n.local.invalidyear),l=d[o-d[0]],s=l>>9&4095,c=l>>5&15,u=31&l;(a=i.newDate(s,c,u)).add(4-(a.dayOfWeek()||7),"d");var f=this.toJD(e,t,r)-a.toJD();return 1+Math.floor(f/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,t){e.year&&(t=e.month(),e=e.year()),e=this._validateYear(e);var r=f[e-f[0]];if(t>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-t?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,l,r,n.local.invalidDate);e=this._validateYear(a.year()),t=a.month(),r=a.day();var o=this.isIntercalaryMonth(e,t),l=this.toChineseMonth(e,t),s=function(e,t,r,n,a){var i,o,l;if("object"==typeof e)o=e,i=t||{};else{var s;if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(s=!1,i=n):(s=!!n,i=a||{}),o={year:e,month:t,day:r,isIntercalary:s}}l=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var h=0;h>9&4095,(g>>5&15)-1,(31&g)+l);return i.year=v.getFullYear(),i.month=1+v.getMonth(),i.day=v.getDate(),i}(e,l,r,o);return i.toJD(s.year,s.month,s.day)},fromJD:function(e){var t=i.fromJD(e),r=function(e,t,r,n){var a,i;if("object"==typeof e)a=e,i=t||{};else{if(!("number"==typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:e,month:t,day:r},i=n||{}}var o=d[a.year-d[0]],l=a.year<<9|a.month<<5|a.day;i.year=l>=o?a.year:a.year-1,o=d[i.year-d[0]];var s,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(a.year,a.month-1,a.day);s=Math.round((u-c)/864e5);var p,h=f[i.year-f[0]];for(p=0;p<13;p++){var g=h&1<<12-p?30:29;if(s>13;!v||p=2&&n<=6},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year()+(a.year()<0?1:0),t=a.month(),(r=a.day())+(t>1?16:0)+(t>2?32*(t-2):0)+400*(e-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":97,"object-assign":68}],86:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()+(t.year()<0?1:0))%4==3||e%4==-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return(e=a.year())<0&&e++,a.day()+30*(a.month()-1)+365*(e-1)+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,a=t-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":97,"object-assign":68}],87:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(t.year())},_leapYear:function(e){return o(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===e?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),12===t&&this.leapYear(e)||8===t&&5===o(this.daysInYear(e),10)?30:9===t&&3===o(this.daysInYear(e),10)?29:this.daysPerMonth[t-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e<=0?e+1:e,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(t<7){for(var l=7;l<=this.monthsInYear(e);l++)o+=this.daysInMonth(e,l);for(l=1;l=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.hebrew=i},{"../main":97,"object-assign":68}],88:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){return(11*this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),e=e<=0?e+1:e,(r=a.day())+Math.ceil(29.5*(t-1))+354*(e-1)+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),n.calendars.islamic=i},{"../main":97,"object-assign":68}],89:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return(e=t.year()<0?t.year()+1:t.year())%4==0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return e=a.year(),t=a.month(),r=a.day(),e<0&&e++,t<=2&&(e--,t+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((t-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),l=t-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,l)}}),n.calendars.julian=i},{"../main":97,"object-assign":68}],90:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function o(e,t){return e-t*Math.floor(e/t)}function l(e,t){return o(e-1,t)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(e){e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year();var t=Math.floor(e/400);return e%=400,e+=e<0?400:0,t+"."+Math.floor(e/20)+"."+e%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(e,t){return this._validate(e,t,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate).day()},weekDay:function(e,t,r){return this._validate(e,t,r,n.local.invalidDate),!0},extraInfo:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=o((e-=this.jdEpoch)+8+340,365);return[Math.floor(t/20)+1,o(t,20)]},_toTzolkin:function(e){return[l((e-=this.jdEpoch)+20,20),l(e+4,13)]},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),n.calendars.mayan=i},{"../main":97,"object-assign":68}],91:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(t.year()+(t.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidMonth);(e=a.year())<0&&e++;for(var i=a.day(),l=1;l=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),n.calendars.nanakshahi=i},{"../main":97,"object-assign":68}],92:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){if(e=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[e])return this.daysPerYear;for(var t=0,r=this.minMonth;r<=12;r++)t+=this.NEPALI_CALENDAR_DATA[e][r];return t},daysInMonth:function(e,t){return e.year&&(t=e.month(),e=e.year()),this._validate(e,t,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[e]?this.daysPerMonth[t-1]:this.NEPALI_CALENDAR_DATA[e][t]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=n.instance(),o=0,l=t,s=e;this._createMissingCalendarData(e);var c=e-(l>9||9===l&&r>=this.NEPALI_CALENDAR_DATA[s][0]?56:57);for(9!==t&&(o=r,l--);9!==l;)l<=0&&(l=12,s--),o+=this.NEPALI_CALENDAR_DATA[s][l],l--;return 9===t?(o+=r-this.NEPALI_CALENDAR_DATA[s][0])<0&&(o+=i.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[s][9]-this.NEPALI_CALENDAR_DATA[s][0],i.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(e){var t=n.instance().fromJD(e),r=t.year(),a=t.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;a>s;)++o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var c=this.NEPALI_CALENDAR_DATA[i][o]-(s-a);return this.newDate(i,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=a.year(),t=a.month(),r=a.day();var i=e-(e>=0?474:473),l=474+o(i,2820);return r+(t<=7?31*(t-1):30*(t-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),n=o(t,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),l=o(n,366);a=Math.floor((2134*i+2816*l+2815)/1028522)+i+1}var s=a+2820*r+474;s=s<=0?s-1:s;var c=e-this.toJD(s,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=e-this.toJD(s,u,1)+1;return this.newDate(s,u,f)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":97,"object-assign":68}],94:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":97,"object-assign":68}],95:[function(e,t,r){var n=e("../main"),a=e("object-assign"),i=n.instance();function o(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(t.year());return i.leapYear(e)},weekOfYear:function(e,t,r){var a=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);e=this._t2gYear(a.year());return i.weekOfYear(e,a.month(),a.day())},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate);e=this._t2gYear(a.year());return i.toJD(e,a.month(),a.day())},fromJD:function(e){var t=i.fromJD(e),r=this._g2tYear(t.year());return this.newDate(r,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),n.calendars.thai=o},{"../main":97,"object-assign":68}],96:[function(e,t,r){var n=e("../main"),a=e("object-assign");function i(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(t.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(e,t){for(var r=this._validate(e,t,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(e,t,r){var a=this._validate(e,t,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,n=0;nt);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),l=i+1,s=a-12*i,c=t-o[r-1]+1;return this.newDate(l,s,c)},isValid:function(e,t,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(e=null!=e.year?e.year:e)>=1276&&e<=1500),a},_validate:function(e,t,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":97,"object-assign":68}],97:[function(e,t,r){var n=e("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function l(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}n(a.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,a){return(n=(null!=e&&e.year?e.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":e[i]+t[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),n(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(l.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+o(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),a=e.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);a=e.day();"y"===r?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(e){for(;ot-1+e.minMonth;)i++,o-=t,t=e.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var l=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,l}catch(e){throw this._validateLevel--,e}},_correctAdd:function(e,t,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==t[0]&&e.year()>0==t[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;t=this._add(e,r*a[0]+i*a[1],a[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),a="m"===r?t:e.month(),i="d"===r?t:e.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),e.date(n,a,i)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var a=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=a-(s>2.5?4716:4715);return c<=0&&c--,this.newDate(c,s,l)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var c=t.exports=new a;c.cdate=i,c.baseCalendar=l,c.calendars.gregorian=s},{"object-assign":68}],98:[function(e,t,r){var n=e("object-assign"),a=e("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(e,t){return"string"!=typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,t,r){if("string"!=typeof e&&(r=t,t=e,e=""),!t)return"";if(t.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var n,i,o,l,s=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,d=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;w+n1}),h=function(e,t,r,n){var a=""+t;if(p(e,n))for(;a.length1},b=function(e,r){var n=y(e,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+i+"}"),l=t.substring(T).match(o);if(!l)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=l[0].length,parseInt(l[0],10)},x=this,_=function(){if("function"==typeof s){y("m");var e=s.call(x,t.substring(T));return T+=e.length,e}return b("m")},w=function(e,r,n,i){for(var o=y(e,i)?n:r,l=0;l-1){p=1,h=g;for(var L=this.daysInMonth(d,p);h>L;L=this.daysInMonth(d,p))p++,h-=L}return f>-1?this.fromJD(f):this.newDate(d,p,h)},determineDate:function(e,t,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return t=t?t.newDate():null,e=null==e?t:"string"==typeof e?function(e){try{return i.parseDate(n,e,a)}catch(e){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,l=o.exec(e);l;)t.add(parseInt(l[1],10),l[2]||"d"),l=o.exec(e);return t}(e):"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?t:i.today().add(e,"d"):i.newDate(e)}})},{"./main":97,"object-assign":68}],99:[function(e,t,r){"use strict";t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]},{}],100:[function(e,t,r){"use strict";var n=e("./arrow_paths"),a=e("../../plots/font_attributes"),i=e("../../plots/cartesian/constants"),o=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=o("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:a({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:a({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":234,"../../plot_api/plot_template":297,"../../plots/cartesian/constants":315,"../../plots/font_attributes":336,"./arrow_paths":99}],101:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./draw").draw;function o(e){var t=e._fullLayout;n.filterVisible(t.annotations).forEach((function(t){var r=a.getFromId(e,t.xref),n=a.getFromId(e,t.yref),i=a.getRefType(t.xref),o=a.getRefType(t.yref);t._extremes={},"range"===i&&l(t,r),"range"===o&&l(t,n)}))}function l(e,t){var r,n=t._id,i=n.charAt(0),o=e[i],l=e["a"+i],s=e[i+"ref"],c=e["a"+i+"ref"],u=e["_"+i+"padplus"],f=e["_"+i+"padminus"],d={x:1,y:-1}[i]*e[i+"shift"],p=3*e.arrowsize*e.arrowwidth||0,h=p+d,g=p-d,v=3*e.startarrowsize*e.arrowwidth||0,m=v+d,y=v-d;if(c===s){var b=a.findExtremes(t,[t.r2c(o)],{ppadplus:h,ppadminus:g}),x=a.findExtremes(t,[t.r2c(l)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=l?m+l:m,y=l?y-l:y,r=a.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,h,m),ppadminus:Math.max(f,g,y)});e._extremes[n]=r}t.exports=function(e){var t=e._fullLayout;if(n.filterVisible(t.annotations).length&&e._fullData.length)return n.syncOrAsync([i,o],e)}},{"../../lib":260,"../../plots/cartesian/axes":308,"./draw":106}],102:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("../../plot_api/plot_template").arrayEditor;function o(e,t){var r,n,a,i,o,s,c,u=e._fullLayout.annotations,f=[],d=[],p=[],h=(t||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var r,l,s=o(e,t),c=s.on,u=s.off.concat(s.explicitOff),f={},d=e._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var Z=!1,W=["x","y"],J=0;J1)&&(ne===re?((pe=ae.r2fraction(t["a"+te]))<0||pe>1)&&(Z=!0):Z=!0),X=ae._offset+ae.r2p(t[te]),$=.5}else{var he="domain"===de;"x"===te?(Q=t[te],X=he?ae._offset+ae._length*Q:X=M.l+M.w*Q):(Q=1-t[te],X=he?ae._offset+ae._length*Q:X=M.t+M.h*Q),$=t.showarrow?.5:Q}if(t.showarrow){fe.head=X;var ge=t["a"+te];if(ee=oe*U(.5,t.xanchor)-le*U(.5,t.yanchor),ne===re){var ve=s.getRefType(ne);"domain"===ve?("y"===te&&(ge=1-ge),fe.tail=ae._offset+ae._length*ge):"paper"===ve?"y"===te?(ge=1-ge,fe.tail=M.t+M.h*ge):fe.tail=M.l+M.w*ge:fe.tail=ae._offset+ae.r2p(ge),K=ee}else fe.tail=X+ge,K=ee+ge;fe.text=fe.tail+ee;var me=w["x"===te?"width":"height"];if("paper"===re&&(fe.head=o.constrain(fe.head,1,me-1)),"pixel"===ne){var ye=-Math.max(fe.tail-3,fe.text),be=Math.min(fe.tail+3,fe.text)-me;ye>0?(fe.tail+=ye,fe.text+=ye):be>0&&(fe.tail-=be,fe.text-=be)}fe.tail+=ue,fe.head+=ue}else K=ee=se*U($,ce),fe.text=X+ee;fe.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=se/2+K,t["_"+te+"padminus"]=se/2-K,t["_"+te+"size"]=se,t["_"+te+"shift"]=ee}if(Z)I.remove();else{var xe=0,_e=0;if("left"!==t.align&&(xe=(T-x)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(N-_)*("middle"===t.valign?.5:1)),f)n.select("svg").attr({x:j+xe-1,y:j+_e}).call(u.setClipUrl,H?P:null,e);else{var we=j+_e-g.top,Me=j+xe-g.left;q.call(d.positionText,Me,we).call(u.setClipUrl,H?P:null,e)}Y.select("rect").call(u.setRect,j,j,T,N),B.call(u.setRect,z/2,z/2,F-z,G-z),I.call(u.setTranslate,Math.round(C.x.text-F/2),Math.round(C.y.text-G/2)),R.attr({transform:"rotate("+D+","+C.x.text+","+C.y.text+")"});var ke,Te=function(r,n){O.selectAll(".annotation-arrow-g").remove();var s=C.x.head,f=C.y.head,d=C.x.tail+r,p=C.y.tail+n,g=C.x.text+r,x=C.y.text+n,_=o.rotationXYMatrix(D,g,x),w=o.apply2DTransform(_),T=o.apply2DTransform2(_),P=+B.attr("width"),E=+B.attr("height"),N=g-.5*P,z=N+P,F=x-.5*E,j=F+E,H=[[N,F,N,j],[N,j,z,j],[z,j,z,F],[z,F,N,F]].map(T);if(!H.reduce((function(e,t){return e^!!o.segmentsIntersect(s,f,s+1e6,f+1e6,t[0],t[1],t[2],t[3])}),!1)){H.forEach((function(e){var t=o.segmentsIntersect(d,p,s,f,e[0],e[1],e[2],e[3]);t&&(d=t.x,p=t.y)}));var Y=t.arrowwidth,G=t.arrowcolor,U=t.arrowside,q=O.append("g").style({opacity:c.opacity(G)}).classed("annotation-arrow-g",!0),V=q.append("path").attr("d","M"+d+","+p+"L"+s+","+f).style("stroke-width",Y+"px").call(c.stroke,c.rgb(G));if(v(V,U,t),k.annotationPosition&&V.node().parentNode&&!i){var Z=s,W=f;if(t.standoff){var J=Math.sqrt(Math.pow(s-d,2)+Math.pow(f-p,2));Z+=t.standoff*(d-s)/J,W+=t.standoff*(p-f)/J}var X,K,Q=q.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-Z)+","+(p-W),transform:l(Z,W)}).style("stroke-width",Y+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");h.init({element:Q.node(),gd:e,prepFn:function(){var e=u.getTranslate(I);X=e.x,K=e.y,m&&m.autorange&&A(m._name+".autorange",!0),b&&b.autorange&&A(b._name+".autorange",!0)},moveFn:function(e,r){var n=w(X,K),a=n[0]+e,i=n[1]+r;I.call(u.setTranslate,a,i),S("x",y(m,e,"x",M,t)),S("y",y(b,r,"y",M,t)),t.axref===t.xref&&S("ax",y(m,e,"ax",M,t)),t.ayref===t.yref&&S("ay",y(b,r,"ay",M,t)),q.attr("transform",l(e,r)),R.attr({transform:"rotate("+D+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",e,L());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};if(t.showarrow&&Te(0,0),E)h.init({element:I.node(),gd:e,prepFn:function(){ke=R.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?S("ax",y(m,e,"ax",M,t)):S("ax",t.ax+e),t.ayref===t.yref?S("ay",y(b,r,"ay",M.w,t)):S("ay",t.ay+r),Te(e,r);else{if(i)return;var a,o;if(m)a=y(m,e,"x",M,t);else{var s=t._xsize/M.w,c=t.x+(t._xshift-t.xshift)/M.w-s/2;a=h.align(c+e/M.w,s,0,1,t.xanchor)}if(b)o=y(b,r,"y",M,t);else{var u=t._ysize/M.h,f=t.y-(t._yshift+t.yshift)/M.h-u/2;o=h.align(f-r/M.h,u,0,1,t.yanchor)}S("x",a),S("y",o),m&&b||(n=h.getCursor(m?.5:a,b?.5:o,t.xanchor,t.yanchor))}R.attr({transform:l(e,r)+ke}),p(I,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",V(n))},doneFn:function(){p(I),a.call("_guiRelayout",e,L());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,b=t.indexOf("end")>=0,x=h.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===p.nodeName){o={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=o.x-u.x,M=o.y-u.y;if(d=(f=Math.atan2(M,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+M*M))return void E();if(x){if(x*x>w*w+M*M)return void E();var k=x*Math.cos(f),T=x*Math.sin(f);u.x+=k,u.y+=T,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+M*M)return void E();var A=_*Math.cos(f),S=_*Math.sin(f);o.x-=A,o.y-=S,e.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var L=p.getTotalLength(),P="";if(L1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+l+'"]').remove():(s._pdata=a(e.glplot.cameraParams,[t.xaxis.r2l(s.x)*r[0],t.yaxis.r2l(s.y)*r[1],t.zaxis.r2l(s.z)*r[2]]),n(e.graphDiv,s,l,e.id,s._xa,s._ya))}}},{"../../plots/gl3d/project":345,"../annotations/draw":106}],113:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../lib");t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:e("./attributes")}}},layoutAttributes:e("./attributes"),handleDefaults:e("./defaults"),includeBasePlot:function(e,t){var r=n.subplotsRegistry.gl3d;if(!r)return;for(var i=r.attrRegex,o=Object.keys(e),l=0;l=0))return e;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return e}var l=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+l+", "+n[3]+")":"rgb("+l+")"}o.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},o.rgb=function(e){return o.tinyRGB(n(e))},o.opacity=function(e){return e?n(e).getAlpha():0},o.addOpacity=function(e,t){var r=n(e).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+t+")"},o.combine=function(e,t){var r=n(e).toRgb();if(1===r.a)return n(e).toRgbString();var a=n(t||c).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()},o.contrast=function(e,t,r){var a=n(e);return 1!==a.getAlpha()&&(a=n(o.combine(e,c))),(a.isDark()?t?a.lighten(t):c:r?a.darken(r):s).toString()},o.stroke=function(e,t){var r=n(t);e.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(e,t){var r=n(t);e.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(e){if(e&&"object"==typeof e){var t,r,n,a,l=Object.keys(e);for(t=0;t0?n>=s:n<=s));a++)n>u&&n0?n>=s:n<=s));a++)n>r[0]&&n1){var ce=Math.pow(10,Math.floor(Math.log(se)/Math.LN10));oe*=ce*c.roundUp(se/ce,[2,5,10]),(Math.abs(U.start)/U.size+1e-6)%1<2e-6&&(ae.tick0=0)}ae.dtick=oe}ae.domain=o?[re+O/I.h,re+K-O/I.h]:[re+D/I.w,re+K-D/I.w],ae.setScale(),e.attr("transform",u(Math.round(I.l),Math.round(I.t)));var ue,fe=e.select("."+T.cbtitleunshift).attr("transform",u(-Math.round(I.l),-Math.round(I.t))),de=ae.ticklabelposition,pe=ae.title.font.size,he=e.select("."+T.cbaxis),ge=0,ve=0;function me(n,a){var i={propContainer:ae,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:N._dfltTitle.colorbar,containerGroup:e.select("."+T.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;e.selectAll("."+o+",."+o+"-math-group").remove(),g.draw(r,n,f(i,a||{}))}return c.syncOrAsync([i.previousPromises,function(){var e,t;(o&&ie||!o&&!ie)&&("top"===B&&(e=D+I.l+I.w*R,t=O+I.t+I.h*(1-re-K)+3+.75*pe),"bottom"===B&&(e=D+I.l+I.w*R,t=O+I.t+I.h*(1-re)-3-.25*pe),"right"===B&&(t=O+I.t+I.h*E+3+.75*pe,e=D+I.l+I.w*re),me(ae._id+"title",{attributes:{x:e,y:t,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!ie||o&&ie){var i,s=e.select("."+T.cbtitle),f=s.select("text"),d=[-A/2,A/2],h=s.select(".h"+ae._id+"title-math-group").node(),g=15.6;if(f.node()&&(g=parseInt(f.node().style.fontSize,10)*w),h?(i=p.bBox(h),ve=i.width,(ge=i.height)>g&&(d[1]-=(ge-g)/2)):f.node()&&!f.classed(T.jsPlaceholder)&&(i=p.bBox(f.node()),ve=i.width,ge=i.height),o){if(ge){if(ge+=5,"top"===B)ae.domain[1]-=ge/I.h,d[1]*=-1;else{ae.domain[0]+=ge/I.h;var m=v.lineCount(f);d[1]+=(1-m)*g}s.attr("transform",u(d[0],d[1])),ae.setScale()}}else ve&&("right"===B&&(ae.domain[0]+=(ve+pe/2)/I.w),s.attr("transform",u(d[0],d[1])),ae.setScale())}e.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",o?u(0,Math.round(I.h*(1-ae.domain[1]))):u(Math.round(I.w*ae.domain[0]),0)),he.attr("transform",o?u(0,Math.round(-I.t)):u(Math.round(-I.l),0));var y=e.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(V);y.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),y.exit().remove();var b=H.map(ae.c2p).map(Math.round).sort((function(e,t){return e-t}));y.each((function(e,i){var l=[0===i?H[0]:(V[i]+V[i-1])/2,i===V.length-1?H[1]:(V[i]+V[i+1])/2].map(ae.c2p).map(Math.round);o&&(l[1]=c.constrain(l[1]+(l[1]>l[0])?1:-1,b[0],b[1]));var s=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(l)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(l)-n.min(l),2));if(t._fillgradient)p.gradient(s,r,t._id,o?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=G(e).replace("e-","");s.attr("fill",a(u).toHexString())}}));var x=e.select("."+T.cblines).selectAll("path."+T.cbline).data(F.color&&F.width?Z:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(e){var t=Q,r=Math.round(ae.c2p(e))+F.width/2%1;n.select(this).attr("d","M"+(o?t+","+r:r+","+t)+(o?"h":"v")+W).call(p.lineGroupStyle,F.width,Y(e),F.dash)})),he.selectAll("g."+ae._id+"tick,path").remove();var _=Q+W+(A||0)/2-("outside"===t.ticks?1:0),M=l.calcTicks(ae),k=l.getTickSigns(ae)[2];return l.drawTicks(r,ae,{vals:"inside"===ae.ticks?l.clipEnds(ae,M):M,layer:he,path:l.makeTickPath(ae,_,k),transFn:l.makeTransTickFn(ae)}),l.drawLabels(r,ae,{vals:M,layer:he,transFn:l.makeTransTickLabelFn(ae),labelFns:l.makeLabelFns(ae,_)})},function(){if(o&&!ie||!o&&ie){var e,a,i=ae.position||0,l=ae._offset+ae._length/2;if("right"===B)a=l,e=I.l+I.w*i+10+pe*(ae.showticklabels?1:.5);else if(e=l,"bottom"===B&&(a=I.t+I.h*i+10+(-1===de.indexOf("inside")?ae.tickfont.size:0)+("intside"!==ae.ticks&&t.ticklen||0)),"top"===B){var s=j.text.split("
").length;a=I.t+I.h*i+10-W-w*pe*s}me((o?"h":"v")+ae._id+"title",{avoid:{selection:n.select(r).selectAll("g."+ae._id+"tick"),side:B,offsetTop:o?0:I.t,offsetLeft:o?I.l:0,maxShift:o?N.width:N.height},attributes:{x:e,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,l=W+A/2;-1===de.indexOf("inside")&&(n=p.bBox(he.node()),l+=o?n.width:n.height),ue=fe.select("text");var c=0,f=o&&"top"===B,g=!o&&"right"===B,v=0;if(ue.node()&&!ue.classed(T.jsPlaceholder)){var y,b=fe.select(".h"+ae._id+"title-math-group").node();b&&(o&&ie||!o&&!ie)?(c=(n=p.bBox(b)).width,y=n.height):(c=(n=p.bBox(fe.node())).right-I.l-(o?Q:ne),y=n.bottom-I.t-(o?ne:Q),o||"top"!==B||(l+=n.height,v=n.height)),g&&(ue.attr("transform",u(c/2+pe/2,0)),c*=2),l=Math.max(l,o?c:y)}var x=2*(o?D:O)+l+S+A/2,w=0;!o&&j.text&&"bottom"===C&&E<=0&&(x+=w=x/2,v+=w),N._hColorbarMoveTitle=w,N._hColorbarMoveCBTitle=v;var z=S+A;e.select("."+T.cbbg).attr("x",(o?Q:ne)-z/2-(o?D:0)).attr("y",(o?ne:Q)-(o?X:O+v-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(X+z,2)).call(h.fill,L).call(h.stroke,t.bordercolor).style("stroke-width",S);var F=g?Math.max(c-10,0):0;if(e.selectAll("."+T.cboutline).attr("x",(o?Q:ne+D)+F).attr("y",(o?ne+O-X:Q)+(f?ge:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(X-(o?2*O+ge:2*D+F),2)).call(h.stroke,t.outlinecolor).style({fill:"none","stroke-width":A}),e.attr("transform",u(I.l-(o?$*x:0),I.t-(o?0:(1-ee)*x-v))),!o&&(S||a(L).getAlpha()&&!a.equals(N.paper_bgcolor,L))){var H=he.selectAll("text"),Y=H[0].length,G=e.select("."+T.cbbg).node(),U=p.bBox(G),q=p.getTranslate(e);H.each((function(e,t){var r=Y-1;if(0===t||t===r){var n,a=p.bBox(this),i=p.getTranslate(this);if(t===r){var o=a.right+i.x;(n=U.right+q.x+ne-S-2+R-o)>0&&(n=0)}else if(0===t){var l=a.left+i.x;(n=U.left+q.x+ne+S+2-l)<0&&(n=0)}n&&(Y<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var V={},Z=M[P],J=k[P],K=M[C],te=k[C],re=x-W;o?("pixels"===d?(V.y=E,V.t=X*K,V.b=X*te):(V.t=V.b=0,V.yt=E+s*K,V.yb=E-s*te),"pixels"===_?(V.x=R,V.l=x*Z,V.r=x*J):(V.l=re*Z,V.r=re*J,V.xl=R-m*Z,V.xr=R+m*J)):("pixels"===d?(V.x=R,V.l=X*Z,V.r=X*J):(V.l=V.r=0,V.xl=R+s*Z,V.xr=R-s*J),"pixels"===_?(V.y=1-E,V.t=x*K,V.b=x*te):(V.t=re*K,V.b=re*te,V.yt=E-m*K,V.yb=E+m*te)),i.autoMargin(r,t._id,V)}],r)}(r,t,e);m&&m.then&&(e._promises||[]).push(m),e._context.edits.colorbarPosition&&function(e,t,r){var n,a,i,l="v"===t.orientation,c=r._fullLayout._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),d(e)},moveFn:function(r,o){e.attr("transform",n+u(r,o)),a=s.align((l?t._uFrac:t._vFrac)+r/c.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),i=s.align((l?t._vFrac:1-t._uFrac)-o/c.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var f=s.getCursor(a,i,t.xanchor,t.yanchor);d(e,f)},doneFn:function(){if(d(e),void 0!==a&&void 0!==i){var n={};n[t._propPrefix+"x"]=a,n[t._propPrefix+"y"]=i,void 0!==t._traceIndex?o.call("_guiRestyle",r,n,t._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}},{"../../constants/alignment":233,"../../lib":260,"../../lib/extend":252,"../../lib/setcursor":280,"../../lib/svg_text_utils":283,"../../plots/cartesian/axes":308,"../../plots/cartesian/axis_defaults":310,"../../plots/cartesian/layout_attributes":321,"../../plots/cartesian/position_defaults":324,"../../plots/plots":348,"../../registry":351,"../color":117,"../colorscale/helpers":128,"../dragelement":136,"../drawing":139,"../titles":226,"./constants":119,"@plotly/d3":11,tinycolor2:81}],122:[function(e,t,r){"use strict";var n=e("../../lib");t.exports=function(e){return n.isPlainObject(e.colorbar)}},{"../../lib":260}],123:[function(e,t,r){"use strict";t.exports={moduleType:"component",name:"colorbar",attributes:e("./attributes"),supplyDefaults:e("./defaults"),draw:e("./draw").draw,hasColorbar:e("./has_colorbar")}},{"./attributes":118,"./defaults":120,"./draw":121,"./has_colorbar":122}],124:[function(e,t,r){"use strict";var n=e("../colorbar/attributes"),a=e("../../lib/regex").counter,i=e("../../lib/sort_object_keys"),o=e("./scales.js").scales;i(o);function l(e){return"`"+e+"`"}t.exports=function(e,t){e=e||"";var r,i=(t=t||{}).cLetter||"c",s=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===i,u="string"==typeof t.colorscaleDflt?o[t.colorscaleDflt]:null,f=t.editTypeOverride||"",d=e?e+".":"";"colorAttr"in t?(r=t.colorAttr,t.colorAttr):l(d+(r={z:"z",c:"color"}[i]));var p=i+"auto",h=i+"min",g=i+"max",v=i+"mid",m=(l(d+p),l(d+h),l(d+g),{});m[h]=m[g]=void 0;var y={};y[p]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},t.anim&&(b.color.anim=!0)),b[p]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[h]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},s||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),t.noColorAxis||(b.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":276,"../../lib/sort_object_keys":281,"../colorbar/attributes":118,"./scales.js":132}],125:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../lib"),i=e("./helpers").extractOpts;t.exports=function(e,t,r){var o,l=e._fullLayout,s=r.vals,c=r.containerStr,u=c?a.nestedProperty(t,c).get():t,f=i(u),d=!1!==f.auto,p=f.min,h=f.max,g=f.mid,v=function(){return a.aggNums(Math.min,null,s)},m=function(){return a.aggNums(Math.max,null,s)};(void 0===p?p=v():d&&(p=u._colorAx&&n(p)?Math.min(p,v()):v()),void 0===h?h=m():d&&(h=u._colorAx&&n(h)?Math.max(h,m()):m()),d&&void 0!==g&&(h-g>g-p?p=g-(h-g):h-g=0?l.colorscale.sequential:l.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":260,"./helpers":128,"fast-isnumeric":30}],126:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./helpers").hasColorscale,i=e("./helpers").extractOpts;t.exports=function(e,t){function r(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,a){var o=a.container?n.nestedProperty(e,a.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var l=i(o),s=l.auto;(s||void 0===l.min)&&r(o,a.min),(s||void 0===l.max)&&r(o,a.max),l.autocolorscale&&r(o,"colorscale")}}for(var l=0;l=0;n--,a++){var i=e[n];r[a]=[1-i[0],i[1]]}return r}function h(e,t){t=t||{};for(var r=e.domain,o=e.range,s=o.length,c=new Array(s),u=0;u4/3-l?o:l}},{}],134:[function(e,t,r){"use strict";var n=e("../../lib"),a=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,r,i){return e="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*e),0,2),t="bottom"===i?0:"middle"===i?1:"top"===i?2:n.constrain(Math.floor(3*t),0,2),a[t][e]}},{"../../lib":260}],135:[function(e,t,r){"use strict";r.selectMode=function(e){return"lasso"===e||"select"===e},r.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.openMode=function(e){return"drawline"===e||"drawopenpath"===e},r.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},r.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},r.selectingOrDrawing=function(e){return r.freeMode(e)||r.rectMode(e)}},{}],136:[function(e,t,r){"use strict";var n=e("mouse-event-offset"),a=e("has-hover"),i=e("has-passive-events"),o=e("../../lib").removeElement,l=e("../../plots/cartesian/constants"),s=t.exports={};s.align=e("./align"),s.getCursor=e("./cursor");var c=e("./unhover");function u(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function f(e){return n(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=c.wrapped,s.unhoverRaw=c.raw,s.init=function(e){var t,r,n,c,d,p,h,g,v=e.gd,m=1,y=v._context.doubleClickDelay,b=e.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,i?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=e.clampFn||function(e,t,r){return Math.abs(e)y&&(m=Math.max(m-1,1)),v._dragged)e.doneFn&&e.doneFn();else if(e.clickFn&&e.clickFn(m,p),!g){var r;try{r=new MouseEvent("click",t)}catch(e){var n=f(t);(r=document.createEvent("MouseEvents")).initMouseEvent("click",t.bubbles,t.cancelable,t.view,t.detail,t.screenX,t.screenY,n[0],n[1],t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}h.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},s.coverSlip=u},{"../../lib":260,"../../plots/cartesian/constants":315,"./align":133,"./cursor":134,"./unhover":137,"has-hover":61,"has-passive-events":62,"mouse-event-offset":66}],137:[function(e,t,r){"use strict";var n=e("../../lib/events"),a=e("../../lib/throttle"),i=e("../../lib/dom").getGraphDiv,o=e("../fx/constants"),l=t.exports={};l.wrapped=function(e,t,r){(e=i(e))._fullLayout&&a.clear(e._fullLayout._uid+o.HOVERID),l.raw(e,t,r)},l.raw=function(e,t){var r=e._fullLayout,a=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===n.triggerHandler(e,"plotly_beforehover",t)||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&a&&e.emit("plotly_unhover",{event:t,points:a}))}},{"../../lib/dom":250,"../../lib/events":251,"../../lib/throttle":284,"../fx/constants":151}],138:[function(e,t,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],139:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=a.numberFormat,o=e("fast-isnumeric"),l=e("tinycolor2"),s=e("../../registry"),c=e("../color"),u=e("../colorscale"),f=a.strTranslate,d=e("../../lib/svg_text_utils"),p=e("../../constants/xmlns_namespaces"),h=e("../../constants/alignment").LINE_SPACING,g=e("../../constants/interactions").DESELECTDIM,v=e("../../traces/scatter/subtypes"),m=e("../../traces/scatter/make_bubble_size_func"),y=e("../../components/fx/helpers").appendArrayPointValue,b=t.exports={};function x(e,t,r){var n=t.fillpattern,a=n&&b.getPatternAttr(n.shape,0,"");if(a){var i=b.getPatternAttr(n.bgcolor,0,null),o=b.getPatternAttr(n.fgcolor,0,null),l=n.fgopacity,s=b.getPatternAttr(n.size,0,8),u=b.getPatternAttr(n.solidity,0,.3),f=t.uid;b.pattern(e,"point",r,f,a,s,u,void 0,n.fillmode,i,o,l)}else t.fillcolor&&e.call(c.fill,t.fillcolor)}b.font=function(e,t,r,n){a.isPlainObject(t)&&(n=t.color,r=t.size,t=t.family),t&&e.style("font-family",t),r+1&&e.style("font-size",r+"px"),n&&e.call(c.fill,n)},b.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},b.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},b.setRect=function(e,t,r,n,a){e.call(b.setPosition,t,r).call(b.setSize,n,a)},b.translatePoint=function(e,t,r,n){var a=r.c2p(e.x),i=n.c2p(e.y);return!!(o(a)&&o(i)&&t.node())&&("text"===t.node().nodeName?t.attr("x",a).attr("y",i):t.attr("transform",f(a,i)),!0)},b.translatePoints=function(e,t,r){e.each((function(e){var a=n.select(this);b.translatePoint(e,a,t,r)}))},b.hideOutsideRangePoint=function(e,t,r,n,a,i){t.attr("display",r.isPtWithinRange(e,a)&&n.isPtWithinRange(e,i)?null:"none")},b.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var r=t.xaxis,a=t.yaxis;e.each((function(t){var i=t[0].trace,o=i.xcalendar,l=i.ycalendar,c=s.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){b.hideOutsideRangePoint(e,n.select(this),r,a,o,l)}))}))}},b.crispRound=function(e,t,r){return t&&o(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},b.singleLineStyle=function(e,t,r,n,a){t.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";c.stroke(t,n||i.color),b.dashLine(t,l,o)},b.lineGroupStyle=function(e,t,r,a){e.style("fill","none").each((function(e){var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=a||i.dash||"";n.select(this).call(c.stroke,r||i.color).call(b.dashLine,l,o)}))},b.dashLine=function(e,t,r){r=+r||0,t=b.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},b.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},b.singleFillStyle=function(e,t){var r=n.select(e.node());x(e,((r.data()[0]||[])[0]||{}).trace||{},t)},b.fillGroupStyle=function(e,t){e.style("stroke-width",0).each((function(e){var r=n.select(this);e[0].trace&&x(r,e[0].trace,t)}))};var _=e("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolBackOffs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(_).forEach((function(e){var t=_[e],r=t.n;b.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),b.symbolNames[r]=e,b.symbolFuncs[r]=t.f,b.symbolBackOffs[r]=t.backoff||0,t.needLine&&(b.symbolNeedLines[r]=!0),t.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(b.symbolNoFill[r]=!0)}));var w=b.symbolNames.length;function M(e,t,r,n){var a=e%100;return b.symbolFuncs[a](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(e){if(o(e))e=+e;else if("string"==typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=b.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=w||e>=400?0:Math.floor(Math.max(e,0))};var k={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},A=i("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(e,t,r,i,o,s){for(var u=o.length,f=S[i],d=new Array(u),p=0;p=100;var f=re(e,r),d=q(e,r);t.attr("d",M(u,s,f,d))}var p,h,g,v=!1;if(e.so)g=l.outlierwidth,h=l.outliercolor,p=o.outliercolor;else{var m=(l||{}).width;g=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,h="mlc"in e?e.mlcc=n.lineScale(e.mlc):a.isArrayOrTypedArray(l.color)?c.defaultLine:l.color,a.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,v=!0),p="mc"in e?e.mcc=n.markerScale(e.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(e))}if(e.om)t.call(c.stroke,p).style({"stroke-width":(g||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:g)+"px");var y=o.gradient,x=e.mgt;x?v=!0:x=y&&y.type,a.isArrayOrTypedArray(x)&&(x=x[0],S[x]||(x=0));var _=o.pattern,w=_&&b.getPatternAttr(_.shape,e.i,"");if(x&&"none"!==x){var k=e.mgc;k?v=!0:k=y.color;var T=r.uid;v&&(T+="-"+e.i),b.gradient(t,i,T,x,[[0,k],[1,p]],"fill")}else if(w){var A=b.getPatternAttr(_.bgcolor,e.i,null),L=b.getPatternAttr(_.fgcolor,e.i,null),P=_.fgopacity,C=b.getPatternAttr(_.size,e.i,8),D=b.getPatternAttr(_.solidity,e.i,.3),O=e.mcc||a.isArrayOrTypedArray(_.shape)||a.isArrayOrTypedArray(_.bgcolor)||a.isArrayOrTypedArray(_.size)||a.isArrayOrTypedArray(_.solidity),R=r.uid;O&&(R+="-"+e.i),b.pattern(t,"point",i,R,w,C,D,e.mcc,_.fillmode,A,L,P)}else c.fill(t,p);g&&c.stroke(t,h)}},b.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=b.tryColorscale(r,""),t.lineScale=b.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=v.isBubble(e)?m(e):function(){return(r.size||6)/2}),e.selectedpoints&&a.extendFlat(t,b.makeSelectedPointStyleFns(e)),t},b.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.marker||{},o=r.marker||{},l=n.marker||{},c=i.opacity,u=o.opacity,f=l.opacity,d=void 0!==u,p=void 0!==f;(a.isArrayOrTypedArray(c)||d||p)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?i.opacity:e.mo;return e.selected?d?u:t:p?f:g*t});var h=i.color,v=o.color,m=l.color;(v||m)&&(t.selectedColorFn=function(e){var t=e.mcc||h;return e.selected?v||t:m||t});var y=i.size,b=o.size,x=l.size,_=void 0!==b,w=void 0!==x;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||y/2;return e.selected?_?b/2:t:w?x/2:t}),t},b.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},a=e.textfont||{},i=r.textfont||{},o=n.textfont||{},l=a.color,s=i.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||l;return e.selected?s||t:u||(s?t:c.addOpacity(t,g))},t},b.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedPointStyleFns(t),a=t.marker||{},i=[];r.selectedOpacityFn&&i.push((function(e,t){e.style("opacity",r.selectedOpacityFn(t))})),r.selectedColorFn&&i.push((function(e,t){c.fill(e,r.selectedColorFn(t))})),r.selectedSizeFn&&i.push((function(e,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);e.attr("d",M(b.symbolNumber(i),o,re(n,t),q(n,t))),n.mrc2=o})),i.length&&e.each((function(e){for(var t=n.select(this),r=0;r0?r:0}b.textPointStyle=function(e,t,r){if(e.size()){var i;if(t.selectedpoints){var o=b.makeSelectedTextStyleFns(t);i=o.selectedTextColorFn}var l=t.texttemplate,s=r._fullLayout;e.each((function(e){var o=n.select(this),c=l?a.extractOption(e,t,"txt","texttemplate"):a.extractOption(e,t,"tx","text");if(c||0===c){if(l){var u=t._module.formatLabels,f=u?u(e,t,s):{},p={};y(p,t,e.i);var h=t._meta||{};c=a.texttemplateString(c,f,s._d3locale,p,e,h)}var g=e.tp||t.textposition,v=C(e,t),m=i?i(e):e.tc||t.textfont.color;o.call(b.font,e.tf||t.textfont.family,v,m).text(c).call(d.convertToTspans,r).call(P,g,v,e.mrc)}else o.remove()}))}},b.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var r=b.makeSelectedTextStyleFns(t);e.each((function(e){var a=n.select(this),i=r.selectedTextColorFn(e),o=e.tp||t.textposition,l=C(e,t);c.fill(a,i);var u=s.traceIs(t,"bar-like");P(a,o,l,e.mrc2||e.mrc,u)}))}};var D,O;function R(e,t,r){return r&&(e=j(e)),t?N(e[1]):E(e[0])}function E(e){var t=n.round(e,2);return D=t,t}function N(e){var t=n.round(e,2);return O=t,t}function I(e,t,r,n){var a=e[0]-t[0],i=e[1]-t[1],o=r[0]-t[0],l=r[1]-t[1],s=Math.pow(a*a+i*i,.25),c=Math.pow(o*o+l*l,.25),u=(c*c*a-s*s*o)*n,f=(c*c*i-s*s*l)*n,d=3*c*(s+c),p=3*s*(s+c);return[[E(t[0]+(d&&u/d)),N(t[1]+(d&&f/d))],[E(t[0]-(p&&u/p)),N(t[1]-(p&&f/p))]]}b.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],a=[];for(r=1;r=c||x>=f&&x<=c)&&(_<=d&&_>=u||_>=d&&_<=u)&&(e=[x,_])}return e}b.steps=function(e){var t=z[e]||F;return function(e){for(var r="M"+E(e[0][0])+","+N(e[0][1]),n=e.length,a=1;a=1e4&&(b.savedBBoxes={},B=0),r&&(b.savedBBoxes[r]=v),B++,a.extendFlat({},v)},b.setClipUrl=function(e,t,r){e.attr("clip-path",Y(t,r))},b.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},b.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||0,r=r||0,i=i.replace(/(\btranslate\(.*?\);?)/,"").trim(),i=(i+=f(t,r)).trim(),e[a]("transform",i),i},b.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},b.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",a=e.attr?"attr":"setAttribute",i=e[n]("transform")||"";return t=t||1,r=r||1,i=i.replace(/(\bscale\(.*?\);?)/,"").trim(),i=(i+="scale("+t+","+r+")").trim(),e[a]("transform",i),i};var G=/\s*sc.*/;b.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(G,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var U=/translate\([^)]*\)\s*$/;function q(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}b.setTextPointsScale=function(e,t,r){e&&e.each((function(){var e,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(a.attr("transform")||"").match(U);e=1===t&&1===r?[]:[f(o,l),"scale("+t+","+r+")",f(-o,-l)],s&&e.push(s),a.attr("transform",e.join(""))}}))},b.getMarkerStandoff=q;var V,Z,W,J,X,K,Q=Math.atan2,$=Math.cos,ee=Math.sin;function te(e,t){var r=t[0],n=t[1];return[r*$(e)-n*ee(e),r*ee(e)+n*$(e)]}function re(e,t){var r,n,a=e.ma;void 0===a&&(a=t.marker.angle||0);var i=t.marker.angleref;if("previous"===i||"north"===i){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],n=l[1]}else{var s=t._xA,c=t._yA;if(!s||!c)return 90;r=s.c2p(e.x),n=c.c2p(e.y)}if(t._geo){var u,f=e.lonlat[0],d=e.lonlat[1],p=t._geo.project([f,d+1e-5]),h=t._geo.project([f+1e-5,d]),g=Q(h[1]-n,h[0]-r),v=Q(p[1]-n,p[0]-r);if("north"===i)u=a/180*Math.PI;else if("previous"===i){var m=f/180*Math.PI,y=d/180*Math.PI,b=V/180*Math.PI,x=Z/180*Math.PI,_=b-m,w=$(x)*ee(_),M=ee(x)*$(y)-$(x)*ee(y)*$(_);u=-Q(w,M)-Math.PI,V=f,Z=d}var k=te(g,[$(u),0]),T=te(v,[ee(u),0]);a=Q(k[1]+T[1],k[0]+T[0])/Math.PI*180,"previous"!==i||K===t.uid&&e.i===X+1||(a=null)}if("previous"===i&&!t._geo)if(K===t.uid&&e.i===X+1&&o(r)&&o(n)){var A=r-W,S=n-J,L=t.line&&t.line.shape||"",P=L.slice(L.length-1);"h"===P&&(S=0),"v"===P&&(A=0),a+=Q(S,A)/Math.PI*180+90}else a=null}return W=r,J=n,X=e.i,K=t.uid,a}b.getMarkerAngle=re},{"../../components/fx/helpers":153,"../../constants/alignment":233,"../../constants/interactions":237,"../../constants/xmlns_namespaces":239,"../../lib":260,"../../lib/svg_text_utils":283,"../../registry":351,"../../traces/scatter/make_bubble_size_func":390,"../../traces/scatter/subtypes":398,"../color":117,"../colorscale":129,"./symbol_defs":140,"@plotly/d3":11,"fast-isnumeric":30,tinycolor2:81}],140:[function(e,t,r){"use strict";var n,a,i,o,l=e("parse-svg-path"),s=e("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,d=Math.cos,p=Math.sin;function h(e){return null===e}function g(e,t,r){if(!(e&&e%360!=0||t))return r;if(i===e&&o===t&&n===r)return a;function s(e,r){var n=d(e),a=p(e),i=r[0],o=r[1]+(t||0);return[i*n-o*a,i*a+o*n]}i=e,o=t,n=r;for(var c=e/180*f,u=0,h=0,g=l(r),v="",m=0;m0;t.each((function(t){var f,d=t[0].trace,p=d.error_x||{},h=d.error_y||{};d.ids&&(f=function(e){return e.id});var g=o.hasMarkers(d)&&d.marker.maxdisplayed>0;h.visible||p.visible||(t=[]);var v=n.select(this).selectAll("g.errorbar").data(t,f);if(v.exit().remove(),t.length){p.visible||v.selectAll("path.xerror").remove(),h.visible||v.selectAll("path.yerror").remove(),v.style("opacity",1);var m=v.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(l.duration).style("opacity",1),i.setClipUrl(v,r.layerClipId,e),v.each((function(e){var t=n.select(this),r=function(e,t,r){var n={x:t.c2p(e.x),y:r.c2p(e.y)};void 0!==e.yh&&(n.yh=r.c2p(e.yh),n.ys=r.c2p(e.ys),a(n.ys)||(n.noYS=!0,n.ys=r.c2p(e.ys,!0)));void 0!==e.xh&&(n.xh=t.c2p(e.xh),n.xs=t.c2p(e.xs),a(n.xs)||(n.noXS=!0,n.xs=t.c2p(e.xs,!0)));return n}(e,s,c);if(!g||e.vis){var i,o=t.select("path.yerror");if(h.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var f=h.width;i="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(i+="m-"+f+",0h"+2*f),!o.size()?o=t.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=t.select("path.xerror");if(p.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var v=(p.copy_ystyle?h:p).width;i="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(i+="m0,-"+v+"v"+2*v),!d.size()?d=t.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":398,"../drawing":139,"@plotly/d3":11,"fast-isnumeric":30}],147:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../color");t.exports=function(e){e.each((function(e){var t=e[0].trace,r=t.error_y||{},i=t.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(a.stroke,r.color),i.copy_ystyle&&(i=r),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(a.stroke,i.color)}))}},{"../color":117,"@plotly/d3":11}],148:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("./layout_attributes").hoverlabel,i=e("../../lib/extend").extendFlat;t.exports={hoverlabel:{bgcolor:i({},a.bgcolor,{arrayOk:!0}),bordercolor:i({},a.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:i({},a.align,{arrayOk:!0}),namelength:i({},a.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":252,"../../plots/font_attributes":336,"./layout_attributes":158}],149:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry");function i(e,t,r,a){a=a||n.identity,Array.isArray(e)&&(t[0][r]=a(e))}t.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(e){return function(t){return n.coerceHoverinfo({hoverinfo:t},{_module:e._module},r)}}for(var l=0;l=0&&r.index_[0]._length||oe<0||oe>w[0]._length)return h.unhoverRaw(e,t)}if(t.pointerX=ie+_[0]._offset,t.pointerY=oe+w[0]._offset,Y="xval"in t?m.flat(s,t.xval):m.p2c(_,ie),G="yval"in t?m.flat(s,t.yval):m.p2c(w,oe),!a(Y[0])||!a(G[0]))return o.warn("Fx.hover failed",t,e),h.unhoverRaw(e,t)}var ce=1/0;function ue(e,r){for(q=0;qee&&(te.splice(0,ee),ce=te[0].distance),y&&0!==F&&0===te.length){$.distance=F,$.index=!1;var f=Z._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(e){return e.spikeDistance<=F}))),f&&f.length){var d,h=f.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(h.length){var g=h[0];a(g.x0)&&a(g.y0)&&(d=de(g),(!ne.vLinePoint||ne.vLinePoint.spikeDistance>d.spikeDistance)&&(ne.vLinePoint=d))}var v=f.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(v.length){var b=v[0];a(b.x0)&&a(b.y0)&&(d=de(b),(!ne.hLinePoint||ne.hLinePoint.spikeDistance>d.spikeDistance)&&(ne.hLinePoint=d))}}}}}function fe(e,t,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(e.distance)Me-1;Ae--)Ce(te[Ae]);te=Se,ve()}var De=e._hoverdata,Oe=[],Re=B(e),Ee=H(e);for(U=0;U1||te.length>1)||"closest"===D&&ae&&te.length>1,Ze=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),We=O(te,{gd:e,hovermode:D,rotateLabels:Ve,bgColor:Ze,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});m.isUnifiedHover(D)||(!function(e,t,r){var n,a,i,o,l,s,c,u=0,f=1,d=e.size(),p=new Array(d),h=0;function g(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,i=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=i;n=!1}if(n){var c=0;for(o=0;ot.pmax&&c++;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos>t.pmax-1&&(s.del=!0,c--);for(o=0;o=0;l--)e[l].dp-=i;for(o=e.length-1;o>=0&&!(c<=0);o--)(s=e[o]).pos+s.dp+s.size>t.pmax&&(s.del=!0,c--)}}}e.each((function(e){var n=e[t],a="x"===n._id.charAt(0),i=n.range;0===h&&i&&i[0]>i[1]!==a&&(f=-1),p[h++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?M:1)/2,pmin:0,pmax:a?r.width:r.height}]})),p.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));for(;!n&&u<=d;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(l=m.length-1;l>=0;l--)m[l].dp+=a;for(v.push.apply(v,m),p.splice(o+1,1),c=0,l=v.length-1;l>=0;l--)c+=v[l].dp;for(i=c/v.length,l=v.length-1;l>=0;l--)v[l].dp-=i;n=!1}else o++}p.forEach(g)}for(o=p.length-1;o>=0;o--){var x=p[o];for(l=x.length-1;l>=0;l--){var _=x[l],w=_.datum;w.offset=_.dp,w.del=_.del}}}(We,Ve?"xa":"ya",u),E(We,Ve,u._invScaleX,u._invScaleY));if(l&&l.tagName){var Je=v.getComponentMethod("annotations","hasClickToShow")(e,Oe);f(n.select(l),Je?"pointer":"")}if(!l||i||!function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var a=r[n],i=e._hoverdata[n];if(a.curveNumber!==i.curveNumber||String(a.pointNumber)!==String(i.pointNumber)||String(a.pointNumbers)!==String(i.pointNumbers))return!0}return!1}(e,0,De))return;De&&e.emit("plotly_unhover",{event:t,points:De});e.emit("plotly_hover",{event:t,points:e._hoverdata,xaxes:_,yaxes:w,xvals:Y,yvals:G})}(e,t,r,i,l)}))},r.loneHover=function(e,t){var r=!0;Array.isArray(e)||(r=!1,e=[e]);var a=t.gd,i=B(a),o=H(a),l=O(e.map((function(e){var r=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,l=e._y0||e.y0||e.y||0,s=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),d=Math.min(l,s),h=Math.max(l,s),g=e.trace;if(v.traceIs(g,"gl3d")){var m=a._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;u+=y,f+=y,d+=b,h+=b}c.bbox={x0:u+o,x1:f+o,y0:d+i,y1:h+i},t.inOut_bbox&&t.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:t.bgColor||p.background,container:n.select(t.container),outerContainer:t.outerContainer||t.container}),s=0,c=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,r){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function O(e,t){var r=t.gd,a=r._fullLayout,i=t.hovermode,c=t.rotateLabels,f=t.bgColor,h=t.container,g=t.outerContainer,w=t.commonLabelOpts||{};if(0===e.length)return[[]];var M=t.fontFamily||y.HOVERFONT,k=t.fontSize||y.HOVERFONTSIZE,T=e[0],L=T.xa,P=T.ya,D=i.charAt(0),O=D+"Label",E=T[O];if(void 0===E&&"multicategory"===L.type)for(var N=0;Na.width-x?(v=a.width-x,t.attr("d","M"+(x-A)+",0L"+x+","+b+A+"v"+b+(2*S+y.height)+"H-"+x+"V"+b+A+"H"+(x-2*A)+"Z")):t.attr("d","M0,0L"+A+","+b+A+"H"+(S+y.width/2)+"v"+b+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+b+A+"H-"+A+"Z")}else{var _,C,D;"right"===P.side?(_="start",C=1,D="",v=L._offset+L._length):(_="end",C=-1,D="-",v=L._offset),m=P._offset+(T.y0+T.y1)/2,s.attr("text-anchor",_),t.attr("d","M0,0L"+D+A+","+A+"V"+(S+y.height/2)+"h"+D+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+D+A+"V-"+A+"Z");var O,R=y.height/2,N=z-y.top-R,I="clip"+a._uid+"commonlabel"+P._id;if(v=0?le:se+fe=0?se:be+fe=0?ie:oe+de=0?oe:xe+de=0,"top"!==e.idealAlign&&q||!V?q?(O+=I/2,e.anchor="start"):e.anchor="middle":(O-=I/2,e.anchor="end");else if(e.pos=O,q=D+N/2+Z<=F,V=D-N/2-Z>=0,"left"!==e.idealAlign&&q||!V)if(q)D+=N/2,e.anchor="start";else{e.anchor="middle";var W=Z/2,J=D+W-F,X=D-W;J>0&&(D-=J),X<0&&(D+=-X)}else D-=N/2,e.anchor="end";w.attr("text-anchor",e.anchor),L&&T.attr("text-anchor",e.anchor),t.attr("transform",l(D,O)+(c?s(_):""))})),_e}function R(e,t,r,n,a,i){var l="",s="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=o.templateString(e.name,e.trace._meta)),l=F(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(s+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(s+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&(s+=(s?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?s=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(s=e.yLabel):s=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(s+=(s?"
":"")+e.text),void 0!==e.extraText&&(s+=(s?"
":"")+e.extraText),i&&""===s&&!e.hovertemplate&&(""===l&&i.remove(),s=l);var f=e.hovertemplate||!1;if(f){var d=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(d[c+"other"]=d[c+"Val"],d[c+"otherLabel"]=d[c+"Label"]),s=(s=o.hovertemplateString(f,d,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(D,(function(t,r){return l=F(r,e.nameLength),""}))}return[s,l]}function E(e,t,r,a){var i=function(e){return e*r},o=function(e){return e*a};e.each((function(e){var r=n.select(this);if(e.del)return r.remove();var a=r.select("text.nums"),l=e.anchor,s="end"===l?-1:1,c={start:1,end:-1,middle:0}[l],f=c*(A+S),p=f+c*(e.txwidth+S),h=0,g=e.offset,v="middle"===l;v&&(f-=e.tx2width/2,p+=e.txwidth/2+S),t&&(g*=-T,h=e.offset*k),r.select("path").attr("d",v?"M-"+i(e.bx/2+e.tx2width/2)+","+o(g-e.by/2)+"h"+i(e.bx)+"v"+o(e.by)+"h-"+i(e.bx)+"Z":"M0,0L"+i(s*A+h)+","+o(A+g)+"v"+o(e.by/2-A)+"h"+i(s*e.bx)+"v-"+o(e.by)+"H"+i(s*A+h)+"V"+o(g-A)+"Z");var m=h+f,y=g+e.ty0-e.by/2+S,b=e.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==l?(a.attr("text-anchor","start"),m=v?-e.bx/2-e.tx2width/2+S:-e.bx-S):"right"===b&&"end"!==l&&(a.attr("text-anchor","end"),m=v?e.bx/2-e.tx2width/2-S:e.bx+S)),a.call(u.positionText,i(m),o(y)),e.tx2width&&(r.select("text.name").call(u.positionText,i(p+c*S+h),o(g+e.ty0-e.by/2+S)),r.select("rect").call(d.setRect,i(p+(c-1)*e.tx2width/2+h),o(g-e.by/2-1),i(e.tx2width),o(e.by+2)))}))}function N(e,t){var r=e.index,n=e.trace||{},i=e.cd[0],l=e.cd[r]||{};function s(e){return e||a(e)&&0===e}var c=Array.isArray(r)?function(e,t){var a=o.castOption(i,r,e);return s(a)?a:o.extractOption({},n,"",t)}:function(e,t){return o.extractOption(l,n,e,t)};function u(t,r,n){var a=c(r,n);s(a)&&(e[t]=a)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===n.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=o.constrain(e.x0,0,e.xa._length),e.x1=o.constrain(e.x1,0,e.xa._length),e.y0=o.constrain(e.y0,0,e.ya._length),e.y1=o.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:g.hoverLabelText(e.xa,e.xLabelVal,n.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:g.hoverLabelText(e.ya,e.yLabelVal,n.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!(isNaN(e.xerr)||"log"===e.xa.type&&e.xerr<=0)){var f=g.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+f+" / -"+g.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+f,"x"===t&&(e.distance+=1)}if(!(isNaN(e.yerr)||"log"===e.ya.type&&e.yerr<=0)){var d=g.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+d+" / -"+g.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+d,"y"===t&&(e.distance+=1)}var p=e.hoverinfo||e.trace.hoverinfo;return p&&"all"!==p&&(-1===(p=Array.isArray(p)?p:p.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===p.indexOf("y")&&(e.yLabel=void 0),-1===p.indexOf("z")&&(e.zLabel=void 0),-1===p.indexOf("text")&&(e.text=void 0),-1===p.indexOf("name")&&(e.name=void 0)),e}function I(e,t,r){var n,a,o=r.container,l=r.fullLayout,s=l._size,c=r.event,u=!!t.hLinePoint,f=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var h=p.combine(l.plot_bgcolor,l.paper_bgcolor);if(u){var v,m,y=t.hLinePoint;n=y&&y.xa,"cursor"===(a=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=a._offset+y.y);var b,x,_=i.readability(y.color,h)<1.5?p.contrast(h):y.color,w=a.spikemode,M=a.spikethickness,k=a.spikecolor||_,T=g.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=v),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),b=s.l+A*s.w,x=s.l+S*s.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:k,"stroke-dasharray":d.dashStyle(a.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==a.side?M:-M),cy:m,r:M,fill:k}).classed("spikeline",!0)}if(f){var L,P,C=t.vLinePoint;n=C&&C.xa,a=C&&C.ya,"cursor"===n.spikesnap?(L=c.pointerX,P=c.pointerY):(L=n._offset+C.x,P=a._offset+C.y);var D,O,R=i.readability(C.color,h)<1.5?p.contrast(h):C.color,E=n.spikemode,N=n.spikethickness,I=n.spikecolor||R,z=g.getPxPosition(e,n);if(-1!==E.indexOf("toaxis")||-1!==E.indexOf("across")){if(-1!==E.indexOf("toaxis")&&(D=z,O=P),-1!==E.indexOf("across")){var F=n._counterDomainMin,j=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),j=Math.max(j,n.position)),D=s.t+(1-j)*s.h,O=s.t+(1-F)*s.h}o.insert("line",":first-child").attr({x1:L,x2:L,y1:D,y2:O,"stroke-width":N,stroke:I,"stroke-dasharray":d.dashStyle(n.spikedash,N)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:L,x2:L,y1:D,y2:O,"stroke-width":N+2,stroke:h}).classed("spikeline",!0).classed("crisp",!0)}-1!==E.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:L,cy:z-("top"!==n.side?N:-N),r:N,fill:I}).classed("spikeline",!0)}}}function z(e,t){return!t||(t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint)}function F(e,t){return u.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em"]})}function j(e,t,r){var n=t[e+"a"],a=t[e+"Val"],i=t.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var l=t.cd[t.index],s=l[e+"Start"];void 0===s&&(s=l[e]);var c=l[e+"End"];void 0===c&&(c=l[e]);var u=c-s;"end"===o?a+=u:"middle"===o&&(a+=u/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function B(e){return e.offsetTop+e.clientTop}function H(e){return e.offsetLeft+e.clientLeft}function Y(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.x,i=n.y,l=a+n.width,s=i+n.height,c=o.apply3DTransform(r._invTransform)(a,i),u=o.apply3DTransform(r._invTransform)(l,s),f=c[0],d=c[1],p=u[0],h=u[1];return{x:f,y:d,width:p-f,height:h-d,top:Math.min(d,h),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(d,h)}}},{"../../lib":260,"../../lib/events":251,"../../lib/override_cursor":271,"../../lib/svg_text_utils":283,"../../plots/cartesian/axes":308,"../../registry":351,"../color":117,"../dragelement":136,"../drawing":139,"../legend/defaults":169,"../legend/draw":170,"./constants":151,"./helpers":153,"@plotly/d3":11,"fast-isnumeric":30,tinycolor2:81}],155:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../color"),i=e("./helpers").isUnifiedHover;t.exports=function(e,t,r,o){o=o||{};var l=t.legend;function s(e){o.font[e]||(o.font[e]=l?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),s("size"),s("family"),s("color"),l?(o.bgcolor||(o.bgcolor=a.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),n.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}},{"../../lib":260,"../color":117,"./helpers":153}],156:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes");t.exports=function(e,t){function r(r,i){return void 0!==t[r]?t[r]:n.coerce(e,t,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":260,"./layout_attributes":158}],157:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../dragelement"),o=e("./helpers"),l=e("./layout_attributes"),s=e("./hover");t.exports={moduleType:"component",name:"fx",constants:e("./constants"),schema:{layout:l},attributes:e("./attributes"),layoutAttributes:l,supplyLayoutGlobalDefaults:e("./layout_global_defaults"),supplyDefaults:e("./defaults"),supplyLayoutDefaults:e("./layout_defaults"),calc:e("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(e,t,r){return a.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return a.castOption(e,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=a.isD3Selection(e)?e:n.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:e("./click")}},{"../../lib":260,"../dragelement":136,"./attributes":148,"./calc":149,"./click":150,"./constants":151,"./defaults":152,"./helpers":153,"./hover":154,"./layout_attributes":158,"./layout_defaults":159,"./layout_global_defaults":160,"@plotly/d3":11}],158:[function(e,t,r){"use strict";var n=e("./constants"),a=e("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,t.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":336,"./constants":151}],159:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./layout_attributes"),i=e("./hovermode_defaults"),o=e("./hoverlabel_defaults");t.exports=function(e,t){function r(r,i){return n.coerce(e,t,a,r,i)}i(e,t)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var l=t._has("mapbox"),s=t._has("geo"),c=t._basePlotModules.length;"zoom"===t.dragmode&&((l||s)&&1===c||l&&s&&2===c)&&(t.dragmode="pan"),o(e,t,r),n.coerceFont(r,"hoverlabel.grouptitlefont",t.hoverlabel.font)}},{"../../lib":260,"./hoverlabel_defaults":155,"./hovermode_defaults":156,"./layout_attributes":158}],160:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("./hoverlabel_defaults"),i=e("./layout_attributes");t.exports=function(e,t){a(e,t,(function(r,a){return n.coerce(e,t,i,r,a)}))}},{"../../lib":260,"./hoverlabel_defaults":155,"./layout_attributes":158}],161:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../lib/regex").counter,i=e("../../plots/domain").attributes,o=e("../../plots/cartesian/constants").idRegex,l=e("../../plot_api/plot_template"),s={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function c(e,t,r){var n=t[r+"axes"],a=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function u(e,t,r,n,a,i){var o=t(e+"gap",r),l=t("domain."+e);t(e+"side",n);for(var s=new Array(a),c=l[0],u=(l[1]-c)/(a-o),f=u*(1-o),d=0;d1){if(!d&&!p&&!h)"independent"===k("pattern")&&(d=!0);v._hasSubplotGrid=d;var b,x,_="top to bottom"===k("roworder"),w=d?.2:.1,M=d?.3:.1;g&&t._splomGridDflt&&(b=t._splomGridDflt.xside,x=t._splomGridDflt.yside),v._domains={x:u("x",k,w,b,y),y:u("y",k,M,x,m,_)}}else delete t.grid}function k(e,t){return n.coerce(r,v,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,a,i,o,l,s,u,d=e.grid||{},p=t._subplots,h=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(h){var b=d.subplots||[];s=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1===_&&(t.legend=void 0),(!1!==_||f.uirevision)&&(p("uirevision",t.uirevision),!1!==_)){p("bgcolor",t.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,M,k,T=a.coerceFont(p,"font",t.font),A="h"===p("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(e.xaxis)?(M=1.1,k="bottom"):(M=-.1,k="top")):(w=1.02,M=1,k="auto"),p("traceorder",b),c.isGrouped(t.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",M),p("yanchor",k),p("valign"),a.noneOrAll(f,d,["x","y"]),p("title.text")){p("title.side",A?"left":"top");var S=a.extendFlat({},T,{size:a.bigFont(T.size)});a.coerceFont(p,"title.font",S)}}}},{"../../lib":260,"../../plot_api/plot_template":297,"../../plots/attributes":304,"../../plots/layout_attributes":346,"../../registry":351,"./attributes":167,"./helpers":173}],170:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib/events"),s=e("../dragelement"),c=e("../drawing"),u=e("../color"),f=e("../../lib/svg_text_utils"),d=e("./handle_click"),p=e("./constants"),h=e("../../constants/alignment"),g=h.LINE_SPACING,v=h.FROM_TL,m=h.FROM_BR,y=e("./get_legend_data"),b=e("./style"),x=e("./helpers");function _(e,t,r){var n=e[0],a=n.width,i=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===i?t._maxWidth*o:r+(o||a)}function w(e,t,r,n,a){var i=r.data()[0][0].trace,s={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};if(i._group&&(s.group=i._group),o.traceIs(i,"pie-like")&&(s.label=r.datum()[0].label),!1!==l.triggerHandler(e,"plotly_legendclick",s))if(1===n)t._clickTimeout=setTimeout((function(){e._fullLayout&&d(r,e,n)}),e._context.doubleClickDelay);else if(2===n){t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==l.triggerHandler(e,"plotly_legenddoubleclick",s)&&d(r,e,n)}}function M(e,t,r){var n,i,l=e.data()[0][0],s=l.trace,u=o.traceIs(s,"pie-like"),d=!r._inHover&&t._context.edits.legendText&&!u,h=r._maxNameLength;l.groupTitle?(n=l.groupTitle.text,i=l.groupTitle.font):(i=r.font,r.entries?n=l.text:(n=u?l.label:s.name,s._meta&&(n=a.templateString(n,s._meta))));var g=a.ensureSingle(e,"text","legendtext");g.attr("text-anchor","start").call(c.font,i).text(d?k(n,h):n);var v=r.itemwidth+2*p.itemGap;f.positionText(g,v,0),d?g.call(f.makeEditable,{gd:t,text:n}).call(A,e,t,r).on("edit",(function(n){this.text(k(n,h)).call(A,e,t,r);var i=l.trace._fullInput||{},c={};if(o.hasTransform(i,"groupby")){var u=o.getTransformIndices(i,"groupby"),f=u[u.length-1],d=a.keyedContainer(i,"transforms["+f+"].styles","target","value.name");d.set(l.trace._group,n),c=d.constructUpdate()}else c.name=n;return o.call("_guiRestyle",t,c,s.index)})):A(g,e,t,r)}function k(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function T(e,t){var r,i=t._context.doubleClickDelay,o=1,l=a.ensureSingle(e,"rect","legendtoggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(u.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(r=(new Date).getTime())-t._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(t,r,e,o,n.event)}})))}function A(e,t,r,n,a){n._inHover&&e.attr("data-notex",!0),f.convertToTspans(e,r,(function(){!function(e,t,r,n){var a=e.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void e.remove();var i=e.select("g[class*=math-group]"),o=i.node();r||(r=t._fullLayout.legend);var l,s=r.borderwidth;l=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var u,d,h=l.size*g;if(o){var v=c.bBox(o);u=v.height,d=v.width,1===n?c.setTranslate(i,s,s+.75*u):c.setTranslate(i,0,.25*u)}else{var m=e.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(u=h*y,d=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(d+=2*p.itemGap),f.positionText(m,s+p.titlePad,s+h);else{var x=2*p.itemGap+r.itemwidth;a.groupTitle&&(x=p.itemGap,d-=r.itemwidth),f.positionText(m,x,-h*((y-1)/2-.3))}}1===n?(r._titleWidth=d,r._titleHeight=u):(a.lineHeight=h,a.height=Math.max(u,16)+3,a.width=d)}(t,r,n,a)}))}function S(e){return a.isRightAnchor(e)?"right":a.isCenterAnchor(e)?"center":"left"}function L(e){return a.isBottomAnchor(e)?"bottom":a.isMiddleAnchor(e)?"middle":"top"}t.exports=function(e,t){return t||(t=e._fullLayout.legend||{}),function(e,t){var r,l,f=e._fullLayout,d="legend"+f._uid,h=t._inHover;h?(r=t.layer,d+="-hover"):r=f._infolayer;if(!r)return;e._legendMouseDownTime||(e._legendMouseDownTime=0);if(h){if(!t.entries)return;l=y(t.entries,t)}else{if(!e.calcdata)return;l=f.showlegend&&y(e.calcdata,t)}var g=f.hiddenlabels||[];if(!(h||f.showlegend&&l.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+d).remove(),i.autoMargin(e,"legend");var k=a.ensureSingle(r,"g","legend",(function(e){h||e.attr("pointer-events","all")})),P=a.ensureSingleById(f._topdefs,"clipPath",d,(function(e){e.append("rect")})),C=a.ensureSingle(k,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));C.call(u.stroke,t.bordercolor).call(u.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var D=a.ensureSingle(k,"g","scrollbox"),O=t.title;if(t._titleWidth=0,t._titleHeight=0,O.text){var R=a.ensureSingle(D,"text","legendtitletext");R.attr("text-anchor","start").call(c.font,O.font).text(O.text),A(R,D,e,t,1)}else D.selectAll(".legendtitletext").remove();var E=a.ensureSingle(k,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),N=D.selectAll("g.groups").data(l);N.enter().append("g").attr("class","groups"),N.exit().remove();var I=N.selectAll("g.traces").data(a.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.style("opacity",(function(e){var t=e[0].trace;return o.traceIs(t,"pie-like")?-1!==g.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){n.select(this).call(M,e,t)})).call(b,e,t).each((function(){h||n.select(this).call(T,e)})),a.syncOrAsync([i.previousPromises,function(){return function(e,t,r,a){var i=e._fullLayout;a||(a=i.legend);var o=i._size,l=x.isVertical(a),s=x.isGrouped(a),u="fraction"===a.entrywidthmode,f=a.borderwidth,d=2*f,h=p.itemGap,g=a.itemwidth+2*h,v=2*(f+h),m=L(a),y=a.y<0||0===a.y&&"top"===m,b=a.y>1||1===a.y&&"bottom"===m,w=a.tracegroupgap,M={};a._maxHeight=Math.max(y||b?i.height/2:o.h,30);var k=0;a._width=0,a._height=0;var T=function(e){var t=0,r=0,n=e.title.side;n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight));return[t,r]}(a);if(l)r.each((function(e){var t=e[0].height;c.setTranslate(this,f+T[0],f+T[1]+a._height+t/2+h),a._height+=t,a._width=Math.max(a._width,e[0].width)})),k=g+a._width,a._width+=h+g+d,a._height+=v,s&&(t.each((function(e,t){c.setTranslate(this,0,t*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=S(a),P=a.x<0||0===a.x&&"right"===A,C=a.x>1||1===a.x&&"left"===A,D=b||y,O=i.width/2;a._maxWidth=Math.max(P?D&&"left"===A?o.l+o.w:O:C?D&&"right"===A?o.r+o.w:O:o.w,2*g);var R=0,E=0;r.each((function(e){var t=_(e,a,g);R=Math.max(R,t),E+=t})),k=null;var N=0;if(s){var I=0,z=0,F=0;t.each((function(){var e=0,t=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,a,g),i=r[0].height;c.setTranslate(this,T[0],T[1]+f+h+i/2+t),t+=i,e=Math.max(e,n),M[r[0].trace.legendgroup]=e}));var r=e+h;z>0&&r+f+z>a._maxWidth?(N=Math.max(N,z),z=0,F+=I+w,I=t):I=Math.max(I,t),c.setTranslate(this,z,F),z+=r})),a._width=Math.max(N,z)+f,a._height=F+I+v}else{var j=r.size(),B=E+d+(j-1)*h=a._maxWidth&&(N=Math.max(N,U),Y=0,G+=H,a._height+=H,H=0),c.setTranslate(this,T[0]+f+Y,T[1]+f+G+t/2+h),U=Y+r+h,Y+=n,H=Math.max(H,t)})),B?(a._width=Y+d,a._height=H+v):(a._width=Math.max(N,U)+d,a._height+=H+v)}}a._width=Math.ceil(Math.max(a._width+T[0],a._titleWidth+2*(f+p.titlePad))),a._height=Math.ceil(Math.max(a._height+T[1],a._titleHeight+2*(f+p.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var q=e._context.edits,V=q.legendText||q.legendPosition;r.each((function(e){var t=n.select(this).select(".legendtoggle"),r=e[0].height,i=e[0].trace.legendgroup,o=_(e,a,g);s&&""!==i&&(o=M[i]);var f=V?g:k||o;l||u||(f+=h/2),c.setRect(t,0,-r/2,f,r)}))}(e,N,I,t)},function(){var l,u,g,y,b=f._size,x=t.borderwidth;if(!h){if(function(e){var t=e._fullLayout.legend,r=S(t),n=L(t);return i.autoMargin(e,"legend",{x:t.x,y:t.y,l:t._width*v[r],r:t._width*m[r],b:t._effHeight*m[n],t:t._effHeight*v[n]})}(e))return;var _=b.l+b.w*t.x-v[S(t)]*t._width,M=b.t+b.h*(1-t.y)-v[L(t)]*t._effHeight;if(f.margin.autoexpand){var T=_,A=M;_=a.constrain(_,0,f.width-t._width),M=a.constrain(M,0,f.height-t._effHeight),_!==T&&a.log("Constrain legend.x to make legend fit inside graph"),M!==A&&a.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(k,_,M)}if(E.on(".drag",null),k.on("wheel",null),h||t._height<=t._maxHeight||e._context.staticPlot){var O=t._effHeight;h&&(O=t._height),C.attr({width:t._width-x,height:O-x,x:x/2,y:x/2}),c.setTranslate(D,0,0),P.select("rect").attr({width:t._width-2*x,height:O-2*x,x:x,y:x}),c.setClipUrl(D,d,e),c.setRect(E,0,0,0,0),delete t._scrollY}else{var R,N,I,z=Math.max(p.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),F=t._effHeight-z-2*p.scrollBarMargin,j=t._height-t._effHeight,B=F/j,H=Math.min(t._scrollY||0,j);C.attr({width:t._width-2*x+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-x,x:x/2,y:x/2}),P.select("rect").attr({width:t._width-2*x+p.scrollBarWidth+p.scrollBarMargin,height:t._effHeight-2*x,x:x,y:x+H}),c.setClipUrl(D,d,e),U(H,z,B),k.on("wheel",(function(){U(H=a.constrain(t._scrollY+n.event.deltaY/F*j,0,j),z,B),0!==H&&H!==j&&n.event.preventDefault()}));var Y=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,I=H})).on("drag",(function(){var e=n.event.sourceEvent;2===e.buttons||e.ctrlKey||(N="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,U(H=function(e,t,r){var n=(r-t)/B+e;return a.constrain(n,0,j)}(I,R,N),z,B))}));E.call(Y);var G=n.behavior.drag().on("dragstart",(function(){var e=n.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,I=H)})).on("drag",(function(){var e=n.event.sourceEvent;"touchmove"===e.type&&(N=e.changedTouches[0].clientY,U(H=function(e,t,r){var n=(t-r)/B+e;return a.constrain(n,0,j)}(I,R,N),z,B))}));D.call(G)}function U(r,n,a){t._scrollY=e._fullLayout.legend._scrollY=r,c.setTranslate(D,0,-r),c.setRect(E,t._width,p.scrollBarMargin+r*a,p.scrollBarWidth,n),P.select("rect").attr("y",x+r)}e._context.edits.legendPosition&&(k.classed("cursor-move",!0),s.init({element:k.node(),gd:e,prepFn:function(){var e=c.getTranslate(k);g=e.x,y=e.y},moveFn:function(e,r){var n=g+e,a=y+r;c.setTranslate(k,n,a),l=s.align(n,0,b.l,b.l+b.w,t.xanchor),u=s.align(a,0,b.t+b.h,b.t,t.yanchor)},doneFn:function(){void 0!==l&&void 0!==u&&o.call("_guiRelayout",e,{"legend.x":l,"legend.y":u})},clickFn:function(t,n){var a=r.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return n.clientX>=e.left&&n.clientX<=e.right&&n.clientY>=e.top&&n.clientY<=e.bottom}));a.size()>0&&w(e,k,a,t,n)}}))}],e)}(e,t)}},{"../../constants/alignment":233,"../../lib":260,"../../lib/events":251,"../../lib/svg_text_utils":283,"../../plots/plots":348,"../../registry":351,"../color":117,"../dragelement":136,"../drawing":139,"./constants":168,"./get_legend_data":171,"./handle_click":172,"./helpers":173,"./style":175,"@plotly/d3":11}],171:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("./helpers");t.exports=function(e,t){var r,i,o=t._inHover,l=a.isGrouped(t),s=a.isReversed(t),c={},u=[],f=!1,d={},p=0,h=0;function g(e,r){if(""!==e&&a.isGrouped(t))-1===u.indexOf(e)?(u.push(e),f=!0,c[e]=[r]):c[e].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rT&&(k=T)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(w.forEach((function(e,t){e[0]._preGroupSort=t})),w.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),r=0;rr?r:e}t.exports=function(e,t,r){var m=t._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*p.itemGap)/2,_=o(x,0),w=function(e,t,r,n){var a;if(e+1)a=e;else{if(!(t&&t.width>0))return 0;a=t.width}return y?n:Math.min(a,r)};function M(e,i,o){var u=e[0].trace,f=u.marker||{},d=f.line||{},p=o?u.visible&&u.type===o:a.traceIs(u,"bar"),h=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(p?[e]:[]);h.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),h.exit().remove(),h.each((function(e){var a=n.select(this),i=e[0],o=w(i.mlw,f.line,5,2);a.style("stroke-width",o+"px");var p=i.mcc;if(!r._inHover&&"mc"in i){var h=c(f),g=h.mid;void 0===g&&(g=(h.max+h.min)/2),p=l.tryColorscale(f,"")(g)}var m=p||i.mc||f.color,y=f.pattern,b=y&&l.getPatternAttr(y.shape,0,"");if(b){var x=l.getPatternAttr(y.bgcolor,0,null),_=l.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,k=v(y.size,8,10),T=v(y.solidity,.5,1),A="legend-"+u.uid;a.call(l.pattern,"legend",t,A,b,k,T,p,y.fillmode,x,_,M)}else a.call(s.fill,m);o&&s.stroke(a,i.mlc||d.color)}))}function k(e,t,r){var o=e[0],l=o.trace,s=r?l.visible&&l.type===r:a.traceIs(l,r),c=n.select(t).select("g.legendpoints").selectAll("path.legend"+r).data(s?[e]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(l.marker||{}).line,p=w(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)}}e.each((function(e){var t=n.select(this),a=i.ensureSingle(t,"g","layers");a.style("opacity",e[0].trace.opacity);var l=r.valign,s=e[0].lineHeight,c=e[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([e]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var f=a.selectAll("g.legendsymbols").data([e]);f.enter().append("g").classed("legendsymbols",!0),f.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var r,a=e[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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,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",e[0]),u?f.call(s.fill,u):f.call((function(e){if(e.size()){var n="legendfill-"+a.uid;l.gradient(e,t,n,h(g,"radial"===r),p,"fill")}}))}))})).each((function(e){var t=e[0].trace,r="waterfall"===t.type;if(e[0]._distinct&&r){var a=e[0].trace[e[0].dir].marker;return e[0].mc=a.color,e[0].mlw=a.line.width,e[0].mlc=a.line.color,M(e,this,"waterfall")}var i=[];t.visible&&r&&(i=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=n.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(i);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var r=n.select(this),a=t[e[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",e[1]).style("stroke-width",i+"px").call(s.fill,a.color),i&&r.call(s.stroke,a.line.color)}))})).each((function(e){M(e,this,"funnel")})).each((function(e){M(e,this)})).each((function(e){var r=e[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&a.traceIs(r,"box-violin")?[e]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var e=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==s.opacity(r.fillcolor)||0!==s.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);e.style("stroke-width",a+"px").call(s.fill,r.fillcolor),a&&s.stroke(e,r.line.color)}else{var c=i.minExtend(r,{marker:{size:y?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(l.pointStyle,c,t)}}))})).each((function(e){k(e,this,"funnelarea")})).each((function(e){k(e,this,"pie")})).each((function(e){var r,a,o=g(e),s=o.showFill,f=o.showLine,d=o.showGradientLine,p=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=e[0],x=y.trace,_=c(x),M=_.colorscale,k=_.reversescale,T=u.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(s||p?[e]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",T+"h"+b+"v6h-"+b+"z").call((function(e){if(e.size())if(s)l.fillGroupStyle(e,t);else{var r="legendfill-"+x.uid;l.gradient(e,t,r,h(k),M,"fill")}})),f||d){var L=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:L}}),r=[i.minExtend(y,{trace:a})]}var P=A.select(".legendlines").selectAll("path").data(f||d?[r]:[]);P.enter().append("path").classed("js-line",!0),P.exit().remove(),P.attr("d",T+(d?"l"+b+",0.0001":"h"+b)).call(f?l.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+x.uid;l.lineGroupStyle(e),l.gradient(e,t,r,h(k),M,"stroke")}})})).each((function(e){var r,a,o=g(e),s=o.anyFill,c=o.anyLine,f=o.showLine,d=o.showMarker,p=e[0],h=p.trace,v=!d&&!c&&!s&&u.hasText(h);function m(e,t,r,n){var a=i.nestedProperty(h,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(e){return p._distinct&&p.index&&e[p.index]?e[p.index]:e[0]}if(d||v||f){var x={},w={};if(d){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",i.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",i.mean,[2,16],12);x.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[i.minExtend(p,x)],(a=i.minExtend(h,w)).selectedpoints=null,a.texttemplate=null}var k=n.select(this).select("g.legendpoints"),T=k.selectAll("path.scatterpts").data(d?r:[]);T.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),T.exit().remove(),T.call(l.pointStyle,a,t),d&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(v?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(l.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);r.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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(e){var t=e[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);r.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(e,r){var a=n.select(this),i=t[r?"increasing":"decreasing"],o=w(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":260,"../../registry":351,"../../traces/pie/helpers":370,"../../traces/pie/style_one":371,"../../traces/scatter/subtypes":398,"../color":117,"../colorscale/helpers":128,"../drawing":139,"./constants":168,"@plotly/d3":11}],176:[function(e,t,r){"use strict";e("./constants");t.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":178}],177:[function(e,t,r){"use strict";var n=e("../../registry"),a=e("../../plots/plots"),i=e("../../plots/cartesian/axis_ids"),o=e("../../fonts/ploticon"),l=e("../shapes/draw").eraseActiveShape,s=e("../../lib"),c=s._,u=t.exports={};function f(e,t){var r,a,o=t.currentTarget,l=o.getAttribute("data-attr"),s=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},f=i.list(e,null,!0),d=c._cartesianSpikesEnabled;if("zoom"===l){var p,h="in"===s?.5:2,g=(1+h)/2,v=(1-h)/2;for(a=0;a1?(O=["toggleHover"],R=["resetViews"]):m?(D=["zoomInGeo","zoomOutGeo"],O=["hoverClosestGeo"],R=["resetGeo"]):v?(O=["hoverClosest3d"],R=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(D=["zoomInMapbox","zoomOutMapbox"],O=["toggleHover"],R=["resetViewMapbox"]):x?O=["hoverClosestGl2d"]:y?O=["hoverClosestPie"]:T?(O=["hoverClosestCartesian","hoverCompareCartesian"],R=["resetViewSankey"]):O=["toggleHover"];g&&(O=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(e){for(var t=0;t0)){var g=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),a=0,i=0;i=n.max)t=z[r+1];else if(e=n.pmax)t=z[r+1];else if(e=0;k--){var T=r.append("path").attr(v).style("opacity",k?.1:m).call(o.stroke,b).call(o.fill,y).call(l.dashLine,k?"solid":_,k?4+x:x);if(h(T,e,i),w){var A=s(e.layout,"selections",i);T.style({cursor:"move"});var S={element:T.node(),plotinfo:p,gd:e,editHelpers:A,isActiveSelection:!0},L=n(c,e);a(L,T,S)}else T.style("pointer-events",k?"all":"none");M[k]=T}var P=M[0];M[1].node().addEventListener("click",(function(){return function(e,t){if(!d(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeSelectionIndex)return void g(e);e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=g,f(e)}}(e,P)}))}(e._fullLayout._selectionLayer)}function h(e,t,r){var n=r.xref+r.yref;l.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function g(e){d(e)&&(e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,f(e)))}t.exports={draw:f,drawOne:p,activateLastSelection:function(e){if(!d(e))return;var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=g,f(e)}}},{"../../plot_api/plot_template":297,"../color":117,"../drawing":139,"../shapes/display_outlines":211,"../shapes/draw_newshape/helpers":216,"../shapes/handle_outline":218,"../shapes/helpers":219}],201:[function(e,t,r){"use strict";var n=e("../../drawing/attributes").dash,a=e("../../../lib/extend").extendFlat;t.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":252,"../../drawing/attributes":138}],202:[function(e,t,r){"use strict";t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],203:[function(e,t,r){"use strict";var n=e("../../dragelement/helpers").selectMode,a=e("../../shapes/handle_outline").clearOutline,i=e("../../shapes/draw_newshape/helpers"),o=i.readPaths,l=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var r=e[0][0];if(r){var i=r.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,f=t.plotinfo,d=f.xaxis,p=f.yaxis,h=t.isActiveSelection,g=t.dragmode,v=(c.layout||{}).selections||[];if(!n(g)&&void 0!==h){var m=c._fullLayout._activeSelectionIndex;if(m-1,x=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(m)){V(e,t,i);var _=function(e,t){var r,n,a=e[0],i=-1,o=[];for(n=0;n0?function(e,t){var r,n,a,i=[];for(a=0;a0&&i.push(r);if(1===i.length&&i[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(a=0;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(l)&&(d=K(_))){for(o&&o.remove(),v=0;v=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,l=p(r),s=g(r);if(l||s){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&a._fullLayout._outlining)l&&(c=M(f,e)),c&&i.call("_guiRelayout",a,{shapes:c}),s&&!H(e)&&(u=k(f,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&T(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function W(e){return e._id}function J(e,t,r,n){if(!e.calcdata)return[];var a,i,o,l=[],s=t.map(W),c=r.map(W);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(a)>-1}function Q(e,t,r){var n,a;for(n=0;n-1&&t;if(!i&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,pe=te[0].yref;if(ne&&pe){var he=ce(te);ue([C(e,ne,"x"),C(e,pe,"y")])($,he)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&fe(e,$),d._reselect=!1}if(!i&&d._deselect){var ge=d._deselect;(function(e,t,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!b){var r=T.clickmode;P.done(Te).then((function(){if(P.clear(Te),2===e){for(xe.remove(),K=0;K-1&&Y(t,k,n.xaxes,n.yaxes,n.subplot,n,xe),"event"===r&&fe(k,void 0);s.click(k,t)})).catch(A.error)}},n.doneFn=function(){ke.remove(),P.done(Te).then((function(){P.clear(Te),!S&&X&&n.selectionDefs&&(X.subtract=be,n.selectionDefs.push(X),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,W)),(S||b)&&Z(n,S),n.doneFnCompleted&&n.doneFnCompleted(Ae),x&&fe(k,ie)})).catch(A.error)}},clearOutline:b,clearSelectionsCache:Z,selectOnClick:Y}},{"../../lib":260,"../../lib/clear_gl_canvases":246,"../../lib/polygon":272,"../../lib/throttle":284,"../../plot_api/subroutines":298,"../../plots/cartesian/axis_ids":312,"../../registry":351,"../color":117,"../dragelement/helpers":135,"../drawing":139,"../fx":157,"../fx/helpers":153,"../shapes/constants":209,"../shapes/display_outlines":211,"../shapes/draw_newshape/helpers":216,"../shapes/draw_newshape/newshapes":217,"../shapes/handle_outline":218,"../shapes/helpers":219,"./constants":198,"./draw":200,"./draw_newselection/newselections":203,"./helpers":204,"point-in-polygon/nested":70,polybooljs:71}],207:[function(e,t,r){"use strict";var n=e("../annotations/attributes"),a=e("../../traces/scatter/attributes").line,i=e("../drawing/attributes").dash,o=e("../../lib/extend").extendFlat,l=e("../../plot_api/plot_template").templatedArray;e("../../constants/axis_placeable_objects");t.exports=l("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":234,"../../lib/extend":252,"../../plot_api/plot_template":297,"../../traces/scatter/attributes":373,"../annotations/attributes":100,"../drawing/attributes":138}],208:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/cartesian/axes"),i=e("./constants"),o=e("./helpers");function l(e){return c(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return c(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function c(e,t,r,a,l,s){var c=e/2,u=s;if("pixel"===t){var f=l?o.extractPathCoords(l,s?i.paramIsY:i.paramIsX):[r,a],d=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),h=p<0?Math.abs(p)+c:c,g=d>0?d+c:c;return{ppad:c,ppadplus:u?h:g,ppadminus:u?g:h}}return{ppad:c}}function u(e,t,r,n,a){var l="category"===e.type||"multicategory"===e.type?e.r2c:e.d2c;if(void 0!==t)return[l(t),l(r)];if(n){var s,c,u,f,d=1/0,p=-1/0,h=n.match(i.segmentRE);for("date"===e.type&&(l=o.decodeDate(l)),s=0;sp&&(p=f)));return p>=d?[d,p]:void 0}}t.exports=function(e){var t=e._fullLayout,r=n.filterVisible(t.shapes);if(r.length&&e._fullData.length)for(var o=0;o1&&(2!==e.length||"Z"!==e[1][0])&&(0===L&&(e[0][0]="M"),t[S]=e,M(),k())}}()}}function F(e,r){!function(e,r){if(t.length)for(var n=0;nb?(k=f,L="y0",T=b,P="y1"):(k=b,L="y1",T=f,P="y0");J(n),Q(l,r),function(e,t,r){var n=t.xref,a=t.yref,o=i.getFromId(r,n),l=i.getFromId(r,a),s="";"paper"===n||o.autorange||(s+=n);"paper"===a||l.autorange||(s+=a);u.setClipUrl(e,s?"clip"+r._fullLayout._uid+s:null,r)}(t,r,e),W.moveFn="move"===R?X:K,W.altKey=n.altKey},doneFn:function(){if(y(e))return;p(t),$(l),_(t,e,r),n.call("_guiRelayout",e,s.getUpdateObj())},clickFn:function(){if(y(e))return;$(l)}};function J(r){if(y(e))R=null;else if(I)R="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=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,l=r.clientY-n.top,s=!z&&a>10&&i>10&&!r.shiftKey?d.getCursor(o/a,1-l/i):"move";p(t,s),R=s.split("-")[0]}}function X(n,a){if("path"===r.type){var i=function(e){return e},o=i,s=i;E?F("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(G(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),N?F("yanchor",r.yanchor=V(M+a)):(s=function(e){return V(U(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),F("path",r.path=w(O,o,s))}else E?F("xanchor",r.xanchor=q(x+n)):(F("x0",r.x0=q(c+n)),F("x1",r.x1=q(m+n))),N?F("yanchor",r.yanchor=V(M+a)):(F("y0",r.y0=V(f+a)),F("y1",r.y1=V(b+a)));t.attr("d",v(e,r)),Q(l,r)}function K(n,a){if(z){var i=function(e){return e},o=i,s=i;E?F("xanchor",r.xanchor=q(x+n)):(o=function(e){return q(G(e)+n)},j&&"date"===j.type&&(o=g.encodeDate(o))),N?F("yanchor",r.yanchor=V(M+a)):(s=function(e){return V(U(e)+a)},H&&"date"===H.type&&(s=g.encodeDate(s))),F("path",r.path=w(O,o,s))}else if(I){if("resize-over-start-point"===R){var u=c+n,d=N?f-a:f+a;F("x0",r.x0=E?u:q(u)),F("y0",r.y0=N?d:V(d))}else if("resize-over-end-point"===R){var p=m+n,h=N?b-a:b+a;F("x1",r.x1=E?p:q(p)),F("y1",r.y1=N?h:V(h))}}else{var y=function(e){return-1!==R.indexOf(e)},_=y("n"),B=y("s"),Y=y("w"),Z=y("e"),W=_?k+a:k,J=B?T+a:T,X=Y?A+n:A,K=Z?S+n:S;N&&(_&&(W=k-a),B&&(J=T-a)),(!N&&J-W>10||N&&W-J>10)&&(F(L,r[L]=N?W:V(W)),F(P,r[P]=N?J:V(J))),K-X>10&&(F(C,r[C]=E?X:q(X)),F(D,r[D]=E?K:q(K)))}t.attr("d",v(e,r)),Q(l,r)}function Q(e,t){(E||N)&&function(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=G(E?t.xanchor:a.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,h.paramIsX))),o=U(N?t.yanchor:a.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,h.paramIsY)));if(i=g.roundPositionForSharpStrokeRendering(i,1),o=g.roundPositionForSharpStrokeRendering(o,1),E&&N){var l="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(E){var s="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",s)}else{var c="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(e){e.selectAll(".visual-cue").remove()}d.init(W),Z.node().onmousemove=J}(e,E,s,t,r,R):!0===s.editable&&E.style("pointer-events",D||c.opacity(S)*A<=.5?"stroke":"all");E.node().addEventListener("click",(function(){return function(e,t){if(!b(e))return;var r=+t.node().getAttribute("data-index");if(r>=0){if(r===e._fullLayout._activeShapeIndex)return void M(e);e._fullLayout._activeShapeIndex=r,e._fullLayout._deactivateShape=M,m(e)}}(e,E)}))}}function _(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");u.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function w(e,t,r){return e.replace(h.segmentRE,(function(e){var n=0,a=e.charAt(0),i=h.paramIsX[a],o=h.paramIsY[a],l=h.numParams[a];return a+e.substr(1).replace(h.paramRE,(function(e){return n>=l||(i[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function M(e){b(e)&&(e._fullLayout._activeShapeIndex>=0&&(s(e),delete e._fullLayout._activeShapeIndex,m(e)))}t.exports={draw:m,drawOne:x,eraseActiveShape:function(e){if(!b(e))return;s(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t0&&sp&&(e="X"),e}));return i>p&&(h=h.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+e)),u+h}))}(t,l,c);if("pixel"===t.xsizemode){var x=l(t.xanchor);u=x+t.x0,f=x+t.x1}else u=l(t.x0),f=l(t.x1);if("pixel"===t.ysizemode){var _=c(t.yanchor);d=_-t.y0,p=_-t.y1}else d=c(t.y0),p=c(t.y1);if("line"===h)return"M"+u+","+d+"L"+f+","+p;if("rect"===h)return"M"+u+","+d+"H"+f+"V"+p+"H"+u+"Z";var w=(u+f)/2,M=(d+p)/2,k=Math.abs(w-u),T=Math.abs(M-d),A="A"+k+","+T,S=w+k+","+M;return"M"+S+A+" 0 1,1 "+(w+","+(M-T))+A+" 0 0,1 "+S+"Z"}},{"../../lib":260,"../../plots/cartesian/axes":308,"./constants":209}],220:[function(e,t,r){"use strict";var n=e("./draw");t.exports={moduleType:"component",name:"shapes",layoutAttributes:e("./attributes"),supplyLayoutDefaults:e("./defaults"),supplyDrawNewShapeDefaults:e("./draw_newshape/defaults"),includeBasePlot:e("../../plots/cartesian/include_components")("shapes"),calcAutorange:e("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"../../plots/cartesian/include_components":319,"./attributes":207,"./calc_autorange":208,"./defaults":210,"./draw":212,"./draw_newshape/defaults":215}],221:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../../plots/pad_attributes"),i=e("../../lib/extend").extendDeepAll,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/animation_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=e("./constants"),u=s("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:u,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:l.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:c.gripBgActiveColor},bgcolor:{valType:"color",dflt:c.railBgColor},bordercolor:{valType:"color",dflt:c.railBorderColor},borderwidth:{valType:"number",min:0,dflt:c.railBorderWidth},ticklen:{valType:"number",min:0,dflt:c.tickLength},tickcolor:{valType:"color",dflt:c.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:c.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":252,"../../plot_api/edit_types":290,"../../plot_api/plot_template":297,"../../plots/animation_attributes":302,"../../plots/font_attributes":336,"../../plots/pad_attributes":347,"./constants":222}],222:[function(e,t,r){"use strict";t.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},{}],223:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.steps;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}for(var l=a(e,t,{name:"steps",handleItemDefaults:c}),s=0,u=0;u0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*f.gripWidth,t._dims.currentValueTotalHeight))}}function L(e,t){var r=e._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,t))}function P(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-f.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*f.stepInset-2*r.inputAreaStart)))}function C(e,t,r){var n=r._dims,a=l.ensureSingle(e,"rect",f.railTouchRectClass,(function(n){n.call(T,t,e,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(e,t){var r=t._dims,n=r.inputAreaLength-2*f.railInset,a=l.ensureSingle(e,"rect",f.railRectClass);a.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),o.setTranslate(a,f.railInset,.5*(r.inputAreaWidth-f.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._fullLayout,r=function(e,t){for(var r=e[f.name],n=[],a=0;a0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),a.autoMargin(e,v(t))}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;c0||d<0){var m={left:[-h,0],right:[h,0],top:[0,-h],bottom:[0,h]}[x.side];t.attr("transform",s(m[0],m[1]))}}}return I.call(z),R&&(L?I.on(".opacity",null):(T=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:e}).on("edit",(function(t){void 0!==b?o.call("_guiRestyle",e,m,t,b):o.call("_guiRelayout",e,m,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(z)})).on("input",(function(e){this.text(e||" ").call(f.positionText,_.x,_.y)}))),I.classed("js-placeholder",A),M}}},{"../../constants/alignment":233,"../../constants/interactions":237,"../../lib":260,"../../lib/svg_text_utils":283,"../../plots/plots":348,"../../registry":351,"../color":117,"../drawing":139,"@plotly/d3":11,"fast-isnumeric":30}],227:[function(e,t,r){"use strict";var n=e("../../plots/font_attributes"),a=e("../color/attributes"),i=e("../../lib/extend").extendFlat,o=e("../../plot_api/edit_types").overrideAll,l=e("../../plots/pad_attributes"),s=e("../../plot_api/plot_template").templatedArray,c=s("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});t.exports=o(s("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:c,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(l({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":252,"../../plot_api/edit_types":290,"../../plot_api/plot_template":297,"../../plots/font_attributes":336,"../../plots/pad_attributes":347,"../color/attributes":116}],228:[function(e,t,r){"use strict";t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],229:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../plots/array_container_defaults"),i=e("./attributes"),o=e("./constants").name,l=i.buttons;function s(e,t,r){function o(r,a){return n.coerce(e,t,i,r,a)}o("visible",a(e,t,{name:"buttons",handleItemDefaults:c}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function c(e,t){function r(r,a){return n.coerce(e,t,l,r,a)}r("visible","skip"===e.method||Array.isArray(e.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}t.exports=function(e,t){a(e,t,{name:o,handleItemDefaults:s})}},{"../../lib":260,"../../plots/array_container_defaults":303,"./attributes":227,"./constants":228}],230:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../plots/plots"),i=e("../color"),o=e("../drawing"),l=e("../../lib"),s=e("../../lib/svg_text_utils"),c=e("../../plot_api/plot_template").arrayEditor,u=e("../../constants/alignment").LINE_SPACING,f=e("./constants"),d=e("./scrollbox");function p(e){return e._index}function h(e,t){return+e.attr(f.menuIndexAttrName)===t._index}function g(e,t,r,n,a,i,o,l){t.active=o,c(e.layout,f.name,t).applyUpdate("active",o),"buttons"===t.type?m(e,n,null,null,t):"dropdown"===t.type&&(a.attr(f.menuIndexAttrName,"-1"),v(e,n,a,i,t),l||m(e,n,a,i,t))}function v(e,t,r,n,a){var i=l.ensureSingle(t,"g",f.headerClassName,(function(e){e.style("pointer-events","all")})),s=a._dims,c=a.active,u=a.buttons[c]||f.blankHeaderOpts,d={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},p={width:s.headerWidth,height:s.headerHeight};i.call(y,a,u,e).call(A,a,d,p),l.ensureSingle(t,"text",f.headerArrowClassName,(function(e){e.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(S,String(h(r,a)?-1:a._index)),m(e,t,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(M,a)})),o.setTranslate(t,s.lx,s.ly)}function m(e,t,r,i,o){r||(r=t).attr("pointer-events","all");var s=function(e){return-1==+e.attr(f.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,c="dropdown"===o.type?f.dropdownButtonClassName:f.buttonClassName,u=r.selectAll("g."+c).data(l.filterVisible(s)),d=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(d.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var h=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?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 x={x:m.lx+h+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(l,s){var c=n.select(this);c.call(y,o,l,e).call(A,o,x),c.on("click",(function(){n.event.defaultPrevented||(l.execute&&(l.args2&&o.active===s?(g(e,o,0,t,r,i,-1),a.executeAPICommand(e,l.method,l.args2)):(g(e,o,0,t,r,i,s),a.executeAPICommand(e,l.method,l.args))),e.emit("plotly_buttonclicked",{menu:o,button:l,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(M,o),u.call(_,o)}))})),u.call(_,o),b?(k.w=Math.max(m.openWidth,m.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(m.openHeight,m.headerHeight)),k.direction=o.direction,i&&(u.size()?function(e,t,r,n,a,i){var o,l,s,c=a.direction,u="up"===c||"down"===c,d=a._dims,p=a.active;if(u)for(l=0,s=0;s0?[0]:[]);if(o.enter().append("g").classed(f.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+f.headerGroupClassName).each(i)})).remove(),0!==r.length){var s=o.selectAll("g."+f.headerGroupClassName).data(r,p);s.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=l.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),u=0;uw,T=l.barLength+2*l.barPad,A=l.barWidth+2*l.barPad,S=h,L=v+m;L+A>c&&(L=c-A);var P=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,l.barColor),k?(this.hbar=P.attr({rx:l.barRadius,ry:l.barRadius,x:S,y:L,width:T,height:A}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>M,D=l.barWidth+2*l.barPad,O=l.barLength+2*l.barPad,R=h+g,E=v;R+D>s&&(R=s-D);var N=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);N.exit().on(".drag",null).remove(),N.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,l.barColor),C?(this.vbar=N.attr({rx:l.barRadius,ry:l.barRadius,x:R,y:E,width:D,height:O}),this._vbarYMin=E+O/2,this._vbarTranslateMax=M-O):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var I=this.id,z=u-.5,F=C?f+D+.5:f+.5,j=d-.5,B=k?p+A+.5:p+.5,H=o._topdefs.selectAll("#"+I).data(k||C?[0]:[]);if(H.exit().remove(),H.enter().append("clipPath").attr("id",I).append("rect"),k||C?(this._clipRect=H.select("rect").attr({x:Math.floor(z),y:Math.floor(j),width:Math.ceil(F)-Math.floor(z),height:Math.ceil(B)-Math.floor(j)}),this.container.call(i.setClipUrl,I,this.gd),this.bg.attr({x:h,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||C){var Y=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(Y);var G=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(G),C&&this.vbar.on(".drag",null).call(G)}this.setTranslate(t,r)},l.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},l.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=n.event.dx),this.vbar&&(t-=n.event.dy),this.setTranslate(e,t)},l.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=n.event.deltaY),this.vbar&&(t+=n.event.deltaY),this.setTranslate(e,t)},l.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var r=e+this._hbarXMin,a=r+this._hbarTranslateMax;e=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=t+this._vbarYMin,l=i+this._vbarTranslateMax;t=(o.constrain(n.event.y,i,l)-i)/(l-i)*(this.position.h-this._box.h)}this.setTranslate(e,t)},l.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=o.constrain(e||0,0,r),t=o.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var a=e/r;this.hbar.call(i.setTranslate,e+a*this._hbarTranslateMax,t)}if(this.vbar){var l=t/n;this.vbar.call(i.setTranslate,e,t+l*this._vbarTranslateMax)}}},{"../../lib":260,"../color":117,"../drawing":139,"@plotly/d3":11}],233:[function(e,t,r){"use strict";t.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],234:[function(e,t,r){"use strict";t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"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",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}},{}],235:[function(e,t,r){"use strict";t.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],236:[function(e,t,r){"use strict";t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],237:[function(e,t,r){"use strict";t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],238:[function(e,t,r){"use strict";t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],239:[function(e,t,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],240:[function(e,t,r){"use strict";r.version=e("./version").version,e("native-promise-only"),e("../build/plotcss");for(var n=e("./registry"),a=r.register=n.register,i=e("./plot_api"),o=Object.keys(i),l=0;l",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],242:[function(e,t,r){"use strict";r.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},r.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},r.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},r.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},r.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},r.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}},{}],243:[function(e,t,r){"use strict";var n=e("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,l=2*o;function s(e){return Math.abs(e[1]-e[0])>l-1e-14}function c(e,t){return i(t-e,l)}function u(e,t){if(s(t))return!0;var r,n;t[0](n=a(n,l))&&(n+=l);var i=a(e,l),o=i+l;return i>=r&&i<=n||o>=r&&o<=n}function f(e,t,r,n,a,i,c){a=a||0,i=i||0;var u,f,d,p,h,g=s([r,n]);function v(e,t){return[e*Math.cos(t)+a,i-e*Math.sin(t)]}g?(u=0,f=o,d=l):r=a&&e<=i);var a,i},pathArc:function(e,t,r,n,a){return f(null,e,t,r,n,a,0)},pathSector:function(e,t,r,n,a){return f(null,e,t,r,n,a,1)},pathAnnulus:function(e,t,r,n,a,i){return f(e,t,r,n,a,i,1)}}},{"./mod":267}],244:[function(e,t,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(e){return a.isView(e)&&!(e instanceof i)}function l(e){return n(e)||o(e)}function s(e,t,r){if(l(e)){if(l(e[0])){for(var n=r,a=0;aa.max?t.set(r):t.set(+e)}},integer:{coerceFunction:function(e,t,r,a){e%1||!n(e)||void 0!==a.min&&ea.max?t.set(r):t.set(+e)}},string:{coerceFunction:function(e,t,r,n){if("string"!=typeof e){var a="number"==typeof e;!0!==n.strict&&a?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,r){a(e).isValid()?t.set(e):t.set(r)}},colorlist:{coerceFunction:function(e,t,r){Array.isArray(e)&&e.length&&e.every((function(e){return a(e).isValid()}))?t.set(e):t.set(r)}},colorscale:{coerceFunction:function(e,t,r){t.set(o.get(e,r))}},angle:{coerceFunction:function(e,t,r){"auto"===e?t.set("auto"):n(e)?t.set(f(+e,360)):t.set(r)}},subplotid:{coerceFunction:function(e,t,r,n){var a=n.regex||u(r);"string"==typeof e&&a.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"==typeof e&&!!u(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"==typeof e){for(var a=e.split("+"),i=0;i=n&&e<=a?e:u}if("string"!=typeof e&&"number"!=typeof e)return u;e=String(e);var c=_(t),m=e.charAt(0);!c||"G"!==m&&"g"!==m||(e=e.substr(1),t="");var w=c&&"chinese"===t.substr(0,7),M=e.match(w?b:y);if(!M)return u;var k=M[1],T=M[3]||"1",A=Number(M[5]||1),S=Number(M[7]||0),L=Number(M[9]||0),P=Number(M[11]||0);if(c){if(2===k.length)return u;var C;k=Number(k);try{var D=v.getComponentMethod("calendars","getCal")(t);if(w){var O="i"===T.charAt(T.length-1);T=parseInt(T,10),C=D.newDate(k,D.toMonthIndex(k,T,O),A)}else C=D.newDate(k,Number(T),A)}catch(e){return u}return C?(C.toJD()-g)*f+S*d+L*p+P*h:u}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),T-=1;var R=new Date(Date.UTC(2e3,T,A,S,L));return R.setUTCFullYear(k),R.getUTCMonth()!==T||R.getUTCDate()!==A?u:R.getTime()+P*h},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(e,t){return r.dateTime2ms(e,t)!==u};var M=90*f,k=3*d,T=5*p;function A(e,t,r,n,a){if((t||r||n||a)&&(e+=" "+w(t,2)+":"+w(r,2),(n||a)&&(e+=":"+w(n,2),a))){for(var i=4;a%10==0;)i-=1,a/=10;e+="."+w(a,i)}return e}r.ms2DateTime=function(e,t,r){if("number"!=typeof e||!(e>=n&&e<=a))return u;t||(t=0);var i,o,l,c,y,b,x=Math.floor(10*s(e+.05,1)),w=Math.round(e-x/10);if(_(r)){var S=Math.floor(w/f)+g,L=Math.floor(s(e,f));try{i=v.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(e){i=m("G%Y-%m-%d")(new Date(w))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=t=n+f&&e<=a-f))return u;var t=Math.floor(10*s(e+.05,1)),r=new Date(Math.round(e-t/10));return A(i("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+t)},r.cleanDate=function(e,t,n){if(e===u)return t;if(r.isJSDate(e)||"number"==typeof e&&isFinite(e)){if(_(n))return l.error("JS Dates and milliseconds are incompatible with world calendars",e),t;if(!(e=r.ms2DateTimeLocal(+e))&&void 0!==t)return t}else if(!r.isDateTime(e,n))return l.error("unrecognized date",e),t;return e};var S=/%\d?f/g,L=/%h/g,P={1:"1",2:"1",3:"2",4:"2"};function C(e,t,r,n){e=e.replace(S,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var a=new Date(Math.floor(t+.05));if(e=e.replace(L,(function(){return P[r("%q")(a)]})),_(n))try{e=v.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(e){return"Invalid"}return r(e)(a)}var D=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(e,t,r,n,a,i){if(a=_(a)&&a,!t)if("y"===r)t=i.year;else if("m"===r)t=i.month;else{if("d"!==r)return function(e,t){var r=s(e+.05,f),n=w(Math.floor(r/d),2)+":"+w(s(Math.floor(r/p),60),2);if("M"!==t){o(t)||(t=0);var a=(100+Math.min(s(e/h,60),D[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+C(i.dayMonthYear,e,n,a);t=i.dayMonth+"\n"+i.year}return C(t,e,n,a)};var O=3*f;r.incrementMonth=function(e,t,r){r=_(r)&&r;var n=s(e,f);if(e=Math.round(e-n),r)try{var a=Math.round(e/f)+g,i=v.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return t%12?i.add(o,t,"m"):i.add(o,t/12,"y"),(o.toJD()-g)*f+n}catch(t){l.error("invalid ms "+e+" in calendar "+r)}var c=new Date(e+O);return c.setUTCMonth(c.getUTCMonth()+t)+n-O},r.findExactDates=function(e,t){for(var r,n,a=0,i=0,l=0,s=0,c=_(t)&&v.getComponentMethod("calendars","getCal")(t),u=0;u0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===l||"FJI"===l?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),a=0;at?r[n++]=[e[a][0]+360,e[a][1]]:a===t?(r[n++]=e[a],r[n++]=[e[a][0],-90]):r[n++]=e[a];var i=d.tester(r);i.pts.pop(),s.push(i)}:function(e){s.push(d.tester(e))},i.type){case"MultiPolygon":for(r=0;ra&&(a=c,t=s)}else t=r;return o.default(t).geometry.coordinates}(u),n.fIn=e,n.fOut=u,l.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var d=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+e)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},r.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r1||g<0||g>1?null:{x:e+s*g,y:t+f*g}}function s(e,t,r,n,a){var i=n*e+a*t;if(i<0)return n*n+a*a;if(i>r){var o=n-e,l=a-t;return o*o+l*l}var s=n*t-a*e;return s*s/r}r.segmentsIntersect=l,r.segmentDistance=function(e,t,r,n,a,i,o,c){if(l(e,t,r,n,a,i,o,c))return 0;var u=r-e,f=n-t,d=o-a,p=c-i,h=u*u+f*f,g=d*d+p*p,v=Math.min(s(u,f,h,a-e,i-t),s(u,f,h,o-e,c-t),s(d,p,g,e-a,t-i),s(d,p,g,r-a,n-i));return Math.sqrt(v)},r.getTextLocation=function(e,t,r,l){if(e===a&&l===i||(n={},a=e,i=l),n[r])return n[r];var s=e.getPointAtLength(o(r-l/2,t)),c=e.getPointAtLength(o(r+l/2,t)),u=Math.atan((c.y-s.y)/(c.x-s.x)),f=e.getPointAtLength(o(r,t)),d={x:(4*f.x+s.x+c.x)/6,y:(4*f.y+s.y+c.y)/6,theta:u};return n[r]=d,d},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(e,t,r){var n,a,i=t.left,o=t.right,l=t.top,s=t.bottom,c=0,u=e.getTotalLength(),f=u;function d(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(a=r);var c=r.xo?r.x-o:0,f=r.ys?r.y-s:0;return Math.sqrt(c*c+f*f)}for(var p=d(c);p;){if((c+=p+r)>f)return;p=d(c)}for(p=d(f);p;){if(c>(f-=p+r))return;p=d(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(e,t,r,n){for(var a,i,o,l=(n=n||{}).pathLength||e.getTotalLength(),s=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(l)[r]?-1:1,f=0,d=0,p=l;f0?p=a:d=a,f++}return i}},{"./mod":267}],258:[function(e,t,r){"use strict";t.exports=function(e){return e}},{}],259:[function(e,t,r){"use strict";t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,a=String(n).length;if(a>16){var i=String(t).length;if(a>=String(e).length+i){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],260:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("d3-format").format,o=e("fast-isnumeric"),l=e("../constants/numerical"),s=l.FP_SAFE,c=-s,u=l.BADNUM,f=t.exports={};f.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var d={};f.warnBadFormat=function(e){var t=String(e);d[t]||(d[t]=1,f.warn('encountered bad format: "'+t+'"'))},f.noFormat=function(e){return String(e)},f.numberFormat=function(e){var t;try{t=i(f.adjustFormat(e))}catch(t){return f.warnBadFormat(e),f.noFormat}return t},f.nestedProperty=e("./nested_property"),f.keyedContainer=e("./keyed_container"),f.relativeAttr=e("./relative_attr"),f.isPlainObject=e("./is_plain_object"),f.toLogRange=e("./to_log_range"),f.relinkPrivateKeys=e("./relink_private");var p=e("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var h=e("./mod");f.mod=h.mod,f.modHalf=h.modHalf;var g=e("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=e("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=e("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=e("./sort_object_keys");var y=e("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=e("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=e("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=e("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=e("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=e("./extend");f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var k=e("./loggers");f.log=k.log,f.warn=k.warn,f.error=k.error;var T=e("./regex");f.counterRegex=T.counter;var A=e("./throttle");f.throttle=A.throttle,f.throttleDone=A.done,f.clearThrottle=A.clear;var S=e("./dom");function L(e){var t={};for(var r in e)for(var n=e[r],a=0;as||e=t)&&(o(e)&&e>=0&&e%1==0)},f.noop=e("./noop"),f.identity=e("./identity"),f.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},f.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},f.simpleMap=function(e,t,r,n,a){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,r)?a>10?(f.warn("randstr failed uniqueness"),s):e(t,r,n,(a||0)+1):s},f.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},f.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,a,i,o=e.length,l=2*o,s=2*t-1,c=new Array(s),u=new Array(o);for(r=0;r=l&&(a-=l*Math.floor(a/l)),a<0?a=-1-a:a>=o&&(a=l-1-a),i+=e[a]*c[n];u[r]=i}return u},f.syncOrAsync=function(e,t,r){var n;function a(){return f.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(a);return r&&r(t)},f.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},f.noneOrAll=function(e,t,r){if(e){var n,a=!1,i=!0;for(n=0;n0?t:0}))},f.fillArray=function(e,t,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(e))for(var a=0;a1?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},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var E=/^\w*$/;f.templateString=function(e,t){var r={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,n){var a;return E.test(n)?a=t[n]:(r[n]=r[n]||f.nestedProperty(t,n).get,a=r[n]()),f.isValidTextValue(a)?a:""}))};var N={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(N,arguments)};var I={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(I,arguments)};var z=/^[:|\|]/;function F(e,t,r){var n=this,i=arguments;t||(t={});var o={};return e.replace(f.TEMPLATE_STRING_REGEX,(function(e,l,s){var c,u,d,p="_xother"===l||"_yother"===l,h="_xother_"===l||"_yother_"===l,g="xother_"===l||"yother_"===l,v="xother"===l||"yother"===l||p||g||h,m=l;if((p||h)&&(m=m.substring(1)),(g||h)&&(m=m.substring(0,m.length-1)),v){if(void 0===(c=t[m]))return""}else for(d=3;d=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 j=2e9;f.seedPseudoRandom=function(){j=2e9},f.pseudoRandom=function(){var e=j;return j=(69069*j+1)%4294967296,Math.abs(j-e)<429496729?f.pseudoRandom():j/4294967296},f.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},a=f.extractOption(e,t,"htx","hovertext");if(f.isValidTextValue(a))return n(a);var i=f.extractOption(e,t,"tx","text");return f.isValidTextValue(i)?n(i):void 0},f.isValidTextValue=function(e){return e||0===e},f.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,f.strTranslate(a-c*(r+o),i-c*(n+l))+f.strScale(c)+(s?"rotate("+s+(t?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(e,t){e.attr("transform",f.getTextTransform(t)),e.style("display",t.scale?null:"none")},f.ensureUniformFontSize=function(e,t){var r=f.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},f.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},f.bigFont=function(e){return Math.round(1.2*e)};var B=f.getFirefoxVersion(),H=null!==B&&B<86;f.getPositionFromD3Event=function(){return H?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":238,"./anchor_utils":242,"./angles":243,"./array":244,"./clean_number":245,"./clear_responsive":247,"./coerce":248,"./dates":249,"./dom":250,"./extend":252,"./filter_unique":253,"./filter_visible":254,"./geometry2d":257,"./identity":258,"./increment":259,"./is_plain_object":261,"./keyed_container":262,"./localize":263,"./loggers":264,"./make_trace_groups":265,"./matrix":266,"./mod":267,"./nested_property":268,"./noop":269,"./notifier":270,"./preserve_drawing_buffer":273,"./push_unique":274,"./regex":276,"./relative_attr":277,"./relink_private":278,"./search":279,"./sort_object_keys":281,"./stats":282,"./throttle":284,"./to_log_range":285,"@plotly/d3":11,"d3-format":24,"d3-time-format":27,"fast-isnumeric":30}],261:[function(e,t,r){"use strict";t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}},{}],262:[function(e,t,r){"use strict";var n=e("./nested_property"),a=/^\w*$/;t.exports=function(e,t,r,i){var o,l,s;r=r||"name",i=i||"value";var c={};t&&t.length?(s=n(e,t),l=s.get()):l=e,t=t||"";var u={};if(l)for(o=0;o2)return c[t]=2|c[t],d.set(e,null);if(f){for(o=t;o1){var t=["LOG:"];for(e=0;e1){var r=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(n.logging>0){var t=["WARN:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(n.logging>0){var t=["ERROR:"];for(e=0;e0){var r=[];for(e=0;e"),"stick")}}},{"../plot_api/plot_config":295,"./notifier":270}],265:[function(e,t,r){"use strict";var n=e("@plotly/d3");t.exports=function(e,t,r){var a=e.selectAll("g."+r.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));a.exit().remove(),a.enter().append("g").attr("class",r),a.order();var i=e.classed("rangeplot")?"nodeRangePlot3":"node3";return a.each((function(e){e[0][i]=n.select(this)})),a}},{"@plotly/d3":11}],266:[function(e,t,r){"use strict";var n=e("gl-mat4");r.init2dArray=function(e,t){for(var r=new Array(e),n=0;nt/2?e-Math.round(e/t)*t:e}}},{}],268:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./array").isArrayOrTypedArray;function i(e,t){return function(){var r,n,o,l,s,c=e;for(l=0;l/g),s=0;si||c===a||cl)&&(!t||!s(e))}:function(e,t){var s=e[0],c=e[1];if(s===a||si||c===a||cl)return!1;var u,f,d,p,h,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(d,m)))if(cu||Math.abs(n(o,d))>a)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var l=r.length,s=n;r.splice(a+1);for(var c=s+1;c1&&o(e.pop());return{addPt:o,raw:e,filtered:r}}},{"../constants/numerical":238,"./matrix":266}],273:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("is-mobile");t.exports=function(e){var t;if("string"!=typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;"undefined"!=typeof navigator&&(e=navigator.userAgent);e&&e.headers&&"string"==typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]);return e}()))return!0;var r=a({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var i=t.split(" "),o=1;o-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":30,"is-mobile":64}],274:[function(e,t,r){"use strict";t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;na.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;rt}function u(e,t){return e>=t}r.findBin=function(e,t,r){if(n(t.start))return r?Math.ceil((e-t.start)/t.size-1e-9)-1:Math.floor((e-t.start)/t.size+1e-9);var i,o,f=0,d=t.length,p=0,h=d>1?(t[d-1]-t[0])/(d-1):1;for(o=h>=0?r?l:s:r?u:c,e+=1e-9*h*(r?-1:1)*(h>=0?1:-1);f90&&a.log("Long binary search..."),f-1},r.sorterAsc=function(e,t){return e-t},r.sorterDes=function(e,t){return t-e},r.distinctVals=function(e){var t,n=e.slice();for(n.sort(r.sorterAsc),t=n.length-1;t>-1&&n[t]===o;t--);for(var a,i=n[t]-n[0]||1,l=i/(t||1)/1e4,s=[],c=0;c<=t;c++){var u=n[c],f=u-a;void 0===a?(s.push(u),a=u):f>l&&(i=Math.min(i,f),s.push(u),a=u)}return{vals:s,minDiff:i}},r.roundUp=function(e,t,r){for(var n,a=0,i=t.length-1,o=0,l=r?0:1,s=r?1:0,c=r?Math.ceil:Math.floor;a0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},r.findIndexOfMin=function(e,t){t=t||i;for(var r,n=1/0,a=0;ai.length)&&(o=i.length),n(t)||(t=!1),a(i[0])){for(s=new Array(o),l=0;le.length-1)return e[e.length-1];var r=t%1;return r*e[Math.ceil(t)]+(1-r)*e[Math.floor(t)]}},{"./array":244,"fast-isnumeric":30}],283:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../lib"),i=a.strTranslate,o=e("../constants/xmlns_namespaces"),l=e("../constants/alignment").LINE_SPACING,s=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(e,t,g){var A=e.text(),S=!e.attr("data-notex")&&t&&t._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(s),C=n.select(e.node().parentNode);if(!C.empty()){var D=e.attr("class")?e.attr("class").split(" ")[0]:"text";return D+="-math",C.selectAll("svg."+D).remove(),C.selectAll("g."+D+"-group").remove(),e.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(t&&t._promises||[]).push(new Promise((function(t){e.style("display","none");var r=parseInt(e.node().style.fontSize,10),o={fontSize:r};!function(e,t,r){var i,o,l,s,d=parseInt((MathJax.version||"").split(".")[0]);if(2!==d&&3!==d)return void a.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+a.randstr({},64),i=(s=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":t.fontSize+"px"}).text(e.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===d?MathJax.Hub.Typeset(i):MathJax.typeset([i])},h=function(){var t=s.select(2===d?".MathJax_SVG":".MathJax"),i=!t.empty()&&s.select("svg").node();if(i){var o,l=i.getBoundingClientRect();o=2===d?n.select("body").select("#MathJax_SVG_glyphs"):t.select("defs"),r(t,o,l)}else a.log("There was an error in the tex syntax.",e),r();s.remove()};2===d?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:f},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,h,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==l&&(MathJax.Hub.processSectionDelay=l),MathJax.Hub.Config(o)})):3===d&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),h(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(S[2],o,(function(n,a,o){C.selectAll("svg."+D).remove(),C.selectAll("g."+D+"-group").remove();var l=n&&n.select("svg");if(!l||!l.node())return O(),void t();var s=C.append("g").classed(D+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});s.node().appendChild(l.node()),a&&a.node()&&l.node().insertBefore(a.node().cloneNode(!0),l.node().firstChild);var c=o.width,u=o.height;l.attr({class:D,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=e.node().style.fill||"black",d=l.select("g");d.attr({fill:f,stroke:f});var p=d.node().getBoundingClientRect(),h=p.width,v=p.height;(h>c||v>u)&&(l.style("overflow","hidden"),h=(p=l.node().getBoundingClientRect()).width,v=p.height);var m=+e.attr("x"),y=+e.attr("y"),b=-(r||e.node().getBoundingClientRect().height)/4;if("y"===D[0])s.attr({transform:"rotate("+[-90,m,y]+")"+i(-h/2,b-v/2)});else if("l"===D[0])y=b-v/2;else if("a"===D[0]&&0!==D.indexOf("atitle"))m=0,y=b;else{var x=e.attr("text-anchor");m-=h*("middle"===x?.5:"end"===x?1:0),y=y+b-v/2}l.attr({x:m,y:y}),g&&g.call(e,s),t(s)}))}))):O(),e}function O(){C.empty()||(D=e.attr("class")+"-math",C.select("svg."+D).remove()),e.text("").style("white-space","pre"),function(e,t){t=t.replace(v," ");var r,i=!1,s=[],c=-1;function u(){c++;var t=document.createElementNS(o.svg,"tspan");n.select(t).attr({class:"line",dy:c*l+"em"}),e.appendChild(t),r=t;var a=s;if(s=[{node:t}],a.length>1)for(var i=1;i doesnt match end tag <"+e+">. Pretending it did match.",t),r=s[s.length-1].node}else a.log("Ignoring unexpected end tag .",t)}b.test(t)?u():(r=e,s=[{node:e}]);for(var S=t.split(m),C=0;C|>|>)/g;var f=[["$","$"],["\\(","\\)"]];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,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function k(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&L(n)}var T=/(^|;)\s*color:/;r.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],a="...".length,i=e.split(m),o=[],l="",s=0,c=0;ca?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"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function L(e){return e.replace(S,(function(e,t){return("#"===t.charAt(0)?function(e){if(e>1114111)return;var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function P(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var a=r.protocol,i=n.protocol;return-1!==g.indexOf(a)&&-1!==g.indexOf(i)?t:""}function C(e,t,r){var n,i,o,l=r.horizontalAlign,s=r.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.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 e=o()-u.left,t=i()-u.top,l=r.gd||{};if(r.gd){l._fullLayout._calcInverseTransform(l);var s=a.apply3DTransform(l._fullLayout._invTransform)(e,t);e=s[0],t=s[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}r.convertEntities=L,r.sanitizeHTML=function(e){e=e.replace(v," ");for(var t=document.createElement("p"),r=t,a=[],i=e.split(m),o=0;oi.ts+t?s():i.timer=setTimeout((function(){s(),i.timer=null}),t)},r.done=function(e){var t=n[e];return t&&t.timer?new Promise((function(e){var r=t.onDone;t.onDone=function(){r&&r(),e(),t.onDone=null}})):Promise.resolve()},r.clear=function(e){if(e)a(n[e]),delete n[e];else for(var t in n)r.clear(t)}},{}],285:[function(e,t,r){"use strict";var n=e("fast-isnumeric");t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var r=Math.log(Math.min(t[0],t[1]))/Math.LN10;return n(r)||(r=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),r}},{"fast-isnumeric":30}],286:[function(e,t,r){"use strict";var n=t.exports={},a=e("../plots/geo/constants").locationmodeToLayer,i=e("topojson-client").feature;n.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(e,t){return e+t+".json"},n.getTopojsonFeatures=function(e,t){var r=a[e.locationmode],n=t.objects[r];return i(t,n).features}},{"../plots/geo/constants":338,"topojson-client":82}],287:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],288:[function(e,t,r){"use strict";t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}},{}],289:[function(e,t,r){"use strict";var n=e("../registry");t.exports=function(e){for(var t,r,a=n.layoutArrayContainers,i=n.layoutArrayRegexes,o=e.split("[")[0],l=0;l0&&o.log("Clearing previous rejected promises from queue."),e._promises=[]},r.cleanLayout=function(e){var t,n;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var i=(l.subplotsRegistry.cartesian||{}).attrRegex,s=(l.subplotsRegistry.polar||{}).attrRegex,f=(l.subplotsRegistry.ternary||{}).attrRegex,d=(l.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(e);for(t=0;t3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),h(e),"rotate"===e.dragmode&&(e.dragmode="orbit"),c.clean(e),e.template&&e.template.layout&&r.cleanLayout(e.template.layout),e},r.cleanData=function(e){for(var t=0;t0)return e.substr(0,t)}r.hasParent=function(e,t){for(var r=x(t);r;){if(r in e)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(e,t,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(c(y))t.set(null);else{if(!Array.isArray(y))return i.warn("Unrecognized full array edit value",f,y),!0;t.set(y)}return!g&&(d(v,m),p(e),!0)}var b,x,_,w,M,k,T,A,S=Object.keys(r).map(Number).sort(o),L=t.get(),P=L||[],C=u(m,f).get(),D=[],O=-1,R=P.length;for(b=0;bP.length-(T?0:1))i.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?D.push(_):T?("add"===k&&(k={}),P.splice(_,0,k),C&&C.splice(_,0,{})):i.warn("Unrecognized full object edit value",f,_,k),-1===O&&(O=_);else for(x=0;x=0;b--)P.splice(D[b],1),C&&C.splice(D[b],1);if(P.length?L||t.set(P):t.set(null),g)return!1;if(d(v,m),h!==a){var E;if(-1===O)E=S;else{for(R=Math.max(P.length,R),E=[],b=0;b=O);b++)E.push(_);for(b=O;b=e.data.length||a<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(a,n+1)>-1||a>=0&&t.indexOf(-e.data.length+a)>-1||a<0&&t.indexOf(e.data.length+a)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),D(e,t,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&D(e,r,"newIndices"),void 0!==r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,r,n,i){!function(e,t,r,n){var a=o.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(t))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in D(e,r,"indices"),t){if(!Array.isArray(t[i])||t[i].length!==r.length)throw new Error("attribute "+i+" must be an array of length equal to indices array length");if(a&&(!(i in n)||!Array.isArray(n[i])||n[i].length!==t[i].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,r,n);for(var s=function(e,t,r,n){var i,s,c,u,f,d=o.isPlainObject(n),p=[];for(var h in Array.isArray(r)||(r=[r]),r=C(r,e.data.length-1),t)for(var g=0;g-1&&-1===r.indexOf("grouptitlefont")?s(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?s(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?s(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&s(r,r.replace("titleoffset","title.offset")):s(r,r.replace("title","title.text"));function s(t,r){e[r]=e[t],delete e[t]}}function H(e,t,r){e=o.getGraphDiv(e),_.clearPromiseQueue(e);var n={};if("string"==typeof t)n[t]=r;else{if(!o.isPlainObject(t))return o.warn("Relayout fail.",t,r),Promise.reject();n=o.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Z(e,n),i=a.flags;i.calc&&(e.calcdata=void 0);var l=[d.previousPromises];i.layoutReplot?l.push(w.layoutReplot):Object.keys(n).length&&(Y(e,i,a)||d.supplyDefaults(e),i.legend&&l.push(w.doLegend),i.layoutstyle&&l.push(w.layoutStyles),i.axrange&&G(l,a.rangesAltered),i.ticks&&l.push(w.doTicksRelayout),i.modebar&&l.push(w.doModeBar),i.camera&&l.push(w.doCamera),i.colorbars&&l.push(w.doColorBars),l.push(A)),l.push(d.rehover,d.redrag,d.reselect),c.add(e,H,[e,a.undoit],H,[e,a.redoit]);var s=o.syncOrAsync(l,e);return s&&s.then||(s=Promise.resolve(e)),s.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function Y(e,t,r){var n=e._fullLayout;if(!t.axrange)return!1;for(var a in t)if("axrange"!==a&&t[a])return!1;for(var i in r.rangesAltered){var o=p.id2name(i),l=e.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[p.id2name(c)];u.autorange=s.autorange,u.range=s.range.slice(),u._input.range=s.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[];for(var n in t){var a=p.getFromId(e,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)t[i]||r.push(i)}return p.draw(e,r,{skipTitle:!0})}:function(e){return p.draw(e,"redraw")};e.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var U=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,q=/^[xyz]axis[0-9]*\.autorange$/,V=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Z(e,t){var r,n,a,i=e.layout,s=e._fullLayout,c=s._guiEditing,d=z(s._preGUI,c),h=Object.keys(t),g=p.list(e),v=o.extendDeepAll({},t),m={};for(B(t),h=Object.keys(t),n=0;n0&&"string"!=typeof R.parts[N];)N--;var F=R.parts[N],j=R.parts[N-1]+"."+F,H=R.parts.slice(0,N).join("."),Y=l(e.layout,H).get(),G=l(s,H).get(),Z=R.get();if(void 0!==E){A[O]=E,S[O]="reverse"===F?E:I(Z);var J=f.getLayoutValObject(s,R.parts);if(J&&J.impliedEdits&&null!==E)for(var X in J.impliedEdits)L(o.relativeAttr(O,X),J.impliedEdits[X]);if(-1!==["width","height"].indexOf(O))if(E){L("autosize",null);var K="height"===O?"width":"height";L(K,s[K])}else s[O]=e._initialAutoSize[O];else if("autosize"===O)L("width",E?null:s.width),L("height",E?null:s.height);else if(j.match(U))D(j),l(s,H+"._inputRange").set(null);else if(j.match(q)){D(j),l(s,H+"._inputRange").set(null);var Q=l(s,H).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else j.match(V)&&l(s,H+"._inputDomain").set(null);if("type"===F){P=Y;var $="linear"===G.type&&"log"===E,ee="log"===G.type&&"linear"===E;if($||ee){if(P&&P.range)if(G.autorange)$&&(P.range=P.range[1]>P.range[0]?[1,2]:[2,1]);else{var te=P.range[0],re=P.range[1];$?(te<=0&&re<=0&&L(H+".autorange",!0),te<=0?te=re/1e6:re<=0&&(re=te/1e6),L(H+".range[0]",Math.log(te)/Math.LN10),L(H+".range[1]",Math.log(re)/Math.LN10)):(L(H+".range[0]",Math.pow(10,te)),L(H+".range[1]",Math.pow(10,re)))}else L(H+".autorange",!0);Array.isArray(s._subplots.polar)&&s._subplots.polar.length&&s[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete s[R.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(e,G,E,L),u.getComponentMethod("images","convertCoords")(e,G,E,L)}else L(H+".autorange",!0),L(H+".range",null);l(s,H+"._inputRange").set(null)}else if(F.match(k)){var ne=l(s,O).get(),ae=(E||{}).type;ae&&"-"!==ae||(ae="linear"),u.getComponentMethod("annotations","convertCoords")(e,ne,ae,L),u.getComponentMethod("images","convertCoords")(e,ne,ae,L)}var ie=x.containerArrayMatch(O);if(ie){r=ie.array,n=ie.index;var oe=ie.property,le=J||{editType:"calc"};""!==n&&""===oe&&(x.isAddVal(E)?S[O]=null:x.isRemoveVal(E)?S[O]=(l(i,r).get()||[])[n]:o.warn("unrecognized full object value",t)),M.update(T,le),m[r]||(m[r]={});var se=m[r][n];se||(se=m[r][n]={}),se[oe]=E,delete t[O]}else"reverse"===F?(Y.range?Y.range.reverse():(L(H+".autorange",!0),Y.range=[1,0]),G.autorange?T.calc=!0:T.plot=!0):("dragmode"===O&&(!1===E&&!1!==Z||!1!==E&&!1===Z)||s._has("scatter-like")&&s._has("regl")&&"dragmode"===O&&("lasso"===E||"select"===E)&&"lasso"!==Z&&"select"!==Z||s._has("gl2d")?T.plot=!0:J?M.update(T,J):T.calc=!0,R.set(E))}}for(r in m){x.applyContainerArrayChanges(e,d(i,r),m[r],T,d)||(T.plot=!0)}for(var ce in C){var ue=(P=p.getFromId(e,ce))&&P._constraintGroup;if(ue)for(var fe in T.calc=!0,ue)C[fe]||(p.getFromId(e,fe)._constraintShrinkable=!0)}return(W(e)||t.height||t.width)&&(T.plot=!0),(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:C,undoit:S,redoit:A,eventData:v}}function W(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&d.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(e,t,n,a){e=o.getGraphDiv(e),_.clearPromiseQueue(e),o.isPlainObject(t)||(t={}),o.isPlainObject(n)||(n={}),Object.keys(t).length&&(e.changed=!0),Object.keys(n).length&&(e.changed=!0);var i=_.coerceTraceIndices(e,a),l=j(e,o.extendFlat({},t),i),s=l.flags,u=Z(e,o.extendFlat({},n)),f=u.flags;(s.calc||f.calc)&&(e.calcdata=void 0),s.clearAxisTypes&&_.clearAxisTypes(e,i,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):s.fullReplot?p.push(r._doPlot):(p.push(d.previousPromises),Y(e,f,u)||d.supplyDefaults(e),s.style&&p.push(w.doTraceStyle),(s.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&G(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(A)),p.push(d.rehover,d.redrag,d.reselect),c.add(e,J,[e,l.undoit,u.undoit,l.traces],J,[e,l.redoit,u.redoit,l.traces]);var h=o.syncOrAsync(p,e);return h&&h.then||(h=Promise.resolve(e)),h.then((function(){return e.emit("plotly_update",{data:l.eventData,layout:u.eventData}),e}))}function X(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var K=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Q=[{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 $(e,t){for(var r=0;r1;)if(n.pop(),void 0!==(r=l(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function te(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function s(e){return Array.isArray(i)?e>=i.length?i[0]:i[e]:i}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,u){function f(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,d.transition(e,t.frame.data,t.frame.layout,_.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}function p(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&f()};t()}var h,g,v=0;function m(e){return Array.isArray(a)?v>=a.length?e.transitionOpts=a[v]:e.transitionOpts=a[0]:e.transitionOpts=a,v++,e}var y=[],b=null==t,x=Array.isArray(t);if(!b&&!x&&o.isPlainObject(t))y.push({type:"object",data:m(o.extendFlat({},t))});else if(b||-1!==["string","number"].indexOf(typeof t))for(h=0;h0&&kk)&&T.push(g);y=T}}y.length>0?function(t){if(0!==t.length){for(var a=0;a=0;n--)if(o.isPlainObject(t[n])){var g=t[n].name,v=(u[g]||h[g]||{}).name,m=t[n].name,y=u[v]||h[v];v&&m&&"number"==typeof m&&y&&T<5&&(T++,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===T&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h[g]={name:g},p.push({frame:d.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}p.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"==typeof(a=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;u[a.name="frame "+e._transitionData._counter++];);if(u[a.name]){for(i=0;i=0;r--)n=t[r],i.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var s=d.modifyFrames,u=d.modifyFrames,f=[e,l],p=[e,i];return c&&c.add(e,s,f,u,p),d.modifyFrames(e,i)},r.addTraces=function e(t,n,a){t=o.getGraphDiv(t);var i,l,s=[],u=r.deleteTraces,f=e,d=[t,s],p=[t,n];for(function(e,t,r){var n,a;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(void 0===t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!y(o))return!1;e=i[a][o]}else e=i[a]}else e=i}}return e}function y(e){return e===Math.round(e)&&e>=0}function b(){var e,t,r={};for(e in f(r,o),n.subplotsRegistry){if((t=n.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a=s.length)return!1;a=(r=(n.transformsRegistry[s[c].type]||{}).attributes)&&r[t[2]],l=3}else{var u=e._module;if(u||(u=(n.modules[e.type||i.type.dflt]||{})._module),!u)return!1;if(!(a=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=i[o])}return m(a,t,l)},r.getLayoutValObject=function(e,t){return m(function(e,t){var r,a,i,l,s=e._basePlotModules;if(s){var c;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var l,s=t+"["+i+"]";function c(){l={},o&&(l[s]={},l[s].templateitemname=o)}function u(e,t){o?n.nestedProperty(l[s],e).set(t):l[s+"."+e]=t}function f(){var e=l;return c(),e}return c(),{modifyBase:function(e,t){l[e]=t},modifyItem:u,getUpdateObj:f,applyUpdate:function(t,r){t&&u(t,r);var a=f();for(var i in a)n.nestedProperty(e,i).set(a[i])}}}},{"../lib":260,"../plots/attributes":304}],298:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../registry"),i=e("../plots/plots"),o=e("../lib"),l=e("../lib/clear_gl_canvases"),s=e("../components/color"),c=e("../components/drawing"),u=e("../components/titles"),f=e("../components/modebar"),d=e("../plots/cartesian/axes"),p=e("../constants/alignment"),h=e("../plots/cartesian/constraints"),g=h.enforce,v=h.clean,m=e("../plots/cartesian/autorange").doAutoRange;function y(e,t,r){for(var n=0;n=e[1]||a[1]<=e[0])&&(i[0]t[0]))return!0}return!1}function b(e){var t,a,l,u,h,g,v=e._fullLayout,m=v._size,b=m.p,_=d.list(e,"",!0);if(v._paperdiv.style({width:e._context.responsive&&v.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":v.width+"px",height:e._context.responsive&&v.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":v.height+"px"}).selectAll(".main-svg").call(c.setSize,v.width,v.height),e._context.setBackground(e,v.paper_bgcolor),r.drawMainTitle(e),f.manage(e),!v._has("cartesian"))return i.previousPromises(e);function M(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-b-n:t._offset+t._length+b+n:m.t+m.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+b+n:t._offset-b-n:m.l+m.w*(e.position||0)+n%1}for(t=0;t<_.length;t++){var k=(u=_[t])._anchorAxis;u._linepositions={},u._lw=c.crispRound(e,u.linewidth,1),u._mainLinePosition=M(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?M(u,k,p.OPPOSITE_SIDE[u.side]):null}var T=[],A=[],S=[],L=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 P=l.xaxis.domain,C=l.yaxis.domain,D=l.plotgroup;if(y(P,C,S)){var O=D.node(),R=l.bg=o.ensureSingle(D,"rect","bg");O.insertBefore(R.node(),O.childNodes[0]),A.push(a)}else D.select("rect.bg").remove(),S.push([P,C]),L||(T.push(a),A.push(a))}var E,N,I,z,F,j,B,H,Y,G,U,q,V,Z=v._bgLayer.selectAll(".bg").data(T);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){v._plots[e].bg=n.select(this)})),t=0;tM?u.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else u.push({code:"data"});if(function e(t,r){for(var n in t)if("_"!==n.charAt(0)){var i=t[n],o=g(t,n,r);a(i)?(Array.isArray(t)&&!1===i._template&&i.templateitemname&&u.push({code:"missing",path:o,templateitemname:i.templateitemname}),e(i,o)):Array.isArray(i)&&v(i)&&e(i,o)}}({data:p,layout:d},""),u.length)return u.map(m)}},{"../lib":260,"../plots/attributes":304,"../plots/plots":348,"./plot_config":295,"./plot_schema":296,"./plot_template":297}],300:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("./plot_api"),i=e("../plots/plots"),o=e("../lib"),l=e("../snapshot/helpers"),s=e("../snapshot/tosvg"),c=e("../snapshot/svgtoimg"),u=e("../version").version,f={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var r,d,p,h;function g(e){return!(e in t)||o.validate(t[e],f[e])}if(t=t||{},o.isPlainObject(e)?(r=e.data||[],d=e.layout||{},p=e.config||{},h={}):(e=o.getGraphDiv(e),r=o.extendDeep([],e.data),d=o.extendDeep({},e.layout),p=e._context,h=e._fullLayout||{}),!g("width")&&null!==t.width||!g("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!g("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var v={};function m(e,r){return o.coerce(t,v,f,e,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var T=o.extendFlat({},d);b?T.width=b:null===t.width&&n(h.width)&&(T.width=h.width),x?T.height=x:null===t.height&&n(h.height)&&(T.height=h.height);var A=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=l.getRedrawFunc(k);function L(){return new Promise((function(e){setTimeout(e,l.getDelay(k._fullLayout))}))}function P(){return new Promise((function(e,t){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(),e(M?p:l.encodeJSON(p))}if(d(),"svg"===y)return e(M?r:l.encodeSVG(r));var h=document.createElement("canvas");h.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:h,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){a.newPlot(k,r,T,A).then(S).then(L).then(P).then((function(t){e(function(e){return M?e.replace(l.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}},{"../lib":260,"../plots/plots":348,"../snapshot/helpers":355,"../snapshot/svgtoimg":357,"../snapshot/tosvg":359,"../version":416,"./plot_api":294,"fast-isnumeric":30}],301:[function(e,t,r){"use strict";var n=e("../lib"),a=e("../plots/plots"),i=e("./plot_schema"),o=e("./plot_config").dfltConfig,l=n.isPlainObject,s=Array.isArray,c=n.isArrayOrTypedArray;function u(e,t,r,a,i,o){o=o||[];for(var f=Object.keys(e),d=0;db.length&&a.push(h("unused",i,m.concat(b.length)));var T,A,S,L,P,C=b.length,D=Array.isArray(k);if(D&&(C=Math.min(C,k.length)),2===x.dimensions)for(A=0;Ab[A].length&&a.push(h("unused",i,m.concat(A,b[A].length)));var O=b[A].length;for(T=0;T<(D?Math.min(O,k[A].length):O);T++)S=D?k[A][T]:k,L=y[A][T],P=b[A][T],n.validate(L,S)?P!==L&&P!==+L&&a.push(h("dynamic",i,m.concat(A,T),L,P)):a.push(h("value",i,m.concat(A,T),L))}else a.push(h("array",i,m.concat(A),y[A]));else for(A=0;A1&&p.push(h("object","layout"))),a.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:a};c=f}for(var d=t.calendar,p="start"===s,h="end"===s,g=e[r+"period0"],v=i(g,d)||0,m=[],y=[],b=[],x=a.length,_=0;_T;)k=o(k,-c,d);for(;k<=T;)k=o(k,c,d);M=o(k,-c,d)}else{for(k=v+(w=Math.round((T-v)/u))*u;k>T;)k-=u;for(;k<=T;)k+=u;M=k-u}m[_]=p?M:h?k:(M+k)/2,y[_]=M,b[_]=k}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":238,"../../lib":260,"fast-isnumeric":30}],306:[function(e,t,r){"use strict";t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],307:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../lib"),o=e("../../constants/numerical").FP_SAFE,l=e("../../registry"),s=e("../../components/drawing"),c=e("./axis_ids"),u=c.getFromId,f=c.isLinked;function d(e,t){var r,n,a=[],o=e._fullLayout,l=h(o,t,0),s=h(o,t,1),c=g(e,t),u=c.min,f=c.max;if(0===u.length||0===f.length)return i.simpleMap(t.range,t.r2l);var d=u[0].val,v=f[0].val;for(r=1;r0&&((M=L-l(b)-s(x))>P?k/M>C&&(_=b,w=x,C=k/M):k/L>C&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},C=k/L));if(d===v){var D=d-1,O=d+1;if(A)if(0===d)a=[0,1];else{var R=(d>0?f:u).reduce((function(e,t){return Math.max(e,s(t))}),0),E=d/(1-Math.min(.5,R/L));a=d>0?[0,E]:[E,0]}else a=S?[Math.max(0,D),Math.max(1,O)]:[D,O]}else A?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-C*l(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(t,b.val,x.val))/(L-l(_)-s(w)),a=[_.val-C*l(_),w.val+C*s(w)];return m&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var a=e.locateBreaks(t,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=T((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),L=T(r.vpadplus||r.vpad),P=T(r.vpadminus||r.vpad);if(!M){if(d=1/0,p=-1/0,w)for(n=0;n0&&(d=i),i>p&&i-o&&(d=i),i>p&&i=O;n--)D(n);return{min:h,max:g,opts:r}},concatExtremes:g};function g(e,t,r){var n,a,i,o=t._id,l=e._fullData,s=e._fullLayout,c=[],f=[];function d(e,t){for(n=0;n=r&&(c.extrapad||!o)){l=!1;break}a(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(s,1),s--)}if(l){var u=i&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function b(e){return a(e)&&Math.abs(e)=t}},{"../../components/drawing":139,"../../constants/numerical":238,"../../lib":260,"../../registry":351,"./axis_ids":312,"@plotly/d3":11,"fast-isnumeric":30}],308:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("fast-isnumeric"),i=e("../../plots/plots"),o=e("../../registry"),l=e("../../lib"),s=l.strTranslate,c=e("../../lib/svg_text_utils"),u=e("../../components/titles"),f=e("../../components/color"),d=e("../../components/drawing"),p=e("./layout_attributes"),h=e("./clean_ticks"),g=e("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,M=g.ONEAVGMONTH,k=g.ONEMINMONTH,T=g.ONEWEEK,A=g.ONEDAY,S=A/2,L=g.ONEHOUR,P=g.ONEMIN,C=g.ONESEC,D=g.MINUS_SIGN,O=g.BADNUM,R={K:"zeroline"},E={K:"gridline",L:"path"},N={K:"minor-gridline",L:"path"},I={K:"tick",L:"path"},z={K:"tick",L:"text"},F={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j=e("../../constants/alignment"),B=j.MID_SHIFT,H=j.CAP_SHIFT,Y=j.LINE_SPACING,G=j.OPPOSITE_SIDE,U=t.exports={};U.setConvert=e("./set_convert");var q=e("./axis_autotype"),V=e("./axis_ids"),Z=V.idSort,W=V.isLinked;U.id2name=V.id2name,U.name2id=V.name2id,U.cleanId=V.cleanId,U.list=V.list,U.listIds=V.listIds,U.getFromId=V.getFromId,U.getFromTrace=V.getFromTrace;var J=e("./autorange");U.getAutoRange=J.getAutoRange,U.findExtremes=J.findExtremes;function X(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}U.coerceRef=function(e,t,r,n,a,i){var o=n.charAt(n.length-1),s=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return a||(a=s[0]||("string"==typeof i?i:i[0])),i||(i=a),s=s.concat(s.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:s.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},l.coerce(e,t,u,c)},U.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},U.coercePosition=function(e,t,r,n,a,i){var o,s;if("range"!==U.getRefType(n))o=l.ensureNumber,s=r(a,i);else{var c=U.getFromId(t,n);s=r(a,i=c.fraction2r(i)),o=c.cleanPos}e[a]=o(s)},U.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?l.ensureNumber:U.getFromId(t,r).cleanPos)(e)},U.redrawComponents=function(e,t){t=t||U.listIds(e);var r=e._fullLayout;function n(n,a,i,l){for(var s=o.getComponentMethod(n,a),c={},u=0;ur&&f2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},U.saveRangeInitial=function(e,t){for(var r=U.list(e,"",!0),n=!1,a=0;a.3*d||u(n)||u(i))){var p=r.dtick/2;e+=e+p.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?e=U.tickIncrement(e,"M6","reverse")+1.5*A:i.exactMonths>.8?e=U.tickIncrement(e,"M1","reverse")+15.5*A:e-=S;var s=U.tickIncrement(e,r);if(s<=n)return s}return e}(y,e,m,c,i)),v=y,0;v<=u;)v=U.tickIncrement(v,m,!1,i);return{start:t.c2r(y,0,i),end:t.c2r(v,0,i),size:m,_dataSpan:u-c}},U.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var n,i=t.dtick&&a(t._tmin);if(i){var o=U.tickIncrement(t._tmin,t.dtick,!0);n=[t._tmin,.99*o+.01*t._tmin]}else{var s=l.simpleMap(t.range,t.r2l);n=[s[0],.8*s[0]+.2*s[1]]}if(e.range=l.simpleMap(n,t.l2r),e._isMinor=!0,U.prepTicks(e,r),i){var c=a(t.dtick),u=a(e.dtick),f=c?t.dtick:+t.dtick.substring(1),d=u?e.dtick:+e.dtick.substring(1);c&&u?ee(f,d)?f===2*T&&d===2*A&&(e.dtick=T):f===2*T&&d===3*A?e.dtick=T:f!==T||(t._input.minor||{}).nticks?te(f/d,2.5)?e.dtick=f/2:e.dtick=f:e.dtick=A:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ee(f,d)?f>=12&&2===d&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ee(f,d)||(e.dtick=te(f/d,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},U.prepTicks=function(e,t){var r=l.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var n,i=e.nticks;i||("category"===e.type||"multicategory"===e.type?(n=e.tickfont?l.bigFont(e.tickfont.size||12):15,i=e._length/n):(n="y"===e._id.charAt(0)?40:80,i=l.constrain(e._length/n,4,9)+1),"radialaxis"===e._name&&(i*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(i*=100),e._roughDTick=Math.abs(r[1]-r[0])/i,U.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(a(e.dtick)||"M"!==e.dtick.charAt(0))}var n=r(),i=U.getTickFormat(e);if(i){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(t=L,o&&!n&&e.dtick=(R?0:1);E--){var N=!E;E?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var I=E?e:l.extendFlat({},e,e.minor);if(N?U.prepMinorTicks(I,e,t):U.prepTicks(I,t),"array"!==I.tickmode){var z=X(u),F=z[0],j=z[1],B=a(I.dtick),H="log"===i&&!(B||"L"===I.dtick.charAt(0)),Y=U.tickFirst(I,t);if(E){if(e._tmin=Y,Y=j:Z<=j;Z=U.tickIncrement(Z,W,f,o)){if(E&&G++,I.rangebreaks&&!f){if(Z=p)break}if(C.length>h||Z===V)break;V=Z;var J={value:Z};E?(H&&Z!==(0|Z)&&(J.simpleLabel=!0),s>1&&G%s&&(J.skipLabel=!0),C.push(J)):(J.minor=!0,D.push(J))}}else E?(C=[],g=ne(e)):(D=[],P=ne(e))}if(R&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var K=C.map((function(e){return e.value})),Q=[],$=0;$0?(i=n-1,o=n):(i=n,o=n);var l,s=e[i].value,c=e[o].value,u=Math.abs(c-s),f=r||u,d=0;f>=y?d=u>=y&&u<=v?u:m:r===x&&f>=_?d=u>=_&&u<=b?u:x:f>=k?d=u>=k&&u<=w?u:M:r===T&&f>=T?d=T:f>=A?d=A:r===S&&f>=S?d=S:r===L&&f>=L&&(d=L),d>=u&&(d=u,l=!0);var p=a+d;if(t.rangebreaks&&d>0){for(var h=0,g=0;g<84;g++){var P=(g+.5)/84;t.maskBreaks(a*(1-P)+P*p)!==O&&h++}(d*=h/84)||(e[n].drop=!0),l&&u>T&&(d=u)}(d>0||0===n)&&(e[n].periodX=a+d/2)}}(C,e,e._definedDelta),e.rangebreaks){var ie="y"===e._id.charAt(0),oe=1;"auto"===e.tickmode&&(oe=e.tickfont?e.tickfont.size:12);var le=NaN;for(r=C.length-1;r>-1;r--)if(C[r].drop)C.splice(r,1);else{C[r].value=Oe(C[r].value,e);var se=e.c2p(C[r].value);(ie?le>se-oe:lep||uep&&(ce.periodX=p),ue10||"01-01"!==n.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12==0?"y":"m";else if(t>=A&&i<=10||t>=15*A)e._tickround="d";else if(t>=P&&i<=16||t>=L)e._tickround="M";else if(t>=C&&i<=19||t>=P)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(i,o)-20,e._tickround<0&&(e._tickround=4)}}else if(a(t)||"L"===t.charAt(0)){var l=e.range.map(e.r2d||Number);a(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var s=Math.max(Math.abs(l[0]),Math.abs(l[1])),c=Math.floor(Math.log(s)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(ge(e.exponentformat)&&!ve(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function pe(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}U.autoTicks=function(e,t,r){var n;function i(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=l.dateTick0(e.calendar,0);var o=2*t;if(o>m)t/=m,n=i(10),e.dtick="M"+12*fe(t,n,ae);else if(o>M)t/=M,e.dtick="M"+fe(t,1,ie);else if(o>A){if(e.dtick=fe(t,A,e._hasDayOfWeekBreaks?[1,2,7,14]:le),!r){var s=U.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(s)?e.tick0=l.dateTick0(e.calendar,2):e.tick0=l.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else o>L?e.dtick=fe(t,L,ie):o>P?e.dtick=fe(t,P,oe):o>C?e.dtick=fe(t,C,oe):(n=i(10),e.dtick=fe(t,n,ae))}else if("log"===e.type){e.tick0=0;var u=l.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=i(10),e.dtick="L"+fe(t,n,ae)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):De(e)?(e.tick0=0,n=1,e.dtick=fe(t,n,ue)):(e.tick0=0,n=i(10),e.dtick=fe(t,n,ae));if(0===e.dtick&&(e.dtick=1),!a(e.dtick)&&"string"!=typeof e.dtick){var d=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(d)}},U.tickIncrement=function(e,t,r,i){var o=r?-1:1;if(a(t))return l.increment(e,o*t);var s=t.charAt(0),c=o*Number(t.substr(1));if("M"===s)return l.incrementMonth(e,c,i);if("L"===s)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===s){var u="D2"===t?ce:se,f=e+.01*o,d=l.roundUp(l.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,d),1))/Math.LN10}throw"unrecognized dtick "+String(t)},U.tickFirst=function(e,t){var r=e.r2l||Number,i=l.simpleMap(e.range,r,void 0,void 0,t),o=i[1] ")}else e._prevDateHead=s,c+="
"+s;t.text=c}(e,o,r,c):"log"===u?function(e,t,r,n,i){var o=e.dtick,s=t.x,c=e.tickformat,u="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)t.text=me(Math.pow(10,s),e,i,n);else if(a(o)||"D"===u&&l.mod(s+.01,1)<.1){var f=Math.round(s),d=Math.abs(f),p=e.exponentformat;"power"===p||ge(p)&&ve(f)?(t.text=0===f?1:1===f?"10":"10"+(f>1?"":D)+d+"",t.fontSize*=1.25):("e"===p||"E"===p)&&d>2?t.text="1"+p+(f>0?"+":D)+d:(t.text=me(Math.pow(10,s),e,"","fakehover"),"D1"===o&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(o);t.text=String(Math.round(Math.pow(10,l.mod(s,1)))),t.fontSize*=.75}if("D1"===e.dtick){var h=String(t.text).charAt(0);"0"!==h&&"1"!==h||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(s<0?.5:.25)))}}(e,o,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r="");t.text=String(r)}(e,o):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),a=e._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?t.text=o+" - "+i:(t.text=i,t.text2=o)}(e,o,r):De(e)?function(e,t,r,n,a){if("radians"!==e.thetaunit||r)t.text=me(t.x,e,a,n);else{var i=t.x/180;if(0===i)t.text="0";else{var o=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}var r=function(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}(e),n=e*r,a=Math.abs(function e(r,n){return t(n,0)?r:e(n,r%n)}(n,r));return[Math.round(n/a),Math.round(r/a)]}(i);if(o[1]>=100)t.text=me(l.deg2rad(t.x),e,a,n);else{var s=t.x<0;1===o[1]?1===o[0]?t.text="\u03c0":t.text=o[0]+"\u03c0":t.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(t.text=D+t.text)}}}}(e,o,r,c,g):function(e,t,r,n,a){"never"===a?a="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(a="hide");t.text=me(t.x,e,a,n)}(e,o,0,c,g),n||(e.tickprefix&&!h(e.showtickprefix)&&(o.text=e.tickprefix+o.text),e.ticksuffix&&!h(e.showticksuffix)&&(o.text+=e.ticksuffix)),"boundaries"===e.tickson||e.showdividers){var v=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};o.xbnd=[v(o.x-.5),v(o.x+e.dtick-.5)]}return o},U.hoverLabelText=function(e,t,r){r&&(e=l.extendFlat({},e,{hoverformat:r}));var n=Array.isArray(t)?t[0]:t,a=Array.isArray(t)?t[1]:void 0;if(void 0!==a&&a!==n)return U.hoverLabelText(e,n,r)+" - "+U.hoverLabelText(e,a,r);var i="log"===e.type&&n<=0,o=U.tickText(e,e.c2l(i?-n:n),"hover").text;return i?0===n?"0":D+o:o};var he=["f","p","n","\u03bc","m","","k","M","G","T"];function ge(e){return"SI"===e||"B"===e}function ve(e){return e>14||e<-15}function me(e,t,r,n){var i=e<0,o=t._tickround,s=r||t.exponentformat||"B",c=t._tickexponent,u=U.getTickFormat(t),f=t.separatethousands;if(n){var d={exponentformat:s,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:a(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};de(d),o=(Number(d._tickround)||0)+4,c=d._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,D);var p,h=Math.pow(10,-o)/2;if("none"===s&&(c=0),(e=Math.abs(e))"+p+"":"B"===s&&9===c?e+="B":ge(s)&&(e+=he[c/3+5]));return i?D+e:e}function ye(e,t){if(e){var r=Object.keys(F).reduce((function(e,r){return-1!==t.indexOf(r)&&F[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function be(e,t){for(var r=[],n={},a=0;a1&&r=a.min&&e=0,i=u(e,t[1])<=0;return(r||a)&&(n||i)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=o(a)))){r=n;break}break;case"log":for(t=0;t0?r.bottom-f:0,d)))),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===h){if("b"===s?n[s]=t._depth:(n[s]=t._depth=Math.max(r.width>0?f-r.top:0,d),p.reverse()),r.width>0){var v=r.right-(t._offset+t._length);v>0&&(n.xr=1,n.r=v);var m=t._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===s?n[s]=t._depth=Math.max(r.height>0?f-r.left:0,d):(n[s]=t._depth=Math.max(r.height>0?r.right-f:0,d),p.reverse()),r.height>0){var y=r.bottom-(t._offset+t._length);y>0&&(n.yb=0,n.b=y);var b=t._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===t.anchor?t.position:t._anchorAxis.domain[p[0]],t.title.text!==c._dfltTitle[h]&&(n[s]+=we(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[u]=t.linewidth,t.mirror&&!0!==t.mirror&&(a[u]+=d),!0===t.mirror||"ticks"===t.mirror?a[g]=t._anchorAxis.domain[p[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(a[g]=[t._counterDomainMin,t._counterDomainMax][p[1]]))}ae&&(l=o.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"==typeof t.automargin&&(ye(n,t.automargin),ye(a,t.automargin)),i.autoMargin(e,Te(t),n),i.autoMargin(e,Ae(t),a),i.autoMargin(e,Se(t),l)})),r.skipTitle||ae&&"bottom"===t.side||re.push((function(){return function(e,t){var r,n=e._fullLayout,a=t._id,i=a.charAt(0),o=t.title.font.size;if(t.title.hasOwnProperty("standoff"))r=t._depth+t.title.standoff+we(t);else{var l=Re(t);if("multicategory"===t.type)r=t._depth;else{var s=1.5*o;l&&(s=.5*o,"outside"===t.ticks&&(s+=t.ticklen)),r=10+s+(t.linewidth?t.linewidth-1:0)}l||(r+="x"===i?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var c,f,p,h,g=U.getPxPosition(e,t);"x"===i?(f=t._offset+t._length/2,p="top"===t.side?g-r:g+r):(p=t._offset+t._length/2,f="right"===t.side?g+r:g-r,c={rotate:"-90",offset:0});if("multicategory"!==t.type){var v=t._selections[t._id+"tick"];if(h={selection:v,side:t.side},v&&v.node()&&v.node().parentNode){var m=d.getTranslate(v.node().parentNode);h.offsetLeft=m.x,h.offsetTop=m.y}t.title.hasOwnProperty("standoff")&&(h.pad=0)}return u.draw(e,a+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[i],avoid:h,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(e,t)})),l.syncOrAsync(re)}}function ie(e){var r=p+(e||"tick");return w[r]||(w[r]=function(e,t){var r,n,a,i;e._selections[t].size()?(r=1/0,n=-1/0,a=1/0,i=-1/0,e._selections[t].each((function(){var e=ke(this),t=d.bBox(e.node().parentNode);r=Math.min(r,t.top),n=Math.max(n,t.bottom),a=Math.min(a,t.left),i=Math.max(i,t.right)}))):(r=0,n=0,a=0,i=0);return{top:r,bottom:n,left:a,right:i,height:n-r,width:i-a}}(t,r)),w[r]}},U.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],a=e.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)==("x"===r)&&(i=i.map((function(e){return-e}))),e.side&&i.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),i},U.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},U.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},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=e.side,u=s?(e.tickwidth||0)/2:0,f=3,d=e.tickfont?e.tickfont.size:12;(o||n)&&(u+=d*H,f+=(e.linewidth||0)/2);(a||i)&&(u+=(e.linewidth||0)/2,f+=3);l&&"top"===c&&(f-=d*(1-H));(a||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[s?u:0,l?f:0]}(e),r=t[0],n=t[1];return"x"===e._id.charAt(0)?function(t){return s(r+e._offset+e.l2p(xe(t)),n)}:function(t){return s(n,r+e._offset+e.l2p(xe(t)))}},U.makeTickPath=function(e,t,r,n){n||(n={});var a=n.minor;if(a&&!e.minor)return"";var i=void 0!==n.len?n.len:a?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+l*r)+"v"+i*r:"M"+(t+l*r)+",0h"+i*r},U.makeLabelFns=function(e,t,r){var n=e.ticklabelposition||"",i=function(e){return-1!==n.indexOf(e)},o=i("top"),s=i("left"),c=i("right"),u=i("bottom")||s||o||c,f=i("inside"),d="inside"===n&&"inside"===e.ticks||!f&&"outside"===e.ticks&&"boundaries"!==e.tickson,p=0,h=0,g=d?e.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)}e.showticklabels&&(d||e.showline)&&(p+=.2*e.tickfont.size);var m,y,b,x,_,w={labelStandoff:p+=(e.linewidth||1)/2*(f?-1:1),labelShift:h},M=0,k=e.side,T=e._id.charAt(0),A=e.tickangle;if("x"===T)x=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(x*=-1),m=h*x,y=t+p*x,b=_?1:-.2,90===Math.abs(A)&&(f?b+=B:b=-90===A&&"bottom"===k?H:90===A&&"top"===k?B:.5,M=B/2*(A/90)),w.xFn=function(e){return e.dx+m+M*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*b},w.anchorFn=function(e,t){if(u){if(s)return"end";if(c)return"start"}return a(t)&&0!==t&&180!==t?t*x<0!==f?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==f?-n:0};else if("y"===T){if(x=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(x*=-1),m=p,y=h*x,b=0,f||90!==Math.abs(A)||(b=-90===A&&"left"===k||90===A&&"right"===k?H:.5),f){var S=a(A)?+A:0;if(0!==S){var L=l.deg2rad(S);M=Math.abs(Math.sin(L))*H*x,b=0}}w.xFn=function(e){return e.dx+t-(m+e.fontSize*b)*x+M*e.fontSize},w.yFn=function(e){return e.dy+y+e.fontSize*B},w.anchorFn=function(e,t){return a(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},U.drawTicks=function(e,t,r){r=r||{};var a=t._id+"tick",i=[].concat(t.minor&&t.minor.ticks?r.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?r.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,_e);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return d.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Ee(t,[I]),o.attr("transform",r.transFn)},U.drawGrid=function(e,t,r){r=r||{};var a=t._id+"grid",i=t.minor&&t.minor.showgrid,o=i?r.vals.filter((function(e){return e.minor})):[],l=t.showgrid?r.vals.filter((function(e){return!e.minor})):[],s=r.counterAxis;if(s&&U.shouldShowZeroLine(e,t,s))for(var c="array"===t.tickmode,u=0;u=0;m--){var y=m?g:v;if(y){var b=y.selectAll("path."+a).data(m?l:o,_e);b.exit().remove(),b.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),b.attr("transform",r.transFn).attr("d",r.path).each((function(e){return f.stroke(n.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return d.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?h:t._gw)+"px"})).style("display",null),"function"==typeof r.path&&b.attr("d",r.path)}}Ee(t,[E,N])},U.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",a=U.shouldShowZeroLine(e,t,r.counterAxis),i=r.layer.selectAll("path."+n).data(a?[{x:0,id:t._id}]:[]);i.exit().remove(),i.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return Z(e.id,t.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,t.zerolinecolor||f.defaultLine).style("stroke-width",d.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Ee(t,[R])},U.drawLabels=function(e,t,r){r=r||{};var i=e._fullLayout,o=t._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(e){return e.text})),h=r.labelFns,g=r.secondary?0:t.tickangle,v=(t._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(t.showticklabels?p:[],_e),y=[];function b(e,i){e.each((function(e){var o=n.select(this),l=o.select(".text-math-group"),u=h.anchorFn(e,i),f=r.transFn.call(o.node(),e)+(a(i)&&0!=+i?" rotate("+i+","+h.xFn(e)+","+(h.yFn(e)-e.fontSize/2)+")":""),p=c.lineCount(o),g=Y*e.fontSize,v=h.heightFn(e,a(i)?+i:0,(p-1)*g);if(v&&(f+=s(0,v)),l.empty()){var m=o.select("text");m.attr({transform:f,"text-anchor":u}),m.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var y=d.bBox(l.node()).width*{end:-.5,start:.5}[u];l.attr("transform",f+s(y,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(t){var r=n.select(this),a=e._promises.length;r.call(c.positionText,h.xFn(t),h.yFn(t)).call(d.font,t.font,t.fontSize,t.fontColor).text(t.text).call(c.convertToTspans,e),e._promises[a]?y.push(e._promises.pop().then((function(){b(r,g)}))):b(r,g)})),Ee(t,[z]),m.exit().remove(),r.repositionOnUpdate&&m.each((function(e){n.select(this).select("text").call(c.positionText,h.xFn(e),h.yFn(e))})),t._adjustTickLabelsOverflow=function(){var r=t.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===t._id.charAt(0),s=0,c=o?e._fullLayout.width:e._fullLayout.height;if(-1!==r.indexOf("domain")){var u=l.simpleMap(t.range,t.r2l);s=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var f=Math.min(s,c),p=Math.max(s,c),h=t.side,g=1/0,v=-1/0;for(var y in m.each((function(e){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=d.bBox(r.node()),l=0;o?(i.right>p||i.leftp||i.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+r._id]?s.style("display","none"):"tick"!==e.K||a||s.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;t._selections&&(t._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];t.automargin&&i._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),p.length&&"x"===u&&!a(g)&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=0;var e,n=0,i=[];if(m.each((function(e){n=Math.max(n,e.fontSize);var r=t.l2p(e.x),a=ke(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"!==t.tickson&&!t.showdividers||r.secondary){var o=p.length,s=Math.abs((p[o-1].x-p[0].x)*t._m)/(o-1),c=t.ticklabelposition||"",f=function(e){return-1!==c.indexOf(e)},h=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||h||y?(t.tickwidth||0)+6:0,w=s<2.5*n||"multicategory"===t.type||"realaxis"===t._name;for(e=0;e1)for(n=1;n2*o}(a,t))return"date";var v="strict"!==r.autotypenumbers;return function(e,t){for(var r=e.length,n=f(r),a=0,o=0,l={},u=0;u2*a}(a,v)?"category":function(e,t){for(var r=e.length,n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=x(o[l])){u=v;break}var f=a("pattern",u);if(f===v)for(l=0;l<2;l++)(c=x(o[l]))&&(t.bounds[l]=o[l]=c-1);if(f)for(l=0;l<2;l++)switch(c=o[l],f){case v:if(!n(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case m:if(!n(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===r.autorange){var d=r.range;if(d[0]d[1])return void(t.enabled=!1)}else if(o[0]>d[0]&&o[1]n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},r.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},r.isLinked=function(e,t){return i(t,e._axisMatchGroups)||i(t,e._axisConstraintGroups)}},{"../../registry":351,"./constants":315}],313:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){if("category"===t.type){var a,i=e.categoryarray,o=Array.isArray(i)&&i.length>0;o&&(a="array");var l,s=r("categoryorder",a);"array"===s&&(l=r("categoryarray")),o||"array"!==s||(s=t.categoryorder="trace"),"trace"===s?t._initialCategories=[]:"array"===s?t._initialCategories=l.slice():(l=function(e,t){var r,n,a,i=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+e*t:o}function v(e,t){for(var r=t._size,n=r.h/r.w,a={},i=Object.keys(e),o=0;oc*b)||M)for(r=0;rR&&zD&&(D=z);d/=(D-C)/(2*O),C=s.l2r(C),D=s.l2r(D),s.range=s._input.range=S=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function j(e,t,r,n,a){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",a+"Z")}function B(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(t,r)).attr("d","M0,0Z")}function H(e,t,r,n,a,i){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),Y(e,t,a,i)}function Y(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function G(e){n.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function U(e){O&&e.data&&e._context.showTips&&(a.notifier(a._(e,"Double-click to zoom back out"),"long"),O=!1)}function q(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,D)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function V(e,t,r,n,i){for(var o,l,s,c,u=!1,f={},d={},p=(i||{}).xaHash,h=(i||{}).yaHash,g=0;g=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(G(a),2!==e||me||Ue(),ve)o.indexOf("select")>-1&&S(r,a,X,K,t.id,De),o.indexOf("event")>-1&&p.click(a,r,t.id);else if(1===e&&me){var l=g?R:O,c="s"===g||"w"===m?0:1,f=l._name+".range["+c+"]",d=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(l,c),h="left",v="middle";if(l.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===l.side&&(h="right")):"e"===m&&(h="right"),a._context.showAxisRangeEntryBoxes&&n.select(xe).call(u.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(d),fill:l.tickfont?l.tickfont.color:"#444",horizontalAlign:h,verticalAlign:v}).on("edit",(function(e){var t=l.d2r(e);void 0!==t&&s.call("_guiRelayout",a,f,t)}))}}}function Ee(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,pe*t+_e)),a=Math.max(0,Math.min(te,he*r+we)),i=Math.abs(n-_e),o=Math.abs(a-we);function l(){Se="",Me.r=Me.l,Me.t=Me.b,Pe.attr("d","M0,0Z")}if(Me.l=Math.min(_e,n),Me.r=Math.max(_e,n),Me.t=Math.min(we,a),Me.b=Math.max(we,a),re.isSubplotConstrained)i>D||o>D?(Se="xy",i/ee>o/te?(o=i*te/ee,we>a?Me.t=we-o:Me.b=we+o):(i=o*ee/te,_e>n?Me.l=_e-i:Me.r=_e+i),Pe.attr("d",q(Me))):l();else if(ne.isSubplotConstrained)if(i>D||o>D){Se="xy";var s=Math.min(Me.l/ee,(te-Me.b)/te),c=Math.max(Me.r/ee,(te-Me.t)/te);Me.l=s*ee,Me.r=c*ee,Me.b=(1-s)*te,Me.t=(1-c)*te,Pe.attr("d",q(Me))}else l();else!ie||o0){var u;if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;ug[1]-1/4096&&(t.domain=l),a.noneOrAll(e.domain,t.domain,l)}return r("layer"),t}},{"../../lib":260,"fast-isnumeric":30}],325:[function(e,t,r){"use strict";var n=e("./show_dflt");t.exports=function(e,t,r,a,i){i||(i={});var o=i.tickSuffixDflt,l=n(e);r("tickprefix")&&r("showtickprefix",l),r("ticksuffix",o)&&r("showticksuffix",l)}},{"./show_dflt":328}],326:[function(e,t,r){"use strict";var n=e("../../constants/alignment").FROM_BL;t.exports=function(e,t,r){void 0===r&&(r=n[e.constraintoward||"center"]);var a=[e.r2l(e.range[0]),e.r2l(e.range[1])],i=a[0]+(a[1]-a[0])*r;e.range=e._input.range=[e.l2r(i+(a[0]-i)*t),e.l2r(i+(a[1]-i)*t)],e.setScale()}},{"../../constants/alignment":233}],327:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("d3-time-format").utcFormat,i=e("../../lib"),o=i.numberFormat,l=e("fast-isnumeric"),s=i.cleanNumber,c=i.ms2DateTime,u=i.dateTime2ms,f=i.ensureNumber,d=i.isArrayOrTypedArray,p=e("../../constants/numerical"),h=p.FP_SAFE,g=p.BADNUM,v=p.LOG_CLIP,m=p.ONEWEEK,y=p.ONEDAY,b=p.ONEHOUR,x=p.ONEMIN,_=p.ONESEC,w=e("./axis_ids"),M=e("./constants"),k=M.HOUR_PATTERN,T=M.WEEKDAY_PATTERN;function A(e){return Math.pow(10,e)}function S(e){return null!=e}t.exports=function(e,t){t=t||{};var r=e._id||"x",p=r.charAt(0);function L(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],a=e.range[1];return.5*(n+a-2*v*Math.abs(n-a))}return g}function P(t,r,n,a){if((a||{}).msUTC&&l(t))return+t;var o=u(t,n||e.calendar);if(o===g){if(!l(t))return g;t=+t;var s=Math.floor(10*i.mod(t+.05,1)),c=Math.round(t-s/10);o=u(new Date(c))+s/10}return o}function C(t,r,n){return c(t,r,n||e.calendar)}function D(t){return e._categories[Math.round(t)]}function O(t){if(S(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"==typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return g}function R(t){if(e._categoriesMap)return e._categoriesMap[t]}function E(e){var t=R(e);return void 0!==t?t:l(e)?+e:void 0}function N(e){return l(e)?+e:R(e)}function I(e,t,r){return n.round(r+t*e,2)}function z(e,t,r){return(e-r)/t}var F=function(t){return l(t)?I(t,e._m,e._b):g},j=function(t){return z(t,e._m,e._b)};if(e.rangebreaks){var B="y"===p;F=function(t){if(!l(t))return g;var r=e._rangebreaks.length;if(!r)return I(t,e._m,e._b);var n=B;e.range[0]>e.range[1]&&(n=!n);for(var a=n?-1:1,i=a*t,o=0,s=0;su)){o=i<(c+u)/2?s:s+1;break}o=s+1}var f=e._B[o]||0;return isFinite(f)?I(t,e._m2,f):0},j=function(t){var r=e._rangebreaks.length;if(!r)return z(t,e._m,e._b);for(var n=0,a=0;ae._rangebreaks[a].pmax&&(n=a+1);return z(t,e._m2,e._B[n])}}e.c2l="log"===e.type?L:f,e.l2c="log"===e.type?A:f,e.l2p=F,e.p2l=j,e.c2p="log"===e.type?function(e,t){return F(L(e,t))}:F,e.p2c="log"===e.type?function(e){return A(j(e))}:j,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=f,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=j,e.cleanPos=f):"log"===e.type?(e.d2r=e.d2l=function(e,t){return L(s(e),t)},e.r2d=e.r2c=function(e){return A(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=f,e.c2r=L,e.l2d=A,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return A(j(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=j,e.cleanPos=f):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=P,e.c2d=e.c2r=e.l2d=e.l2r=C,e.d2p=e.r2p=function(t,r,n){return e.l2p(P(t,0,n))},e.p2d=e.p2r=function(e,t,r){return C(j(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,g,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=O,e.r2d=e.c2d=e.l2d=D,e.d2r=e.d2l_noadd=E,e.r2c=function(t){var r=N(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=f,e.r2l=N,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return D(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return"string"==typeof e&&""!==e?e:f(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=D,e.d2r=e.d2l_noadd=E,e.r2c=function(t){var r=E(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=R,e.l2r=e.c2r=f,e.r2l=E,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return D(j(e))},e.r2p=e.d2p,e.p2r=j,e.cleanPos=function(e){return Array.isArray(e)||"string"==typeof e&&""!==e?e:f(e)},e.setupMultiCategory=function(n){var a,o,l=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var c in s)if(c!==r){var u=t[w.id2name(c)];l=l.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],h=[];for(a=0;ah&&(o[n]=h),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var a=w.getFromId({_fullLayout:t},e.overlaying);e.domain=a.domain}var i=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(i);var l,s,c=e.r2l(e[i][0],o),u=e.r2l(e[i][1],o),f="y"===p;if((f?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks)&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(l=0;lu&&(d=!d),d&&e._rangebreaks.reverse();var h=d?-1:1;for(e._m2=h*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(f?u:c)),l=0;la&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=l.min&&(el.max&&(l.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n rect").call(o.setTranslate,0,0).call(o.setScale,1,1),e.plot.call(o.setTranslate,t._offset,r._offset).call(o.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,e)}function v(t,r){var n=t.plotinfo,a=n.xaxis,s=n.yaxis,c=a._length,u=s._length,f=!!t.xr1,d=!!t.yr1,p=[];if(f){var h=i.simpleMap(t.xr0,a.r2l),g=i.simpleMap(t.xr1,a.r2l),v=h[1]-h[0],m=g[1]-g[0];p[0]=(h[0]*(1-r)+r*g[0]-h[0])/(h[1]-h[0])*c,p[2]=c*(1-r+r*m/v),a.range[0]=a.l2r(h[0]*(1-r)+r*g[0]),a.range[1]=a.l2r(h[1]*(1-r)+r*g[1])}else p[0]=0,p[2]=c;if(d){var y=i.simpleMap(t.yr0,s.r2l),b=i.simpleMap(t.yr1,s.r2l),x=y[1]-y[0],_=b[1]-b[0];p[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*u,p[3]=u*(1-r+r*_/x),s.range[0]=a.l2r(y[0]*(1-r)+r*b[0]),s.range[1]=s.l2r(y[1]*(1-r)+r*b[1])}else p[1]=0,p[3]=u;l.drawOne(e,a,{skipTitle:!0}),l.drawOne(e,s,{skipTitle:!0}),l.redrawComponents(e,[a._id,s._id]);var w=f?c/p[2]:1,M=d?u/p[3]:1,k=f?p[0]:0,T=d?p[1]:0,A=f?p[0]/p[2]*c:0,S=d?p[1]/p[3]*u:0,L=a._offset-A,P=s._offset-S;n.clipRect.call(o.setTranslate,k,T).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,L,P).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}l.redrawComponents(e)}},{"../../components/drawing":139,"../../lib":260,"../../registry":351,"./axes":308,"@plotly/d3":11}],333:[function(e,t,r){"use strict";var n=e("../../registry").traceIs,a=e("./axis_autotype");function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function o(e,t){var r=i(e),a=n(e,"box-violin"),o=n(e._fullInput||{},"candlestick");return a&&!o&&t===r&&void 0===e[r]&&void 0===e[r+"0"]}t.exports=function(e,t,r,l){r("autotypenumbers",l.autotypenumbersDflt),"-"===r("type",(l.splomStash||{}).type)&&(!function(e,t){if("-"!==e.type)return;var r,l=e._id,s=l.charAt(0);-1!==l.indexOf("scene")&&(l=s);var c=function(e,t,r){for(var n=0;n0&&(a["_"+r+"axes"]||{})[t])return a;if((a[r+"axis"]||r)===t){if(o(a,r))return a;if((a[r]||[]).length||a[r+"0"])return a}}}(t,l,s);if(!c)return;if("histogram"===c.type&&s==={v:"y",h:"x"}[c.orientation||"v"])return void(e.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=e.autotypenumbers,o(c,s)){var p=i(c),h=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?s(o,t,l,n+1):t(l,i,o)}}))}r.manageCommandObserver=function(e,t,n,o){var l={},s=!0;t&&t._commandObserver&&(l=t._commandObserver),l.cache||(l.cache={}),l.lookupTable={};var c=r.hasSimpleAPICommandBindings(e,n,l.lookupTable);if(t&&t._commandObserver){if(c)return l;if(t._commandObserver.remove)return t._commandObserver.remove(),t._commandObserver=null,l}if(c){i(e,c,l.cache),l.check=function(){if(s){var t=i(e,c,l.cache);return t.changed&&o&&void 0!==l.lookupTable[t.value]&&(l.disable(),Promise.resolve(o({value:t.value,type:c.type,prop:c.prop,traces:c.traces,index:l.lookupTable[t.value]})).then(l.enable,l.enable)),t.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&a<0&&(a+=360);var l=(a-n)/4;return{type:"Polygon",coordinates:[[[n,i],[n,o],[n+l,o],[n+2*l,o],[n+3*l,o],[a,o],[a,i],[a-l,i],[a-2*l,i],[a-3*l,i],[n,i]]]}}t.exports=function(e){return new A(e)},S.plot=function(e,t,r,n){var a=this;if(n)return a.update(e,t,!0);a._geoCalcData=e,a._fullLayout=t;var i=t[this.id],o=[],l=!1;for(var s in w.layerNameToAdjective)if("frame"!==s&&i["show"+s]){l=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(i,t)}if(!r){if(this.updateProjection(e,t))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(t,n),this.updateDims(t,n),this.updateFx(t,n),h.generalUpdatePerTraceModule(this.graphDiv,this,e,n);var l=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=l.selectAll(".point"),this.dataPoints.text=l.selectAll("text"),this.dataPaths.line=l.selectAll(".js-line");var s=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=s.selectAll("path"),this._render()},S.updateProjection=function(e,t){var r=this.graphDiv,n=t[this.id],s=t._size,u=n.domain,f=n.projection,d=n.lonaxis,p=n.lataxis,h=d._ax,g=p._ax,m=this.projection=function(e){var t=e.projection,r=t.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var s=(a[n]||l[n])(),u=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],d=function(e){return e?s:[]},p=0;pu*Math.PI/180}return!1},s.getPath=function(){return i().projection(s)},s.getBounds=function(e){return s.getPath().bounds(e)},s.precision(w.precision),e._isSatellite&&s.tilt(t.tilt).distance(t.distance);u&&s.clipAngle(u-w.clipPad);return s}(n),y=[[s.l+s.w*u.x[0],s.t+s.h*(1-u.y[1])],[s.l+s.w*u.x[1],s.t+s.h*(1-u.y[0])]],b=n.center||{},x=f.rotation||{},_=d.range||[],M=p.range||[];if(n.fitbounds){h._length=y[1][0]-y[0][0],g._length=y[1][1]-y[0][1],h.range=v(r,h),g.range=v(r,g);var k=(h.range[0]+h.range[1])/2,T=(g.range[0]+g.range[1])/2;if(n._isScoped)b={lon:k,lat:T};else if(n._isClipped){b={lon:k,lat:T},x={lon:k,lat:T,roll:x.roll};var A=f.type,S=w.lonaxisSpan[A]/2||180,P=w.lataxisSpan[A]/2||90;_=[k-S,k+S],M=[T-P,T+P]}else b={lon:k,lat:T},x={lon:k,lat:x.lat,roll:x.roll}}m.center([b.lon-x.lon,b.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(f.parallels);var C=L(_,M);m.fitExtent(y,C);var D=this.bounds=m.getBounds(C),O=this.fitScale=m.scale(),R=m.translate();if(n.fitbounds){var E=m.getBounds(L(h.range,g.range)),N=Math.min((D[1][0]-D[0][0])/(E[1][0]-E[0][0]),(D[1][1]-D[0][1])/(E[1][1]-E[0][1]));isFinite(N)?m.scale(N*O):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else m.scale(f.scale*O);var I=this.midPt=[(D[0][0]+D[1][0])/2,(D[0][1]+D[1][1])/2];if(m.translate([R[0]+(I[0]-R[0]),R[1]+(I[1]-R[1])]).clipExtent(D),n._isAlbersUsa){var z=m([b.lon,b.lat]),F=m.translate();m.translate([F[0]-(z[0]-F[0]),F[1]-(z[1]-F[1])])}},S.updateBaseLayers=function(e,t){var r=this,a=r.topojson,i=r.layers,o=r.basePaths;function l(e){return"lonaxis"===e||"lataxis"===e}function s(e){return Boolean(w.lineLayers[e])}function c(e){return Boolean(w.fillLayers[e])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return s(e)||c(e)?t["show"+e]:!l(e)||t[e].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(e){delete i[e],delete o[e],n.select(this).remove()})),p.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=i[e]=n.select(this);"bg"===e?r.bgRect=t.append("rect").style("pointer-events","all"):l(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):s(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):c(e)&&(o[e]=t.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],i=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):s(r)||c(r)?n.datum(T(a,a.objects[r])):l(r)&&n.datum(function(e,t,r){var n,a,i,o=t[e],l=w.scopeDefaults[t.scope];"lonaxis"===e?(n=l.lonaxisRange,a=l.lataxisRange,i=function(e,t){return[e,t]}):"lataxis"===e&&(n=l.lataxisRange,a=l.lonaxisRange,i=function(e,t){return[t,e]});var s={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};g.setConvert(s,r);var c=g.calcTicks(s);t.isScoped||"lonaxis"!==e||c.pop();for(var u=c.length,f=new Array(u),d=0;d-1&&x(n.event,a,[r.xaxis],[r.yaxis],r.id,u),l.indexOf("event")>-1&&p.click(a,n.event))}))}function f(e){return r.projection.invert([e[0]+r.xaxis._offset,e[1]+r.yaxis._offset])}},S.makeFramework=function(){var e=this,t=e.graphDiv,r=t._fullLayout,a="clip"+r._uid+e.id;e.clipDef=r._clips.append("clipPath").attr("id",a),e.clipRect=e.clipDef.append("rect"),e.framework=n.select(e.container).append("g").attr("class","geo "+e.id).call(d.setClipUrl,a,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},g.setConvert(e.mockAxis,r)},S.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,a=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":a.lon,"projection.rotation.lat":a.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":a.lon},c.extendFlat(this.viewInitial,t)},S.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?u(r[0],r[1]):null}function a(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",a).attr("transform",n)}},{"../../components/color":117,"../../components/dragelement":136,"../../components/drawing":139,"../../components/fx":157,"../../components/selections":205,"../../lib":260,"../../lib/geo_location_utils":255,"../../lib/topojson_utils":286,"../../registry":351,"../cartesian/autorange":307,"../cartesian/axes":308,"../plots":348,"./constants":338,"./zoom":343,"@plotly/d3":11,"d3-geo":26,"d3-geo-projection":25,"topojson-client":82}],340:[function(e,t,r){"use strict";var n=e("../../plots/get_data").getSubplotCalcData,a=e("../../lib").counterRegex,i=e("./geo"),o="geo",l=a(o),s={};s.geo={valType:"subplotid",dflt:o,editType:"calc"},t.exports={attr:o,name:o,idRoot:o,idRegex:l,attrRegex:l,attributes:s,layoutAttributes:e("./layout_attributes"),supplyLayoutDefaults:e("./layout_defaults"),plot:function(e){for(var t=e._fullLayout,r=e.calcdata,a=t._subplots.geo,l=0;l0&&D<0&&(D+=360);var O,R,E,N=(C+D)/2;if(!p){var I=h?f.projRotate:[N,0,0];O=r("projection.rotation.lon",I[0]),r("projection.rotation.lat",I[1]),r("projection.rotation.roll",I[2]),r("showcoastlines",!h&&b)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!b&&void 0)&&r("oceancolor")}(p?(R=-96.6,E=38.7):(R=h?N:O,E=(P[0]+P[1])/2),r("center.lon",R),r("center.lat",E),g&&(r("projection.tilt"),r("projection.distance")),v)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!b&&void 0)&&r("landcolor"),r("showlakes",!!b&&void 0)&&r("lakecolor"),r("showrivers",!!b&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",h&&"usa"!==u&&b)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",b),r("subunitcolor"),r("subunitwidth")),h||r("showframe",b)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete t.projection.scale,h?(delete t.center.lon,delete t.center.lat):m?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){a(e,t,r,{type:"geo",attributes:l,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":260,"../get_data":344,"../subplot_defaults":349,"./constants":338,"./layout_attributes":341}],343:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../registry"),o=Math.PI/180,l=180/Math.PI,s={cursor:"pointer"},c={cursor:"auto"};function u(e,t){return n.behavior.zoom().translate(t.translate()).scale(t.scale())}function f(e,t,r){var n=e.id,o=e.graphDiv,l=o.layout,s=l[n],c=o._fullLayout,u=c[n],f={},d={};function p(e,t){f[n+"."+e]=a.nestedProperty(s,e).get(),i.call("_storeDirectGUIEdit",l,c._preGUI,f);var r=a.nestedProperty(u,e);r.get()!==t&&(r.set(t),a.nestedProperty(s,e).set(t),d[n+"."+e]=t)}r(p),p("projection.scale",t.scale()/e.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",d)}function d(e,t){var r=u(0,t);function a(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(s)})).on("zoom",(function(){t.scale(n.event.scale).translate(n.event.translate),e.render(!0);var r=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(e,t,a)})),r}function p(e,t){var r,a,i,o,l,d,p,h,g,v=u(0,t);function m(e){return t.invert(e)}function y(r){var n=t.rotate(),a=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",a[0]),r("center.lat",a[1])}return v.on("zoomstart",(function(){n.select(this).style(s),r=n.mouse(this),a=t.rotate(),i=t.translate(),o=a,l=m(r)})).on("zoom",(function(){if(d=n.mouse(this),function(e){var r=m(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(r))return v.scale(t.scale()),void v.translate(t.translate());t.scale(n.event.scale),t.translate([i[0],n.event.translate[1]]),l?m(d)&&(h=m(d),p=[o[0]+(h[0]-l[0]),a[1],a[2]],t.rotate(p),o=p):l=m(r=d),g=!0,e.render(!0);var s=t.rotate(),c=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){n.select(this).style(c),g&&f(e,t,y)})),v}function h(e,t){var r,a={r:t.rotate(),k:t.scale()},i=u(0,t),o=function(e){var t=0,r=arguments.length,a=[];for(;++th?(i=(f>0?90:-90)-p,a=0):(i=Math.asin(f/h)*l-p,a=Math.sqrt(h*h-f*f));var g=180-i-2*p,v=(Math.atan2(d,u)-Math.atan2(c,a))*l,m=(Math.atan2(d,u)-Math.atan2(c,-a))*l;return x(r[0],r[1],i,v)<=x(r[0],r[1],g,m)?[i,v,r[2]]:[g,m,r[2]]}function x(e,t,r,n){var a=_(r-e),i=_(n-t);return Math.sqrt(a*a+i*i)}function _(e){return(e%360+540)%360-180}function w(e,t,r){var n=r*o,a=e.slice(),i=0===t?1:0,l=2===t?1:2,s=Math.cos(n),c=Math.sin(n);return a[i]=e[i]*s-e[l]*c,a[l]=e[l]*s+e[i]*c,a}function M(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*l,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*l,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*l]}function k(e,t){for(var r=0,n=0,a=e.length;n=t.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=t._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),l=r.select(".js-link-spacer"),s=r.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){x.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),a=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+a})}}(e,o),l.text(o.text()&&s.text()?" - ":"")}},x.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var r=n.select(e).append("div").attr("id","hiddenform").style("display","none"),a=r.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return a.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(e,!1,"keepdata"),a.node().submit(),r.remove(),e.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function T(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,a={};function i(e){for(var r=!0,i=0;i1&&E.length>1){for(l.getComponentMethod("grid","sizeDefaults")(c,s),o=0;o15&&E.length>15&&0===s.shapes.length&&0===s.images.length,x.linkSubplots(d,s,f,n),x.cleanPlot(d,s,f,n);var j=!(!n._has||!n._has("gl2d")),B=!(!s._has||!s._has("gl2d")),H=!(!n._has||!n._has("cartesian"))||j,Y=!(!s._has||!s._has("cartesian"))||B;H&&!Y?n._bgLayer.remove():Y&&!H&&(s._shouldCreateBgLayer=!0),n._zoomlayer&&!e._dragging&&h({_fullLayout:n}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var a=0;a0){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;n1,g=!t.height&&Math.abs(r.height-a)>1;(g||h)&&(h&&(r.width=n),g&&(r.height=a)),e._initialAutoSize||(e._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(e,t,r,n){var a,i,o,s=l.componentsRegistry,c=t._basePlotModules,f=l.subplotsRegistry.cartesian;for(a in s)(o=s[a]).includeBasePlot&&o.includeBasePlot(e,t);for(var d in c.length||c.push(f),t._has("cartesian")&&(l.getComponentMethod("grid","contentDefaults")(e,t),f.finalizeSubplots(e,t)),t._subplots)t._subplots[d].sort(u.subplotSort);for(i=0;i1&&(r.l/=m,r.r/=m)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var b=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,M=void 0!==r.yb?r.yb:r.y;h[t]={l:{val:b,size:r.l+v},r:{val:_,size:r.r+v},b:{val:M,size:r.b+v},t:{val:w,size:r.t+v}},g[t]=1}else delete h[t],delete g[t];if(!n._replotting)return x.doAutoMargin(e)}},x.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),C(t);var a=t._size,i=t.margin,s=u.extendFlat({},a),c=i.l,f=i.r,d=i.t,h=i.b,g=t._pushmargin,v=t._pushmarginIds,m=t.minreducedwidth,y=t.minreducedheight;if(!1!==t.margin.autoexpand){for(var b in g)v[b]||delete g[b];for(var _ in g.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:d},b:{val:0,size:h}},g){var w=g[_].l||{},M=g[_].b||{},k=w.val,T=w.size,A=M.val,S=M.size;for(var L in g){if(o(T)&&g[L].r){var P=g[L].r.val,D=g[L].r.size;if(P>k){var O=(T*P+(D-r)*k)/(P-k),R=(D*(1-k)+(T-r)*(1-P))/(P-k);O+R>c+f&&(c=O,f=R)}}if(o(S)&&g[L].t){var E=g[L].t.val,N=g[L].t.size;if(E>A){var I=(S*E+(N-n)*A)/(E-A),z=(N*(1-A)+(S-n)*(1-E))/(E-A);I+z>h+d&&(h=I,d=z)}}}}}var F=u.constrain(r-i.l-i.r,2,m),j=u.constrain(n-i.t-i.b,2,y),B=Math.max(0,r-F),H=Math.max(0,n-j);if(B){var Y=(c+f)/B;Y>1&&(c/=Y,f/=Y)}if(H){var G=(h+d)/H;G>1&&(h/=G,d/=G)}if(a.l=Math.round(c),a.r=Math.round(f),a.t=Math.round(d),a.b=Math.round(h),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!t._replotting&&x.didMarginChange(s,a)){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var U=3*(1+Object.keys(v).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return l.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function s(){return i++,function(){o++,n||o!==i||function(t){if(!e._transitionData)return;(function(e){if(e)for(;e.length;)e.shift()})(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return l.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)}(a)}}r.runFn(s),setTimeout(s())}))}],i=u.syncOrAsync(a,e);return i&&i.then||(i=Promise.resolve()),i.then((function(){return e}))}x.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},x.graphJson=function(e,t,r,n,a,i){(a&&t&&!e._fullData||a&&!t&&!e._fullLayout)&&x.supplyDefaults(e);var o=a?e._fullData:e.data,l=a?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function c(e,t){if("function"==typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,a={};return Object.keys(e).sort().forEach((function(i){if(-1===["_","["].indexOf(i.charAt(0)))if("function"!=typeof e[i]){if("keepdata"===r){if("src"===i.substr(i.length-3))return}else if("keepstream"===r){if("string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"==typeof(n=e[i+"src"])&&n.indexOf(":")>0)return;a[i]=c(e[i],t)}else t&&(a[i]="_function")})),a}return Array.isArray(e)?e.map((function(e){return c(e,t)})):u.isTypedArray(e)?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var f={data:(o||[]).map((function(e){var r=c(e);return t&&delete r.fit,r}))};if(!t&&(f.layout=c(l),a)){var d=l._size;f.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return s&&(f.frames=c(s)),i&&(f.config=c(e._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(e,t){var r,n,a,i=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;i--)if(l[i].enabled){r._indexToPoints=l[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:d,y:d}]),o[0].t||(o[0].t={}),o[0].trace=r,h[t]=o}}for(E(o,c,f),a=0;a0){for(var n=[],a=0;a-1&&(f[p[r]].title={text:""});for(r=0;r")?"":t.html(e).text()}));return t.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),a.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":117,"../components/drawing":139,"../constants/xmlns_namespaces":239,"../lib":260,"@plotly/d3":11}],360:[function(e,t,r){"use strict";var n=e("../../plots/template_attributes").hovertemplateAttrs,a=e("../scattergeo/attributes"),i=e("../../components/colorscale/attributes"),o=e("../../plots/attributes"),l=e("../../components/color/attributes").defaultLine,s=e("../../lib/extend").extendFlat,c=a.marker.line;t.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},a.geojson,{}),featureidkey:a.featureidkey,text:s({},a.text,{}),hovertext:s({},a.hovertext,{}),marker:{line:{color:s({},c.color,{dflt:l}),width:s({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:s({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":116,"../../components/colorscale/attributes":124,"../../lib/extend":252,"../../plots/attributes":304,"../../plots/template_attributes":350,"../scattergeo/attributes":401}],361:[function(e,t,r){"use strict";var n=e("fast-isnumeric"),a=e("../../constants/numerical").BADNUM,i=e("../../components/colorscale/calc"),o=e("../scatter/arrays_to_calcdata"),l=e("../scatter/calc_selection");function s(e){return e&&"string"==typeof e}t.exports=function(e,t){var r,c=t._length,u=new Array(c);r=t.geojson?function(e){return s(e)||n(e)}:s;for(var f=0;f")}(e,f,o),[e]}},{"../../lib":260,"../../plots/cartesian/axes":308,"./attributes":360}],365:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../heatmap/colorbar"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"choropleth",basePlotModule:e("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":340,"../heatmap/colorbar":369,"./attributes":360,"./calc":361,"./defaults":362,"./event_data":363,"./hover":364,"./plot":366,"./select":367,"./style":368}],366:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/geo_location_utils"),o=e("../../lib/topojson_utils").getTopojsonFeatures,l=e("../../plots/cartesian/autorange").findExtremes,s=e("./style").style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],a=n._subplot,s=r.locationmode,c=r._length,u="geojson-id"===s?i.extractTraceFeature(e):o(r,a.topojson),f=[],d=[],p=0;ps&&C[m].gap;)m--;for(b=C[m].s,g=C.length-1;g>m;g--)C[g].s=b;for(;sA[u]&&u=0;a--){var i=e[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],380:[function(e,t,r){"use strict";var n=e("../../lib"),a=e("../../registry"),i=e("./attributes"),o=e("./constants"),l=e("./subtypes"),s=e("./xy_defaults"),c=e("./period_defaults"),u=e("./stack_defaults"),f=e("./marker_defaults"),d=e("./line_defaults"),p=e("./line_shape_defaults"),h=e("./text_defaults"),g=e("./fillcolor_defaults"),v=e("../../lib").coercePattern;t.exports=function(e,t,r,m){function y(r,a){return n.coerce(e,t,i,r,a)}var b=s(e,t,m,y);if(b||(t.visible=!1),t.visible){c(e,t,m,y),y("xhoverformat"),y("yhoverformat");var x=u(e,t,m,y),_=!x&&b=Math.min(t,r)&&h<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(d.c2p(e.x)-h);return i=Math.min(t,r)&&g<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),a=1-1/n,i=Math.abs(p.c2p(e.y)-g);return iZ!=(j=E[O][1])>=Z&&(I=E[O-1][0],z=E[O][0],j-F&&(N=I+(z-I)*(Z-F)/(j-F),G=Math.min(G,N),U=Math.max(U,N)));G=Math.max(G,0),U=Math.min(U,d._length);var W=l.defaultLine;return l.opacity(f.fillcolor)?W=f.fillcolor:l.opacity((f.line||{}).color)&&(W=f.line.color),n.extendFlat(e,{distance:e.maxHoverDistance,x0:G,x1:U,y0:Z,y1:Z,color:W,hovertemplate:!1}),delete e.index,f.text&&!Array.isArray(f.text)?e.text=String(f.text):e.text=f.name,[e]}}}},{"../../components/color":117,"../../components/fx":157,"../../lib":260,"../../registry":351,"./get_trace_color":383}],385:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports={hasLines:n.hasLines,hasMarkers:n.hasMarkers,hasText:n.hasText,isBubble:n.isBubble,attributes:e("./attributes"),supplyDefaults:e("./defaults"),crossTraceDefaults:e("./cross_trace_defaults"),calc:e("./calc").calc,crossTraceCalc:e("./cross_trace_calc"),arraysToCalcdata:e("./arrays_to_calcdata"),plot:e("./plot"),colorbar:e("./marker_colorbar"),formatLabels:e("./format_labels"),style:e("./style").style,styleOnSelect:e("./style").styleOnSelect,hoverPoints:e("./hover"),selectPoints:e("./select"),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:e("../../plots/cartesian"),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},{"../../plots/cartesian":320,"./arrays_to_calcdata":372,"./attributes":373,"./calc":374,"./cross_trace_calc":378,"./cross_trace_defaults":379,"./defaults":380,"./format_labels":382,"./hover":384,"./marker_colorbar":391,"./plot":394,"./select":395,"./style":397,"./subtypes":398}],386:[function(e,t,r){"use strict";var n=e("../../lib").isArrayOrTypedArray,a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults");t.exports=function(e,t,r,o,l,s){s||(s={});var c=(e.marker||{}).color;(l("line.color",r),a(e,"line"))?i(e,t,o,l,{prefix:"line.",cLetter:"c"}):l("line.color",!n(c)&&c||r);l("line.width"),s.noDash||l("line.dash"),s.backoff&&l("line.backoff")}},{"../../components/colorscale/defaults":127,"../../components/colorscale/helpers":128,"../../lib":260}],387:[function(e,t,r){"use strict";var n=e("../../components/drawing"),a=e("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,l=o+.5,s=o-.5,c=e("../../lib"),u=c.segmentsIntersect,f=c.constrain,d=e("./constants");t.exports=function(e,t){var r,a,o,p,h,g,v,m,y,b,x,_,w,M,k,T,A,S,L=t.trace||{},P=t.xaxis,C=t.yaxis,D="log"===P.type,O="log"===C.type,R=P._length,E=C._length,N=t.backoff,I=L.marker,z=t.connectGaps,F=t.baseTolerance,j=t.shape,B="linear"===j,H=L.fill&&"none"!==L.fill,Y=[],G=d.minTolerance,U=e.length,q=new Array(U),V=0;function Z(r){var n=e[r];if(!n)return!1;var a=t.linearized?P.l2p(n.x):P.c2p(n.x),o=t.linearized?C.l2p(n.y):C.c2p(n.y);if(a===i){if(D&&(a=P.c2p(n.x,!0)),a===i)return!1;O&&o===i&&(a*=Math.abs(P._m*E*(P._m>0?l:s)/(C._m*R*(C._m>0?l:s)))),a*=1e3}if(o===i){if(O&&(o=C.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function W(e,t,r,n){var a=r-e,i=n-t,o=.5-e,l=.5-t,s=a*a+i*i,c=a*o+i*l;if(c>0&&coe||e[1]se)return[f(e[0],ie,oe),f(e[1],le,se)]}function fe(e,t){return e[0]===t[0]&&(e[0]===ie||e[0]===oe)||(e[1]===t[1]&&(e[1]===le||e[1]===se)||void 0)}function de(e,t,r){return function(n,a){var i=ue(n),o=ue(a),l=[];if(i&&o&&fe(i,o))return l;i&&l.push(i),o&&l.push(o);var s=2*c.constrain((n[e]+a[e])/2,t,r)-((i||n)[e]+(o||a)[e]);s&&((i&&o?s>0==i[e]>o[e]?i:o:i||o)[e]+=s);return l}}function pe(e){var t=e[0],r=e[1],n=t===q[V-1][0],a=r===q[V-1][1];if(!n||!a)if(V>1){var i=t===q[V-2][0],o=r===q[V-2][1];n&&(t===ie||t===oe)&&i?o?V--:q[V-1]=e:a&&(r===le||r===se)&&o?i?V--:q[V-1]=e:q[V++]=e}else q[V++]=e}function he(e){q[V-1][0]!==e[0]&&q[V-1][1]!==e[1]&&pe([$,ee]),pe(e),te=null,$=ee=0}"linear"===j||"spline"===j?ne=function(e,t){for(var r=[],n=0,a=0;a<4;a++){var i=ce[a],o=u(e[0],e[1],t[0],t[1],i[0],i[1],i[2],i[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&X(o,e)oe?oe:0,Q=t[1]se?se:0,K||Q){if(V)if(te){var n=ne(te,t);n.length>1&&(he(n[0]),q[V++]=n[1])}else re=ne(q[V-1],t)[0],q[V++]=re;else q[V++]=[K||t[0],Q||t[1]];var a=q[V-1];K&&Q&&(a[0]!==K||a[1]!==Q)?(te&&($!==K&&ee!==Q?pe($&&ee?(i=te,l=(o=t)[0]-i[0],s=(o[1]-i[1])/l,(i[1]*o[0]-o[1]*i[0])/l>0?[s>0?ie:oe,se]:[s>0?oe:ie,le]):[$||K,ee||Q]):$&&ee&&pe([$,ee])),pe([K,Q])):$-K&&ee-Q&&pe([K||$,Q||ee]),te=t,$=K,ee=Q}else te&&he(ne(te,t)[0]),q[V++]=t;var i,o,l,s}for(r=0;rJ(g,me))break;o=g,(w=y[0]*m[0]+y[1]*m[1])>x?(x=w,p=g,v=!1):w<_&&(_=w,h=g,v=!0)}if(v?(ve(p),o!==h&&ve(h)):(h!==a&&ve(h),o!==p&&ve(p)),ve(o),r>=e.length||!g)break;ve(g),a=g}}else ve(p)}te&&pe([$||te[0],ee||te[1]]),Y.push(q.slice(0,V))}var ye=j.slice(j.length-1);if(N&&"h"!==ye&&"v"!==ye){for(var be=!1,xe=-1,_e=[],we=0;we=0?s=p:(s=p=d,d++),s0?Math.max(r,i):0}}},{"fast-isnumeric":30}],391:[function(e,t,r){"use strict";t.exports={container:"marker",min:"cmin",max:"cmax"}},{}],392:[function(e,t,r){"use strict";var n=e("../../components/color"),a=e("../../components/colorscale/helpers").hasColorscale,i=e("../../components/colorscale/defaults"),o=e("./subtypes");t.exports=function(e,t,r,l,s,c){var u=o.isBubble(e),f=(e.line||{}).color;(c=c||{},f&&(r=f),s("marker.symbol"),s("marker.opacity",u?.7:1),s("marker.size"),c.noAngle||(s("marker.angle"),c.noAngleRef||s("marker.angleref"),c.noStandOff||s("marker.standoff")),s("marker.color",r),a(e,"marker")&&i(e,t,l,s,{prefix:"marker.",cLetter:"c"}),c.noSelect||(s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size")),c.noLine||(s("marker.line.color",f&&!Array.isArray(f)&&t.marker.color!==f?f:u?n.background:n.defaultLine),a(e,"marker.line")&&i(e,t,l,s,{prefix:"marker.line.",cLetter:"c"}),s("marker.line.width",u?1:0)),u&&(s("marker.sizeref"),s("marker.sizemin"),s("marker.sizemode")),c.gradient)&&("none"!==s("marker.gradient.type")&&s("marker.gradient.color"))}},{"../../components/color":117,"../../components/colorscale/defaults":127,"../../components/colorscale/helpers":128,"./subtypes":398}],393:[function(e,t,r){"use strict";var n=e("../../lib").dateTick0,a=e("../../constants/numerical").ONEWEEK;function i(e,t){return n(t,e%a==0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var l=n("yperiod");l&&(n("yperiod0",i(l,t.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":238,"../../lib":260}],394:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../registry"),i=e("../../lib"),o=i.ensureSingle,l=i.identity,s=e("../../components/drawing"),c=e("./subtypes"),u=e("./line_points"),f=e("./link_traces"),d=e("../../lib/polygon").tester;function p(e,t,r,f,p,h,g){var v;!function(e,t,r,a,o){var l=r.xaxis,s=r.yaxis,u=n.extent(i.simpleMap(l.range,l.r2c)),f=n.extent(i.simpleMap(s.range,s.r2c)),d=a[0].trace;if(!c.hasMarkers(d))return;var p=d.marker.maxdisplayed;if(0===p)return;var h=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=f[0]&&e.y<=f[1]})),g=Math.ceil(h.length/p),v=0;o.forEach((function(e,r){var n=e[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(e){return m?e.transition():e}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(h),k=o(M,"g","errorbars"),T=o(M,"g","lines"),A=o(M,"g","points"),S=o(M,"g","text");if(a.getComponentMethod("errorbars","plot")(e,k,r,g),!0===_.visible){var L,P;y(M).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var D,O,R="",E=[],N=_._prevtrace;N&&(R=N._prevRevpath||"",P=N._nextFill,E=N._polygons);var I,z,F,j,B,H,Y,G="",U="",q=[],V=i.noop;if(L=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(P&&P.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(I=s.steps(w.shape),z=s.steps(w.shape.split("").reverse().join(""))):I=z="spline"===w.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),w.smoothing):s.smoothopen(e,w.smoothing)}:function(e){return"M"+e.join("L")},F=function(e){return z(e.reverse())},q=u(f,{xaxis:b,yaxis:x,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),Y=_._polygons=new Array(q.length),v=0;v1){var r=n.select(this);if(r.datum(f),e)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 Z=T.selectAll(".js-line").data(q);y(Z.exit()).style("opacity",0).remove(),Z.each(V(!1)),Z.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(s.lineGroupStyle).each(V(!0)),s.setClipUrl(Z,r.layerClipId,e),q.length?(L?(L.datum(f),j&&H&&(C?("y"===C?j[1]=H[1]=x.c2p(0,!0):"x"===C&&(j[0]=H[0]=b.c2p(0,!0)),y(L).attr("d","M"+H+"L"+j+"L"+G.substr(1)).call(s.singleFillStyle,e)):y(L).attr("d",G+"Z").call(s.singleFillStyle,e))):P&&("tonext"===_.fill.substr(0,6)&&G&&R?("tonext"===_.fill?y(P).attr("d",G+"Z"+R+"Z").call(s.singleFillStyle,e):y(P).attr("d",G+"L"+R.substr(1)+"Z").call(s.singleFillStyle,e),_._polygons=_._polygons.concat(E)):(J(P),_._polygons=null)),_._prevRevpath=U,_._prevPolygons=Y):(L?J(L):P&&J(P),_._polygons=_._prevRevpath=_._prevPolygons=null),A.datum(f),S.datum(f),function(t,a,i){var o,u=i[0].trace,f=c.hasMarkers(u),d=c.hasText(u),p=ee(u),h=te,g=te;if(f||d){var v=l,_=u.stackgroup,w=_&&"infer zero"===e._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?K:X:_&&!w&&(v=Q),f&&(h=v),d&&(g=v)}var M,k=(o=t.selectAll("path.point").data(h,p)).enter().append("path").classed("point",!0);m&&k.call(s.pointStyle,u,e).call(s.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=s.makePointStyleFns(u)),o.each((function(t){var a=n.select(this),i=y(a);s.translatePoint(t,i,b,x)?(s.singlePointStyle(t,i,u,M,e),r.layerClipId&&s.hideOutsideRangePoint(t,i,b,x,u.xcalendar,u.ycalendar),u.customdata&&a.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(g,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(e){var t=n.select(this),a=y(t.select("text"));s.translatePoint(e,a,b,x)?r.layerClipId&&s.hideOutsideRangePoint(e,t,b,x,u.xcalendar,u.ycalendar):t.remove()})),o.selectAll("text").call(s.textPointStyle,u,e).each((function(e){var t=b.c2p(e.x),r=x.c2p(e.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:t,y:r})}))})),o.exit().remove()}(A,S,f);var W=!1===_.cliponaxis?null:r.layerClipId;s.setClipUrl(A,W,e),s.setClipUrl(S,W,e)}function J(e){y(e).attr("d","M0,0Z")}function X(e){return e.filter((function(e){return!e.gap&&e.vis}))}function K(e){return e.filter((function(e){return e.vis}))}function Q(e){return e.filter((function(e){return!e.gap}))}function $(e){return e.id}function ee(e){if(e.ids)return $}function te(){return!1}}t.exports=function(e,t,r,a,i,c){var u,d,h=!i,g=!!i&&i.duration>0,v=f(e,t,r);((u=a.selectAll("g.trace").data(v,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(e,t,r){t.each((function(t){var a=o(n.select(this),"g","fills");s.setClipUrl(a,r.layerClipId,e);var i=t[0].trace,c=[];i._ownfill&&c.push("_ownFill"),i._nexttrace&&c.push("_nextFill");var u=a.selectAll("g").data(c,l);u.enter().append("g"),u.exit().each((function(e){i[e]=null})).remove(),u.order().each((function(e){i[e]=o(n.select(this),"path","js-fill")}))}))}(e,u,t),g)?(c&&(d=c()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){a.selectAll("g.trace").each((function(r,n){p(e,n,t,r,v,this,i)}))}))):u.each((function(r,n){p(e,n,t,r,v,this,i)}));h&&u.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":139,"../../lib":260,"../../lib/polygon":272,"../../registry":351,"./line_points":387,"./link_traces":389,"./subtypes":398,"@plotly/d3":11}],395:[function(e,t,r){"use strict";var n=e("./subtypes");t.exports=function(e,t){var r,a,i,o,l=e.cd,s=e.xaxis,c=e.yaxis,u=[],f=l[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===t)for(r=0;r")}(c,g,e,s[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}},{"../../components/fx":157,"../../constants/numerical":238,"../../lib":260,"../scatter/get_trace_color":383,"./attributes":401}],407:[function(e,t,r){"use strict";t.exports={attributes:e("./attributes"),supplyDefaults:e("./defaults"),colorbar:e("../scatter/marker_colorbar"),formatLabels:e("./format_labels"),calc:e("./calc"),calcGeoJSON:e("./plot").calcGeoJSON,plot:e("./plot").plot,style:e("./style"),styleOnSelect:e("../scatter/style").styleOnSelect,hoverPoints:e("./hover"),eventData:e("./event_data"),selectPoints:e("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:e("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":340,"../scatter/marker_colorbar":391,"../scatter/style":397,"./attributes":401,"./calc":402,"./defaults":403,"./event_data":404,"./format_labels":405,"./hover":406,"./plot":408,"./select":409,"./style":410}],408:[function(e,t,r){"use strict";var n=e("@plotly/d3"),a=e("../../lib"),i=e("../../lib/topojson_utils").getTopojsonFeatures,o=e("../../lib/geojson_utils"),l=e("../../lib/geo_location_utils"),s=e("../../plots/cartesian/autorange").findExtremes,c=e("../../constants/numerical").BADNUM,u=e("../scatter/calc").calcMarkerSize,f=e("../scatter/subtypes"),d=e("./style");t.exports={calcGeoJSON:function(e,t){var r,n,a=e[0].trace,o=t[a.geo],f=o._subplot,d=a._length;if(Array.isArray(a.locations)){var p=a.locationmode,h="geojson-id"===p?l.extractTraceFeature(e):i(a,f.topojson);for(r=0;ra&&(a=u,o=c)}}return a?i(o):l};case"rms":return function(e,t){for(var r=0,a=0,o=0;o":return function(e){return d(e)>l};case">=":return function(e){return d(e)>=l};case"[]":return function(e){var t=d(e);return t>=l[0]&&t<=l[1]};case"()":return function(e){var t=d(e);return t>l[0]&&t=l[0]&&tl[0]&&t<=l[1]};case"][":return function(e){var t=d(e);return t<=l[0]||t>=l[1]};case")(":return function(e){var t=d(e);return tl[1]};case"](":return function(e){var t=d(e);return t<=l[0]||t>l[1]};case")[":return function(e){var t=d(e);return t=l[1]};case"{}":return function(e){return-1!==l.indexOf(d(e))};case"}{":return function(e){return-1===l.indexOf(d(e))}}}(r,i.getDataToCoordFunc(e,t,l,a),d),b={},x={},_=0;h?(v=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set(new Array(f))},m=function(e,t){var r=b[e.astr][t];e.get()[t]=r}):(v=function(e){b[e.astr]=n.extendDeep([],e.get()),e.set([])},m=function(e,t){var r=b[e.astr][t];e.get().push(r)}),k(v);for(var w=o(t.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var s=e.styles,c=o.styles=[];if(s)for(i=0;i=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],187:[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]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),g=!d&&e.pointBetween(s,c,u);if(h)return g?l(n,s):l(t,u),n;p&&(d||(g?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=c(h),p=d.before?d.before.ev:null,g=d.after?d.after.ev:null;function v(){if(p){var t=u(h,p);if(t)return t}return!!g&&u(h,g)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(t)(b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:i,h.seg.myFill.above=b?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)m=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m};r&&r.status(h.seg,!!p&&p.seg,!!g&&g.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function A(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=b=t.map((function(t,c){var u=b[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(b[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},m.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},m.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},m.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>m.precisionThreshold||e.scale[1]*e.viewport.height>m.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=m.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},m.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var p=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),p||(e.passes[f]=p={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},m.defaults,t)),null!=t.thickness&&(p.thickness=parseFloat(t.thickness)),null!=t.opacity&&(p.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(p.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(p.overlay=!!t.overlay,f=P}));(D=D.slice(0,F)).push(P)}for(var z=function(t){var e=M.slice(2*I,2*D[t]).concat(P?M.slice(2*P):[]),r=(p.hole||[]).map((function(e){return e-P+(D[t]-I)})),n=c(e,r);n=n.map((function(e){return e+I+(e+It.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),v&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=u(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var d=m.float32(t);return i({data:d,usage:"dynamic"}),a({data:m.fract32(t,d),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function d(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},u.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nM))&&(s.lower||!(A>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||J(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(t)||J(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=et[t.usage]),"primitive"in t&&(n=at[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(f,e,r,n,i,o,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){K(s).forEach(o)}}}function g(t){for(var e=X.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,d(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function O(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&z(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;L.call(r);var a=E();return"number"==typeof t?k(a,0|t,"number"==typeof e?0|e:0|t):t?(D(r,t),S(a,t)):k(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,P(i),C(a,3553),R(r,3553),F(),O(a),o.profile&&(i.stats.size=A(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new I(3553);return yt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return c(o,i),o.width=0,o.height=0,d(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,P(i),p(o,3553,e,r,a),F(),M(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,P(i);for(var l=0;i.mipmask>>l;++l){var c=a>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return F(),o.profile&&(i.stats.size=A(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=h.texInfo;for(L.call(l),s=0;6>s;++s)g[s]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(g[0],t),S(g[1],e),S(g[2],r),S(g[3],n),S(g[4],i),S(g[5],a);else if(D(l,t),u(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(g[s],h),S(g[s],t[s]);else for(s=0;6>s;++s)S(g[s],t)}else for(t=0|t||1,s=0;6>s;++s)k(g[s],t,t);for(c(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(h),s=0;6>s;++s)C(g[s],34069+s);for(R(l,34067),F(),o.profile&&(h.stats.size=A(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)O(g[s]);return f}var h=new I(34067);yt[h.id]=h,a.cubeCount++;var g=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=m();return c(a,h),a.width=0,a.height=0,d(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,P(h),p(a,34069+t,r,n,i),F(),M(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return F(),o.profile&&(h.stats.size=A(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);R(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){K(M).forEach(v)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,K(M).forEach((function(e){e.framebuffer=t.createFramebuffer(),m(e)}))}})}function k(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r=h.byteLength?c.subdata(h):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=i.create(u,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else i.getBuffer(u)?(f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(u.buffer)?(f.buffer=i.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?tt[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;ct&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);K(c).forEach(e),c={},K(u).forEach(e),u={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var d=o[e];if(d&&(d.refCount++,!a))return d;var p=new s(n,e);return r.shaderCount++,l(p,i,a),d||(o[e]=p),h.push(p),V(p,{destroy:function(){if(p.refCount--,0>=p.refCount){t.deleteProgram(p.program);var e=h.indexOf(p);h.splice(e,1),r.shaderCount--}0>=o[p.vertId].refCount&&(t.deleteShader(u[p.vertId]),delete u[p.vertId],delete f[p.fragId][p.vertId]),Object.keys(f[p.fragId]).length||(t.deleteShader(c[p.fragId]),delete c[p.fragId],delete f[p.fragId])}})},restore:function(){c={},u={};for(var t=0;t>>e|t<<32-e}function L(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function D(t){return Array.prototype.slice.call(t)}function R(t){return D(t).join("")}function I(t){function e(){var t=[],e=[];return V((function(){t.push.apply(t,D(arguments))}),{def:function(){var r="v"+i++;return e.push(r),0>>4&15)+"0123456789abcdef".charAt(15&e);return r}(function(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,c,u,f,h,d,p=8*t.length;for(t=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),e[p>>5]|=128<<24-p%32,e[15+(p+64>>9<<4)]=p,u=0;uf;f++){var g;if(16>f)r[f]=e[f+u];else h=f,d=L(d=O(d=r[f-2],17)^O(d,19)^d>>>10,r[f-7]),g=O(g=r[f-15],7)^O(g,18)^g>>>3,r[h]=L(L(d,g),r[f-16]);h=L(L(L(L(c,h=O(h=o,6)^O(h,11)^O(h,25)),o&s^~o&l),Mt[f]),r[f]),d=L(c=O(c=p,2)^O(c,13)^O(c,22),p&n^p&i^n&i),c=l,l=s,s=o,o=L(a,h),a=i,i=n,n=p,p=L(h,d)}t[0]=L(p,t[0]),t[1]=L(n,t[1]),t[2]=L(i,t[2]),t[3]=L(a,t[3]),t[4]=L(o,t[4]),t[5]=L(s,t[5]),t[6]=L(l,t[6]),t[7]=L(c,t[7])}for(e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t){for(var e,r,n="",i=-1;++i=e&&56320<=r&&57343>=r&&(e=65536+((1023&e)<<10)+(1023&r),i++),127>=e?n+=String.fromCharCode(e):2047>=e?n+=String.fromCharCode(192|e>>>6&31,128|63&e):65535>=e?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):2097151>=e&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(r))),n[e])?n[e].apply(null,o):(r=Function.apply(null,a.concat(r)),n&&(n[e]=r),r.apply(null,o))}}}function P(t){return Array.isArray(t)||J(t)||l(t)}function F(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",a,".createStream(",34962,",",i,".buffer);","}else{",u,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",u,");","}"),l}))})),o}function k(t,e,n,i,o){function s(t){var e=c[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[p,g,v,s],");")}d&&"null"!==d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[p,v,m,g+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[p,g,v]+");")}d&&"null"!==d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,h=n.draw,d=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),h.elementsActive&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",rt?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),p=i("primitive"),g=i("offset"),v=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof v){if(0===v)return}else r("if(",v,"){"),r.exit("}");$&&(s=i("instances"),l=t.instancing);var m=d+".type",y=h.elements&&N(h.elements)&&!h.vaoActive;$&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function Y(t,e,r,n,i){return i=(e=_()).proc("body",i),$&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function q(t,e,r,n){L(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),R(t,e,r,n.attributes,(function(){return!0}))),U(t,e,r,n.uniforms,(function(){return!0}),!1),H(t,e,e,r)}function W(t,e,r,n){function i(){return!0}t.batchId="a1",L(t,e),R(t,e,r,n.attributes,i),U(t,e,r,n.uniforms,i,!1),H(t,e,e,r)}function X(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}L(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&S(t,u,r.context),r.needsFramebuffer&&C(t,u,r.framebuffer),O(t,u,r.state,i),r.profile&&i(r.profile)&&D(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),R(t,c,r,n.attributes,a),R(t,u,r,n.attributes,i)),U(t,c,r,n.uniforms,a,!1),U(t,u,r,n.uniforms,i,!0),H(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return Y(W,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function Z(t,r){function n(e){var n=r.shader[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.shader,"."+e,n):i.set(a.shader,"."+e,t.link(n,{stable:!0})))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;if(S(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),F(Object.keys(r.state)).forEach((function(e){var n=r.state[e],o=n.append(t,i);v(o)?o.forEach((function(r,n){isNaN(r)?i.set(t.next[e],"["+n+"]",r):i.set(t.next[e],"["+n+"]",t.link(r,{stable:!0}))})):N(n)?i.set(a.next,"."+e,t.link(o,{stable:!0})):i.set(a.next,"."+e,o)})),D(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.draw,"."+e,n):i.set(a.draw,"."+e,t.link(n),{stable:!0}))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.map((function(e){return isNaN(e)?e:t.link(e,{stable:!0})}))+"]"),i.set(a.uniforms,"["+t.link(e.id(n),{stable:!0})+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new K).forEach((function(t){i.set(a,"."+t,n[t])}))})),r.scopeVAO){var s=r.scopeVAO.append(t,i);isNaN(s)?i.set(a.vao,".targetVAO",s):i.set(a.vao,".targetVAO",t.link(s,{stable:!0}))}n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=xt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height||(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=xt[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){K(u).forEach(o)},restore:function(){K(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},wt=[];wt[6408]=4,wt[6407]=3;var At=[];At[5121]=1,At[5126]=4,At[36193]=2;var Mt=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Tt=["x","y","z","w"],kt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),St={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ct={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Et={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ot={cw:2304,ccw:2305},Lt=new z(!1,!1,!1,(function(){}));return function(t){function e(){if(0===K.length)A&&A.update(),et=null;else{et=q.next(e),f();for(var t=K.length-1;0<=t;--t){var r=K[t];r&&r(D,null,0)}v.flush(),A&&A.update()}}function r(){!et&&0=K.length&&n()}}}}function u(){var t=X.viewport,e=X.scissor_box;t[0]=t[1]=e[0]=e[1]=0,D.viewportWidth=D.framebufferWidth=D.drawingBufferWidth=t[2]=e[2]=v.drawingBufferWidth,D.viewportHeight=D.framebufferHeight=D.drawingBufferHeight=t[3]=e[3]=v.drawingBufferHeight}function f(){D.tick+=1,D.time=g(),u(),Y.procs.poll()}function h(){N.refresh(),u(),Y.procs.refresh(),A&&A.update()}function g(){return(W()-k)/1e3}if(!(t=i(t)))return null;var v=t.gl,m=v.getContextAttributes();v.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)rt(V({framebuffer:t.framebuffer.faces[e]},t),l);else rt(t,l);else l(0,t)},prop:G.define.bind(null,1),context:G.define.bind(null,2),this:G.define.bind(null,3),draw:s({}),buffer:function(t){return I.create(t,34962,!1,!1)},elements:function(t){return P.create(t,!1)},texture:N.create2D,cube:N.createCube,renderbuffer:B.create,framebuffer:j.create,framebufferCube:j.createCube,vao:F.createVAO,attributes:m,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=Q;break;case"restore":r=$;break;case"destroy":r=tt}return r.push(e),{cancel:function(){for(var t=0;t",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,g=void 0===p?0:p,v=t.sweepFlag,m=void 0===v?0:v,y=[];if(0===u||0===f)return[];var b=Math.sin(d*i/360),x=Math.cos(d*i/360),_=x*(e-l)/2+b*(r-c)/2,w=-b*(e-l)/2+x*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(u*=Math.sqrt(A),f*=Math.sqrt(A));var M=function(t,e,r,n,a,o,l,c,u,f,h,d){var p=Math.pow(a,2),g=Math.pow(o,2),v=Math.pow(h,2),m=Math.pow(d,2),y=p*g-p*m-g*v;y<0&&(y=0),y/=p*m+g*v;var b=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*d,x=y*-o/a*h,_=f*b-u*x+(t+r)/2,w=u*b+f*x+(e+n)/2,A=(h-b)/a,M=(d-x)/o,T=(-h-b)/a,k=(-d-x)/o,S=s(1,0,A,M),C=s(A,M,T,k);return 0===c&&C>0&&(C-=i),1===c&&C<0&&(C+=i),[_,w,S,C]}(e,r,l,c,u,f,g,m,b,x,_,w),T=n(M,4),k=T[0],S=T[1],C=T[2],E=T[3],O=Math.abs(E)/(i/4);Math.abs(1-O)<1e-7&&(O=1);var L=Math.max(Math.ceil(O),1);E/=L;for(var D=0;De[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":17,assert:22,"is-svg-path":168,"normalize-svg-path":202,"parse-svg-path":179}],202:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,d=0,p=0,g=t.length;p4?(o=v[v.length-4],s=v[v.length-3]):(o=h,s=d),r.push(v)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":200}],203:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=c.width=e.w||e.width||200,f=c.height=e.h||e.height||200);var h=Math.min(r,f),d=e.stroke||0,p=e.viewbox||e.viewBox||i(t),g=[r/(p[2]-p[0]),f/(p[3]-p[1])],v=Math.min(g[0]||0,g[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",d&&("number"!=typeof d&&(d=1),u.strokeStyle=d>0?"white":"black",u.lineWidth=Math.abs(d));if(u.translate(.5*r,.5*f),u.scale(v,v),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var m=new Path2D(t);u.fill(m),d&&u.stroke(m)}else{var y=a(t);o(u,y),u.fill(),d&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":29,"draw-svg-path":58,"is-svg-path":168,"parse-svg-path":179,"svg-path-bounds":201}],204:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},l=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":192,timers:204}],205:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:F(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,g=e.b,i={r:255*O(d,255),g:255*O(p,255),b:255*O(g,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=I(e.s),c=I(e.v),i=function(e,r,n){e=6*O(e,360),r=O(r,100),n=O(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=I(e.s),u=I(e.l),i=function(t,e,r){var n,i,a;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=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,g;return a=E(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function k(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%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,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=a(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=a(360*t.h),r=a(100*t.s),n=a(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=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[R(a(t).toString(16)),R(a(e).toString(16)),R(a(r).toString(16)),R(P(n))];if(i&&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:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*O(this._r,255))+"%",g:a(100*O(this._g,255))+"%",b:a(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*O(this._r,255))+"%, "+a(100*O(this._g,255))+"%, "+a(100*O(this._b,255))+"%)":"rgba("+a(100*O(this._r,255))+"%, "+a(100*O(this._g,255))+"%, "+a(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+d(i._r,i._g,i._b,i._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(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,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]:I(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:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!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":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=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"},C=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function E(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,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function L(t){return o(1,s(0,t))}function D(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function P(e){return t.round(255*parseFloat(e)).toString(16)}function F(t){return D(t)/255}var z,N,B,j=(N="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",B="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),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 U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],206:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=i(t));for(var r=0,n=e.length;r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":210}],212:[function(t,e,r){"use strict";var n=t("../value/is"),i={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},{"../value/is":218}],213:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":209,"./is":214}],214:[function(t,e,r){"use strict";var n=t("../function/is"),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!i.test(a.call(t))}},{"../function/is":208}],215:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":212}],216:[function(t,e,r){"use strict";var n=t("../value/is"),i=t("../object/is"),a=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},{"../object/is":212,"../value/is":218}],217:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":209,"./is":218}],218:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],219:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),i=t("dup"),a=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,f=c.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function d(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function A(t){return s?new BigUint64Array(d(8*t),0,t):null}function M(t){return l?new BigInt64Array(d(8*t),0,t):null}function T(t){return new DataView(d(t),0,t)}function k(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return M(t);case"biguint64":return A(t);case"buffer":return k(t);case"data":case"dataview":return T(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=M,r.mallocDataView=T,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":28,buffer:31,dup:60}],220:[function(t,e,r){var n=/[\'\"]/;e.exports=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},{}],221:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(g>>5&15)-1,(31&g)+s);return a.year=v.getFullYear(),a.month=1+v.getMonth(),a.day=v.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var d,p=f[a.year-f[0]];for(d=0;d<13;d++){var g=p&1<<12-d?30:29;if(l>13;!v||d=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":237,"object-assign":176}],226:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":237,"object-assign":176}],227:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":237,"object-assign":176}],228:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":237,"object-assign":176}],229:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":237,"object-assign":176}],230:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":237,"object-assign":176}],231:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":237,"object-assign":176}],232:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":237,"object-assign":176}],234:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":237,"object-assign":176}],235:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":237,"object-assign":176}],236:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":237,"object-assign":176}],237:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":176}],238:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),p=function(t,e,r,n){var i=""+e;if(d(t,n))for(;i.length1},b=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(T).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(T));return T+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=g;for(var C=this.daysInMonth(h,d);p>C;C=this.daysInMonth(h,d))d++,p-=C}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":237,"object-assign":176}],239:[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}]},{}],240:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=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:i({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",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.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",a.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:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":374,"../../plot_api/plot_template":439,"../../plots/cartesian/constants":457,"../../plots/font_attributes":478,"./arrow_paths":239}],241:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(c===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,p,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([a,o],t)}},{"../../lib":400,"../../plots/cartesian/axes":450,"./draw":246}],242:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=it.r2fraction(e["a"+et]))<0||dt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(Q=e[et],J=pt?it._offset+it._length*Q:J=A.l+A.w*Q):(Q=1-e[et],J=pt?it._offset+it._length*Q:J=A.t+A.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var gt=e["a"+et];if(tt=ot*Y(.5,e.xanchor)-st*Y(.5,e.yanchor),nt===rt){var vt=l.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=it._offset+it._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=A.t+A.h*gt):ft.tail=A.l+A.w*gt:ft.tail=it._offset+it.r2p(gt),K=tt}else ft.tail=J+gt,K=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),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*Y($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)F.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(T-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(P-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+xt-1,y:B+_t}).call(u.setClipUrl,U?E:null,t);else{var wt=B+_t-g.top,At=B+xt-g.left;G.call(h.positionText,At,wt).call(u.setClipUrl,U?E:null,t)}H.select("rect").call(u.setRect,B,B,T,P),j.call(u.setRect,z/2,z/2,N-z,V-z),F.call(u.setTranslate,Math.round(O.x.text-N/2),Math.round(O.y.text-V/2)),R.attr({transform:"rotate("+L+","+O.x.text+","+O.y.text+")"});var Mt,Tt=function(r,n){D.selectAll(".annotation-arrow-g").remove();var l=O.x.head,f=O.y.head,h=O.x.tail+r,d=O.y.tail+n,g=O.x.text+r,x=O.y.text+n,_=o.rotationXYMatrix(L,g,x),w=o.apply2DTransform(_),T=o.apply2DTransform2(_),E=+j.attr("width"),I=+j.attr("height"),P=g-.5*E,z=P+E,N=x-.5*I,B=N+I,U=[[P,N,P,B],[P,B,z,B],[z,B,z,N],[z,N,P,N]].map(T);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,V=e.arrowcolor,Y=e.arrowside,G=D.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),q=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(c.stroke,c.rgb(V));if(v(q,Y,e),M.annotationPosition&&q.node().parentNode&&!a){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-X),transform:s(W,X)}).style("stroke-width",H+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(F);J=t.x,K=t.y,m&&m.autorange&&k(m._name+".autorange",!0),b&&b.autorange&&k(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;F.call(u.setTranslate,i,a),S("x",y(m,t,"x",A,e)),S("y",y(b,r,"y",A,e)),e.axref===e.xref&&S("ax",y(m,t,"ax",A,e)),e.ayref===e.yref&&S("ay",y(b,r,"ay",A,e)),G.attr("transform",s(t,r)),R.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Tt(0,0),I)p.init({element:F.node(),gd:t,prepFn:function(){Mt=R.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(m,t,"ax",A,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(b,r,"ay",A.w,e)):S("ay",e.ay+r),Tt(t,r);else{if(a)return;var i,o;if(m)i=y(m,t,"x",A,e);else{var l=e._xsize/A.w,c=e.x+(e._xshift-e.xshift)/A.w-l/2;i=p.align(c+t/A.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",A,e);else{var u=e._ysize/A.h,f=e.y-(e._yshift+e.yshift)/A.h-u/2;o=p.align(f-r/A.h,u,0,1,e.yanchor)}S("x",i),S("y",o),m&&b||(n=p.getCursor(m?.5:i,b?.5:o,e.xanchor,e.yanchor))}R.attr({transform:s(t,r)+Mt}),d(F,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(F),i.call("_guiRelayout",t,C());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=0,b=e.indexOf("end")>=0,x=p.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===d.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,A=o.y-u.y;if(h=(f=Math.atan2(A,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+A*A))return void I();if(x){if(x*x>w*w+A*A)return void I();var M=x*Math.cos(f),T=x*Math.sin(f);u.x+=M,u.y+=T,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+A*A)return void I();var k=_*Math.cos(f),S=_*Math.sin(f);o.x-=k,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var C=d.getTotalLength(),E="";if(C1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":485,"../annotations/draw":246}],253:[function(t,e,r){"use strict";var n=t("../../registry"),i=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 a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ct=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ct*c.roundUp(lt/ct,[2,5,10]),(Math.abs(Y.start)/Y.size+1e-6)%1<2e-6&&(it.tick0=0)}it.dtick=ot}it.domain=o?[rt+D/F.h,rt+K-D/F.h]:[rt+L/F.w,rt+K-L/F.w],it.setScale(),t.attr("transform",u(Math.round(F.l),Math.round(F.t)));var ut,ft=t.select("."+T.cbtitleunshift).attr("transform",u(-Math.round(F.l),-Math.round(F.t))),ht=it.ticklabelposition,dt=it.title.font.size,pt=t.select("."+T.cbaxis),gt=0,vt=0;function mt(n,i){var a={propContainer:it,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:P._dfltTitle.colorbar,containerGroup:t.select("."+T.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),g.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&at||!o&&!at)&&("top"===j&&(t=L+F.l+F.w*R,e=D+F.t+F.h*(1-rt-K)+3+.75*dt),"bottom"===j&&(t=L+F.l+F.w*R,e=D+F.t+F.h*(1-rt)-3-.25*dt),"right"===j&&(e=D+F.t+F.h*I+3+.75*dt,t=L+F.l+F.w*rt),mt(it._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!at||o&&at){var a,l=t.select("."+T.cbtitle),f=l.select("text"),h=[-k/2,k/2],p=l.select(".h"+it._id+"title-math-group").node(),g=15.6;if(f.node()&&(g=parseInt(f.node().style.fontSize,10)*w),p?(a=d.bBox(p),vt=a.width,(gt=a.height)>g&&(h[1]-=(gt-g)/2)):f.node()&&!f.classed(T.jsPlaceholder)&&(a=d.bBox(f.node()),vt=a.width,gt=a.height),o){if(gt){if(gt+=5,"top"===j)it.domain[1]-=gt/F.h,h[1]*=-1;else{it.domain[0]+=gt/F.h;var m=v.lineCount(f);h[1]+=(1-m)*g}l.attr("transform",u(h[0],h[1])),it.setScale()}}else vt&&("right"===j&&(it.domain[0]+=(vt+dt/2)/F.w),l.attr("transform",u(h[0],h[1])),it.setScale())}t.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",o?u(0,Math.round(F.h*(1-it.domain[1]))):u(Math.round(F.w*it.domain[0]),0)),pt.attr("transform",o?u(0,Math.round(-F.t)):u(Math.round(-F.l),0));var y=t.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(q);y.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),y.exit().remove();var b=U.map(it.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var s=[0===a?U[0]:(q[a]+q[a-1])/2,a===q.length-1?U[1]:(q[a]+q[a+1])/2].map(it.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,b[0],b[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)d.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=V(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var x=t.select("."+T.cblines).selectAll("path."+T.cbline).data(N.color&&N.width?W:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(t){var e=Q,r=Math.round(it.c2p(t))+N.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+X).call(d.lineGroupStyle,N.width,H(t),N.dash)})),pt.selectAll("g."+it._id+"tick,path").remove();var _=Q+X+(k||0)/2-("outside"===e.ticks?1:0),A=s.calcTicks(it),M=s.getTickSigns(it)[2];return s.drawTicks(r,it,{vals:"inside"===it.ticks?s.clipEnds(it,A):A,layer:pt,path:s.makeTickPath(it,_,M),transFn:s.makeTransTickFn(it)}),s.drawLabels(r,it,{vals:A,layer:pt,transFn:s.makeTransTickLabelFn(it),labelFns:s.makeLabelFns(it,_)})},function(){if(o&&!at||!o&&at){var t,i,a=it.position||0,s=it._offset+it._length/2;if("right"===j)i=s,t=F.l+F.w*a+10+dt*(it.showticklabels?1:.5);else if(t=s,"bottom"===j&&(i=F.t+F.h*a+10+(-1===ht.indexOf("inside")?it.tickfont.size:0)+("intside"!==it.ticks&&e.ticklen||0)),"top"===j){var l=B.text.split("
").length;i=F.t+F.h*a+10-X-w*dt*l}mt((o?"h":"v")+it._id+"title",{avoid:{selection:n.select(r).selectAll("g."+it._id+"tick"),side:j,offsetTop:o?0:F.t,offsetLeft:o?F.l:0,maxShift:o?P.width:P.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=X+k/2;-1===ht.indexOf("inside")&&(n=d.bBox(pt.node()),s+=o?n.width:n.height),ut=ft.select("text");var c=0,f=o&&"top"===j,g=!o&&"right"===j,v=0;if(ut.node()&&!ut.classed(T.jsPlaceholder)){var y,b=ft.select(".h"+it._id+"title-math-group").node();b&&(o&&at||!o&&!at)?(c=(n=d.bBox(b)).width,y=n.height):(c=(n=d.bBox(ft.node())).right-F.l-(o?Q:nt),y=n.bottom-F.t-(o?nt:Q),o||"top"!==j||(s+=n.height,v=n.height)),g&&(ut.attr("transform",u(c/2+dt/2,0)),c*=2),s=Math.max(s,o?c:y)}var x=2*(o?L:D)+s+S+k/2,w=0;!o&&B.text&&"bottom"===O&&I<=0&&(x+=w=x/2,v+=w),P._hColorbarMoveTitle=w,P._hColorbarMoveCBTitle=v;var z=S+k;t.select("."+T.cbbg).attr("x",(o?Q:nt)-z/2-(o?L:0)).attr("y",(o?nt:Q)-(o?J:D+v-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(J+z,2)).call(p.fill,C).call(p.stroke,e.bordercolor).style("stroke-width",S);var N=g?Math.max(c-10,0):0;if(t.selectAll("."+T.cboutline).attr("x",(o?Q:nt+L)+N).attr("y",(o?nt+D-J:Q)+(f?gt:0)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(J-(o?2*D+gt:2*L+N),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":k}),t.attr("transform",u(F.l-(o?$*x:0),F.t-(o?0:(1-tt)*x-v))),!o&&(S||i(C).getAlpha()&&!i.equals(P.paper_bgcolor,C))){var U=pt.selectAll("text"),H=U[0].length,V=t.select("."+T.cbbg).node(),Y=d.bBox(V),G=d.getTranslate(t);U.each((function(t,e){var r=H-1;if(0===e||e===r){var n,i=d.bBox(this),a=d.getTranslate(this);if(e===r){var o=i.right+a.x;(n=Y.right+G.x+nt-S-2+R-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=Y.left+G.x+nt+S+2-s)<0&&(n=0)}n&&(H<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var q={},W=A[E],Z=M[E],K=A[O],et=M[O],rt=x-X;o?("pixels"===h?(q.y=I,q.t=J*K,q.b=J*et):(q.t=q.b=0,q.yt=I+l*K,q.yb=I-l*et),"pixels"===_?(q.x=R,q.l=x*W,q.r=x*Z):(q.l=rt*W,q.r=rt*Z,q.xl=R-m*W,q.xr=R+m*Z)):("pixels"===h?(q.x=R,q.l=J*W,q.r=J*Z):(q.l=q.r=0,q.xl=R+l*W,q.xr=R-l*Z),"pixels"===_?(q.y=1-I,q.t=x*K,q.b=x*et):(q.t=rt*K,q.b=rt*et,q.yt=I-m*K,q.yb=I+m*et)),a.autoMargin(r,e._id,q)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,f)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":373,"../../lib":400,"../../lib/extend":392,"../../lib/setcursor":421,"../../lib/svg_text_utils":426,"../../plots/cartesian/axes":450,"../../plots/cartesian/axis_defaults":452,"../../plots/cartesian/layout_attributes":463,"../../plots/cartesian/position_defaults":466,"../../plots/plots":488,"../../registry":490,"../color":257,"../colorscale/helpers":268,"../dragelement":276,"../drawing":279,"../titles":366,"./constants":259,"@plotly/d3":14,tinycolor2:205}],262:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":400}],263:[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":258,"./defaults":260,"./draw":261,"./has_colorbar":262}],264:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var d=a+"auto",p=a+"min",g=a+"max",v=a+"mid",m=(s(h+d),s(h+p),s(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":417,"../../lib/sort_object_keys":423,"../colorbar/attributes":258,"./scales.js":272}],265:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return i.aggNums(Math.min,null,l)},m=function(){return i.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=u._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=u._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":400,"./helpers":268,"fast-isnumeric":121}],266:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=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,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],274:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":400}],275:[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)}},{}],276:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var 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)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!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)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=u},{"../../lib":400,"../../plots/cartesian/constants":457,"./align":273,"./cursor":274,"./unhover":277,"has-hover":159,"has-passive-events":160,"mouse-event-offset":171}],277:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":390,"../../lib/events":391,"../../lib/throttle":427,"../fx/constants":291}],278:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],279:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,h=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,g=t("../../constants/interactions").DESELECTDIM,v=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};function x(t,e,r){var n=e.fillpattern,i=n&&b.getPatternAttr(n.shape,0,"");if(i){var a=b.getPatternAttr(n.bgcolor,0,null),o=b.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=b.getPatternAttr(n.size,0,8),u=b.getPatternAttr(n.solidity,0,.3),f=e.uid;b.pattern(t,"point",r,f,i,l,u,void 0,n.fillmode,a,o,s)}else e.fillcolor&&t.call(c.fill,e.fillcolor)}b.font=function(t,e,r,n){i.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(c.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,i){t.call(b.setPosition,e,r).call(b.setSize,n,i)},b.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);b.translatePoint(t,i,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.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},b.singleFillStyle=function(t,e){var r=n.select(t.node());x(t,((r.data()[0]||[])[0]||{}).trace||{},e)},b.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&x(r,t[0].trace,e)}))};var _=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolBackOffs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,b.symbolBackOffs[r]=e.backoff||0,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var w=b.symbolNames.length;function A(t,e,r,n){var i=t%100;return b.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var M={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},k=a("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=S[a],h=new Array(u),d=0;d=100;var f=rt(t,r),h=G(t,r);e.attr("d",A(u,l,f,h))}var d,p,g,v=!1;if(t.so)g=s.outlierwidth,p=s.outliercolor,d=o.outliercolor;else{var m=(s||{}).width;g=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,p="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(d=c.defaultLine,v=!0),d="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,d).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var y=o.gradient,x=t.mgt;x?v=!0:x=y&&y.type,i.isArrayOrTypedArray(x)&&(x=x[0],S[x]||(x=0));var _=o.pattern,w=_&&b.getPatternAttr(_.shape,t.i,"");if(x&&"none"!==x){var M=t.mgc;M?v=!0:M=y.color;var T=r.uid;v&&(T+="-"+t.i),b.gradient(e,a,T,x,[[0,M],[1,d]],"fill")}else if(w){var k=b.getPatternAttr(_.bgcolor,t.i,null),C=b.getPatternAttr(_.fgcolor,t.i,null),E=_.fgopacity,O=b.getPatternAttr(_.size,t.i,8),L=b.getPatternAttr(_.solidity,t.i,.3),D=t.mcc||i.isArrayOrTypedArray(_.shape)||i.isArrayOrTypedArray(_.bgcolor)||i.isArrayOrTypedArray(_.size)||i.isArrayOrTypedArray(_.solidity),R=r.uid;D&&(R+="-"+t.i),b.pattern(e,"point",a,R,w,O,L,t.mcc,_.fillmode,k,C,E)}else c.fill(e,d);g&&c.stroke(e,p)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=v.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,h=void 0!==u,d=void 0!==f;(i.isArrayOrTypedArray(c)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:e:d?f:g*e});var p=a.color,v=o.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?v||e:m||e});var y=a.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,g))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",A(b.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,d,t,p)}var g=t.tp||e.textposition,v=O(t,e),m=a?a(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,v,m).text(c).call(h.convertToTspans,r).call(E,g,v,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=O(t,e);c.fill(i,a);var u=l.traceIs(e,"bar-like");E(i,o,s,t.mrc2||t.mrc,u)}))}};var L,D;function R(t,e,r){return r&&(t=B(t)),e?P(t[1]):I(t[0])}function I(t){var e=n.round(t,2);return L=e,e}function P(t){var e=n.round(t,2);return D=e,e}function F(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,h=3*c*(l+c),d=3*l*(l+c);return[[I(e[0]+(h&&u/h)),P(e[1]+(h&&f/h))],[I(e[0]-(d&&u/d)),P(e[1]-(d&&f/d))]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||x>=f&&x<=c)&&(_<=h&&_>=u||_>=h&&_<=u)&&(t=[x,_])}return t}b.steps=function(t){var e=z[t]||N;return function(t){for(var r="M"+I(t[0][0])+","+P(t[0][1]),n=t.length,i=1;i=1e4&&(b.savedBBoxes={},j=0),r&&(b.savedBBoxes[r]=v),j++,i.extendFlat({},v)},b.setClipUrl=function(t,e,r){t.attr("clip-path",H(e,r))},b.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}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},b.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}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var V=/\s*sc.*/;b.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(V,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var Y=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(Y);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},b.getMarkerStandoff=G;var q,W,X,Z,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,c=e._yA;if(!l||!c)return 90;r=l.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var u,f=t.lonlat[0],h=t.lonlat[1],d=e._geo.project([f,h+1e-5]),p=e._geo.project([f+1e-5,h]),g=Q(p[1]-n,p[0]-r),v=Q(d[1]-n,d[0]-r);if("north"===a)u=i/180*Math.PI;else if("previous"===a){var m=f/180*Math.PI,y=h/180*Math.PI,b=q/180*Math.PI,x=W/180*Math.PI,_=b-m,w=$(x)*tt(_),A=tt(x)*$(y)-$(x)*tt(y)*$(_);u=-Q(w,A)-Math.PI,q=f,W=h}var M=et(g,[$(u),0]),T=et(v,[tt(u),0]);i=Q(M[1]+T[1],M[0]+T[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var k=r-X,S=n-Z,C=e.line&&e.line.shape||"",E=C.slice(C.length-1);"h"===E&&(S=0),"v"===E&&(k=0),i+=Q(S,k)/Math.PI*180+90}else i=null}return X=r,Z=n,J=t.i,K=e.uid,i}b.getMarkerAngle=rt},{"../../components/fx/helpers":293,"../../constants/alignment":373,"../../constants/interactions":377,"../../constants/xmlns_namespaces":379,"../../lib":400,"../../lib/svg_text_utils":426,"../../registry":490,"../../traces/scatter/make_bubble_size_func":556,"../../traces/scatter/subtypes":564,"../color":257,"../colorscale":269,"./symbol_defs":280,"@plotly/d3":14,"fast-isnumeric":121,tinycolor2:205}],280:[function(t,e,r){"use strict";var n,i,a,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,h=Math.cos,d=Math.sin;function p(t){return null===t}function g(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=h(t),i=d(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,p=0,g=s(r),v="",m=0;m0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.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(s.duration).style("opacity",1),a.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),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!g||t.vis){var a,o=e.select("path.yerror");if(p.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=p.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="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(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var v=(d.copy_ystyle?p:d).width;a="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(a+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":564,"../drawing":279,"@plotly/d3":14,"fast-isnumeric":121}],287:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":257,"@plotly/d3":14}],288:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":392,"../../plots/font_attributes":478,"./layout_attributes":298}],289:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||ot<0||ot>w[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=ot+w[0]._offset,H="xval"in e?m.flat(l,e.xval):m.p2c(_,at),V="yval"in e?m.flat(l,e.yval):m.p2c(w,ot),!i(H[0])||!i(V[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(G=0;Gtt&&(et.splice(0,tt),ct=et[0].distance),y&&0!==N&&0===et.length){$.distance=N,$.index=!1;var f=W._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=N}))),f&&f.length){var h,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var g=p[0];i(g.x0)&&i(g.y0)&&(h=ht(g),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>h.spikeDistance)&&(nt.vLinePoint=h))}var v=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var b=v[0];i(b.x0)&&i(b.y0)&&(h=ht(b),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>h.spikeDistance)&&(nt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)At-1;kt--)Ot(et[kt]);et=St,vt()}var Lt=t._hoverdata,Dt=[],Rt=j(t),It=U(t);for(Y=0;Y1||et.length>1)||"closest"===L&&it&&et.length>1,Wt=d.combine(u.plot_bgcolor||d.background,u.paper_bgcolor),Xt=D(et,{gd:t,hovermode:L,rotateLabels:qt,bgColor:Wt,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});m.isUnifiedHover(L)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===p&&a&&a[0]>a[1]!==i&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?A:1)/2,pmin:0,pmax:i?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=h;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=i;for(v.push.apply(v,m),d.splice(o+1,1),c=0,s=v.length-1;s>=0;s--)c+=v[s].dp;for(a=c/v.length,s=v.length-1;s>=0;s--)v[s].dp-=a;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,qt?"xa":"ya",u),I(Xt,qt,u._invScaleX,u._invScaleY));if(s&&s.tagName){var Zt=v.getComponentMethod("annotations","hasClickToShow")(t,Dt);f(n.select(s),Zt?"pointer":"")}if(!s||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Lt))return;Lt&&t.emit("plotly_unhover",{event:e,points:Lt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:H,yvals:V})}(t,e,r,a,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=D(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),p=Math.max(s,l),g=t.trace;if(v.traceIs(g,"gl3d")){var m=i._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;u+=y,f+=y,h+=b,p+=b}c.bbox={x0:u+o,x1:f+o,y0:h+a,y1:p+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||d.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,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function D(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,p=e.container,g=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var A=e.fontFamily||y.HOVERFONT,M=e.fontSize||y.HOVERFONTSIZE,T=t[0],C=T.xa,E=T.ya,L=a.charAt(0),D=L+"Label",I=T[D];if(void 0===I&&"multicategory"===C.type)for(var P=0;Pi.width-x?(v=i.width-x,e.attr("d","M"+(x-k)+",0L"+x+","+b+k+"v"+b+(2*S+y.height)+"H-"+x+"V"+b+k+"H"+(x-2*k)+"Z")):e.attr("d","M0,0L"+k+","+b+k+"H"+(S+y.width/2)+"v"+b+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+b+k+"H-"+k+"Z")}else{var _,O,L;"right"===E.side?(_="start",O=1,L="",v=C._offset+C._length):(_="end",O=-1,L="-",v=C._offset),m=E._offset+(T.y0+T.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+L+k+","+k+"V"+(S+y.height/2)+"h"+L+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+L+k+"V-"+k+"Z");var D,R=y.height/2,P=z-y.top-R,F="clip"+i._uid+"commonlabel"+E._id;if(v=0?st:lt+ft=0?lt:bt+ft=0?at:ot+ht=0?ot:xt+ht=0,"top"!==t.idealAlign&&G||!q?G?(D+=F/2,t.anchor="start"):t.anchor="middle":(D-=F/2,t.anchor="end");else if(t.pos=D,G=L+P/2+W<=N,q=L-P/2-W>=0,"left"!==t.idealAlign&&G||!q)if(G)L+=P/2,t.anchor="start";else{t.anchor="middle";var X=W/2,Z=L+X-N,J=L-X;Z>0&&(L-=Z),J<0&&(L+=-J)}else L-=P/2,t.anchor="end";w.attr("text-anchor",t.anchor),C&&T.attr("text-anchor",t.anchor),e.attr("transform",s(L,D)+(c?l(_):""))})),_t}function R(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=N(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(h[c+"other"]=h[c+"Val"],h[c+"otherLabel"]=h[c+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(L,(function(e,r){return s=N(r,t.nameLength),""}))}return[l,s]}function I(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(k+S),d=f+c*(t.txwidth+S),p=0,g=t.offset,v="middle"===s;v&&(f-=t.tx2width/2,d+=t.txwidth/2+S),e&&(g*=-T,p=t.offset*M),r.select("path").attr("d",v?"M-"+a(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*k+p)+","+o(k+g)+"v"+o(t.by/2-k)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*k+p)+"V"+o(g-k)+"Z");var m=p+f,y=g+t.ty0-t.by/2+S,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(i.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===b&&"end"!==s&&(i.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(m),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(d+c*S+p),o(g+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,a(d+(c-1)*t.tx2width/2+p),o(g-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function P(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}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,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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 h=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function F(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var p=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=i._offset+y.y);var b,x,_=a.readability(y.color,p)<1.5?d.contrast(p):y.color,w=i.spikemode,A=i.spikethickness,M=i.spikecolor||_,T=g.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=v),-1!==w.indexOf("across")){var k=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(k=Math.min(k,i.position),S=Math.max(S,i.position)),b=l.l+k*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A,stroke:M,"stroke-dasharray":h.dashStyle(i.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==i.side?A:-A),cy:m,r:A,fill:M}).classed("spikeline",!0)}if(f){var C,E,O=e.vLinePoint;n=O&&O.xa,i=O&&O.ya,"cursor"===n.spikesnap?(C=c.pointerX,E=c.pointerY):(C=n._offset+O.x,E=i._offset+O.y);var L,D,R=a.readability(O.color,p)<1.5?d.contrast(p):O.color,I=n.spikemode,P=n.spikethickness,F=n.spikecolor||R,z=g.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(L=z,D=E),-1!==I.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),L=l.t+(1-B)*l.h,D=l.t+(1-N)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:L,y2:D,"stroke-width":P,stroke:F,"stroke-dasharray":h.dashStyle(n.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:L,y2:D,"stroke-width":P+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:z-("top"!==n.side?P:-P),r:P,fill:F}).classed("spikeline",!0)}}}function z(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function N(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function H(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],h=c[1],d=u[0],p=u[1];return{x:f,y:h,width:d-f,height:p-h,top:Math.min(h,p),left:Math.min(f,d),right:Math.max(f,d),bottom:Math.max(h,p)}}},{"../../lib":400,"../../lib/events":391,"../../lib/override_cursor":411,"../../lib/svg_text_utils":426,"../../plots/cartesian/axes":450,"../../registry":490,"../color":257,"../dragelement":276,"../drawing":279,"../legend/defaults":309,"../legend/draw":310,"./constants":291,"./helpers":293,"@plotly/d3":14,"fast-isnumeric":121,tinycolor2:205}],295:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.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":400,"../color":257,"./helpers":293}],296:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":400,"./layout_attributes":298}],297:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":400,"../dragelement":276,"./attributes":288,"./calc":289,"./click":290,"./constants":291,"./defaults":292,"./helpers":293,"./hover":294,"./layout_attributes":298,"./layout_defaults":299,"./layout_global_defaults":300,"@plotly/d3":14}],298:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes"),a=i({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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),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":478,"./constants":291}],299:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":400,"./hoverlabel_defaults":295,"./hovermode_defaults":296,"./layout_attributes":298}],300:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":400,"./hoverlabel_defaults":295,"./layout_attributes":298}],301:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("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:a({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"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),h=0;h1){if(!h&&!d&&!p)"independent"===M("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===M("roworder"),w=h?.2:.1,A=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:u("x",M,w,b,y),y:u("y",M,A,x,m,_)}}else delete e.grid}function M(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1===_&&(e.legend=void 0),(!1!==_||f.uirevision)&&(d("uirevision",e.uirevision),!1!==_)){d("bgcolor",e.paper_bgcolor),d("bordercolor"),d("borderwidth");var w,A,M,T=i.coerceFont(d,"font",e.font),k="h"===d("orientation");if(k?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(A=1.1,M="bottom"):(A=-.1,M="top")):(w=1.02,A=1,M="auto"),d("traceorder",b),c.isGrouped(e.legend)&&d("tracegroupgap"),d("entrywidth"),d("entrywidthmode"),d("itemsizing"),d("itemwidth"),d("itemclick"),d("itemdoubleclick"),d("groupclick"),d("x",w),d("xanchor"),d("y",A),d("yanchor",M),d("valign"),i.noneOrAll(f,h,["x","y"]),d("title.text")){d("title.side",k?"left":"top");var S=i.extendFlat({},T,{size:i.bigFont(T.size)});i.coerceFont(d,"title.font",S)}}}},{"../../lib":400,"../../plot_api/plot_template":439,"../../plots/attributes":446,"../../plots/layout_attributes":486,"../../registry":490,"./attributes":307,"./helpers":313}],310:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function w(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function A(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!u,p=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var g=i.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").call(c.font,a).text(h?M(n,p):n);var v=r.itemwidth+2*d.itemGap;f.positionText(g,v,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(k,t,e,r).on("edit",(function(n){this.text(M(n,p)).call(k,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),c=h.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):k(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.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||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function k(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,h,p=s.size*g;if(o){var v=c.bBox(o);u=v.height,h=v.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var m=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(u=p*y,h=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),f.positionText(m,l+d.titlePad,l+p);else{var x=2*d.itemGap+r.itemwidth;i.groupTitle&&(x=d.itemGap,h-=r.itemwidth),f.positionText(m,x,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=p,i.height=Math.max(u,16)+3,i.width=h)}(e,r,n,i)}))}function S(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function C(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,p=e._inHover;p?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(p){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var g=f.hiddenlabels||[];if(!(p||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),a.autoMargin(t,"legend");var M=i.ensureSingle(r,"g","legend",(function(t){p||t.attr("pointer-events","all")})),E=i.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),O=i.ensureSingle(M,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));O.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var L=i.ensureSingle(M,"g","scrollbox"),D=e.title;if(e._titleWidth=0,e._titleHeight=0,D.text){var R=i.ensureSingle(L,"text","legendtitletext");R.attr("text-anchor","start").call(c.font,D.font).text(D.text),k(R,L,t,e,1)}else L.selectAll(".legendtitletext").remove();var I=i.ensureSingle(M,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(u.fill,d.scrollBarColor)})),P=L.selectAll("g.groups").data(s);P.enter().append("g").attr("class","groups"),P.exit().remove();var F=P.selectAll("g.traces").data(i.identity);F.enter().append("g").attr("class","traces"),F.exit().remove(),F.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(A,t,e)})).call(b,t,e).each((function(){p||n.select(this).call(T,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),u="fraction"===i.entrywidthmode,f=i.borderwidth,h=2*f,p=d.itemGap,g=i.itemwidth+2*p,v=2*(f+p),m=C(i),y=i.y<0||0===i.y&&"top"===m,b=i.y>1||1===i.y&&"bottom"===m,w=i.tracegroupgap,A={};i._maxHeight=Math.max(y||b?a.height/2:o.h,30);var M=0;i._width=0,i._height=0;var T=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+T[0],f+T[1]+i._height+e/2+p),i._height+=e,i._width=Math.max(i._width,t[0].width)})),M=g+i._width,i._width+=p+g+h,i._height+=v,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var k=S(i),E=i.x<0||0===i.x&&"right"===k,O=i.x>1||1===i.x&&"left"===k,L=b||y,D=a.width/2;i._maxWidth=Math.max(E?L&&"left"===k?o.l+o.w:D:O?L&&"right"===k?o.r+o.w:D:o.w,2*g);var R=0,I=0;r.each((function(t){var e=_(t,i,g);R=Math.max(R,e),I+=e})),M=null;var P=0;if(l){var F=0,z=0,N=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,i,g),a=r[0].height;c.setTranslate(this,T[0],T[1]+f+p+a/2+e),e+=a,t=Math.max(t,n),A[r[0].trace.legendgroup]=t}));var r=t+p;z>0&&r+f+z>i._maxWidth?(P=Math.max(P,z),z=0,N+=F+w,F=e):F=Math.max(F,e),c.setTranslate(this,z,N),z+=r})),i._width=Math.max(P,z)+f,i._height=N+F+v}else{var B=r.size(),j=I+h+(B-1)*p=i._maxWidth&&(P=Math.max(P,Y),H=0,V+=U,i._height+=U,U=0),c.setTranslate(this,T[0]+f+H,T[1]+f+V+e/2+p),Y=H+r+p,H+=n,U=Math.max(U,e)})),j?(i._width=H+h,i._height=U+v):(i._width=Math.max(P,Y)+h,i._height+=U+v)}}i._width=Math.ceil(Math.max(i._width+T[0],i._titleWidth+2*(f+d.titlePad))),i._height=Math.ceil(Math.max(i._height+T[1],i._titleHeight+2*(f+d.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,q=G.legendText||G.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=t[0].trace.legendgroup,o=_(t,i,g);l&&""!==a&&(o=A[a]);var f=q?g:M||o;s||u||(f+=p/2),c.setRect(e,0,-r/2,f,r)}))}(t,P,F,e)},function(){var s,u,g,y,b=f._size,x=e.borderwidth;if(!p){if(function(t){var e=t._fullLayout.legend,r=S(e),n=C(e);return a.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))return;var _=b.l+b.w*e.x-v[S(e)]*e._width,A=b.t+b.h*(1-e.y)-v[C(e)]*e._effHeight;if(f.margin.autoexpand){var T=_,k=A;_=i.constrain(_,0,f.width-e._width),A=i.constrain(A,0,f.height-e._effHeight),_!==T&&i.log("Constrain legend.x to make legend fit inside graph"),A!==k&&i.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(M,_,A)}if(I.on(".drag",null),M.on("wheel",null),p||e._height<=e._maxHeight||t._context.staticPlot){var D=e._effHeight;p&&(D=e._height),O.attr({width:e._width-x,height:D-x,x:x/2,y:x/2}),c.setTranslate(L,0,0),E.select("rect").attr({width:e._width-2*x,height:D-2*x,x:x,y:x}),c.setClipUrl(L,h,t),c.setRect(I,0,0,0,0),delete e._scrollY}else{var R,P,F,z=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),N=e._effHeight-z-2*d.scrollBarMargin,B=e._height-e._effHeight,j=N/B,U=Math.min(e._scrollY||0,B);O.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),E.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),c.setClipUrl(L,h,t),Y(U,z,j),M.on("wheel",(function(){Y(U=i.constrain(e._scrollY+n.event.deltaY/N*B,0,B),z,j),0!==U&&U!==B&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;R="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,F=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(P="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Y(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,B)}(F,R,P),z,j))}));I.call(H);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(R=t.changedTouches[0].clientY,F=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(P=t.changedTouches[0].clientY,Y(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,B)}(F,R,P),z,j))}));L.call(V)}function Y(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(L,0,-r),c.setRect(I,e._width,d.scrollBarMargin+r*i,d.scrollBarWidth,n),E.select("rect").attr("y",x+r)}t._context.edits.legendPosition&&(M.classed("cursor-move",!0),l.init({element:M.node(),gd:t,prepFn:function(){var t=c.getTranslate(M);g=t.x,y=t.y},moveFn:function(t,r){var n=g+t,i=y+r;c.setTranslate(M,n,i),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),u=l.align(i,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=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}));i.size()>0&&w(t,M,i,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":373,"../../lib":400,"../../lib/events":391,"../../lib/svg_text_utils":426,"../../plots/plots":488,"../../registry":490,"../color":257,"../dragelement":276,"../drawing":279,"./constants":308,"./get_legend_data":311,"./handle_click":312,"./helpers":313,"./style":315,"@plotly/d3":14}],311:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,h={},d=0,p=0;function g(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+d;u.push(n),c[n]=[r],d++}}for(r=0;rT&&(M=T)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var k=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*d.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function A(t,a,o){var u=t[0].trace,f=u.marker||{},h=f.line||{},d=o?u.visible&&u.type===o:i.traceIs(u,"bar"),p=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(d?[t]:[]);p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var d=a.mcc;if(!r._inHover&&"mc"in a){var p=c(f),g=p.mid;void 0===g&&(g=(p.max+p.min)/2),d=s.tryColorscale(f,"")(g)}var m=d||a.mc||f.color,y=f.pattern,b=y&&s.getPatternAttr(y.shape,0,"");if(b){var x=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),A=y.fgopacity,M=v(y.size,8,10),T=v(y.solidity,.5,1),k="legend-"+u.uid;i.call(s.pattern,"legend",e,k,b,M,T,d,y.fillmode,x,_,A)}else i.call(l.fill,m);o&&l.stroke(i,a.mlc||h.color)}))}function M(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,d=w(h(u.width,o.pts),u,5,2),p=a.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=u.color;var g=a.minExtend(o,{trace:p});f(c,g,p)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.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,i=t[0].trace,o=[];if(i.visible)switch(i.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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),h=c(i),d=h.colorscale,g=h.reversescale;if(d){if(!r){var v=d.length;u=0===o?d[g?v-1:0][1]:1===o?d[g?0:v-1][1]:d[Math.floor((v-1)/2)][1]}}else{var m=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,p(g,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,A(t,this,"waterfall")}var a=[];e.visible&&r&&(a=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(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){A(t,this,"funnel")})).each((function(t){A(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){M(t,this,"funnelarea")})).each((function(t){M(t,this,"pie")})).each((function(t){var r,i,o=g(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=t[0],x=y.trace,_=c(x),A=_.colorscale,M=_.reversescale,T=u.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",k=n.select(this),S=k.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",T+"h"+b+"v6h-"+b+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,p(M),A,"fill")}})),f||h){var C=w(void 0,x.line,10,5);i=a.minExtend(x,{line:{width:C}}),r=[a.minExtend(y,{trace:i})]}var E=k.select(".legendlines").selectAll("path").data(f||h?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",T+(h?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(M),A,"stroke")}})})).each((function(t){var r,i,o=g(t),l=o.anyFill,c=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,v=!h&&!c&&!l&&u.hasText(p);function m(t,e,r,n){var i=a.nestedProperty(p,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||v||f){var x={},w={};if(h){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",a.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var A=m("marker.size",a.mean,[2,16],12);x.ms=A,w.marker.size=A}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[a.minExtend(d,x)],(i=a.minExtend(p,w)).selectedpoints=null,i.texttemplate=null}var M=n.select(this).select("g.legendpoints"),T=M.selectAll("path.scatterpts").data(h?r:[]);T.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),T.exit().remove(),T.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var k=M.selectAll("g.pointtext").data(v?r:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),k.exit().remove(),k.selectAll("text").call(s.textPointStyle,i,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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":400,"../../registry":490,"../../traces/pie/helpers":532,"../../traces/pie/style_one":533,"../../traces/scatter/subtypes":564,"../color":257,"../colorscale/helpers":268,"../drawing":279,"./constants":308,"@plotly/d3":14}],316:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":318}],317:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h=c._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(i=0;i1?(D=["toggleHover"],R=["resetViews"]):m?(L=["zoomInGeo","zoomOutGeo"],D=["hoverClosestGeo"],R=["resetGeo"]):v?(D=["hoverClosest3d"],R=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(L=["zoomInMapbox","zoomOutMapbox"],D=["toggleHover"],R=["resetViewMapbox"]):x?D=["hoverClosestGl2d"]:y?D=["hoverClosestPie"]:T?(D=["hoverClosestCartesian","hoverCompareCartesian"],R=["resetViewSankey"]):D=["toggleHover"];g&&(D=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=z[r+1];else if(t=n.pmax)e=z[r+1];else if(t=0;M--){var T=r.append("path").attr(v).style("opacity",M?.1:m).call(o.stroke,b).call(o.fill,y).call(s.dashLine,M?"solid":_,M?4+x:x);if(p(T,t,a),w){var k=l(t.layout,"selections",a);T.style({cursor:"move"});var S={element:T.node(),plotinfo:d,gd:t,editHelpers:k,isActiveSelection:!0},C=n(c,t);i(C,T,S)}else T.style("pointer-events",M?"all":"none");A[M]=T}var E=A[0];A[1].node().addEventListener("click",(function(){return function(t,e){if(!h(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void g(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=g,f(t)}}(t,E)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function g(t){h(t)&&(t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t)))}e.exports={draw:f,drawOne:d,activateLastSelection:function(t){if(!h(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=g,f(t)}}},{"../../plot_api/plot_template":439,"../color":257,"../drawing":279,"../shapes/display_outlines":351,"../shapes/draw_newshape/helpers":356,"../shapes/handle_outline":358,"../shapes/helpers":359}],341:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":392,"../../drawing/attributes":278}],342:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],343:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,i=t("../../shapes/handle_outline").clearOutline,a=t("../../shapes/draw_newshape/helpers"),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,f=e.plotinfo,h=f.xaxis,d=f.yaxis,p=e.isActiveSelection,g=e.dragmode,v=(c.layout||{}).selections||[];if(!n(g)&&void 0!==p){var m=c._fullLayout._activeSelectionIndex;if(m-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(m)){q(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=K(_))){for(o&&o.remove(),v=0;v=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=d(r),l=g(r);if(s||l){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&i._fullLayout._outlining)s&&(c=A(f,t)),c&&a.call("_guiRelayout",i,{shapes:c}),l&&!U(t)&&(u=M(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:u}).then((function(){e&&T(i)}))),i._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function X(t){return t._id}function Z(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(X),c=r.map(X);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,dt=et[0].yref;if(nt&&dt){var pt=ct(et);ut([O(t,nt,"x"),O(t,dt,"y")])($,pt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),h._reselect=!1}if(!a&&h._deselect){var gt=h._deselect;(function(t,e,r){for(var n=0;n=0)M._fullLayout._deactivateShape(M);else if(!b){var r=T.clickmode;E.done(Tt).then((function(){if(E.clear(Tt),2===t){for(xt.remove(),K=0;K-1&&H(e,M,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&ft(M,void 0);l.click(M,e)})).catch(k.error)}},n.doneFn=function(){Mt.remove(),E.done(Tt).then((function(){E.clear(Tt),!S&&J&&n.selectionDefs&&(J.subtract=bt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,X)),(S||b)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(kt),x&&ft(M,at)})).catch(k.error)}},clearOutline:b,clearSelectionsCache:W,selectOnClick:H}},{"../../lib":400,"../../lib/clear_gl_canvases":386,"../../lib/polygon":412,"../../lib/throttle":427,"../../plot_api/subroutines":440,"../../plots/cartesian/axis_ids":454,"../../registry":490,"../color":257,"../dragelement/helpers":275,"../drawing":279,"../fx":297,"../fx/helpers":293,"../shapes/constants":349,"../shapes/display_outlines":351,"../shapes/draw_newshape/helpers":356,"../shapes/draw_newshape/newshapes":357,"../shapes/handle_outline":358,"../shapes/helpers":359,"./constants":338,"./draw":340,"./draw_newselection/newselections":343,"./helpers":344,"point-in-polygon/nested":183,polybooljs:184}],347:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{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":374,"../../lib/extend":392,"../../plot_api/plot_template":439,"../../traces/scatter/attributes":539,"../annotations/attributes":240,"../drawing/attributes":278}],348:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,f),d=n.aggNums(Math.min,null,f),p=d<0?Math.abs(d)+c:c,g=h>0?h+c:c;return{ppad:c,ppadplus:u?p:g,ppadminus:u?g:p}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]: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;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===C&&(t[0][0]="M"),e[S]=t,A(),M())}}()}}function N(t,r){!function(t,r){if(e.length)for(var n=0;nb?(M=f,C="y0",T=b,E="y1"):(M=b,C="y1",T=f,E="y0");Z(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===R?J:K,X.altKey=n.altKey},doneFn:function(){if(y(t))return;d(e),$(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(y(t))return;$(s)}};function Z(r){if(y(t))R=null;else if(F)R="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(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!z&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";d(e,l),R=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;I?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=q(A+i)):(l=function(t){return q(Y(t)+i)},U&&"date"===U.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else I?N("xanchor",r.xanchor=G(x+n)):(N("x0",r.x0=G(c+n)),N("x1",r.x1=G(m+n))),P?N("yanchor",r.yanchor=q(A+i)):(N("y0",r.y0=q(f+i)),N("y1",r.y1=q(b+i)));e.attr("d",v(t,r)),Q(s,r)}function K(n,i){if(z){var a=function(t){return t},o=a,l=a;I?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=q(A+i)):(l=function(t){return q(Y(t)+i)},U&&"date"===U.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else if(F){if("resize-over-start-point"===R){var u=c+n,h=P?f-i:f+i;N("x0",r.x0=I?u:G(u)),N("y0",r.y0=P?h:q(h))}else if("resize-over-end-point"===R){var d=m+n,p=P?b-i:b+i;N("x1",r.x1=I?d:G(d)),N("y1",r.y1=P?p:q(p))}}else{var y=function(t){return-1!==R.indexOf(t)},_=y("n"),j=y("s"),H=y("w"),W=y("e"),X=_?M+i:M,Z=j?T+i:T,J=H?k+n:k,K=W?S+n:S;P&&(_&&(X=M-i),j&&(Z=T-i)),(!P&&Z-X>10||P&&X-Z>10)&&(N(C,r[C]=P?X:q(X)),N(E,r[E]=P?Z:q(Z))),K-J>10&&(N(O,r[O]=I?J:G(J)),N(L,r[L]=I?K:G(K)))}e.attr("d",v(t,r)),Q(s,r)}function Q(t,e){(I||P)&&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 a=V(I?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=Y(P?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(a=g.roundPositionForSharpStrokeRendering(a,1),o=g.roundPositionForSharpStrokeRendering(o,1),I&&P){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,I,l,e,r,R):!0===l.editable&&I.style("pointer-events",L||c.opacity(S)*k<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!b(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,m(t)}}(t,I)}))}}function _(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 w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,i=t.charAt(0),a=p.paramIsX[i],o=p.paramIsY[i],s=p.numParams[i];return i+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){b(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,m(t)))}e.exports={draw:m,drawOne:x,eraseActiveShape:function(t){if(!b(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&ld&&(t="X"),t}));return a>d&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+p}))}(e,s,c);if("pixel"===e.xsizemode){var x=s(e.xanchor);u=x+e.x0,f=x+e.x1}else u=s(e.x0),f=s(e.x1);if("pixel"===e.ysizemode){var _=c(e.yanchor);h=_-e.y0,d=_-e.y1}else h=c(e.y0),d=c(e.y1);if("line"===p)return"M"+u+","+h+"L"+f+","+d;if("rect"===p)return"M"+u+","+h+"H"+f+"V"+d+"H"+u+"Z";var w=(u+f)/2,A=(h+d)/2,M=Math.abs(w-u),T=Math.abs(A-h),k="A"+M+","+T,S=w+M+","+A;return"M"+S+k+" 0 1,1 "+(w+","+(A-T))+k+" 0 0,1 "+S+"Z"}},{"../../lib":400,"../../plots/cartesian/axes":450,"./constants":349}],360:[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":461,"./attributes":347,"./calc_autorange":348,"./defaults":350,"./draw":352,"./draw_newshape/defaults":355}],361:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps: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:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt: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":392,"../../plot_api/edit_types":432,"../../plot_api/plot_template":439,"../../plots/animation_attributes":444,"../../plots/font_attributes":478,"../../plots/pad_attributes":487,"./constants":362}],362:[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}},{}],363:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function E(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,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(T,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,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=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,v(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return F.call(z),R&&(C?F.on(".opacity",null):(T=0,k=!0,F.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),F.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(z)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),F.classed("js-placeholder",k),A}}},{"../../constants/alignment":373,"../../constants/interactions":377,"../../lib":400,"../../lib/svg_text_utils":426,"../../plots/plots":488,"../../registry":490,"../color":257,"../drawing":279,"@plotly/d3":14,"fast-isnumeric":121}],367:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":392,"../../plot_api/edit_types":432,"../../plot_api/plot_template":439,"../../plots/font_attributes":478,"../../plots/pad_attributes":487,"../color/attributes":256}],368:[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"}}},{}],369:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(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,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":400,"../../plots/array_container_defaults":445,"./attributes":367,"./constants":368}],370:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),v(t,n,i,a,e),s||m(t,n,i,a,e))}function v(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(k,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(p(r,i)?-1:i._index)),m(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(A,i)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=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(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),d=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(k,o,x),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(A,o),u.call(_,o)}))})),u.call(_,o),b?(M.w=Math.max(m.openWidth,m.headerWidth),M.h=x.y-M.t):(M.w=x.x-M.l,M.h=Math.max(m.openHeight,m.headerHeight)),M.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,d=i.active;if(u)for(s=0,l=0;l0?[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(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,T=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,S=p,C=v+m;C+k>c&&(C=c-k);var E=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),M?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:T,height:k}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>A,L=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,R=p+g,I=v;R+L>l&&(R=l-L);var P=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),O?(this.vbar=P.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:I,width:L,height:D}),this._vbarYMin=I+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,z=u-.5,N=O?f+L+.5:f+.5,B=h-.5,j=M?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+F).data(M||O?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),M||O?(this._clipRect=U.select("rect").attr({x:Math.floor(z),y:Math.floor(B),width:Math.ceil(N)-Math.floor(z),height:Math.ceil(j)-Math.floor(B)}),this.container.call(a.setClipUrl,F,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),M||O){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":400,"../color":257,"../drawing":279,"@plotly/d3":14}],373:[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"}}},{}],374:[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(" ")}}},{}],375:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],376:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],377:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],378:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],379:[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}},{}],380:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],382:[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}},{}],383:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}g?(u=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":407}],384:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(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(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?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),A=t.match(w?b:y);if(!A)return u;var M=A[1],T=A[3]||"1",k=Number(A[5]||1),S=Number(A[7]||0),C=Number(A[9]||0),E=Number(A[11]||0);if(c){if(2===M.length)return u;var O;M=Number(M);try{var L=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===T.charAt(T.length-1);T=parseInt(T,10),O=L.newDate(M,L.toMonthIndex(M,T,D),k)}else O=L.newDate(M,Number(T),k)}catch(t){return u}return O?(O.toJD()-g)*f+S*h+C*d+E*p:u}M=2===M.length?(Number(M)+2e3-x)%100+x:Number(M),T-=1;var R=new Date(Date.UTC(2e3,T,k,S,C));return R.setUTCFullYear(M),R.getUTCMonth()!==T||R.getUTCDate()!==k?u:R.getTime()+E*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var A=90*f,M=3*h,T=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var S=Math.floor(w/f)+g,C=Math.floor(l(t,f));try{a=v.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a("%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 s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,C=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function O(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(C,(function(){return E[r("%q")(i)]})),_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),L[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+O(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return O(e,t,n,i)};var D=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+g,a=v.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+D);return c.setUTCMonth(c.getUTCMonth()+e)+n-D},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,d=c-a,p=u*u+f*f,g=h*h+d*d,v=Math.min(l(u,f,p,i-t,a-e),l(u,f,p,o-t,c-e),l(h,d,g,t-i,e-a),l(h,d,g,r-i,n-a));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var d=h(c);d;){if((c+=d+r)>f)return;d=h(c)}for(d=h(f);d;){if(c>(f-=d+r))return;d=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":407}],396:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=v?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;x1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],400:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var d=t("./array");f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=t("./mod");f.mod=p.mod,f.modHalf=p.modHalf;var g=t("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=t("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=t("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var A=t("./extend");f.extendFlat=A.extendFlat,f.extendDeep=A.extendDeep,f.extendDeepAll=A.extendDeepAll,f.extendDeepNoArrays=A.extendDeepNoArrays;var M=t("./loggers");f.log=M.log,f.warn=M.warn,f.error=M.error;var T=t("./regex");f.counterRegex=T.counter;var k=t("./throttle");f.throttle=k.throttle,f.throttleDone=k.done,f.clearThrottle=k.clear;var S=t("./dom");function C(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.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},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return I.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var P={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return N.apply(P,arguments)};var F={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return N.apply(F,arguments)};var z=/^[:|\|]/;function N(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,h,d="_xother"===s||"_yother"===s,p="_xother_"===s||"_yother_"===s,g="xother_"===s||"yother_"===s,v="xother"===s||"yother"===s||d||g||p,m=s;if((d||p)&&(m=m.substring(1)),(g||p)&&(m=m.substring(0,m.length-1)),v){if(void 0===(c=e[m]))return""}else for(h=3;h=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var B=2e9;f.seedPseudoRandom=function(){B=2e9},f.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?f.pseudoRandom():B/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.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;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.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)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":378,"./anchor_utils":382,"./angles":383,"./array":384,"./clean_number":385,"./clear_responsive":387,"./coerce":388,"./dates":389,"./dom":390,"./extend":392,"./filter_unique":393,"./filter_visible":394,"./geometry2d":395,"./identity":398,"./increment":399,"./is_plain_object":401,"./keyed_container":402,"./localize":403,"./loggers":404,"./make_trace_groups":405,"./matrix":406,"./mod":407,"./nested_property":408,"./noop":409,"./notifier":410,"./preserve_drawing_buffer":414,"./push_unique":415,"./regex":417,"./relative_attr":418,"./relink_private":419,"./search":420,"./sort_object_keys":423,"./stats":424,"./throttle":427,"./to_log_range":428,"@plotly/d3":14,"d3-format":52,"d3-time-format":53,"fast-isnumeric":121}],401:[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).hasOwnProperty("hasOwnProperty")}},{}],402:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":437,"./notifier":410}],405:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":14}],406:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],408:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(h,m)))if(cu||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":378,"./matrix":406}],413:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e,a){var o=t._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[],cachedCode:a||{}})}catch(t){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":422,regl:198}],414:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":121,"is-mobile":164}],415:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}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 a,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?u:c,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":384,"fast-isnumeric":121}],425:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":35}],426:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,g){var k=t.text(),S=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&k.match(l),O=n.select(t.node().parentNode);if(!O.empty()){var L=t.attr("class")?t.attr("class").split(" ")[0]:"text";return L+="-math",O.selectAll("svg."+L).remove(),O.selectAll("g."+L+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),S?(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 a,o,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2!==h&&3!==h)return void i.warn("No MathJax version:",MathJax.version);var d=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(a):MathJax.typeset([a])},p=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),d,p,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){d(),p(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}(S[2],o,(function(n,i,o){O.selectAll("svg."+L).remove(),O.selectAll("g."+L+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return D(),void e();var l=O.append("g").classed(L+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:L,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",h=s.select("g");h.attr({fill:f,stroke:f});var d=h.node().getBoundingClientRect(),p=d.width,v=d.height;(p>c||v>u)&&(s.style("overflow","hidden"),p=(d=s.node().getBoundingClientRect()).width,v=d.height);var m=+t.attr("x"),y=+t.attr("y"),b=-(r||t.node().getBoundingClientRect().height)/4;if("y"===L[0])l.attr({transform:"rotate("+[-90,m,y]+")"+a(-p/2,b-v/2)});else if("l"===L[0])y=b-v/2;else if("a"===L[0]&&0!==L.indexOf("atitle"))m=0,y=b;else{var x=t.attr("text-anchor");m-=p*("middle"===x?.5:"end"===x?1:0),y=y+b-v/2}s.attr({x:m,y:y}),g&&g.call(t,l),e(l)}))}))):D(),t}function D(){O.empty()||(L=t.attr("class")+"-math",O.select("svg."+L).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(m),O=0;O|>|>)/g;var f=[["$","$"],["\\(","\\)"]];var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&C(n)}var T=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(m),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,p-i)+"..."):o.push(u.substr(0,p));break}s=""}}return o.join("")};var k={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(S,(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)):k[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==g.indexOf(i)&&-1!==g.indexOf(a)?e:""}function O(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=C,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(m),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.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)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],428:[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":121}],429:[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"}}},{}],430:[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"}}},{}],431:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&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 a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),p(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;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.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 a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,A,M,T,k,S=Object.keys(r).map(Number).sort(o),C=e.get(),E=C||[],O=u(m,f).get(),L=[],D=-1,R=E.length;for(b=0;bE.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==M)A.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?L.push(_):T?("add"===M&&(M={}),E.splice(_,0,M),O&&O.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,M),-1===D&&(D=_);else for(x=0;x=0;b--)E.splice(L[b],1),O&&O.splice(L[b],1);if(E.length?C||e.set(E):e.set(null),g)return!1;if(h(v,m),p!==i){var I;if(-1===D)I=S;else{for(R=Math.max(E.length,R),I=[],b=0;b=D);b++)I.push(_);for(b=D;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),L(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&L(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in L(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=O(r,t.data.length-1),e)for(var g=0;g-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(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 i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(H(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&V(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(k)),s.push(h.rehover,h.redrag,h.reselect),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[d.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function V(t,e){var r=e?function(t){var r=[];for(var n in e){var i=d.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return d.draw(t,r,{skipTitle:!0})}:function(t){return d.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,h=z(l._preGUI,c),p=Object.keys(e),g=d.list(t),v=o.extendDeepAll({},e),m={};for(j(e),p=Object.keys(e),n=0;n0&&"string"!=typeof R.parts[P];)P--;var N=R.parts[P],B=R.parts[P-1]+"."+N,U=R.parts.slice(0,P).join("."),H=s(t.layout,U).get(),V=s(l,U).get(),W=R.get();if(void 0!==I){k[D]=I,S[D]="reverse"===N?I:F(W);var Z=f.getLayoutValObject(l,R.parts);if(Z&&Z.impliedEdits&&null!==I)for(var J in Z.impliedEdits)C(o.relativeAttr(D,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(D))if(I){C("autosize",null);var K="height"===D?"width":"height";C(K,l[K])}else l[D]=t._initialAutoSize[D];else if("autosize"===D)C("width",I?null:l.width),C("height",I?null:l.height);else if(B.match(Y))L(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){L(B),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else B.match(q)&&s(l,U+"._inputDomain").set(null);if("type"===N){E=H;var $="linear"===V.type&&"log"===I,tt="log"===V.type&&"linear"===I;if($||tt){if(E&&E.range)if(V.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&C(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),C(U+".range[0]",Math.log(et)/Math.LN10),C(U+".range[1]",Math.log(rt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,et)),C(U+".range[1]",Math.pow(10,rt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete l[R.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,I,C),u.getComponentMethod("images","convertCoords")(t,V,I,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(N.match(M)){var nt=s(l,D).get(),it=(I||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,C),u.getComponentMethod("images","convertCoords")(t,nt,it,C)}var at=x.containerArrayMatch(D);if(at){r=at.array,n=at.index;var ot=at.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(I)?S[D]=null:x.isRemoveVal(I)?S[D]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(T,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=I,delete e[D]}else"reverse"===N?(H.range?H.range.reverse():(C(U+".autorange",!0),H.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):("dragmode"===D&&(!1===I&&!1!==W||!1!==I&&!1===W)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===D&&("lasso"===I||"select"===I)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?T.plot=!0:Z?A.update(T,Z):T.calc=!0,R.set(I))}}for(r in m){x.applyContainerArrayChanges(t,h(a,r),m[r],T,h)||(T.plot=!0)}for(var ct in O){var ut=(E=d.getFromId(t,ct))&&E._constraintGroup;if(ut)for(var ft in T.calc=!0,ut)O[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(T.plot=!0),(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:O,undoit:S,redoit:k,eventData:v}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=B(t,o.extendFlat({},e),a),l=s.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var d=[];f.layoutReplot?d.push(w.layoutReplot):l.fullReplot?d.push(r._doPlot):(d.push(h.previousPromises),H(t,f,u)||h.supplyDefaults(t),l.style&&d.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&d.push(w.doColorBars),f.legend&&d.push(w.doLegend),f.layoutstyle&&d.push(w.layoutStyles),f.axrange&&V(d,u.rangesAltered),f.ticks&&d.push(w.doTicksRelayout),f.modebar&&d.push(w.doModeBar),f.camera&&d.push(w.doCamera),d.push(k)),d.push(h.rehover,h.redrag,h.reselect),c.add(t,Z,[t,s.undoit,u.undoit,s.traces],Z,[t,s.redoit,u.redoit,s.traces]);var p=o.syncOrAsync(d,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}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(a,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,h.transition(t,e.frame.data,e.frame.layout,_.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 d(){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 p,g,v=0;function m(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&MM)&&T.push(g);y=T}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(u[g]||p[g]||{}).name,m=e[n].name,y=u[v]||p[v];v&&m&&"number"==typeof m&&y&&T<5&&(T++,o.warn('addFrames: overwriting frame "'+(u[v]||p[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===T&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,s],d=[t,a];return c&&c.add(t,l,f,u,d),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return m(i,e,s)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":400,"../plots/attributes":446}],440:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function b(t){var e,i,s,u,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.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 a.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var M=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=A(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?A(u,M,d.OPPOSITE_SIDE[u.side]):null}var T=[],k=[],S=[],C=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(i in v._plots)if((s=v._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,O=s.yaxis.domain,L=s.plotgroup;if(y(E,O,S)){var D=L.node(),R=s.bg=o.ensureSingle(L,"rect","bg");D.insertBefore(R.node(),D.childNodes[0]),k.push(i)}else L.select("rect.bg").remove(),S.push([E,O]),C||(T.push(i),k.push(i))}var I,P,F,z,N,B,j,U,H,V,Y,G,q,W=v._bgLayer.selectAll(".bg").data(T);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eA?u.push({code:"unused",traceType:y,templateCount:w,dataCount:A}):A>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:A})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=g(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&v(a)&&t(a,o)}}({data:d,layout:h},""),u.length)return u.map(m)}},{"../lib":400,"../plots/attributes":446,"../plots/plots":488,"./plot_config":437,"./plot_schema":438,"./plot_template":439}],442:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=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,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=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"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),A=m("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var T=o.extendFlat({},h);b?T.width=b:null===e.width&&n(p.width)&&(T.width=p.width),x?T.height=x:null===e.height&&n(p.height)&&(T.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(M);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(M._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(M,y,_),n=M._fullLayout.width,f=M._fullLayout.height;function h(){i.purge(M),document.body.removeChild(M)}if("full-json"===y){var d=a.graphJson(M,!1,"keepdata","object",!0,!0);return d.version=u,d=JSON.stringify(d),h(),t(A?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(A?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(M,r,T,k).then(S).then(C).then(E).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":400,"../plots/plots":488,"../snapshot/helpers":494,"../snapshot/svgtoimg":496,"../snapshot/tosvg":498,"../version":599,"./plot_api":436,"fast-isnumeric":121}],443:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&i.push(p("unused",a,m.concat(b.length)));var T,k,S,C,E,O=b.length,L=Array.isArray(M);if(L&&(O=Math.min(O,M.length)),2===x.dimensions)for(k=0;kb[k].length&&i.push(p("unused",a,m.concat(k,b[k].length)));var D=b[k].length;for(T=0;T<(L?Math.min(D,M[k].length):D);T++)S=L?M[k][T]:M,C=y[k][T],E=b[k][T],n.validate(C,S)?E!==C&&E!==+C&&i.push(p("dynamic",a,m.concat(k,T),C,E)):i.push(p("value",a,m.concat(k,T),C))}else i.push(p("array",a,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),i.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:i};c=f}for(var h=e.calendar,d="start"===l,p="end"===l,g=t[r+"period0"],v=a(g,h)||0,m=[],y=[],b=[],x=i.length,_=0;_T;)M=o(M,-c,h);for(;M<=T;)M=o(M,c,h);A=o(M,-c,h)}else{for(M=v+(w=Math.round((T-v)/u))*u;M>T;)M-=u;for(;M<=T;)M+=u;A=M-u}m[_]=d?A:p?M:(A+M)/2,y[_]=A,b[_]=M}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":378,"../../lib":400,"fast-isnumeric":121}],448:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],449:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),c=g(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=u[0].val,v=f[0].val;for(r=1;r0&&((A=C-s(b)-l(x))>E?M/A>O&&(_=b,w=x,O=M/A):M/C>O&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},O=M/C));if(h===v){var L=h-1,D=h+1;if(k)if(0===h)i=[0,1];else{var R=(h>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),I=h/(1-Math.min(.5,R/C));i=h>0?[0,I]:[I,0]}else i=S?[Math.max(0,L),Math.max(1,D)]:[L,D]}else k?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-O*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-d(e,b.val,x.val))/(C-s(_)-l(w)),i=[_.val-O*s(_),w.val+O*l(w)];return m&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=T(r.vpadplus||r.vpad),E=T(r.vpadminus||r.vpad);if(!A){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=a),a>d&&a-o&&(h=a),a>d&&a=D;n--)L(n);return{min:p,max:g,opts:r}},concatExtremes:g};function g(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function h(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function b(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":279,"../../constants/numerical":378,"../../lib":400,"../../registry":490,"./axis_ids":454,"@plotly/d3":14,"fast-isnumeric":121}],450:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,A=g.ONEAVGMONTH,M=g.ONEMINMONTH,T=g.ONEWEEK,k=g.ONEDAY,S=k/2,C=g.ONEHOUR,E=g.ONEMIN,O=g.ONESEC,L=g.MINUS_SIGN,D=g.BADNUM,R={K:"zeroline"},I={K:"gridline",L:"path"},P={K:"minor-gridline",L:"path"},F={K:"tick",L:"path"},z={K:"tick",L:"text"},N={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},B=t("../../constants/alignment"),j=B.MID_SHIFT,U=B.CAP_SHIFT,H=B.LINE_SPACING,V=B.OPPOSITE_SIDE,Y=e.exports={};Y.setConvert=t("./set_convert");var G=t("./axis_autotype"),q=t("./axis_ids"),W=q.idSort,X=q.isLinked;Y.id2name=q.id2name,Y.name2id=q.name2id,Y.cleanId=q.cleanId,Y.list=q.list,Y.listIds=q.listIds,Y.getFromId=q.getFromId,Y.getFromTrace=q.getFromTrace;var Z=t("./autorange");Y.getAutoRange=Z.getAutoRange,Y.findExtremes=Z.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}Y.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},Y.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},Y.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==Y.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=Y.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},Y.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:Y.getFromId(e,r).cleanPos)(t)},Y.redrawComponents=function(t,e){e=e||Y.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;ur&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},Y.saveRangeInitial=function(t,e){for(var r=Y.list(t,"",!0),n=!1,i=0;i.3*h||u(n)||u(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=Y.tickIncrement(t,"M6","reverse")+1.5*k:a.exactMonths>.8?t=Y.tickIncrement(t,"M1","reverse")+15.5*k:t-=S;var l=Y.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,c,a)),v=y,0;v<=u;)v=Y.tickIncrement(v,m,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(v,0,a),size:m,_dataSpan:u-c}},Y.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=Y.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,Y.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),f=c?e.dtick:+e.dtick.substring(1),h=u?t.dtick:+t.dtick.substring(1);c&&u?tt(f,h)?f===2*T&&h===2*k&&(t.dtick=T):f===2*T&&h===3*k?t.dtick=T:f!==T||(e._input.minor||{}).nticks?et(f/h,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=k:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":tt(f,h)?f>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,h)||(t.dtick=et(f/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},Y.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,Y.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!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=Y.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=C,o&&!n&&t.dtick=(R?0:1);I--){var P=!I;I?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var F=I?t:s.extendFlat({},t,t.minor);if(P?Y.prepMinorTicks(F,t,e):Y.prepTicks(F,e),"array"!==F.tickmode){var z=J(u),N=z[0],B=z[1],j=i(F.dtick),U="log"===a&&!(j||"L"===F.dtick.charAt(0)),H=Y.tickFirst(F,e);if(I){if(t._tmin=H,H=B:W<=B;W=Y.tickIncrement(W,X,f,o)){if(I&&V++,F.rangebreaks&&!f){if(W=d)break}if(O.length>p||W===q)break;q=W;var Z={value:W};I?(U&&W!==(0|W)&&(Z.simpleLabel=!0),l>1&&V%l&&(Z.skipLabel=!0),O.push(Z)):(Z.minor=!0,L.push(Z))}}else I?(O=[],g=nt(t)):(L=[],E=nt(t))}if(R&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=O.map((function(t){return t.value})),Q=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,h=0;f>=y?h=u>=y&&u<=v?u:m:r===x&&f>=_?h=u>=_&&u<=b?u:x:f>=M?h=u>=M&&u<=w?u:A:r===T&&f>=T?h=T:f>=k?h=k:r===S&&f>=S?h=S:r===C&&f>=C&&(h=C),h>=u&&(h=u,s=!0);var d=i+h;if(e.rangebreaks&&h>0){for(var p=0,g=0;g<84;g++){var E=(g+.5)/84;e.maskBreaks(i*(1-E)+E*d)!==D&&p++}(h*=p/84)||(t[n].drop=!0),s&&u>T&&(h=u)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(O,t,t._definedDelta),t.rangebreaks){var at="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=O.length-1;r>-1;r--)if(O[r].drop)O.splice(r,1);else{O[r].value=Dt(O[r].value,t);var lt=t.c2p(O[r].value);(at?st>lt-ot:std||utd&&(ct.periodX=d),ut10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=k&&a<=10||e>=15*k)t._tickround="d";else if(e>=E&&a<=16||e>=C)t._tickround="M";else if(e>=O&&a<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(gt(t.exponentformat)&&!vt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function dt(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}}Y.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>m)e/=m,n=a(10),t.dtick="M"+12*ft(e,n,it);else if(o>A)e/=A,t.dtick="M"+ft(e,1,at);else if(o>k){if(t.dtick=ft(e,k,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=Y.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>C?t.dtick=ft(e,C,at):o>E?t.dtick=ft(e,E,ot):o>O?t.dtick=ft(e,O,ot):(n=a(10),t.dtick=ft(e,n,it))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=a(10),t.dtick="L"+ft(e,n,it)}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))):Lt(t)?(t.tick0=0,n=1,t.dtick=ft(e,n,ut)):(t.tick0=0,n=a(10),t.dtick=ft(e,n,it));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},Y.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ct:lt,f=t+.01*o,h=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},Y.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=mt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||gt(d)&&vt(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":L)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":L)+h:(e.text=mt(Math.pow(10,l),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,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,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),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Lt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=mt(e.x,t,i,n);else{var a=e.x/180;if(0===a)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,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=mt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=L+e.text)}}}}(t,o,r,c,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=mt(e.x,t,i,n)}(t,o,0,c,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var 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},Y.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return Y.hoverLabelText(t,n,r)+" - "+Y.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=Y.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":L+o:o};var pt=["f","p","n","\u03bc","m","","k","M","G","T"];function gt(t){return"SI"===t||"B"===t}function vt(t){return t>14||t<-15}function mt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=Y.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};ht(h),o=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,L);var d,p=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+d+"":"B"===l&&9===c?t+="B":gt(l)&&(t+=pt[c/3+5]));return a?L+t:t}function yt(t,e){if(t){var r=Object.keys(N).reduce((function(t,r){return-1!==e.indexOf(r)&&N[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function bt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),d.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"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==c._dfltTitle[p]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=h),!0===e.mirror||"ticks"===e.mirror?i[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}it&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(yt(n,e.automargin),yt(i,e.automargin)),a.autoMargin(t,Tt(e),n),a.autoMargin(t,kt(e),i),a.autoMargin(t,St(e),s)})),r.skipTitle||it&&"bottom"===e.side||rt.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+wt(e);else{var s=Rt(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"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,d,p,g=Y.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,d="top"===e.side?g-r:g+r):(d=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(p={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=h.getTranslate(v.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:p,transform:c,attributes:{x:f,y:d,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function at(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=Mt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},Y.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},Y.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},Y.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=h*U,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=h*(1-U));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(xt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(xt(e)))}},Y.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},Y.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,g=h?t.ticklen:0;if(f?g*=-1:u&&(g=0),h&&(d+=g,r)){var v=s.deg2rad(r);d=g*Math.cos(v)+1,p=g*Math.sin(v)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},A=0,M=t.side,T=t._id.charAt(0),k=t.tickangle;if("x"===T)x=(_=!f&&"bottom"===M||f&&"top"===M)?1:-1,f&&(x*=-1),m=p*x,y=e+d*x,b=_?1:-.2,90===Math.abs(k)&&(f?b+=j:b=-90===k&&"bottom"===M?U:90===k&&"top"===M?j:.5,A=j/2*(k/90)),w.xFn=function(t){return t.dx+m+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*x<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"===T){if(x=(_=!f&&"left"===M||f&&"right"===M)?1:-1,f&&(x*=-1),m=d,y=p*x,b=0,f||90!==Math.abs(k)||(b=-90===k&&"left"===M||90===k&&"right"===M?U:.5),f){var S=i(k)?+k:0;if(0!==S){var C=s.deg2rad(S);A=Math.abs(Math.sin(C))*U*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*j},w.anchorFn=function(t,e){return i(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},Y.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,_t);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),It(e,[F]),o.attr("transform",r.transFn)},Y.drawGrid=function(t,e,r){r=r||{};var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&Y.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;m--){var y=m?g:v;if(y){var b=y.selectAll("path."+i).data(m?s:o,_t);b.exit().remove(),b.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),b.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?p:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&b.attr("d",r.path)}}It(e,[I,P])},Y.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=Y.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.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 W(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),It(e,[R])},Y.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",d=r.vals.filter((function(t){return t.text})),p=r.labelFns,g=r.secondary?0:e.tickangle,v=(e._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(e.showticklabels?d:[],_t),y=[];function b(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),u=p.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),d=c.lineCount(o),g=H*t.fontSize,v=p.heightFn(t,i(a)?+a:0,(d-1)*g);if(v&&(f+=l(0,v)),s.empty()){var m=o.select("text");m.attr({transform:f,"text-anchor":u}),m.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var y=h.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(y,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,p.xFn(e),p.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){b(r,g)}))):b(r,g)})),It(e,[z]),m.exit().remove(),r.repositionOnUpdate&&m.each((function(t){n.select(this).select("text").call(c.positionText,p.xFn(t),p.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),d=Math.max(l,c),p=e.side,g=1/0,v=-1/0;for(var y in m.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=h.bBox(r.node()),s=0;o?(a.right>d||a.leftd||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),d.length&&"x"===u&&!i(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,a=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=Mt(this),o=h.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,l=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},p=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,v)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=x(o[s])){u=v;break}var f=i("pattern",u);if(f===v)for(s=0;s<2;s++)(c=x(o[s]))&&(e.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case v: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 m: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 h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]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 a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":490,"./constants":457}],455:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*b)||A)for(r=0;rR&&zL&&(L=z);h/=(L-O)/(2*D),O=l.l2r(O),L=l.l2r(L),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,i,a)}function H(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 V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Y(t){D&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),D=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},h={},d=(a||{}).xaHash,p=(a||{}).yaHash,g=0;g=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(V(i),2!==t||mt||Yt(),vt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Lt),o.indexOf("event")>-1&&d.click(i,r,e.id);else if(1===t&&mt){var s=g?R:D,c="s"===g||"w"===m?0:1,f=s._name+".range["+c+"]",h=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),p="left",v="middle";if(s.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),i._context.showAxisRangeEntryBoxes&&n.select(xt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:v}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function It(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),i=Math.max(0,Math.min(et,pt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",At.r=At.l,At.t=At.b,Et.attr("d","M0,0Z")}if(At.l=Math.min(_t,n),At.r=Math.max(_t,n),At.t=Math.min(wt,i),At.b=Math.max(wt,i),rt.isSubplotConstrained)a>L||o>L?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?At.t=wt-o:At.b=wt+o):(a=o*tt/et,_t>n?At.l=_t-a:At.r=_t+a),Et.attr("d",G(At))):s();else if(nt.isSubplotConstrained)if(a>L||o>L){St="xy";var l=Math.min(At.l/tt,(et-At.b)/et),c=Math.max(At.r/tt,(et-At.t)/et);At.l=l*tt,At.r=c*tt,At.b=(1-l)*et,At.t=(1-c)*et,Et.attr("d",G(At))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;ug[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":400,"fast-isnumeric":121}],467:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":470}],468:[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 i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":373}],469:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,g=d.BADNUM,v=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,b=d.ONEHOUR,x=d.ONEMIN,_=d.ONESEC,w=t("./axis_ids"),A=t("./constants"),M=A.HOUR_PATTERN,T=A.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function C(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*v*Math.abs(n-i))}return g}function E(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===g){if(!s(e))return g;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function O(e,r,n){return c(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function D(e){if(S(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 g}function R(e){if(t._categoriesMap)return t._categoriesMap[e]}function I(t){var e=R(t);return void 0!==e?e:s(t)?+t:void 0}function P(t){return s(t)?+t:R(t)}function F(t,e,r){return n.round(r+e*t,2)}function z(t,e,r){return(t-r)/e}var N=function(e){return s(e)?F(e,t._m,t._b):g},B=function(e){return z(e,t._m,t._b)};if(t.rangebreaks){var j="y"===d;N=function(e){if(!s(e))return g;var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?F(e,t._m2,f):0},B=function(e){var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return z(e,t._m2,t._B[n])}}t.c2l="log"===t.type?C:f,t.l2c="log"===t.type?k:f,t.l2p=N,t.p2l=B,t.c2p="log"===t.type?function(t,e){return N(C(t,e))}:N,t.p2c="log"===t.type?function(t){return k(B(t))}:B,-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=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return C(l(t),e)},t.r2d=t.r2c=function(t){return k(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=C,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=O,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return O(B(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,g,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=D,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=R,t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(i=0;ip&&(o[n]=p),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][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(s=0;su&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=a.simpleMap(e.xr0,i.r2l),g=a.simpleMap(e.xr1,i.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*c,d[2]=c*(1-r+r*m/v),i.range[0]=i.l2r(p[0]*(1-r)+r*g[0]),i.range[1]=i.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=c;if(h){var y=a.simpleMap(e.yr0,l.r2l),b=a.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*u,d[3]=u*(1-r+r*_/x),l.range[0]=i.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/d[2]:1,A=h?u/d[3]:1,M=f?d[0]:0,T=h?d[1]:0,k=f?d[0]/d[2]*c:0,S=h?d[1]/d[3]*u:0,C=i._offset-k,E=l._offset-S;n.clipRect.call(o.setTranslate,M,T).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,C,E).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":279,"../../lib":400,"../../registry":490,"./axes":450,"@plotly/d3":14}],475:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],h={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(c,l)){var d=a(c),p=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(v(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.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"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var A=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&I.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&I.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,f,n),x.cleanPlot(h,l,f,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,H=!(!l._has||!l._has("cartesian"))||j;U&&!H?n._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&p({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=x.layoutAttributes.width.min,d=x.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-i)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a1&&(r.l/=m,r.r/=m)}if(d){var y=(r.t+r.b)/d;y>1&&(r.t/=y,r.b/=y)}var b=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,A=void 0!==r.yb?r.yb:r.y;p[e]={l:{val:b,size:r.l+v},r:{val:_,size:r.r+v},b:{val:A,size:r.b+v},t:{val:w,size:r.t+v}},g[e]=1}else delete p[e],delete g[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={}),O(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,h=a.t,p=a.b,g=e._pushmargin,v=e._pushmarginIds,m=e.minreducedwidth,y=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var b in g)v[b]||delete g[b];for(var _ in g.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},g){var w=g[_].l||{},A=g[_].b||{},M=w.val,T=w.size,k=A.val,S=A.size;for(var C in g){if(o(T)&&g[C].r){var E=g[C].r.val,L=g[C].r.size;if(E>M){var D=(T*E+(L-r)*M)/(E-M),R=(L*(1-M)+(T-r)*(1-E))/(E-M);D+R>c+f&&(c=D,f=R)}}if(o(S)&&g[C].t){var I=g[C].t.val,P=g[C].t.size;if(I>k){var F=(S*I+(P-n)*k)/(I-k),z=(P*(1-k)+(S-n)*(1-I))/(I-k);F+z>p+h&&(p=F,h=z)}}}}}var N=u.constrain(r-a.l-a.r,2,m),B=u.constrain(n-a.t-a.b,2,y),j=Math.max(0,r-N),U=Math.max(0,n-B);if(j){var H=(c+f)/j;H>1&&(c/=H,f/=H)}if(U){var V=(p+h)/U;V>1&&(p/=V,h/=V)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(h),i.b=Math.round(p),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&x.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var Y=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(I(o,c,f),i=0;i0){for(var n=[],i=0;i-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":257,"../components/drawing":279,"../constants/xmlns_namespaces":379,"../lib":400,"@plotly/d3":14}],499:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rP){R("x scale is not linear");break}}if(b.length&&"fast"===L){var F=(b[b.length-1]-b[0])/(b.length-1),z=Math.abs(F/100);for(M=0;Mz){R("y scale is not linear");break}}}var N=i.maxRowLength(A),B="scaled"===e.xtype?"":r,j=d(e,B,v,m,N,k),U="scaled"===e.ytype?"":b,H=d(e,U,x,_,A.length,S);O||(e._extremes[k._id]=a.findExtremes(k,j),e._extremes[S._id]=a.findExtremes(S,H));var V={x:j,y:H,z:A,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===j.length-1&&(V.xCenter=B),U&&U.length===H.length-1&&(V.yCenter=U),E&&(V.xRanges=T.xRanges,V.yRanges=T.yRanges,V.pts=T.pts),C||l(t,e,{vals:A,cLetter:"z"}),C&&e.contours&&"heatmap"===e.contours.coloring){var Y={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};V.xfill=d(Y,B,v,m,N,k),V.yfill=d(Y,U,x,_,A.length,S)}return[V]}},{"../../components/colorscale/calc":265,"../../constants/numerical":378,"../../lib":400,"../../plots/cartesian/align_period":447,"../../plots/cartesian/axes":450,"../../registry":490,"../histogram2d/calc":518,"./clean_2d_array":502,"./convert_column_xyz":504,"./find_empties":505,"./interp2d":506,"./make_bound_array":507}],502:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,f,h;function d(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||g)[2]+(f[[r+1,i]]||g)[2]+(f[[r,i-1]]||g)[2]+(f[[r,i+1]]||g)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":400}],506:[function(t,e,r){"use strict";var n=t("../../lib"),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,c,u,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[a][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":400}],507:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,f=[],h=n.traceIs(t,"contour"),d=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!d&&"category"!==s.type){var g=e.length;if(!(g<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||p)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;u0&&(a=!0);for(var l=0;la){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function d(t,e,r,n,a,s){if(n&&t>o){var l=p(e,a,s),c=p(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,h=-.1*e,d=t-h,p=r[0],g=r[1],v=Math.min(f(p+h,p+d,n,a),f(g+h,g+d,n,a)),m=Math.min(f(p+c,p+h,n,a),f(g+c,g+h,n,a));if(v>m&&mo){var y=s===i?1:6,b=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(N)&&(j=o.tickIncrement(j,x.size,!0,d)),I.start=r.l2r(j),z||i.nestedProperty(e,m+".start").set(I.start)}var U=x.end,H=r.r2l(R.end),V=void 0!==H;if((x.endFound||V)&&H!==r.r2l(U)){var Y=V?H:i.aggNums(Math.max,null,p);I.end=r.l2r(Y),V||i.nestedProperty(e,m+".start").set(I.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[m]=i.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[I,p]}e.exports={calc:function(t,e){var r,a,d,p,g=[],v=[],m="h"===e.orientation,y=o.getFromId(t,m?e.yaxis:e.xaxis),b=m?"y":"x",x={x:"y",y:"x"}[b],_=e[b+"calendar"],w=e.cumulative,A=h(t,e,y,b),M=A[0],T=A[1],k="string"==typeof M.size,S=[],C=k?S:M,E=[],O=[],L=[],D=0,R=e.histnorm,I=e.histfunc,P=-1!==R.indexOf("density");w.enabled&&P&&(R=R.replace(/ ?density$/,""),P=!1);var F,z="max"===I||"min"===I?null:0,N=l.count,B=c[R],j=!1,U=function(t){return y.r2c(t,0,_)};for(i.isArrayOrTypedArray(e[x])&&"count"!==I&&(F=e[x],j="avg"===I,N=l[I]),r=U(M.start),d=U(M.end)+(r-o.tickIncrement(r,M.size,!1,_))/1e6;r=0&&p=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,w.direction,w.currentbin);var K=Math.min(g.length,v.length),Q=[],$=0,tt=K-1;for(r=0;r=$;r--)if(v[r]){tt=r;break}for(r=$;r<=tt;r++)if(n(g[r])&&n(v[r])){var et={p:g[r],s:v[r],b:0};w.enabled||(et.pts=L[r],q?et.ph0=et.ph1=L[r].length?T[L[r][0]]:g[r]:(e._computePh=!0,et.ph0=Y(S[r]),et.ph1=Y(S[r+1],!0))),Q.push(et)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,M.size,!1,_)-Q[0].p),s(Q,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(Q,e,Z),Q},calcAllAutoBins:h}},{"../../lib":400,"../../plots/cartesian/axes":450,"../../registry":490,"../bar/arrays_to_calcdata":499,"./average":513,"./bin_functions":514,"./bin_label_vals":515,"./norm_functions":517,"fast-isnumeric":121}],517:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;iS&&A.splice(S,A.length-S),k.length>S&&k.splice(S,k.length-S);var C=[],E=[],O=[],L="string"==typeof w.size,D="string"==typeof T.size,R=[],I=[],P=L?R:w,F=D?I:T,z=0,N=[],B=[],j=e.histnorm,U=e.histfunc,H=-1!==j.indexOf("density"),V="max"===U||"min"===U?null:0,Y=a.count,G=o[j],q=!1,W=[],X=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(q="avg"===U,Y=a[U]);var J=w.size,K=b(w.start),Q=b(w.end)+(K-i.tickIncrement(K,J,!1,m))/1e6;for(r=K;r=0&&d=0&&p=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*fe){h=r;break}}if(a=u,isNaN(a)&&(a=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-c[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(p,e);g&&(o.interval=l[a],o.intervalPix=p,o.region=g)}}if(t.ordinal&&!o.region){var v=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&y<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),x(t.parentNode)}function A(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function M(t){t.on("mousemove",(function(t){i.event.preventDefault(),t.parent.inBrushDrag||A(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(i.behavior.drag().on("dragstart",(function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(A(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&k(r)):k(r),a.brushCallback(e),x(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||k(r),a.brushCallback(e),c?x(t.parentNode,s):(s(),x(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function T(t,e){return t[0]-e[0]}function k(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(T)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,r){var i=t.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e,r){var i=r._context.staticPlot,a=t.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(p).call(g).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(M).attr("height",(function(t){return t.height-n.verticalPadding}));var s=t.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(t){return t.height})).call(b);var c=t.selectAll(".highlight").data(o);c.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(b)}(i,e,r)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?S(t.sort(T)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[d(0,r,t[0],[]),d(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":400,"../../lib/gup":397,"./constants":524,"@plotly/d3":14}],521:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":519,"./base_plot":522,"./calc":523,"./defaults":525}],522:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":379,"../../plots/get_data":480,"./plot":531,"@plotly/d3":14}],523:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale"),a=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),p.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:d}),v=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(g)&&g.length||(e.visible=!1),h(e,g,"values",v);var m={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",m),n.coerceFont(u,"tickfont",m),n.coerceFont(u,"rangefont",m),u("labelangle"),u("labelside"),u("unselected.line.color"),u("unselected.line.opacity")}},{"../../components/colorscale/defaults":267,"../../components/colorscale/helpers":268,"../../lib":400,"../../plots/array_container_defaults":445,"../../plots/cartesian/axes":450,"../../plots/domain":477,"./attributes":519,"./axisbrush":520,"./constants":524,"./merge_length":529}],526:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":400}],527:[function(t,e,r){"use strict";var n=t("./base_index");n.plot=t("./plot"),e.exports=n},{"./base_index":521,"./plot":531}],528:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[i].dim1.canvasX,o=i);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var d=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&no._length&&(S=S.slice(0,o._length));var E,O=o.tickvals;function L(t,e){return{val:t,text:E[e]}}function D(t,e){return t.val-e.val}if(Array.isArray(O)&&O.length){E=o.ticktext,Array.isArray(E)&&E.length?E.length>O.length?E=E.slice(0,O.length):O.length>E.length&&(O=O.slice(0,E.length)):E=O.map(a(o.tickformat));for(var R=1;R=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==B&&(u?a.hover(h):a.unhover&&a.unhover(h),B=f)}})),N.style("opacity",(function(t){return t.pick?0:1})),d.style("background","rgba(255, 255, 255, 0)");var j=d.selectAll("."+y.cn.parcoords).data(z,p);j.exit().remove(),j.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var U=j.selectAll("."+y.cn.parcoordsControlView).data(g,p);U.enter().append("g").classed(y.cn.parcoordsControlView,!0),U.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var H=U.selectAll("."+y.cn.yAxis).data((function(t){return t.dimensions}),p);H.enter().append("g").classed(y.cn.yAxis,!0),U.each((function(t){R(H,t,A)})),N.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=x(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),H.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),H.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;F.linePickActive(!1),t.x=Math.max(-y.overdrag,Math.min(t.model.width+y.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,H.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),R(H,e,A),H.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",c(t.x,0)),H.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!C(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,R(H,e,A),n.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!C(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),F.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),H.exit().remove();var V=H.selectAll("."+y.cn.axisOverlays).data(g,p);V.enter().append("g").classed(y.cn.axisOverlays,!0),V.selectAll("."+y.cn.axis).remove();var Y=V.selectAll("."+y.cn.axis).data(g,p);Y.enter().append("g").classed(y.cn.axis,!0),Y.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return m.isOrdinal(t)?e:I(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(Y.selectAll("text"),t.model.tickFont)})),Y.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),Y.selectAll("text").style("text-shadow",u.makeTextShadow(T)).style("cursor","default");var G=V.selectAll("."+y.cn.axisHeading).data(g,p);G.enter().append("g").classed(y.cn.axisHeading,!0);var q=G.selectAll("."+y.cn.axisTitle).data(g,p);q.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),q.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=D(t.model.labelAngle,t.model.labelSide),r=y.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=D(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var W=V.selectAll("."+y.cn.axisExtent).data(g,p);W.enter().append("g").classed(y.cn.axisExtent,!0);var X=W.selectAll("."+y.cn.axisExtentTop).data(g,p);X.enter().append("g").classed(y.cn.axisExtentTop,!0),X.attr("transform",c(0,-y.axisExtentOffset));var Z=X.selectAll("."+y.cn.axisExtentTopText).data(g,p);Z.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(L),Z.text((function(t){return P(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var J=W.selectAll("."+y.cn.axisExtentBottom).data(g,p);J.enter().append("g").classed(y.cn.axisExtentBottom,!0),J.attr("transform",(function(t){return c(0,t.model.height+y.axisExtentOffset)}));var K=J.selectAll("."+y.cn.axisExtentBottomText).data(g,p);K.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(L),K.text((function(t){return P(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),b.ensureAxisBrush(V,T,t)}},{"../../components/colorscale":269,"../../components/drawing":279,"../../lib":400,"../../lib/gup":397,"../../lib/svg_text_utils":426,"../../plots/cartesian/axes":450,"./axisbrush":520,"./constants":524,"./helpers":526,"./lines":528,"@plotly/d3":14,"color-rgba":37}],531:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl"),a=t("./helpers").isVisible,o={};function s(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var r=t._fullLayout;if(i(t,[],o)){var l={},c={},u={},f={},h=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=f[r]=n._fullInput.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()}));n(t,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,n,i){var a=c[e][n],o=i.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[s]){var h=a.constraintrange;l[s]=h||null}var d=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,d.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete d.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[f[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return s(t,e,r)-s(t,e,n)}}(r,c[e].filter(a));l[e].sort(n),c[e].filter((function(t){return!a(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[f[e]]])}})}}).reglPrecompiled=o},{"../../lib/prepare_regl":413,"./helpers":526,"./parcoords":530}],532:[function(t,e,r){"use strict";var n=t("../../lib");function i(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=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r>>1,h)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);if(d)r=d;else for(r=new Int32Array(e),l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=i(t.marker.color),v=i(t.marker.border.color),m=t.opacity*t.marker.opacity;g[3]*=m,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,v[3]*=m,this.pointcloudOptions.borderColor=v;var b=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=a(_,[p[0],p[2]],{ppad:A}),t._extremes[w._id]=a(w,[p[1],p[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../../stackgl_modules":600,"../../lib/str2rgbarray":425,"../../plots/cartesian/autorange":449,"../scatter/get_trace_color":549}],536:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),e._length=null}},{"../../lib":400,"./attributes":534}],537:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":483,"../scatter3d/calc":567,"./attributes":534,"./convert":535,"./defaults":536}],538:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rl&&O[m].gap;)m--;for(b=O[m].s,g=O.length-1;g>m;g--)O[g].s=b;for(;lk[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],546:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),g=t("./fillcolor_defaults"),v=t("../../lib").coercePattern;e.exports=function(t,e,r,m){function y(r,i){return n.coerce(t,e,a,r,i)}var b=l(t,e,m,y);if(b||(e.visible=!1),e.visible){c(t,e,m,y),y("xhoverformat"),y("yhoverformat");var x=u(t,e,m,y),_=!x&&b=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-p);return a=Math.min(e,r)&&g<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(d.c2p(t.y)-g);return aW!=(B=I[D][1])>=W&&(F=I[D-1][0],z=I[D][0],B-N&&(P=F+(z-F)*(W-N)/(B-N),V=Math.min(V,P),Y=Math.max(Y,P)));V=Math.max(V,0),Y=Math.min(Y,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:Y,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":257,"../../components/fx":297,"../../lib":400,"../../registry":490,"./get_trace_color":549}],551:[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":462,"./arrays_to_calcdata":538,"./attributes":539,"./calc":540,"./cross_trace_calc":544,"./cross_trace_defaults":545,"./defaults":546,"./format_labels":548,"./hover":550,"./marker_colorbar":557,"./plot":560,"./select":561,"./style":563,"./subtypes":564}],552:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){l||(l={});var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":267,"../../components/colorscale/helpers":268,"../../lib":400}],553:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../../constants/numerical"),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,c=t("../../lib"),u=c.segmentsIntersect,f=c.constrain,h=t("./constants");e.exports=function(t,e){var r,i,o,d,p,g,v,m,y,b,x,_,w,A,M,T,k,S,C=e.trace||{},E=e.xaxis,O=e.yaxis,L="log"===E.type,D="log"===O.type,R=E._length,I=O._length,P=e.backoff,F=C.marker,z=e.connectGaps,N=e.baseTolerance,B=e.shape,j="linear"===B,U=C.fill&&"none"!==C.fill,H=[],V=h.minTolerance,Y=t.length,G=new Array(Y),q=0;function W(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),o=e.linearized?O.l2p(n.y):O.c2p(n.y);if(i===a){if(L&&(i=E.c2p(n.x,!0)),i===a)return!1;D&&o===a&&(i*=Math.abs(E._m*I*(E._m>0?s:l)/(O._m*R*(O._m>0?s:l)))),i*=1e3}if(o===a){if(D&&(o=O.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function X(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function ht(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l);return s}}function dt(t){var e=t[0],r=t[1],n=e===G[q-1][0],i=r===G[q-1][1];if(!n||!i)if(q>1){var a=e===G[q-2][0],o=r===G[q-2][1];n&&(e===at||e===ot)&&a?o?q--:G[q-1]=t:i&&(r===st||r===lt)&&o?a?q--:G[q-1]=t:G[q++]=t}else G[q++]=t}function pt(t){G[q-1][0]!==t[0]&&G[q-1][1]!==t[1]&&dt([$,tt]),dt(t),et=null,$=tt=0}"linear"===B||"spline"===B?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(q)if(et){var n=nt(et,e);n.length>1&&(pt(n[0]),G[q++]=n[1])}else rt=nt(G[q-1],e)[0],G[q++]=rt;else G[q++]=[K||e[0],Q||e[1]];var i=G[q-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?dt($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&dt([$,tt])),dt([K,Q])):$-K&&tt-Q&&dt([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&pt(nt(et,e)[0]),G[q++]=e;var a,o,s,l}for(r=0;rZ(g,mt))break;o=g,(w=y[0]*m[0]+y[1]*m[1])>x?(x=w,d=g,v=!1):w<_&&(_=w,p=g,v=!0)}if(v?(vt(d),o!==p&&vt(p)):(p!==i&&vt(p),o!==d&&vt(d)),vt(o),r>=t.length||!g)break;vt(g),i=g}}else vt(d)}et&&dt([$||et[0],tt||et[1]]),H.push(G.slice(0,q))}var yt=B.slice(B.length-1);if(P&&"h"!==yt&&"v"!==yt){for(var bt=!1,xt=-1,_t=[],wt=0;wt=0?l=d:(l=d=h,h++),l0?Math.max(r,a):0}}},{"fast-isnumeric":121}],557:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],558:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":257,"../../components/colorscale/defaults":267,"../../components/colorscale/helpers":268,"./subtypes":564}],559:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":378,"../../lib":400}],560:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!c.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(p),M=o(A,"g","errorbars"),T=o(A,"g","lines"),k=o(A,"g","points"),S=o(A,"g","text");if(i.getComponentMethod("errorbars","plot")(t,M,r,g),!0===_.visible){var C,E;y(A).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var L,D,R="",I=[],P=_._prevtrace;P&&(R=P._prevRevpath||"",E=P._nextFill,I=P._polygons);var F,z,N,B,j,U,H,V="",Y="",G=[],q=a.noop;if(C=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(F=l.steps(w.shape),z=l.steps(w.shape.split("").reverse().join(""))):F=z="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return z(t.reverse())},G=u(f,{xaxis:b,yaxis:x,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),H=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",L).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",L),l.singleLineStyle(f,i)}}}}}var W=T.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(q(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(q(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(C?(C.datum(f),B&&U&&(O?("y"===O?B[1]=U[1]=x.c2p(0,!0):"x"===O&&(B[0]=U[0]=b.c2p(0,!0)),y(C).attr("d","M"+U+"L"+B+"L"+V.substr(1)).call(l.singleFillStyle,t)):y(C).attr("d",V+"Z").call(l.singleFillStyle,t))):E&&("tonext"===_.fill.substr(0,6)&&V&&R?("tonext"===_.fill?y(E).attr("d",V+"Z"+R+"Z").call(l.singleFillStyle,t):y(E).attr("d",V+"L"+R.substr(1)+"Z").call(l.singleFillStyle,t),_._polygons=_._polygons.concat(I)):(Z(E),_._polygons=null)),_._prevRevpath=Y,_._prevPolygons=H):(C?Z(C):E&&Z(E),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),S.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),h=c.hasText(u),d=tt(u),p=et,g=et;if(f||h){var v=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?K:J:_&&!w&&(v=Q),f&&(p=v),h&&(g=v)}var A,M=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&M.call(l.pointStyle,u,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,u,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,S,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,X,t),l.setClipUrl(S,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,h,p=!a,g=!!a&&a.duration>0,v=f(t,e,r);((u=i.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 i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),g)?(c&&(h=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,a)}))}))):u.each((function(r,n){d(t,n,e,r,v,this,a)}));p&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":279,"../../lib":400,"../../lib/polygon":412,"../../registry":490,"./line_points":553,"./link_traces":555,"./subtypes":564,"@plotly/d3":14}],561:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=v,w=2*x,A={},M=l.makeCalcdata(e,"x"),T=y.makeCalcdata(e,"y"),k=s(e,l,"x",M),S=s(e,y,"y",T),C=k.vals,E=S.vals;e._x=C,e._y=E,e.xperiodalignment&&(e._origX=M,e._xStarts=k.starts,e._xEnds=k.ends),e.yperiodalignment&&(e._origY=T,e._yStarts=S.starts,e._yEnds=S.ends);var O=new Array(w),L=new Array(x);for(r=0;r1&&i.extendFlat(s.line,d.linePositions(t,r,n));if(s.errorX||s.errorY){var l=d.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}s.text&&(i.extendFlat(s.text,{positions:n},d.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},d.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},d.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,O,C,E),I=p(t,b);return f(o,e),_?R.marker&&(D=R.marker.sizeAvg||Math.max(R.marker.size,3)):D=c(e,x),u(t,e,l,y,C,E,D),R.errorX&&m(e,l,R.errorX),R.errorY&&m(e,y,R.errorY),R.fill&&!I.fill2d&&(I.fill2d=!0),R.marker&&!I.scatter2d&&(I.scatter2d=!0),R.line&&!I.line2d&&(I.line2d=!0),!R.errorX&&!R.errorY||I.error2d||(I.error2d=!0),R.text&&!I.glText&&(I.glText=!0),R.marker&&(R.marker.snap=x),I.lineOptions.push(R.line),I.errorXOptions.push(R.errorX),I.errorYOptions.push(R.errorY),I.fillOptions.push(R.fill),I.markerOptions.push(R.marker),I.markerSelectedOptions.push(R.markerSel),I.markerUnselectedOptions.push(R.markerUnsel),I.textOptions.push(R.text),I.textSelectedOptions.push(R.textSel),I.textUnselectedOptions.push(R.textUnsel),I.selectBatch.push([]),I.unselectBatch.push([]),A._scene=I,A.index=I.count,A.x=C,A.y=E,A.positions=O,I.count++,[{x:!1,y:!1,t:A,trace:e}]}},{"../../constants/numerical":378,"../../lib":400,"../../plots/cartesian/align_period":447,"../../plots/cartesian/autorange":449,"../../plots/cartesian/axis_ids":454,"../scatter/calc":540,"../scatter/colorscale_calc":542,"./constants":571,"./convert":572,"./scene_update":580,"@plotly/point-cluster":15}],571:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],572:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("svg-path-sdf"),a=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),d=t("./helpers"),p=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,i=t._fullLayout,a=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,h=o.family,d={},p=t._context.plotGlPixelRatio,g=e.texttemplate;if(g){d.text=[];var v=i._d3locale,y=Array.isArray(g),b=y?Math.min(g.length,a):a,x=y?function(t){return g[t]}:function(){return g};for(r=0;rp.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var h=n[0],d=n[1];for(i=0;i1?l[i]:l[0]:l,p=Array.isArray(c)?c.length>1?c[i]:c[0]:c,g=v[d],m=v[p],y=u?u/.8+1:0,b=-m*y-.5*m;o.offset[i]=[g*y/h,b/h]}}return o}}},{"../../components/drawing":279,"../../components/fx/helpers":293,"../../constants/interactions":377,"../../lib":400,"../../lib/gl_format_color":396,"../../plots/cartesian/axis_ids":454,"../../registry":490,"../scatter/make_bubble_size_func":556,"../scatter/subtypes":564,"./constants":571,"./helpers":576,"color-normalize":35,"fast-isnumeric":121,"svg-path-sdf":203}],573:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),d=t("../scatter/fillcolor_defaults"),p=t("../scatter/text_defaults");e.exports=function(t,e,r,g){function v(r,i){return n.coerce(t,e,o,r,i)}var m=!!t.marker&&a.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),b=c(t,e,g,v);if(b){u(t,e,g,v),v("xhoverformat"),v("yhoverformat");var x=b100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":571}],577:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var d=o.textfont;d&&(h.ts=i.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.tc=Array.isArray(d.color)?d.color[f]:d.color,h.tf=Array.isArray(d.family)?d.family[f]:d.family);var p=o.marker;p&&(h.ms=i.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.mo=i.isArrayOrTypedArray(p.opacity)?p.opacity[f]:p.opacity,h.mx=i.isArrayOrTypedArray(p.symbol)?p.symbol[f]:p.symbol,h.ma=i.isArrayOrTypedArray(p.angle)?p.angle[f]:p.angle,h.mc=i.isArrayOrTypedArray(p.color)?p.color[f]:p.color);var g=p&&p.line;g&&(h.mlc=Array.isArray(g.color)?g.color[f]:g.color,h.mlw=i.isArrayOrTypedArray(g.width)?g.width[f]:g.width);var v=p&&p.gradient;v&&"none"!==v.type&&(h.mgt=Array.isArray(v.type)?v.type[f]:v.type,h.mgc=Array.isArray(v.color)?v.color[f]:v.color);var m=s.c2p(h.x,!0),y=l.c2p(h.y,!0),b=h.mrc||1,x=o.hoverlabel;x&&(h.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,h.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,h.hts=i.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,h.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,h.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,h.hnl=i.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=h;var M=o._origX,T=o._origY,k=i.extendFlat({},t,{color:a(o,h),x0:m-b,x1:m+b,xLabelVal:M?M[f]:h.x,y0:y-b,y1:y+b,yLabelVal:T?T[f]:h.y,cd:A,distance:c,spikeDistance:u,hovertemplate:h.ht});return h.htx?k.text=h.htx:h.tx?k.text=h.tx:o.text&&(k.text=o.text),i.fillText(h,o,k),n.getComponentMethod("errorbars","hoverInfo")(h,o,k),k}e.exports={hoverPoints:function(t,e,r,n){var i,a,s,l,c,u,f,h,d,p,g=t.cd,v=g[0].t,m=g[0].trace,y=t.xa,b=t.ya,x=v.x,_=v.y,w=y.c2p(e),A=b.c2p(r),M=t.distance;if(v.tree){var T=y.p2c(w-M),k=y.p2c(w+M),S=b.p2c(A-M),C=b.p2c(A+M);i="x"===n?v.tree.range(Math.min(T,k),Math.min(b._rl[0],b._rl[1]),Math.max(T,k),Math.max(b._rl[0],b._rl[1])):v.tree.range(Math.min(T,k),Math.min(S,C),Math.max(T,k),Math.max(S,C))}else i=v.ids;var E=M;if("x"===n){var O=!!m.xperiodalignment,L=!!m.yperiodalignment;for(u=0;u=Math.min(D,R)&&w<=Math.max(D,R)?0:1/0}if(f=Math.min(I,P)&&A<=Math.max(I,P)?0:1/0}p=Math.sqrt(f*f+h*h),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=x[a=i[u]],c=_[a],f=y.c2p(l)-w,h=b.c2p(c)-A,(d=Math.sqrt(f*f+h*h))y.glText.length){var A=_-y.glText.length;for(g=0;gr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),y.line2d.update(y.lineOptions)),y.error2d){var T=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(T)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=s.repeat(null,_),y.fill2d&&(y.fillOptions=y.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,c=y.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(y.fillOrder[e]=u);var f,h,d=[],p=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(p[h+1]);)h-=2;0!==p[f+1]&&(d=[p[f],0]),d=d.concat(p.slice(f,h+2)),0!==p[h+1]&&(d=d.concat([p[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(p[h]);)h-=2;0!==p[f]&&(d=[0,p[f+1]]),d=d.concat(p.slice(f,h+2)),0!==p[h]&&(d=d.concat([0,p[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(d=[],i=0,t.splitNull=!0,a=0;a-1;for(g=0;g<_;g++){var E=r[g][0],O=E.trace,L=E.t,D=L.index,R=O._length,I=L.x,P=L.y;if(O.selectedpoints||S||C){if(S||(S=!0),O.selectedpoints){var F=y.selectBatch[D]=s.selIndices2selPoints(O),z={};for(v=0;vh?x.sizeAvg||Math.max(x.size,3):a(e,b),d=0;da&&l||i-1,L=!0;if(o(b)||!!d.selectedpoints||O){var D=d._length;if(d.selectedpoints){g.selectBatch=d.selectedpoints;var R=d.selectedpoints,I={};for(l=0;li&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),b={},x={},_=0;p?(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),M(v);for(var w=o(e.transforms,r),A=0;A1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)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 i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){(function(){ +var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=i():!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:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(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 h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":185,"./lib/epsilon":186,"./lib/geojson":187,"./lib/intersecter":188,"./lib/segment-chainer":190,"./lib/segment-selector":191}],185:[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")}}}},{}],186:[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 i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],187:[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]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),g=!d&&e.pointBetween(s,c,u);if(h)return g?l(n,s):l(t,u),n;p&&(d||(g?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=c(h),p=d.before?d.before.ev:null,g=d.after?d.after.ev:null;function v(){if(p){var t=u(h,p);if(t)return t}return!!g&&u(h,g)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!g&&g.seg);var m,y=v();if(y){var b;if(t)(b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=g?g.seg.myFill.above:i,h.seg.myFill.above=b?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)m=g?h.primary===g.primary?g.seg.otherFill.above:g.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m};r&&r.status(h.seg,!!p&&p.seg,!!g&&g.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function A(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=b=t.map((function(t,c){var u=b[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(b[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},m.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},m.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},m.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>m.precisionThreshold||e.scale[1]*e.viewport.height>m.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=m.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},m.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var p=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),p||(e.passes[f]=p={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},m.defaults,t)),null!=t.thickness&&(p.thickness=parseFloat(t.thickness)),null!=t.opacity&&(p.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(p.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(p.overlay=!!t.overlay,f=P}));(D=D.slice(0,F)).push(P)}for(var z=function(t){var e=M.slice(2*I,2*D[t]).concat(P?M.slice(2*P):[]),r=(p.hole||[]).map((function(e){return e-P+(D[t]-I)})),n=c(e,r);n=n.map((function(e){return e+I+(e+It.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),v&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=u(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var d=m.float32(t);return i({data:d,usage:"dynamic"}),a({data:m.fract32(t,d),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function d(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},u.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nM))&&(s.lower||!(A>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||J(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(t)||J(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=et[t.usage]),"primitive"in t&&(n=at[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(f,e,r,n,i,o,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){K(s).forEach(o)}}}function g(t){for(var e=X.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,d(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function O(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&z(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;L.call(r);var a=E();return"number"==typeof t?k(a,0|t,"number"==typeof e?0|e:0|t):t?(D(r,t),S(a,t)):k(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,P(i),C(a,3553),R(r,3553),F(),O(a),o.profile&&(i.stats.size=A(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new I(3553);return yt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return c(o,i),o.width=0,o.height=0,d(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,P(i),p(o,3553,e,r,a),F(),M(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,P(i);for(var l=0;i.mipmask>>l;++l){var c=a>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return F(),o.profile&&(i.stats.size=A(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=h.texInfo;for(L.call(l),s=0;6>s;++s)g[s]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(g[0],t),S(g[1],e),S(g[2],r),S(g[3],n),S(g[4],i),S(g[5],a);else if(D(l,t),u(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(g[s],h),S(g[s],t[s]);else for(s=0;6>s;++s)S(g[s],t)}else for(t=0|t||1,s=0;6>s;++s)k(g[s],t,t);for(c(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(h),s=0;6>s;++s)C(g[s],34069+s);for(R(l,34067),F(),o.profile&&(h.stats.size=A(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)O(g[s]);return f}var h=new I(34067);yt[h.id]=h,a.cubeCount++;var g=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=m();return c(a,h),a.width=0,a.height=0,d(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,P(h),p(a,34069+t,r,n,i),F(),M(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return F(),o.profile&&(h.stats.size=A(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);R(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){K(M).forEach(v)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,K(M).forEach((function(e){e.framebuffer=t.createFramebuffer(),m(e)}))}})}function k(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r=h.byteLength?c.subdata(h):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=i.create(u,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else i.getBuffer(u)?(f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(u.buffer)?(f.buffer=i.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?tt[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;ct&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);K(c).forEach(e),c={},K(u).forEach(e),u={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var d=o[e];if(d&&(d.refCount++,!a))return d;var p=new s(n,e);return r.shaderCount++,l(p,i,a),d||(o[e]=p),h.push(p),V(p,{destroy:function(){if(p.refCount--,0>=p.refCount){t.deleteProgram(p.program);var e=h.indexOf(p);h.splice(e,1),r.shaderCount--}0>=o[p.vertId].refCount&&(t.deleteShader(u[p.vertId]),delete u[p.vertId],delete f[p.fragId][p.vertId]),Object.keys(f[p.fragId]).length||(t.deleteShader(c[p.fragId]),delete c[p.fragId],delete f[p.fragId])}})},restore:function(){c={},u={};for(var t=0;t>>e|t<<32-e}function L(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function D(t){return Array.prototype.slice.call(t)}function R(t){return D(t).join("")}function I(t){function e(){var t=[],e=[];return V((function(){t.push.apply(t,D(arguments))}),{def:function(){var r="v"+i++;return e.push(r),0>>4&15)+"0123456789abcdef".charAt(15&e);return r}(function(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,c,u,f,h,d,p=8*t.length;for(t=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),e[p>>5]|=128<<24-p%32,e[15+(p+64>>9<<4)]=p,u=0;uf;f++){var g;if(16>f)r[f]=e[f+u];else h=f,d=L(d=O(d=r[f-2],17)^O(d,19)^d>>>10,r[f-7]),g=O(g=r[f-15],7)^O(g,18)^g>>>3,r[h]=L(L(d,g),r[f-16]);h=L(L(L(L(c,h=O(h=o,6)^O(h,11)^O(h,25)),o&s^~o&l),Mt[f]),r[f]),d=L(c=O(c=p,2)^O(c,13)^O(c,22),p&n^p&i^n&i),c=l,l=s,s=o,o=L(a,h),a=i,i=n,n=p,p=L(h,d)}t[0]=L(p,t[0]),t[1]=L(n,t[1]),t[2]=L(i,t[2]),t[3]=L(a,t[3]),t[4]=L(o,t[4]),t[5]=L(s,t[5]),t[6]=L(l,t[6]),t[7]=L(c,t[7])}for(e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t){for(var e,r,n="",i=-1;++i=e&&56320<=r&&57343>=r&&(e=65536+((1023&e)<<10)+(1023&r),i++),127>=e?n+=String.fromCharCode(e):2047>=e?n+=String.fromCharCode(192|e>>>6&31,128|63&e):65535>=e?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):2097151>=e&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(r))),n[e])?n[e].apply(null,o):(r=Function.apply(null,a.concat(r)),n&&(n[e]=r),r.apply(null,o))}}}function P(t){return Array.isArray(t)||J(t)||l(t)}function F(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",a,".createStream(",34962,",",i,".buffer);","}else{",u,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",u,");","}"),l}))})),o}function k(t,e,n,i,o){function s(t){var e=c[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[p,g,v,s],");")}d&&"null"!==d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[p,v,m,g+"<<(("+m+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[p,g,v]+");")}d&&"null"!==d?y?t():(r("if(",d,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,h=n.draw,d=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),h.elementsActive&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",rt?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),p=i("primitive"),g=i("offset"),v=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof v){if(0===v)return}else r("if(",v,"){"),r.exit("}");$&&(s=i("instances"),l=t.instancing);var m=d+".type",y=h.elements&&N(h.elements)&&!h.vaoActive;$&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function Y(t,e,r,n,i){return i=(e=_()).proc("body",i),$&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function q(t,e,r,n){L(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),R(t,e,r,n.attributes,(function(){return!0}))),U(t,e,r,n.uniforms,(function(){return!0}),!1),H(t,e,e,r)}function W(t,e,r,n){function i(){return!0}t.batchId="a1",L(t,e),R(t,e,r,n.attributes,i),U(t,e,r,n.uniforms,i,!1),H(t,e,e,r)}function X(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}L(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&S(t,u,r.context),r.needsFramebuffer&&C(t,u,r.framebuffer),O(t,u,r.state,i),r.profile&&i(r.profile)&&D(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),R(t,c,r,n.attributes,a),R(t,u,r,n.attributes,i)),U(t,c,r,n.uniforms,a,!1),U(t,u,r,n.uniforms,i,!0),H(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return Y(W,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function Z(t,r){function n(e){var n=r.shader[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.shader,"."+e,n):i.set(a.shader,"."+e,t.link(n,{stable:!0})))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;if(S(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),F(Object.keys(r.state)).forEach((function(e){var n=r.state[e],o=n.append(t,i);v(o)?o.forEach((function(r,n){isNaN(r)?i.set(t.next[e],"["+n+"]",r):i.set(t.next[e],"["+n+"]",t.link(r,{stable:!0}))})):N(n)?i.set(a.next,"."+e,t.link(o,{stable:!0})):i.set(a.next,"."+e,o)})),D(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.draw,"."+e,n):i.set(a.draw,"."+e,t.link(n),{stable:!0}))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.map((function(e){return isNaN(e)?e:t.link(e,{stable:!0})}))+"]"),i.set(a.uniforms,"["+t.link(e.id(n),{stable:!0})+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new K).forEach((function(t){i.set(a,"."+t,n[t])}))})),r.scopeVAO){var s=r.scopeVAO.append(t,i);isNaN(s)?i.set(a.vao,".targetVAO",s):i.set(a.vao,".targetVAO",t.link(s,{stable:!0}))}n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=xt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height||(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=xt[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){K(u).forEach(o)},restore:function(){K(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},wt=[];wt[6408]=4,wt[6407]=3;var At=[];At[5121]=1,At[5126]=4,At[36193]=2;var Mt=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Tt=["x","y","z","w"],kt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),St={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ct={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Et={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ot={cw:2304,ccw:2305},Lt=new z(!1,!1,!1,(function(){}));return function(t){function e(){if(0===K.length)A&&A.update(),et=null;else{et=q.next(e),f();for(var t=K.length-1;0<=t;--t){var r=K[t];r&&r(D,null,0)}v.flush(),A&&A.update()}}function r(){!et&&0=K.length&&n()}}}}function u(){var t=X.viewport,e=X.scissor_box;t[0]=t[1]=e[0]=e[1]=0,D.viewportWidth=D.framebufferWidth=D.drawingBufferWidth=t[2]=e[2]=v.drawingBufferWidth,D.viewportHeight=D.framebufferHeight=D.drawingBufferHeight=t[3]=e[3]=v.drawingBufferHeight}function f(){D.tick+=1,D.time=g(),u(),Y.procs.poll()}function h(){N.refresh(),u(),Y.procs.refresh(),A&&A.update()}function g(){return(W()-k)/1e3}if(!(t=i(t)))return null;var v=t.gl,m=v.getContextAttributes();v.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)rt(V({framebuffer:t.framebuffer.faces[e]},t),l);else rt(t,l);else l(0,t)},prop:G.define.bind(null,1),context:G.define.bind(null,2),this:G.define.bind(null,3),draw:s({}),buffer:function(t){return I.create(t,34962,!1,!1)},elements:function(t){return P.create(t,!1)},texture:N.create2D,cube:N.createCube,renderbuffer:B.create,framebuffer:j.create,framebufferCube:j.createCube,vao:F.createVAO,attributes:m,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=Q;break;case"restore":r=$;break;case"destroy":r=tt}return r.push(e),{cancel:function(){for(var t=0;t",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,g=void 0===p?0:p,v=t.sweepFlag,m=void 0===v?0:v,y=[];if(0===u||0===f)return[];var b=Math.sin(d*i/360),x=Math.cos(d*i/360),_=x*(e-l)/2+b*(r-c)/2,w=-b*(e-l)/2+x*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(u*=Math.sqrt(A),f*=Math.sqrt(A));var M=function(t,e,r,n,a,o,l,c,u,f,h,d){var p=Math.pow(a,2),g=Math.pow(o,2),v=Math.pow(h,2),m=Math.pow(d,2),y=p*g-p*m-g*v;y<0&&(y=0),y/=p*m+g*v;var b=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*d,x=y*-o/a*h,_=f*b-u*x+(t+r)/2,w=u*b+f*x+(e+n)/2,A=(h-b)/a,M=(d-x)/o,T=(-h-b)/a,k=(-d-x)/o,S=s(1,0,A,M),C=s(A,M,T,k);return 0===c&&C>0&&(C-=i),1===c&&C<0&&(C+=i),[_,w,S,C]}(e,r,l,c,u,f,g,m,b,x,_,w),T=n(M,4),k=T[0],S=T[1],C=T[2],E=T[3],O=Math.abs(E)/(i/4);Math.abs(1-O)<1e-7&&(O=1);var L=Math.max(Math.ceil(O),1);E/=L;for(var D=0;De[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":17,assert:22,"is-svg-path":168,"normalize-svg-path":202,"parse-svg-path":179}],202:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,d=0,p=0,g=t.length;p4?(o=v[v.length-4],s=v[v.length-3]):(o=h,s=d),r.push(v)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":200}],203:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=c.width=e.w||e.width||200,f=c.height=e.h||e.height||200);var h=Math.min(r,f),d=e.stroke||0,p=e.viewbox||e.viewBox||i(t),g=[r/(p[2]-p[0]),f/(p[3]-p[1])],v=Math.min(g[0]||0,g[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",d&&("number"!=typeof d&&(d=1),u.strokeStyle=d>0?"white":"black",u.lineWidth=Math.abs(d));if(u.translate(.5*r,.5*f),u.scale(v,v),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var m=new Path2D(t);u.fill(m),d&&u.stroke(m)}else{var y=a(t);o(u,y),u.fill(),d&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":29,"draw-svg-path":58,"is-svg-path":168,"parse-svg-path":179,"svg-path-bounds":201}],204:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},l=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":192,timers:204}],205:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),a:F(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:D(e[1]),g:D(e[2]),b:D(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),a:F(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:D(e[1]+""+e[1]),g:D(e[2]+""+e[2]),b:D(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,g=e.b,i={r:255*O(d,255),g:255*O(p,255),b:255*O(g,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=I(e.s),c=I(e.v),i=function(e,r,n){e=6*O(e,360),r=O(r,100),n=O(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=I(e.s),u=I(e.l),i=function(t,e,r){var n,i,a;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=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,g;return a=E(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=O(t,255),e=O(e,255),r=O(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function k(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%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,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=a(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=a(360*t.h),r=a(100*t.s),n=a(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=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[R(a(t).toString(16)),R(a(e).toString(16)),R(a(r).toString(16)),R(P(n))];if(i&&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:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*O(this._r,255))+"%",g:a(100*O(this._g,255))+"%",b:a(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*O(this._r,255))+"%, "+a(100*O(this._g,255))+"%, "+a(100*O(this._b,255))+"%)":"rgba("+a(100*O(this._r,255))+"%, "+a(100*O(this._g,255))+"%, "+a(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+d(i._r,i._g,i._b,i._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(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,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]:I(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:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!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":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=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"},C=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function E(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,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function L(t){return o(1,s(0,t))}function D(t){return parseInt(t,16)}function R(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function P(e){return t.round(255*parseFloat(e)).toString(16)}function F(t){return D(t)/255}var z,N,B,j=(N="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",B="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),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 U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],206:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=i(t));for(var r=0,n=e.length;r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":210}],212:[function(t,e,r){"use strict";var n=t("../value/is"),i={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},{"../value/is":218}],213:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":209,"./is":214}],214:[function(t,e,r){"use strict";var n=t("../function/is"),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!i.test(a.call(t))}},{"../function/is":208}],215:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":212}],216:[function(t,e,r){"use strict";var n=t("../value/is"),i=t("../object/is"),a=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},{"../object/is":212,"../value/is":218}],217:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":209,"./is":218}],218:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],219:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),i=t("dup"),a=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,f=c.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function d(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function p(t){return new Uint8Array(d(t),0,t)}function g(t){return new Uint16Array(d(2*t),0,t)}function v(t){return new Uint32Array(d(4*t),0,t)}function m(t){return new Int8Array(d(t),0,t)}function y(t){return new Int16Array(d(2*t),0,t)}function b(t){return new Int32Array(d(4*t),0,t)}function x(t){return new Float32Array(d(4*t),0,t)}function _(t){return new Float64Array(d(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(d(t),0,t):p(t)}function A(t){return s?new BigUint64Array(d(8*t),0,t):null}function M(t){return l?new BigInt64Array(d(8*t),0,t):null}function T(t){return new DataView(d(t),0,t)}function k(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return d(t);switch(e){case"uint8":return p(t);case"uint16":return g(t);case"uint32":return v(t);case"int8":return m(t);case"int16":return y(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return M(t);case"biguint64":return A(t);case"buffer":return k(t);case"data":case"dataview":return T(t);default:return null}return null},r.mallocArrayBuffer=d,r.mallocUint8=p,r.mallocUint16=g,r.mallocUint32=v,r.mallocInt8=m,r.mallocInt16=y,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=M,r.mallocDataView=T,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":28,buffer:31,dup:60}],220:[function(t,e,r){var n=/[\'\"]/;e.exports=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},{}],221:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(g>>5&15)-1,(31&g)+s);return a.year=v.getFullYear(),a.month=1+v.getMonth(),a.day=v.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var d,p=f[a.year-f[0]];for(d=0;d<13;d++){var g=p&1<<12-d?30:29;if(l>13;!v||d=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":237,"object-assign":176}],226:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":237,"object-assign":176}],227:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":237,"object-assign":176}],228:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":237,"object-assign":176}],229:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":237,"object-assign":176}],230:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":237,"object-assign":176}],231:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":237,"object-assign":176}],232:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":237,"object-assign":176}],234:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":237,"object-assign":176}],235:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":237,"object-assign":176}],236:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":237,"object-assign":176}],237:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":176}],238:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),p=function(t,e,r,n){var i=""+e;if(d(t,n))for(;i.length1},b=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(T).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(T));return T+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=g;for(var C=this.daysInMonth(h,d);p>C;C=this.daysInMonth(h,d))d++,p-=C}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":237,"object-assign":176}],239:[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}]},{}],240:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=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:i({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",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.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",a.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:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":374,"../../plot_api/plot_template":439,"../../plots/cartesian/constants":457,"../../plots/font_attributes":478,"./arrow_paths":239}],241:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,g=d-h,v=3*t.startarrowsize*t.arrowwidth||0,m=v+h,y=v-h;if(c===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:g}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,p,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([a,o],t)}},{"../../lib":400,"../../plots/cartesian/axes":450,"./draw":246}],242:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=it.r2fraction(e["a"+et]))<0||dt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(Q=e[et],J=pt?it._offset+it._length*Q:J=A.l+A.w*Q):(Q=1-e[et],J=pt?it._offset+it._length*Q:J=A.t+A.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var gt=e["a"+et];if(tt=ot*Y(.5,e.xanchor)-st*Y(.5,e.yanchor),nt===rt){var vt=l.getRefType(nt);"domain"===vt?("y"===et&&(gt=1-gt),ft.tail=it._offset+it._length*gt):"paper"===vt?"y"===et?(gt=1-gt,ft.tail=A.t+A.h*gt):ft.tail=A.l+A.w*gt:ft.tail=it._offset+it.r2p(gt),K=tt}else ft.tail=J+gt,K=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),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*Y($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)F.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(T-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(P-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+xt-1,y:B+_t}).call(u.setClipUrl,U?E:null,t);else{var wt=B+_t-g.top,At=B+xt-g.left;G.call(h.positionText,At,wt).call(u.setClipUrl,U?E:null,t)}H.select("rect").call(u.setRect,B,B,T,P),j.call(u.setRect,z/2,z/2,N-z,V-z),F.call(u.setTranslate,Math.round(O.x.text-N/2),Math.round(O.y.text-V/2)),R.attr({transform:"rotate("+L+","+O.x.text+","+O.y.text+")"});var Mt,Tt=function(r,n){D.selectAll(".annotation-arrow-g").remove();var l=O.x.head,f=O.y.head,h=O.x.tail+r,d=O.y.tail+n,g=O.x.text+r,x=O.y.text+n,_=o.rotationXYMatrix(L,g,x),w=o.apply2DTransform(_),T=o.apply2DTransform2(_),E=+j.attr("width"),I=+j.attr("height"),P=g-.5*E,z=P+E,N=x-.5*I,B=N+I,U=[[P,N,P,B],[P,B,z,B],[z,B,z,N],[z,N,P,N]].map(T);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,V=e.arrowcolor,Y=e.arrowside,G=D.append("g").style({opacity:c.opacity(V)}).classed("annotation-arrow-g",!0),q=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(c.stroke,c.rgb(V));if(v(q,Y,e),M.annotationPosition&&q.node().parentNode&&!a){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-X),transform:s(W,X)}).style("stroke-width",H+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(F);J=t.x,K=t.y,m&&m.autorange&&k(m._name+".autorange",!0),b&&b.autorange&&k(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;F.call(u.setTranslate,i,a),S("x",y(m,t,"x",A,e)),S("y",y(b,r,"y",A,e)),e.axref===e.xref&&S("ax",y(m,t,"ax",A,e)),e.ayref===e.yref&&S("ay",y(b,r,"ay",A,e)),G.attr("transform",s(t,r)),R.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Tt(0,0),I)p.init({element:F.node(),gd:t,prepFn:function(){Mt=R.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(m,t,"ax",A,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(b,r,"ay",A.w,e)):S("ay",e.ay+r),Tt(t,r);else{if(a)return;var i,o;if(m)i=y(m,t,"x",A,e);else{var l=e._xsize/A.w,c=e.x+(e._xshift-e.xshift)/A.w-l/2;i=p.align(c+t/A.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",A,e);else{var u=e._ysize/A.h,f=e.y-(e._yshift+e.yshift)/A.h-u/2;o=p.align(f-r/A.h,u,0,1,e.yanchor)}S("x",i),S("y",o),m&&b||(n=p.getCursor(m?.5:i,b?.5:o,e.xanchor,e.yanchor))}R.attr({transform:s(t,r)+Mt}),d(F,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(F),i.call("_guiRelayout",t,C());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=0,b=e.indexOf("end")>=0,x=p.backoff*v+r.standoff,_=g.backoff*m+r.startstandoff;if("line"===d.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,A=o.y-u.y;if(h=(f=Math.atan2(A,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+A*A))return void I();if(x){if(x*x>w*w+A*A)return void I();var M=x*Math.cos(f),T=x*Math.sin(f);u.x+=M,u.y+=T,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+A*A)return void I();var k=_*Math.cos(f),S=_*Math.sin(f);o.x-=k,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var C=d.getTotalLength(),E="";if(C1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":485,"../annotations/draw":246}],253:[function(t,e,r){"use strict";var n=t("../../registry"),i=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 a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ct=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ct*c.roundUp(lt/ct,[2,5,10]),(Math.abs(Y.start)/Y.size+1e-6)%1<2e-6&&(it.tick0=0)}it.dtick=ot}it.domain=o?[rt+D/F.h,rt+K-D/F.h]:[rt+L/F.w,rt+K-L/F.w],it.setScale(),t.attr("transform",u(Math.round(F.l),Math.round(F.t)));var ut,ft=t.select("."+T.cbtitleunshift).attr("transform",u(-Math.round(F.l),-Math.round(F.t))),ht=it.ticklabelposition,dt=it.title.font.size,pt=t.select("."+T.cbaxis),gt=0,vt=0;function mt(n,i){var a={propContainer:it,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:P._dfltTitle.colorbar,containerGroup:t.select("."+T.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),g.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&at||!o&&!at)&&("top"===j&&(t=L+F.l+F.w*R,e=D+F.t+F.h*(1-rt-K)+3+.75*dt),"bottom"===j&&(t=L+F.l+F.w*R,e=D+F.t+F.h*(1-rt)-3-.25*dt),"right"===j&&(e=D+F.t+F.h*I+3+.75*dt,t=L+F.l+F.w*rt),mt(it._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!at||o&&at){var a,l=t.select("."+T.cbtitle),f=l.select("text"),h=[-k/2,k/2],p=l.select(".h"+it._id+"title-math-group").node(),g=15.6;if(f.node()&&(g=parseInt(f.node().style.fontSize,10)*w),p?(a=d.bBox(p),vt=a.width,(gt=a.height)>g&&(h[1]-=(gt-g)/2)):f.node()&&!f.classed(T.jsPlaceholder)&&(a=d.bBox(f.node()),vt=a.width,gt=a.height),o){if(gt){if(gt+=5,"top"===j)it.domain[1]-=gt/F.h,h[1]*=-1;else{it.domain[0]+=gt/F.h;var m=v.lineCount(f);h[1]+=(1-m)*g}l.attr("transform",u(h[0],h[1])),it.setScale()}}else vt&&("right"===j&&(it.domain[0]+=(vt+dt/2)/F.w),l.attr("transform",u(h[0],h[1])),it.setScale())}t.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",o?u(0,Math.round(F.h*(1-it.domain[1]))):u(Math.round(F.w*it.domain[0]),0)),pt.attr("transform",o?u(0,Math.round(-F.t)):u(Math.round(-F.l),0));var y=t.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(q);y.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),y.exit().remove();var b=U.map(it.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var s=[0===a?U[0]:(q[a]+q[a-1])/2,a===q.length-1?U[1]:(q[a]+q[a+1])/2].map(it.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,b[0],b[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)d.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=V(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var x=t.select("."+T.cblines).selectAll("path."+T.cbline).data(N.color&&N.width?W:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(t){var e=Q,r=Math.round(it.c2p(t))+N.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+X).call(d.lineGroupStyle,N.width,H(t),N.dash)})),pt.selectAll("g."+it._id+"tick,path").remove();var _=Q+X+(k||0)/2-("outside"===e.ticks?1:0),A=s.calcTicks(it),M=s.getTickSigns(it)[2];return s.drawTicks(r,it,{vals:"inside"===it.ticks?s.clipEnds(it,A):A,layer:pt,path:s.makeTickPath(it,_,M),transFn:s.makeTransTickFn(it)}),s.drawLabels(r,it,{vals:A,layer:pt,transFn:s.makeTransTickLabelFn(it),labelFns:s.makeLabelFns(it,_)})},function(){if(o&&!at||!o&&at){var t,i,a=it.position||0,s=it._offset+it._length/2;if("right"===j)i=s,t=F.l+F.w*a+10+dt*(it.showticklabels?1:.5);else if(t=s,"bottom"===j&&(i=F.t+F.h*a+10+(-1===ht.indexOf("inside")?it.tickfont.size:0)+("intside"!==it.ticks&&e.ticklen||0)),"top"===j){var l=B.text.split("
").length;i=F.t+F.h*a+10-X-w*dt*l}mt((o?"h":"v")+it._id+"title",{avoid:{selection:n.select(r).selectAll("g."+it._id+"tick"),side:j,offsetTop:o?0:F.t,offsetLeft:o?F.l:0,maxShift:o?P.width:P.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=X+k/2;-1===ht.indexOf("inside")&&(n=d.bBox(pt.node()),s+=o?n.width:n.height),ut=ft.select("text");var c=0,f=o&&"top"===j,g=!o&&"right"===j,v=0;if(ut.node()&&!ut.classed(T.jsPlaceholder)){var y,b=ft.select(".h"+it._id+"title-math-group").node();b&&(o&&at||!o&&!at)?(c=(n=d.bBox(b)).width,y=n.height):(c=(n=d.bBox(ft.node())).right-F.l-(o?Q:nt),y=n.bottom-F.t-(o?nt:Q),o||"top"!==j||(s+=n.height,v=n.height)),g&&(ut.attr("transform",u(c/2+dt/2,0)),c*=2),s=Math.max(s,o?c:y)}var x=2*(o?L:D)+s+S+k/2,w=0;!o&&B.text&&"bottom"===O&&I<=0&&(x+=w=x/2,v+=w),P._hColorbarMoveTitle=w,P._hColorbarMoveCBTitle=v;var z=S+k;t.select("."+T.cbbg).attr("x",(o?Q:nt)-z/2-(o?L:0)).attr("y",(o?nt:Q)-(o?J:D+v-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(J+z,2)).call(p.fill,C).call(p.stroke,e.bordercolor).style("stroke-width",S);var N=g?Math.max(c-10,0):0;if(t.selectAll("."+T.cboutline).attr("x",(o?Q:nt+L)+N).attr("y",(o?nt+D-J:Q)+(f?gt:0)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(J-(o?2*D+gt:2*L+N),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":k}),t.attr("transform",u(F.l-(o?$*x:0),F.t-(o?0:(1-tt)*x-v))),!o&&(S||i(C).getAlpha()&&!i.equals(P.paper_bgcolor,C))){var U=pt.selectAll("text"),H=U[0].length,V=t.select("."+T.cbbg).node(),Y=d.bBox(V),G=d.getTranslate(t);U.each((function(t,e){var r=H-1;if(0===e||e===r){var n,i=d.bBox(this),a=d.getTranslate(this);if(e===r){var o=i.right+a.x;(n=Y.right+G.x+nt-S-2+R-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=Y.left+G.x+nt+S+2-s)<0&&(n=0)}n&&(H<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var q={},W=A[E],Z=M[E],K=A[O],et=M[O],rt=x-X;o?("pixels"===h?(q.y=I,q.t=J*K,q.b=J*et):(q.t=q.b=0,q.yt=I+l*K,q.yb=I-l*et),"pixels"===_?(q.x=R,q.l=x*W,q.r=x*Z):(q.l=rt*W,q.r=rt*Z,q.xl=R-m*W,q.xr=R+m*Z)):("pixels"===h?(q.x=R,q.l=J*W,q.r=J*Z):(q.l=q.r=0,q.xl=R+l*W,q.xr=R-l*Z),"pixels"===_?(q.y=1-I,q.t=x*K,q.b=x*et):(q.t=rt*K,q.b=rt*et,q.yt=I-m*K,q.yb=I+m*et)),a.autoMargin(r,e._id,q)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,f)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":373,"../../lib":400,"../../lib/extend":392,"../../lib/setcursor":421,"../../lib/svg_text_utils":426,"../../plots/cartesian/axes":450,"../../plots/cartesian/axis_defaults":452,"../../plots/cartesian/layout_attributes":463,"../../plots/cartesian/position_defaults":466,"../../plots/plots":488,"../../registry":490,"../color":257,"../colorscale/helpers":268,"../dragelement":276,"../drawing":279,"../titles":366,"./constants":259,"@plotly/d3":14,tinycolor2:205}],262:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":400}],263:[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":258,"./defaults":260,"./draw":261,"./has_colorbar":262}],264:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var d=a+"auto",p=a+"min",g=a+"max",v=a+"mid",m=(s(h+d),s(h+p),s(h+g),{});m[p]=m[g]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":417,"../../lib/sort_object_keys":423,"../colorbar/attributes":258,"./scales.js":272}],265:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),h=!1!==f.auto,d=f.min,p=f.max,g=f.mid,v=function(){return i.aggNums(Math.min,null,l)},m=function(){return i.aggNums(Math.max,null,l)};(void 0===d?d=v():h&&(d=u._colorAx&&n(d)?Math.min(d,v()):v()),void 0===p?p=m():h&&(p=u._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==g&&(p-g>g-d?d=g-(p-g):p-g=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":400,"./helpers":268,"fast-isnumeric":121}],266:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=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,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],274:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":400}],275:[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)}},{}],276:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var 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)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,h,d,p,g,v=t.gd,m=1,y=v._context.doubleClickDelay,b=t.element;v._mouseDownTime||(v._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),v._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!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)}p.dispatchEvent(r)}v._dragging=!1,v._dragged=!1}else v._dragged=!1}},l.coverSlip=u},{"../../lib":400,"../../plots/cartesian/constants":457,"./align":273,"./cursor":274,"./unhover":277,"has-hover":159,"has-passive-events":160,"mouse-event-offset":171}],277:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":390,"../../lib/events":391,"../../lib/throttle":427,"../fx/constants":291}],278:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],279:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,h=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,g=t("../../constants/interactions").DESELECTDIM,v=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};function x(t,e,r){var n=e.fillpattern,i=n&&b.getPatternAttr(n.shape,0,"");if(i){var a=b.getPatternAttr(n.bgcolor,0,null),o=b.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=b.getPatternAttr(n.size,0,8),u=b.getPatternAttr(n.solidity,0,.3),f=e.uid;b.pattern(t,"point",r,f,i,l,u,void 0,n.fillmode,a,o,s)}else e.fillcolor&&t.call(c.fill,e.fillcolor)}b.font=function(t,e,r,n){i.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(c.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,i){t.call(b.setPosition,e,r).call(b.setSize,n,i)},b.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);b.translatePoint(t,i,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.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},b.singleFillStyle=function(t,e){var r=n.select(t.node());x(t,((r.data()[0]||[])[0]||{}).trace||{},e)},b.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&x(r,t[0].trace,e)}))};var _=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolBackOffs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,b.symbolBackOffs[r]=e.backoff||0,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var w=b.symbolNames.length;function A(t,e,r,n){var i=t%100;return b.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var M={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},k=a("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:M},horizontalreversed:{node:"linearGradient",attrs:M,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=S[a],h=new Array(u),d=0;d=100;var f=rt(t,r),h=G(t,r);e.attr("d",A(u,l,f,h))}var d,p,g,v=!1;if(t.so)g=s.outlierwidth,p=s.outliercolor,d=o.outliercolor;else{var m=(s||{}).width;g=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,p="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(d=c.defaultLine,v=!0),d="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,d).style({"stroke-width":(g||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:g)+"px");var y=o.gradient,x=t.mgt;x?v=!0:x=y&&y.type,i.isArrayOrTypedArray(x)&&(x=x[0],S[x]||(x=0));var _=o.pattern,w=_&&b.getPatternAttr(_.shape,t.i,"");if(x&&"none"!==x){var M=t.mgc;M?v=!0:M=y.color;var T=r.uid;v&&(T+="-"+t.i),b.gradient(e,a,T,x,[[0,M],[1,d]],"fill")}else if(w){var k=b.getPatternAttr(_.bgcolor,t.i,null),C=b.getPatternAttr(_.fgcolor,t.i,null),E=_.fgopacity,O=b.getPatternAttr(_.size,t.i,8),L=b.getPatternAttr(_.solidity,t.i,.3),D=t.mcc||i.isArrayOrTypedArray(_.shape)||i.isArrayOrTypedArray(_.bgcolor)||i.isArrayOrTypedArray(_.size)||i.isArrayOrTypedArray(_.solidity),R=r.uid;D&&(R+="-"+t.i),b.pattern(e,"point",a,R,w,O,L,t.mcc,_.fillmode,k,C,E)}else c.fill(e,d);g&&c.stroke(e,p)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=v.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,h=void 0!==u,d=void 0!==f;(i.isArrayOrTypedArray(c)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:e:d?f:g*e});var p=a.color,v=o.color,m=s.color;(v||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?v||e:m||e});var y=a.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,g))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",A(b.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,d,t,p)}var g=t.tp||e.textposition,v=O(t,e),m=a?a(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,v,m).text(c).call(h.convertToTspans,r).call(E,g,v,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=O(t,e);c.fill(i,a);var u=l.traceIs(e,"bar-like");E(i,o,s,t.mrc2||t.mrc,u)}))}};var L,D;function R(t,e,r){return r&&(t=B(t)),e?P(t[1]):I(t[0])}function I(t){var e=n.round(t,2);return L=e,e}function P(t){var e=n.round(t,2);return D=e,e}function F(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,h=3*c*(l+c),d=3*l*(l+c);return[[I(e[0]+(h&&u/h)),P(e[1]+(h&&f/h))],[I(e[0]-(d&&u/d)),P(e[1]-(d&&f/d))]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||x>=f&&x<=c)&&(_<=h&&_>=u||_>=h&&_<=u)&&(t=[x,_])}return t}b.steps=function(t){var e=z[t]||N;return function(t){for(var r="M"+I(t[0][0])+","+P(t[0][1]),n=t.length,i=1;i=1e4&&(b.savedBBoxes={},j=0),r&&(b.savedBBoxes[r]=v),j++,i.extendFlat({},v)},b.setClipUrl=function(t,e,r){t.attr("clip-path",H(e,r))},b.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}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},b.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}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var V=/\s*sc.*/;b.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(V,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var Y=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(Y);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},b.getMarkerStandoff=G;var q,W,X,Z,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,c=e._yA;if(!l||!c)return 90;r=l.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var u,f=t.lonlat[0],h=t.lonlat[1],d=e._geo.project([f,h+1e-5]),p=e._geo.project([f+1e-5,h]),g=Q(p[1]-n,p[0]-r),v=Q(d[1]-n,d[0]-r);if("north"===a)u=i/180*Math.PI;else if("previous"===a){var m=f/180*Math.PI,y=h/180*Math.PI,b=q/180*Math.PI,x=W/180*Math.PI,_=b-m,w=$(x)*tt(_),A=tt(x)*$(y)-$(x)*tt(y)*$(_);u=-Q(w,A)-Math.PI,q=f,W=h}var M=et(g,[$(u),0]),T=et(v,[tt(u),0]);i=Q(M[1]+T[1],M[0]+T[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var k=r-X,S=n-Z,C=e.line&&e.line.shape||"",E=C.slice(C.length-1);"h"===E&&(S=0),"v"===E&&(k=0),i+=Q(S,k)/Math.PI*180+90}else i=null}return X=r,Z=n,J=t.i,K=e.uid,i}b.getMarkerAngle=rt},{"../../components/fx/helpers":293,"../../constants/alignment":373,"../../constants/interactions":377,"../../constants/xmlns_namespaces":379,"../../lib":400,"../../lib/svg_text_utils":426,"../../registry":490,"../../traces/scatter/make_bubble_size_func":556,"../../traces/scatter/subtypes":564,"../color":257,"../colorscale":269,"./symbol_defs":280,"@plotly/d3":14,"fast-isnumeric":121,tinycolor2:205}],280:[function(t,e,r){"use strict";var n,i,a,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,h=Math.cos,d=Math.sin;function p(t){return null===t}function g(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=h(t),i=d(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,p=0,g=s(r),v="",m=0;m0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var g=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var v=n.select(this).selectAll("g.errorbar").data(e,f);if(v.exit().remove(),e.length){d.visible||v.selectAll("path.xerror").remove(),p.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(s.duration).style("opacity",1),a.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),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!g||t.vis){var a,o=e.select("path.yerror");if(p.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=p.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="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(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var v=(d.copy_ystyle?p:d).width;a="M"+r.xh+","+(r.y-v)+"v"+2*v+"m0,-"+v+"H"+r.xs,r.noXS||(a+="m0,-"+v+"v"+2*v),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":564,"../drawing":279,"@plotly/d3":14,"fast-isnumeric":121}],287:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":257,"@plotly/d3":14}],288:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":392,"../../plots/font_attributes":478,"./layout_attributes":298}],289:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||ot<0||ot>w[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=ot+w[0]._offset,H="xval"in e?m.flat(l,e.xval):m.p2c(_,at),V="yval"in e?m.flat(l,e.yval):m.p2c(w,ot),!i(H[0])||!i(V[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(G=0;Gtt&&(et.splice(0,tt),ct=et[0].distance),y&&0!==N&&0===et.length){$.distance=N,$.index=!1;var f=W._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=N}))),f&&f.length){var h,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var g=p[0];i(g.x0)&&i(g.y0)&&(h=ht(g),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>h.spikeDistance)&&(nt.vLinePoint=h))}var v=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(v.length){var b=v[0];i(b.x0)&&i(b.y0)&&(h=ht(b),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>h.spikeDistance)&&(nt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)At-1;kt--)Ot(et[kt]);et=St,vt()}var Lt=t._hoverdata,Dt=[],Rt=j(t),It=U(t);for(Y=0;Y1||et.length>1)||"closest"===L&&it&&et.length>1,Wt=d.combine(u.plot_bgcolor||d.background,u.paper_bgcolor),Xt=D(et,{gd:t,hovermode:L,rotateLabels:qt,bgColor:Wt,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});m.isUnifiedHover(L)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,h=t.size(),d=new Array(h),p=0;function g(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===p&&a&&a[0]>a[1]!==i&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?A:1)/2,pmin:0,pmax:i?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=h;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=i;for(v.push.apply(v,m),d.splice(o+1,1),c=0,s=v.length-1;s>=0;s--)c+=v[s].dp;for(a=c/v.length,s=v.length-1;s>=0;s--)v[s].dp-=a;n=!1}else o++}d.forEach(g)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,qt?"xa":"ya",u),I(Xt,qt,u._invScaleX,u._invScaleY));if(s&&s.tagName){var Zt=v.getComponentMethod("annotations","hasClickToShow")(t,Dt);f(n.select(s),Zt?"pointer":"")}if(!s||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Lt))return;Lt&&t.emit("plotly_unhover",{event:e,points:Lt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:H,yvals:V})}(t,e,r,a,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=D(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),p=Math.max(s,l),g=t.trace;if(v.traceIs(g,"gl3d")){var m=i._fullLayout[g.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;u+=y,f+=y,h+=b,p+=b}c.bbox={x0:u+o,x1:f+o,y0:h+a,y1:p+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||d.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,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function D(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,p=e.container,g=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var A=e.fontFamily||y.HOVERFONT,M=e.fontSize||y.HOVERFONTSIZE,T=t[0],C=T.xa,E=T.ya,L=a.charAt(0),D=L+"Label",I=T[D];if(void 0===I&&"multicategory"===C.type)for(var P=0;Pi.width-x?(v=i.width-x,e.attr("d","M"+(x-k)+",0L"+x+","+b+k+"v"+b+(2*S+y.height)+"H-"+x+"V"+b+k+"H"+(x-2*k)+"Z")):e.attr("d","M0,0L"+k+","+b+k+"H"+(S+y.width/2)+"v"+b+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+b+k+"H-"+k+"Z")}else{var _,O,L;"right"===E.side?(_="start",O=1,L="",v=C._offset+C._length):(_="end",O=-1,L="-",v=C._offset),m=E._offset+(T.y0+T.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+L+k+","+k+"V"+(S+y.height/2)+"h"+L+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+L+k+"V-"+k+"Z");var D,R=y.height/2,P=z-y.top-R,F="clip"+i._uid+"commonlabel"+E._id;if(v=0?st:lt+ft=0?lt:bt+ft=0?at:ot+ht=0?ot:xt+ht=0,"top"!==t.idealAlign&&G||!q?G?(D+=F/2,t.anchor="start"):t.anchor="middle":(D-=F/2,t.anchor="end");else if(t.pos=D,G=L+P/2+W<=N,q=L-P/2-W>=0,"left"!==t.idealAlign&&G||!q)if(G)L+=P/2,t.anchor="start";else{t.anchor="middle";var X=W/2,Z=L+X-N,J=L-X;Z>0&&(L-=Z),J<0&&(L+=-J)}else L-=P/2,t.anchor="end";w.attr("text-anchor",t.anchor),C&&T.attr("text-anchor",t.anchor),e.attr("transform",s(L,D)+(c?l(_):""))})),_t}function R(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=N(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(h[c+"other"]=h[c+"Val"],h[c+"otherLabel"]=h[c+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(L,(function(e,r){return s=N(r,t.nameLength),""}))}return[l,s]}function I(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(k+S),d=f+c*(t.txwidth+S),p=0,g=t.offset,v="middle"===s;v&&(f-=t.tx2width/2,d+=t.txwidth/2+S),e&&(g*=-T,p=t.offset*M),r.select("path").attr("d",v?"M-"+a(t.bx/2+t.tx2width/2)+","+o(g-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*k+p)+","+o(k+g)+"v"+o(t.by/2-k)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*k+p)+"V"+o(g-k)+"Z");var m=p+f,y=g+t.ty0-t.by/2+S,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(i.attr("text-anchor","start"),m=v?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===b&&"end"!==s&&(i.attr("text-anchor","end"),m=v?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(m),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(d+c*S+p),o(g+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,a(d+(c-1)*t.tx2width/2+p),o(g-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function P(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}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,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:g.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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 h=g.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+g.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function F(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var p=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var v,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(v=c.pointerX,m=c.pointerY):(v=n._offset+y.x,m=i._offset+y.y);var b,x,_=a.readability(y.color,p)<1.5?d.contrast(p):y.color,w=i.spikemode,A=i.spikethickness,M=i.spikecolor||_,T=g.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=v),-1!==w.indexOf("across")){var k=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(k=Math.min(k,i.position),S=Math.max(S,i.position)),b=l.l+k*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A,stroke:M,"stroke-dasharray":h.dashStyle(i.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":A+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==i.side?A:-A),cy:m,r:A,fill:M}).classed("spikeline",!0)}if(f){var C,E,O=e.vLinePoint;n=O&&O.xa,i=O&&O.ya,"cursor"===n.spikesnap?(C=c.pointerX,E=c.pointerY):(C=n._offset+O.x,E=i._offset+O.y);var L,D,R=a.readability(O.color,p)<1.5?d.contrast(p):O.color,I=n.spikemode,P=n.spikethickness,F=n.spikecolor||R,z=g.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(L=z,D=E),-1!==I.indexOf("across")){var N=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(N=Math.min(N,n.position),B=Math.max(B,n.position)),L=l.t+(1-B)*l.h,D=l.t+(1-N)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:L,y2:D,"stroke-width":P,stroke:F,"stroke-dasharray":h.dashStyle(n.spikedash,P)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:L,y2:D,"stroke-width":P+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:z-("top"!==n.side?P:-P),r:P,fill:F}).classed("spikeline",!0)}}}function z(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function N(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function H(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],h=c[1],d=u[0],p=u[1];return{x:f,y:h,width:d-f,height:p-h,top:Math.min(h,p),left:Math.min(f,d),right:Math.max(f,d),bottom:Math.max(h,p)}}},{"../../lib":400,"../../lib/events":391,"../../lib/override_cursor":411,"../../lib/svg_text_utils":426,"../../plots/cartesian/axes":450,"../../registry":490,"../color":257,"../dragelement":276,"../drawing":279,"../legend/defaults":309,"../legend/draw":310,"./constants":291,"./helpers":293,"@plotly/d3":14,"fast-isnumeric":121,tinycolor2:205}],295:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.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":400,"../color":257,"./helpers":293}],296:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":400,"./layout_attributes":298}],297:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":400,"../dragelement":276,"./attributes":288,"./calc":289,"./click":290,"./constants":291,"./defaults":292,"./helpers":293,"./hover":294,"./layout_attributes":298,"./layout_defaults":299,"./layout_global_defaults":300,"@plotly/d3":14}],298:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes"),a=i({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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),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":478,"./constants":291}],299:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":400,"./hoverlabel_defaults":295,"./hovermode_defaults":296,"./layout_attributes":298}],300:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":400,"./hoverlabel_defaults":295,"./layout_attributes":298}],301:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("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:a({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"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),h=0;h1){if(!h&&!d&&!p)"independent"===M("pattern")&&(h=!0);v._hasSubplotGrid=h;var b,x,_="top to bottom"===M("roworder"),w=h?.2:.1,A=h?.3:.1;g&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),v._domains={x:u("x",M,w,b,y),y:u("y",M,A,x,m,_)}}else delete e.grid}function M(t,e){return n.coerce(r,v,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,g=r.rows,v=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(g);var x=1;for(n=0;n1);if(!1===_&&(e.legend=void 0),(!1!==_||f.uirevision)&&(d("uirevision",e.uirevision),!1!==_)){d("bgcolor",e.paper_bgcolor),d("bordercolor"),d("borderwidth");var w,A,M,T=i.coerceFont(d,"font",e.font),k="h"===d("orientation");if(k?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(A=1.1,M="bottom"):(A=-.1,M="top")):(w=1.02,A=1,M="auto"),d("traceorder",b),c.isGrouped(e.legend)&&d("tracegroupgap"),d("entrywidth"),d("entrywidthmode"),d("itemsizing"),d("itemwidth"),d("itemclick"),d("itemdoubleclick"),d("groupclick"),d("x",w),d("xanchor"),d("y",A),d("yanchor",M),d("valign"),i.noneOrAll(f,h,["x","y"]),d("title.text")){d("title.side",k?"left":"top");var S=i.extendFlat({},T,{size:i.bigFont(T.size)});i.coerceFont(d,"title.font",S)}}}},{"../../lib":400,"../../plot_api/plot_template":439,"../../plots/attributes":446,"../../plots/layout_attributes":486,"../../registry":490,"./attributes":307,"./helpers":313}],310:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),g=p.LINE_SPACING,v=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function w(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function A(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!u,p=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var g=i.ensureSingle(t,"text","legendtext");g.attr("text-anchor","start").call(c.font,a).text(h?M(n,p):n);var v=r.itemwidth+2*d.itemGap;f.positionText(g,v,0),h?g.call(f.makeEditable,{gd:e,text:n}).call(k,t,e,r).on("edit",(function(n){this.text(M(n,p)).call(k,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),c=h.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):k(g,t,e,r)}function M(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.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||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function k(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,h,p=s.size*g;if(o){var v=c.bBox(o);u=v.height,h=v.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var m=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(u=p*y,h=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),f.positionText(m,l+d.titlePad,l+p);else{var x=2*d.itemGap+r.itemwidth;i.groupTitle&&(x=d.itemGap,h-=r.itemwidth),f.positionText(m,x,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=p,i.height=Math.max(u,16)+3,i.width=h)}(e,r,n,i)}))}function S(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function C(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,p=e._inHover;p?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(p){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var g=f.hiddenlabels||[];if(!(p||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),a.autoMargin(t,"legend");var M=i.ensureSingle(r,"g","legend",(function(t){p||t.attr("pointer-events","all")})),E=i.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),O=i.ensureSingle(M,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));O.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var L=i.ensureSingle(M,"g","scrollbox"),D=e.title;if(e._titleWidth=0,e._titleHeight=0,D.text){var R=i.ensureSingle(L,"text","legendtitletext");R.attr("text-anchor","start").call(c.font,D.font).text(D.text),k(R,L,t,e,1)}else L.selectAll(".legendtitletext").remove();var I=i.ensureSingle(M,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(u.fill,d.scrollBarColor)})),P=L.selectAll("g.groups").data(s);P.enter().append("g").attr("class","groups"),P.exit().remove();var F=P.selectAll("g.traces").data(i.identity);F.enter().append("g").attr("class","traces"),F.exit().remove(),F.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==g.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(A,t,e)})).call(b,t,e).each((function(){p||n.select(this).call(T,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),u="fraction"===i.entrywidthmode,f=i.borderwidth,h=2*f,p=d.itemGap,g=i.itemwidth+2*p,v=2*(f+p),m=C(i),y=i.y<0||0===i.y&&"top"===m,b=i.y>1||1===i.y&&"bottom"===m,w=i.tracegroupgap,A={};i._maxHeight=Math.max(y||b?a.height/2:o.h,30);var M=0;i._width=0,i._height=0;var T=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+T[0],f+T[1]+i._height+e/2+p),i._height+=e,i._width=Math.max(i._width,t[0].width)})),M=g+i._width,i._width+=p+g+h,i._height+=v,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var k=S(i),E=i.x<0||0===i.x&&"right"===k,O=i.x>1||1===i.x&&"left"===k,L=b||y,D=a.width/2;i._maxWidth=Math.max(E?L&&"left"===k?o.l+o.w:D:O?L&&"right"===k?o.r+o.w:D:o.w,2*g);var R=0,I=0;r.each((function(t){var e=_(t,i,g);R=Math.max(R,e),I+=e})),M=null;var P=0;if(l){var F=0,z=0,N=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,i,g),a=r[0].height;c.setTranslate(this,T[0],T[1]+f+p+a/2+e),e+=a,t=Math.max(t,n),A[r[0].trace.legendgroup]=t}));var r=t+p;z>0&&r+f+z>i._maxWidth?(P=Math.max(P,z),z=0,N+=F+w,F=e):F=Math.max(F,e),c.setTranslate(this,z,N),z+=r})),i._width=Math.max(P,z)+f,i._height=N+F+v}else{var B=r.size(),j=I+h+(B-1)*p=i._maxWidth&&(P=Math.max(P,Y),H=0,V+=U,i._height+=U,U=0),c.setTranslate(this,T[0]+f+H,T[1]+f+V+e/2+p),Y=H+r+p,H+=n,U=Math.max(U,e)})),j?(i._width=H+h,i._height=U+v):(i._width=Math.max(P,Y)+h,i._height+=U+v)}}i._width=Math.ceil(Math.max(i._width+T[0],i._titleWidth+2*(f+d.titlePad))),i._height=Math.ceil(Math.max(i._height+T[1],i._titleHeight+2*(f+d.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,q=G.legendText||G.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=t[0].trace.legendgroup,o=_(t,i,g);l&&""!==a&&(o=A[a]);var f=q?g:M||o;s||u||(f+=p/2),c.setRect(e,0,-r/2,f,r)}))}(t,P,F,e)},function(){var s,u,g,y,b=f._size,x=e.borderwidth;if(!p){if(function(t){var e=t._fullLayout.legend,r=S(e),n=C(e);return a.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))return;var _=b.l+b.w*e.x-v[S(e)]*e._width,A=b.t+b.h*(1-e.y)-v[C(e)]*e._effHeight;if(f.margin.autoexpand){var T=_,k=A;_=i.constrain(_,0,f.width-e._width),A=i.constrain(A,0,f.height-e._effHeight),_!==T&&i.log("Constrain legend.x to make legend fit inside graph"),A!==k&&i.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(M,_,A)}if(I.on(".drag",null),M.on("wheel",null),p||e._height<=e._maxHeight||t._context.staticPlot){var D=e._effHeight;p&&(D=e._height),O.attr({width:e._width-x,height:D-x,x:x/2,y:x/2}),c.setTranslate(L,0,0),E.select("rect").attr({width:e._width-2*x,height:D-2*x,x:x,y:x}),c.setClipUrl(L,h,t),c.setRect(I,0,0,0,0),delete e._scrollY}else{var R,P,F,z=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),N=e._effHeight-z-2*d.scrollBarMargin,B=e._height-e._effHeight,j=N/B,U=Math.min(e._scrollY||0,B);O.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),E.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),c.setClipUrl(L,h,t),Y(U,z,j),M.on("wheel",(function(){Y(U=i.constrain(e._scrollY+n.event.deltaY/N*B,0,B),z,j),0!==U&&U!==B&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;R="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,F=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(P="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Y(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,B)}(F,R,P),z,j))}));I.call(H);var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(R=t.changedTouches[0].clientY,F=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(P=t.changedTouches[0].clientY,Y(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,B)}(F,R,P),z,j))}));L.call(V)}function Y(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(L,0,-r),c.setRect(I,e._width,d.scrollBarMargin+r*i,d.scrollBarWidth,n),E.select("rect").attr("y",x+r)}t._context.edits.legendPosition&&(M.classed("cursor-move",!0),l.init({element:M.node(),gd:t,prepFn:function(){var t=c.getTranslate(M);g=t.x,y=t.y},moveFn:function(t,r){var n=g+t,i=y+r;c.setTranslate(M,n,i),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),u=l.align(i,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=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}));i.size()>0&&w(t,M,i,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":373,"../../lib":400,"../../lib/events":391,"../../lib/svg_text_utils":426,"../../plots/plots":488,"../../registry":490,"../color":257,"../dragelement":276,"../drawing":279,"./constants":308,"./get_legend_data":311,"./handle_click":312,"./helpers":313,"./style":315,"@plotly/d3":14}],311:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,h={},d=0,p=0;function g(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+d;u.push(n),c[n]=[r],d++}}for(r=0;rT&&(M=T)}w[r][0]._groupMinRank=M,w[r][0]._preGroupSort=r}var k=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*d.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function A(t,a,o){var u=t[0].trace,f=u.marker||{},h=f.line||{},d=o?u.visible&&u.type===o:i.traceIs(u,"bar"),p=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(d?[t]:[]);p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var d=a.mcc;if(!r._inHover&&"mc"in a){var p=c(f),g=p.mid;void 0===g&&(g=(p.max+p.min)/2),d=s.tryColorscale(f,"")(g)}var m=d||a.mc||f.color,y=f.pattern,b=y&&s.getPatternAttr(y.shape,0,"");if(b){var x=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),A=y.fgopacity,M=v(y.size,8,10),T=v(y.solidity,.5,1),k="legend-"+u.uid;i.call(s.pattern,"legend",e,k,b,M,T,d,y.fillmode,x,_,A)}else i.call(l.fill,m);o&&l.stroke(i,a.mlc||h.color)}))}function M(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,d=w(h(u.width,o.pts),u,5,2),p=a.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=u.color;var g=a.minExtend(o,{trace:p});f(c,g,p)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.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,i=t[0].trace,o=[];if(i.visible)switch(i.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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),h=c(i),d=h.colorscale,g=h.reversescale;if(d){if(!r){var v=d.length;u=0===o?d[g?v-1:0][1]:1===o?d[g?0:v-1][1]:d[Math.floor((v-1)/2)][1]}}else{var m=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,p(g,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,A(t,this,"waterfall")}var a=[];e.visible&&r&&(a=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(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){A(t,this,"funnel")})).each((function(t){A(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){M(t,this,"funnelarea")})).each((function(t){M(t,this,"pie")})).each((function(t){var r,i,o=g(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,v=o.anyFill,m=o.anyLine,y=t[0],x=y.trace,_=c(x),A=_.colorscale,M=_.reversescale,T=u.hasMarkers(x)||!v?"M5,0":m?"M5,-2":"M5,-3",k=n.select(this),S=k.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",T+"h"+b+"v6h-"+b+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,p(M),A,"fill")}})),f||h){var C=w(void 0,x.line,10,5);i=a.minExtend(x,{line:{width:C}}),r=[a.minExtend(y,{trace:i})]}var E=k.select(".legendlines").selectAll("path").data(f||h?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",T+(h?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(M),A,"stroke")}})})).each((function(t){var r,i,o=g(t),l=o.anyFill,c=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,v=!h&&!c&&!l&&u.hasText(p);function m(t,e,r,n){var i=a.nestedProperty(p,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||v||f){var x={},w={};if(h){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",a.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var A=m("marker.size",a.mean,[2,16],12);x.ms=A,w.marker.size=A}f&&(w.line={width:m("line.width",b,[0,10],5)}),v&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[a.minExtend(d,x)],(i=a.minExtend(p,w)).selectedpoints=null,i.texttemplate=null}var M=n.select(this).select("g.legendpoints"),T=M.selectAll("path.scatterpts").data(h?r:[]);T.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),T.exit().remove(),T.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var k=M.selectAll("g.pointtext").data(v?r:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),k.exit().remove(),k.selectAll("text").call(s.textPointStyle,i,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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":400,"../../registry":490,"../../traces/pie/helpers":532,"../../traces/pie/style_one":533,"../../traces/scatter/subtypes":564,"../color":257,"../colorscale/helpers":268,"../drawing":279,"./constants":308,"@plotly/d3":14}],316:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":318}],317:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h=c._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,g=(1+p)/2,v=(1-p)/2;for(i=0;i1?(D=["toggleHover"],R=["resetViews"]):m?(L=["zoomInGeo","zoomOutGeo"],D=["hoverClosestGeo"],R=["resetGeo"]):v?(D=["hoverClosest3d"],R=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(L=["zoomInMapbox","zoomOutMapbox"],D=["toggleHover"],R=["resetViewMapbox"]):x?D=["hoverClosestGl2d"]:y?D=["hoverClosestPie"]:T?(D=["hoverClosestCartesian","hoverCompareCartesian"],R=["resetViewSankey"]):D=["toggleHover"];g&&(D=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var g=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=z[r+1];else if(t=n.pmax)e=z[r+1];else if(t=0;M--){var T=r.append("path").attr(v).style("opacity",M?.1:m).call(o.stroke,b).call(o.fill,y).call(s.dashLine,M?"solid":_,M?4+x:x);if(p(T,t,a),w){var k=l(t.layout,"selections",a);T.style({cursor:"move"});var S={element:T.node(),plotinfo:d,gd:t,editHelpers:k,isActiveSelection:!0},C=n(c,t);i(C,T,S)}else T.style("pointer-events",M?"all":"none");A[M]=T}var E=A[0];A[1].node().addEventListener("click",(function(){return function(t,e){if(!h(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void g(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=g,f(t)}}(t,E)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function g(t){h(t)&&(t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t)))}e.exports={draw:f,drawOne:d,activateLastSelection:function(t){if(!h(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=g,f(t)}}},{"../../plot_api/plot_template":439,"../color":257,"../drawing":279,"../shapes/display_outlines":351,"../shapes/draw_newshape/helpers":356,"../shapes/handle_outline":358,"../shapes/helpers":359}],341:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":392,"../../drawing/attributes":278}],342:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],343:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,i=t("../../shapes/handle_outline").clearOutline,a=t("../../shapes/draw_newshape/helpers"),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,f=e.plotinfo,h=f.xaxis,d=f.yaxis,p=e.isActiveSelection,g=e.dragmode,v=(c.layout||{}).selections||[];if(!n(g)&&void 0!==p){var m=c._fullLayout._activeSelectionIndex;if(m-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(m)){q(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=K(_))){for(o&&o.remove(),v=0;v=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=d(r),l=g(r);if(s||l){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&i._fullLayout._outlining)s&&(c=A(f,t)),c&&a.call("_guiRelayout",i,{shapes:c}),l&&!U(t)&&(u=M(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:u}).then((function(){e&&T(i)}))),i._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function X(t){return t._id}function Z(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(X),c=r.map(X);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,dt=et[0].yref;if(nt&&dt){var pt=ct(et);ut([O(t,nt,"x"),O(t,dt,"y")])($,pt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),h._reselect=!1}if(!a&&h._deselect){var gt=h._deselect;(function(t,e,r){for(var n=0;n=0)M._fullLayout._deactivateShape(M);else if(!b){var r=T.clickmode;E.done(Tt).then((function(){if(E.clear(Tt),2===t){for(xt.remove(),K=0;K-1&&H(e,M,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&ft(M,void 0);l.click(M,e)})).catch(k.error)}},n.doneFn=function(){Mt.remove(),E.done(Tt).then((function(){E.clear(Tt),!S&&J&&n.selectionDefs&&(J.subtract=bt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,X)),(S||b)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(kt),x&&ft(M,at)})).catch(k.error)}},clearOutline:b,clearSelectionsCache:W,selectOnClick:H}},{"../../lib":400,"../../lib/clear_gl_canvases":386,"../../lib/polygon":412,"../../lib/throttle":427,"../../plot_api/subroutines":440,"../../plots/cartesian/axis_ids":454,"../../registry":490,"../color":257,"../dragelement/helpers":275,"../drawing":279,"../fx":297,"../fx/helpers":293,"../shapes/constants":349,"../shapes/display_outlines":351,"../shapes/draw_newshape/helpers":356,"../shapes/draw_newshape/newshapes":357,"../shapes/handle_outline":358,"../shapes/helpers":359,"./constants":338,"./draw":340,"./draw_newselection/newselections":343,"./helpers":344,"point-in-polygon/nested":183,polybooljs:184}],347:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{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":374,"../../lib/extend":392,"../../plot_api/plot_template":439,"../../traces/scatter/attributes":539,"../annotations/attributes":240,"../drawing/attributes":278}],348:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,f),d=n.aggNums(Math.min,null,f),p=d<0?Math.abs(d)+c:c,g=h>0?h+c:c;return{ppad:c,ppadplus:u?p:g,ppadminus:u?g:p}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]: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;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===C&&(t[0][0]="M"),e[S]=t,A(),M())}}()}}function N(t,r){!function(t,r){if(e.length)for(var n=0;nb?(M=f,C="y0",T=b,E="y1"):(M=b,C="y1",T=f,E="y0");Z(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===R?J:K,X.altKey=n.altKey},doneFn:function(){if(y(t))return;d(e),$(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(y(t))return;$(s)}};function Z(r){if(y(t))R=null;else if(F)R="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(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!z&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";d(e,l),R=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;I?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=q(A+i)):(l=function(t){return q(Y(t)+i)},U&&"date"===U.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else I?N("xanchor",r.xanchor=G(x+n)):(N("x0",r.x0=G(c+n)),N("x1",r.x1=G(m+n))),P?N("yanchor",r.yanchor=q(A+i)):(N("y0",r.y0=q(f+i)),N("y1",r.y1=q(b+i)));e.attr("d",v(t,r)),Q(s,r)}function K(n,i){if(z){var a=function(t){return t},o=a,l=a;I?N("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(V(t)+n)},B&&"date"===B.type&&(o=g.encodeDate(o))),P?N("yanchor",r.yanchor=q(A+i)):(l=function(t){return q(Y(t)+i)},U&&"date"===U.type&&(l=g.encodeDate(l))),N("path",r.path=w(D,o,l))}else if(F){if("resize-over-start-point"===R){var u=c+n,h=P?f-i:f+i;N("x0",r.x0=I?u:G(u)),N("y0",r.y0=P?h:q(h))}else if("resize-over-end-point"===R){var d=m+n,p=P?b-i:b+i;N("x1",r.x1=I?d:G(d)),N("y1",r.y1=P?p:q(p))}}else{var y=function(t){return-1!==R.indexOf(t)},_=y("n"),j=y("s"),H=y("w"),W=y("e"),X=_?M+i:M,Z=j?T+i:T,J=H?k+n:k,K=W?S+n:S;P&&(_&&(X=M-i),j&&(Z=T-i)),(!P&&Z-X>10||P&&X-Z>10)&&(N(C,r[C]=P?X:q(X)),N(E,r[E]=P?Z:q(Z))),K-J>10&&(N(O,r[O]=I?J:G(J)),N(L,r[L]=I?K:G(K)))}e.attr("d",v(t,r)),Q(s,r)}function Q(t,e){(I||P)&&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 a=V(I?e.xanchor:i.midRange(r?[e.x0,e.x1]:g.extractPathCoords(e.path,p.paramIsX))),o=Y(P?e.yanchor:i.midRange(r?[e.y0,e.y1]:g.extractPathCoords(e.path,p.paramIsY)));if(a=g.roundPositionForSharpStrokeRendering(a,1),o=g.roundPositionForSharpStrokeRendering(o,1),I&&P){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,I,l,e,r,R):!0===l.editable&&I.style("pointer-events",L||c.opacity(S)*k<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!b(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,m(t)}}(t,I)}))}}function _(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 w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,i=t.charAt(0),a=p.paramIsX[i],o=p.paramIsY[i],s=p.numParams[i];return i+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){b(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,m(t)))}e.exports={draw:m,drawOne:x,eraseActiveShape:function(t){if(!b(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&ld&&(t="X"),t}));return a>d&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+p}))}(e,s,c);if("pixel"===e.xsizemode){var x=s(e.xanchor);u=x+e.x0,f=x+e.x1}else u=s(e.x0),f=s(e.x1);if("pixel"===e.ysizemode){var _=c(e.yanchor);h=_-e.y0,d=_-e.y1}else h=c(e.y0),d=c(e.y1);if("line"===p)return"M"+u+","+h+"L"+f+","+d;if("rect"===p)return"M"+u+","+h+"H"+f+"V"+d+"H"+u+"Z";var w=(u+f)/2,A=(h+d)/2,M=Math.abs(w-u),T=Math.abs(A-h),k="A"+M+","+T,S=w+M+","+A;return"M"+S+k+" 0 1,1 "+(w+","+(A-T))+k+" 0 0,1 "+S+"Z"}},{"../../lib":400,"../../plots/cartesian/axes":450,"./constants":349}],360:[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":461,"./attributes":347,"./calc_autorange":348,"./defaults":350,"./draw":352,"./draw_newshape/defaults":355}],361:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps: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:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt: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":392,"../../plot_api/edit_types":432,"../../plot_api/plot_template":439,"../../plots/animation_attributes":444,"../../plots/font_attributes":478,"../../plots/pad_attributes":487,"./constants":362}],362:[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}},{}],363:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function E(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,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(T,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function L(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,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=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,v(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return F.call(z),R&&(C?F.on(".opacity",null):(T=0,k=!0,F.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),F.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(z)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),F.classed("js-placeholder",k),A}}},{"../../constants/alignment":373,"../../constants/interactions":377,"../../lib":400,"../../lib/svg_text_utils":426,"../../plots/plots":488,"../../registry":490,"../color":257,"../drawing":279,"@plotly/d3":14,"fast-isnumeric":121}],367:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":392,"../../plot_api/edit_types":432,"../../plot_api/plot_template":439,"../../plots/font_attributes":478,"../../plots/pad_attributes":487,"../color/attributes":256}],368:[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"}}},{}],369:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(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,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":400,"../../plots/array_container_defaults":445,"./attributes":367,"./constants":368}],370:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function g(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),v(t,n,i,a,e),s||m(t,n,i,a,e))}function v(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(k,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(p(r,i)?-1:i._index)),m(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(A,i)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=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(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),d=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,v=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?v=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(v=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+v+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},M={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(k,o,x),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(g(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(g(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(A,o),u.call(_,o)}))})),u.call(_,o),b?(M.w=Math.max(m.openWidth,m.headerWidth),M.h=x.y-M.t):(M.w=x.x-M.l,M.h=Math.max(m.openHeight,m.headerHeight)),M.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,d=i.active;if(u)for(s=0,l=0;l0?[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(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,T=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,S=p,C=v+m;C+k>c&&(C=c-k);var E=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),M?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:T,height:k}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var O=m>A,L=s.barWidth+2*s.barPad,D=s.barLength+2*s.barPad,R=p+g,I=v;R+L>l&&(R=l-L);var P=this.container.selectAll("rect.scrollbar-vertical").data(O?[0]:[]);P.exit().on(".drag",null).remove(),P.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),O?(this.vbar=P.attr({rx:s.barRadius,ry:s.barRadius,x:R,y:I,width:L,height:D}),this._vbarYMin=I+D/2,this._vbarTranslateMax=A-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,z=u-.5,N=O?f+L+.5:f+.5,B=h-.5,j=M?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+F).data(M||O?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),M||O?(this._clipRect=U.select("rect").attr({x:Math.floor(z),y:Math.floor(B),width:Math.ceil(N)-Math.floor(z),height:Math.ceil(j)-Math.floor(B)}),this.container.call(a.setClipUrl,F,this.gd),this.bg.attr({x:p,y:v,width:g,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),M||O){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(V),O&&this.vbar.on(".drag",null).call(V)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":400,"../color":257,"../drawing":279,"@plotly/d3":14}],373:[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"}}},{}],374:[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(" ")}}},{}],375:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],376:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],377:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],378:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],379:[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}},{}],380:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],382:[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}},{}],383:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,h,d,p,g=l([r,n]);function v(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}g?(u=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":407}],384:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(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(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?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),A=t.match(w?b:y);if(!A)return u;var M=A[1],T=A[3]||"1",k=Number(A[5]||1),S=Number(A[7]||0),C=Number(A[9]||0),E=Number(A[11]||0);if(c){if(2===M.length)return u;var O;M=Number(M);try{var L=v.getComponentMethod("calendars","getCal")(e);if(w){var D="i"===T.charAt(T.length-1);T=parseInt(T,10),O=L.newDate(M,L.toMonthIndex(M,T,D),k)}else O=L.newDate(M,Number(T),k)}catch(t){return u}return O?(O.toJD()-g)*f+S*h+C*d+E*p:u}M=2===M.length?(Number(M)+2e3-x)%100+x:Number(M),T-=1;var R=new Date(Date.UTC(2e3,T,k,S,C));return R.setUTCFullYear(M),R.getUTCMonth()!==T||R.getUTCDate()!==k?u:R.getTime()+E*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var A=90*f,M=3*h,T=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var S=Math.floor(w/f)+g,C=Math.floor(l(t,f));try{a=v.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a("%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 s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,C=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function O(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(C,(function(){return E[r("%q")(i)]})),_(n))try{t=v.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var L=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),L[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+O(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return O(e,t,n,i)};var D=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+g,a=v.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-g)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+D);return c.setUTCMonth(c.getUTCMonth()+e)+n-D},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&v.getComponentMethod("calendars","getCal")(e),u=0;u1||g<0||g>1?null:{x:t+l*g,y:e+f*g}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,d=c-a,p=u*u+f*f,g=h*h+d*d,v=Math.min(l(u,f,p,i-t,a-e),l(u,f,p,o-t,c-e),l(h,d,g,t-i,e-a),l(h,d,g,r-i,n-a));return Math.sqrt(v)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var d=h(c);d;){if((c+=d+r)>f)return;d=h(c)}for(d=h(f);d;){if(c>(f-=d+r))return;d=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":407}],396:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,d,p,g=t.color,v=l(g),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=v?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,v||m)for(var x=0;x1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],400:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var d=t("./array");f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=t("./mod");f.mod=p.mod,f.modHalf=p.modHalf;var g=t("./coerce");f.valObjectMeta=g.valObjectMeta,f.coerce=g.coerce,f.coerce2=g.coerce2,f.coerceFont=g.coerceFont,f.coercePattern=g.coercePattern,f.coerceHoverinfo=g.coerceHoverinfo,f.coerceSelectionMarkerOpacity=g.coerceSelectionMarkerOpacity,f.validate=g.validate;var v=t("./dates");f.dateTime2ms=v.dateTime2ms,f.isDateTime=v.isDateTime,f.ms2DateTime=v.ms2DateTime,f.ms2DateTimeLocal=v.ms2DateTimeLocal,f.cleanDate=v.cleanDate,f.isJSDate=v.isJSDate,f.formatDate=v.formatDate,f.incrementMonth=v.incrementMonth,f.dateTick0=v.dateTick0,f.dfltRange=v.dfltRange,f.findExactDates=v.findExactDates,f.MIN_MS=v.MIN_MS,f.MAX_MS=v.MAX_MS;var m=t("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var A=t("./extend");f.extendFlat=A.extendFlat,f.extendDeep=A.extendDeep,f.extendDeepAll=A.extendDeepAll,f.extendDeepNoArrays=A.extendDeepNoArrays;var M=t("./loggers");f.log=M.log,f.warn=M.warn,f.error=M.error;var T=t("./regex");f.counterRegex=T.counter;var k=t("./throttle");f.throttle=k.throttle,f.throttleDone=k.done,f.clearThrottle=k.clear;var S=t("./dom");function C(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.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},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return I.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var P={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return N.apply(P,arguments)};var F={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return N.apply(F,arguments)};var z=/^[:|\|]/;function N(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,h,d="_xother"===s||"_yother"===s,p="_xother_"===s||"_yother_"===s,g="xother_"===s||"yother_"===s,v="xother"===s||"yother"===s||d||g||p,m=s;if((d||p)&&(m=m.substring(1)),(g||p)&&(m=m.substring(0,m.length-1)),v){if(void 0===(c=e[m]))return""}else for(h=3;h=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var B=2e9;f.seedPseudoRandom=function(){B=2e9},f.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?f.pseudoRandom():B/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.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;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.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)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":378,"./anchor_utils":382,"./angles":383,"./array":384,"./clean_number":385,"./clear_responsive":387,"./coerce":388,"./dates":389,"./dom":390,"./extend":392,"./filter_unique":393,"./filter_visible":394,"./geometry2d":395,"./identity":398,"./increment":399,"./is_plain_object":401,"./keyed_container":402,"./localize":403,"./loggers":404,"./make_trace_groups":405,"./matrix":406,"./mod":407,"./nested_property":408,"./noop":409,"./notifier":410,"./preserve_drawing_buffer":414,"./push_unique":415,"./regex":417,"./relative_attr":418,"./relink_private":419,"./search":420,"./sort_object_keys":423,"./stats":424,"./throttle":427,"./to_log_range":428,"@plotly/d3":14,"d3-format":52,"d3-time-format":53,"fast-isnumeric":121}],401:[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).hasOwnProperty("hasOwnProperty")}},{}],402:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":437,"./notifier":410}],405:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":14}],406:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],408:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,h,d,p,g=r.length,v=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(h,m)))if(cu||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":378,"./matrix":406}],413:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e,a){var o=t._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[],cachedCode:a||{}})}catch(t){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":422,regl:198}],414:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":121,"is-mobile":164}],415:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}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 a,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?u:c,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":384,"fast-isnumeric":121}],425:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":35}],426:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,g){var k=t.text(),S=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&k.match(l),O=n.select(t.node().parentNode);if(!O.empty()){var L=t.attr("class")?t.attr("class").split(" ")[0]:"text";return L+="-math",O.selectAll("svg."+L).remove(),O.selectAll("g."+L+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),S?(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 a,o,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2!==h&&3!==h)return void i.warn("No MathJax version:",MathJax.version);var d=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(a):MathJax.typeset([a])},p=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),d,p,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){d(),p(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}(S[2],o,(function(n,i,o){O.selectAll("svg."+L).remove(),O.selectAll("g."+L+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return D(),void e();var l=O.append("g").classed(L+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:L,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",h=s.select("g");h.attr({fill:f,stroke:f});var d=h.node().getBoundingClientRect(),p=d.width,v=d.height;(p>c||v>u)&&(s.style("overflow","hidden"),p=(d=s.node().getBoundingClientRect()).width,v=d.height);var m=+t.attr("x"),y=+t.attr("y"),b=-(r||t.node().getBoundingClientRect().height)/4;if("y"===L[0])l.attr({transform:"rotate("+[-90,m,y]+")"+a(-p/2,b-v/2)});else if("l"===L[0])y=b-v/2;else if("a"===L[0]&&0!==L.indexOf("atitle"))m=0,y=b;else{var x=t.attr("text-anchor");m-=p*("middle"===x?.5:"end"===x?1:0),y=y+b-v/2}s.attr({x:m,y:y}),g&&g.call(t,l),e(l)}))}))):D(),t}function D(){O.empty()||(L=t.attr("class")+"-math",O.select("svg."+L).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(v," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(m),O=0;O|>|>)/g;var f=[["$","$"],["\\(","\\)"]];var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},g=["http:","https:","mailto:","",void 0,":"],v=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&C(n)}var T=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(m),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,p-i)+"..."):o.push(u.substr(0,p));break}s=""}}return o.join("")};var k={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(S,(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)):k[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==g.indexOf(i)&&-1!==g.indexOf(a)?e:""}function O(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=C,r.sanitizeHTML=function(t){t=t.replace(v," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(m),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.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)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],428:[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":121}],429:[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"}}},{}],430:[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"}}},{}],431:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&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 a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,g=Object.keys(t);for(e=0;e3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),p(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;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.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 a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!g&&(h(v,m),d(t),!0)}var b,x,_,w,A,M,T,k,S=Object.keys(r).map(Number).sort(o),C=e.get(),E=C||[],O=u(m,f).get(),L=[],D=-1,R=E.length;for(b=0;bE.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==M)A.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(M)?L.push(_):T?("add"===M&&(M={}),E.splice(_,0,M),O&&O.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,M),-1===D&&(D=_);else for(x=0;x=0;b--)E.splice(L[b],1),O&&O.splice(L[b],1);if(E.length?C||e.set(E):e.set(null),g)return!1;if(h(v,m),p!==i){var I;if(-1===D)I=S;else{for(R=Math.max(E.length,R),I=[],b=0;b=D);b++)I.push(_);for(b=D;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function D(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),L(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&L(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in L(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=O(r,t.data.length-1),e)for(var g=0;g-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(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 i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(H(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&V(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(k)),s.push(h.rehover,h.redrag,h.reselect),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[d.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function V(t,e){var r=e?function(t){var r=[];for(var n in e){var i=d.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return d.draw(t,r,{skipTitle:!0})}:function(t){return d.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var Y=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,h=z(l._preGUI,c),p=Object.keys(e),g=d.list(t),v=o.extendDeepAll({},e),m={};for(j(e),p=Object.keys(e),n=0;n0&&"string"!=typeof R.parts[P];)P--;var N=R.parts[P],B=R.parts[P-1]+"."+N,U=R.parts.slice(0,P).join("."),H=s(t.layout,U).get(),V=s(l,U).get(),W=R.get();if(void 0!==I){k[D]=I,S[D]="reverse"===N?I:F(W);var Z=f.getLayoutValObject(l,R.parts);if(Z&&Z.impliedEdits&&null!==I)for(var J in Z.impliedEdits)C(o.relativeAttr(D,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(D))if(I){C("autosize",null);var K="height"===D?"width":"height";C(K,l[K])}else l[D]=t._initialAutoSize[D];else if("autosize"===D)C("width",I?null:l.width),C("height",I?null:l.height);else if(B.match(Y))L(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){L(B),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else B.match(q)&&s(l,U+"._inputDomain").set(null);if("type"===N){E=H;var $="linear"===V.type&&"log"===I,tt="log"===V.type&&"linear"===I;if($||tt){if(E&&E.range)if(V.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&C(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),C(U+".range[0]",Math.log(et)/Math.LN10),C(U+".range[1]",Math.log(rt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,et)),C(U+".range[1]",Math.pow(10,rt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[R.parts[0]]&&"radialaxis"===R.parts[1]&&delete l[R.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,V,I,C),u.getComponentMethod("images","convertCoords")(t,V,I,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(N.match(M)){var nt=s(l,D).get(),it=(I||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,C),u.getComponentMethod("images","convertCoords")(t,nt,it,C)}var at=x.containerArrayMatch(D);if(at){r=at.array,n=at.index;var ot=at.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(I)?S[D]=null:x.isRemoveVal(I)?S[D]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(T,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=I,delete e[D]}else"reverse"===N?(H.range?H.range.reverse():(C(U+".autorange",!0),H.range=[1,0]),V.autorange?T.calc=!0:T.plot=!0):("dragmode"===D&&(!1===I&&!1!==W||!1!==I&&!1===W)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===D&&("lasso"===I||"select"===I)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?T.plot=!0:Z?A.update(T,Z):T.calc=!0,R.set(I))}}for(r in m){x.applyContainerArrayChanges(t,h(a,r),m[r],T,h)||(T.plot=!0)}for(var ct in O){var ut=(E=d.getFromId(t,ct))&&E._constraintGroup;if(ut)for(var ft in T.calc=!0,ut)O[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(T.plot=!0),(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:O,undoit:S,redoit:k,eventData:v}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=B(t,o.extendFlat({},e),a),l=s.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var d=[];f.layoutReplot?d.push(w.layoutReplot):l.fullReplot?d.push(r._doPlot):(d.push(h.previousPromises),H(t,f,u)||h.supplyDefaults(t),l.style&&d.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&d.push(w.doColorBars),f.legend&&d.push(w.doLegend),f.layoutstyle&&d.push(w.layoutStyles),f.axrange&&V(d,u.rangesAltered),f.ticks&&d.push(w.doTicksRelayout),f.modebar&&d.push(w.doModeBar),f.camera&&d.push(w.doCamera),d.push(k)),d.push(h.rehover,h.redrag,h.reselect),c.add(t,Z,[t,s.undoit,u.undoit,s.traces],Z,[t,s.redoit,u.redoit,s.traces]);var p=o.syncOrAsync(d,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}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(a,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,h.transition(t,e.frame.data,e.frame.layout,_.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 d(){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 p,g,v=0;function m(t){return Array.isArray(i)?v>=i.length?t.transitionOpts=i[v]:t.transitionOpts=i[0]:t.transitionOpts=i,v++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&MM)&&T.push(g);y=T}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var g=e[n].name,v=(u[g]||p[g]||{}).name,m=e[n].name,y=u[v]||p[v];v&&m&&"number"==typeof m&&y&&T<5&&(T++,o.warn('addFrames: overwriting frame "'+(u[v]||p[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===T&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[g]={name:g},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,s],d=[t,a];return c&&c.add(t,l,f,u,d),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return m(i,e,s)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":400,"../plots/attributes":446}],440:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),g=p.enforce,v=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function b(t){var e,i,s,u,p,g,v=t._fullLayout,m=v._size,b=m.p,_=h.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 a.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var M=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=A(u,M,u.side),u._mainMirrorPosition=u.mirror&&M?A(u,M,d.OPPOSITE_SIDE[u.side]):null}var T=[],k=[],S=[],C=1===l.opacity(v.paper_bgcolor)&&1===l.opacity(v.plot_bgcolor)&&v.paper_bgcolor===v.plot_bgcolor;for(i in v._plots)if((s=v._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,O=s.yaxis.domain,L=s.plotgroup;if(y(E,O,S)){var D=L.node(),R=s.bg=o.ensureSingle(L,"rect","bg");D.insertBefore(R.node(),D.childNodes[0]),k.push(i)}else L.select("rect.bg").remove(),S.push([E,O]),C||(T.push(i),k.push(i))}var I,P,F,z,N,B,j,U,H,V,Y,G,q,W=v._bgLayer.selectAll(".bg").data(T);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){v._plots[t].bg=n.select(this)})),e=0;eA?u.push({code:"unused",traceType:y,templateCount:w,dataCount:A}):A>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:A})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=g(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&v(a)&&t(a,o)}}({data:d,layout:h},""),u.length)return u.map(m)}},{"../lib":400,"../plots/attributes":446,"../plots/plots":488,"./plot_config":437,"./plot_schema":438,"./plot_template":439}],442:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=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,h,d,p;function g(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=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"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),A=m("imageDataOnly"),M=document.createElement("div");M.style.position="absolute",M.style.left="-5000px",document.body.appendChild(M);var T=o.extendFlat({},h);b?T.width=b:null===e.width&&n(p.width)&&(T.width=p.width),x?T.height=x:null===e.height&&n(p.height)&&(T.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(M);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(M._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(M,y,_),n=M._fullLayout.width,f=M._fullLayout.height;function h(){i.purge(M),document.body.removeChild(M)}if("full-json"===y){var d=a.graphJson(M,!1,"keepdata","object",!0,!0);return d.version=u,d=JSON.stringify(d),h(),t(A?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(A?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(M,r,T,k).then(S).then(C).then(E).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":400,"../plots/plots":488,"../snapshot/helpers":494,"../snapshot/svgtoimg":496,"../snapshot/tosvg":498,"../version":599,"./plot_api":436,"fast-isnumeric":121}],443:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&i.push(p("unused",a,m.concat(b.length)));var T,k,S,C,E,O=b.length,L=Array.isArray(M);if(L&&(O=Math.min(O,M.length)),2===x.dimensions)for(k=0;kb[k].length&&i.push(p("unused",a,m.concat(k,b[k].length)));var D=b[k].length;for(T=0;T<(L?Math.min(D,M[k].length):D);T++)S=L?M[k][T]:M,C=y[k][T],E=b[k][T],n.validate(C,S)?E!==C&&E!==+C&&i.push(p("dynamic",a,m.concat(k,T),C,E)):i.push(p("value",a,m.concat(k,T),C))}else i.push(p("array",a,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),i.supplyDefaults(g);for(var v=g._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:i};c=f}for(var h=e.calendar,d="start"===l,p="end"===l,g=t[r+"period0"],v=a(g,h)||0,m=[],y=[],b=[],x=i.length,_=0;_T;)M=o(M,-c,h);for(;M<=T;)M=o(M,c,h);A=o(M,-c,h)}else{for(M=v+(w=Math.round((T-v)/u))*u;M>T;)M-=u;for(;M<=T;)M+=u;A=M-u}m[_]=d?A:p?M:(A+M)/2,y[_]=A,b[_]=M}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":378,"../../lib":400,"fast-isnumeric":121}],448:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],449:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),c=g(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=u[0].val,v=f[0].val;for(r=1;r0&&((A=C-s(b)-l(x))>E?M/A>O&&(_=b,w=x,O=M/A):M/C>O&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},O=M/C));if(h===v){var L=h-1,D=h+1;if(k)if(0===h)i=[0,1];else{var R=(h>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),I=h/(1-Math.min(.5,R/C));i=h>0?[0,I]:[I,0]}else i=S?[Math.max(0,L),Math.max(1,D)]:[L,D]}else k?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-O*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),O=(w.val-_.val-d(e,b.val,x.val))/(C-s(_)-l(w)),i=[_.val-O*s(_),w.val+O*l(w)];return m&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=T(r.vpadplus||r.vpad),E=T(r.vpadminus||r.vpad);if(!A){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=a),a>d&&a-o&&(h=a),a>d&&a=D;n--)L(n);return{min:p,max:g,opts:r}},concatExtremes:g};function g(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function h(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function b(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":279,"../../constants/numerical":378,"../../lib":400,"../../registry":490,"./axis_ids":454,"@plotly/d3":14,"fast-isnumeric":121}],450:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),g=t("../../constants/numerical"),v=g.ONEMAXYEAR,m=g.ONEAVGYEAR,y=g.ONEMINYEAR,b=g.ONEMAXQUARTER,x=g.ONEAVGQUARTER,_=g.ONEMINQUARTER,w=g.ONEMAXMONTH,A=g.ONEAVGMONTH,M=g.ONEMINMONTH,T=g.ONEWEEK,k=g.ONEDAY,S=k/2,C=g.ONEHOUR,E=g.ONEMIN,O=g.ONESEC,L=g.MINUS_SIGN,D=g.BADNUM,R={K:"zeroline"},I={K:"gridline",L:"path"},P={K:"minor-gridline",L:"path"},F={K:"tick",L:"path"},z={K:"tick",L:"text"},N={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},B=t("../../constants/alignment"),j=B.MID_SHIFT,U=B.CAP_SHIFT,H=B.LINE_SPACING,V=B.OPPOSITE_SIDE,Y=e.exports={};Y.setConvert=t("./set_convert");var G=t("./axis_autotype"),q=t("./axis_ids"),W=q.idSort,X=q.isLinked;Y.id2name=q.id2name,Y.name2id=q.name2id,Y.cleanId=q.cleanId,Y.list=q.list,Y.listIds=q.listIds,Y.getFromId=q.getFromId,Y.getFromTrace=q.getFromTrace;var Z=t("./autorange");Y.getAutoRange=Z.getAutoRange,Y.findExtremes=Z.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}Y.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},Y.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},Y.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==Y.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=Y.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},Y.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:Y.getFromId(e,r).cleanPos)(t)},Y.redrawComponents=function(t,e){e=e||Y.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;ur&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},Y.saveRangeInitial=function(t,e){for(var r=Y.list(t,"",!0),n=!1,i=0;i.3*h||u(n)||u(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=Y.tickIncrement(t,"M6","reverse")+1.5*k:a.exactMonths>.8?t=Y.tickIncrement(t,"M1","reverse")+15.5*k:t-=S;var l=Y.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,c,a)),v=y,0;v<=u;)v=Y.tickIncrement(v,m,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(v,0,a),size:m,_dataSpan:u-c}},Y.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=Y.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,Y.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),f=c?e.dtick:+e.dtick.substring(1),h=u?t.dtick:+t.dtick.substring(1);c&&u?tt(f,h)?f===2*T&&h===2*k&&(t.dtick=T):f===2*T&&h===3*k?t.dtick=T:f!==T||(e._input.minor||{}).nticks?et(f/h,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=k:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":tt(f,h)?f>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,h)||(t.dtick=et(f/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},Y.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,Y.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!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=Y.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=C,o&&!n&&t.dtick=(R?0:1);I--){var P=!I;I?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var F=I?t:s.extendFlat({},t,t.minor);if(P?Y.prepMinorTicks(F,t,e):Y.prepTicks(F,e),"array"!==F.tickmode){var z=J(u),N=z[0],B=z[1],j=i(F.dtick),U="log"===a&&!(j||"L"===F.dtick.charAt(0)),H=Y.tickFirst(F,e);if(I){if(t._tmin=H,H=B:W<=B;W=Y.tickIncrement(W,X,f,o)){if(I&&V++,F.rangebreaks&&!f){if(W=d)break}if(O.length>p||W===q)break;q=W;var Z={value:W};I?(U&&W!==(0|W)&&(Z.simpleLabel=!0),l>1&&V%l&&(Z.skipLabel=!0),O.push(Z)):(Z.minor=!0,L.push(Z))}}else I?(O=[],g=nt(t)):(L=[],E=nt(t))}if(R&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=O.map((function(t){return t.value})),Q=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,h=0;f>=y?h=u>=y&&u<=v?u:m:r===x&&f>=_?h=u>=_&&u<=b?u:x:f>=M?h=u>=M&&u<=w?u:A:r===T&&f>=T?h=T:f>=k?h=k:r===S&&f>=S?h=S:r===C&&f>=C&&(h=C),h>=u&&(h=u,s=!0);var d=i+h;if(e.rangebreaks&&h>0){for(var p=0,g=0;g<84;g++){var E=(g+.5)/84;e.maskBreaks(i*(1-E)+E*d)!==D&&p++}(h*=p/84)||(t[n].drop=!0),s&&u>T&&(h=u)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(O,t,t._definedDelta),t.rangebreaks){var at="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=O.length-1;r>-1;r--)if(O[r].drop)O.splice(r,1);else{O[r].value=Dt(O[r].value,t);var lt=t.c2p(O[r].value);(at?st>lt-ot:std||utd&&(ct.periodX=d),ut10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=k&&a<=10||e>=15*k)t._tickround="d";else if(e>=E&&a<=16||e>=C)t._tickround="M";else if(e>=O&&a<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(gt(t.exponentformat)&&!vt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function dt(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}}Y.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>m)e/=m,n=a(10),t.dtick="M"+12*ft(e,n,it);else if(o>A)e/=A,t.dtick="M"+ft(e,1,at);else if(o>k){if(t.dtick=ft(e,k,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=Y.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>C?t.dtick=ft(e,C,at):o>E?t.dtick=ft(e,E,ot):o>O?t.dtick=ft(e,O,ot):(n=a(10),t.dtick=ft(e,n,it))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=a(10),t.dtick="L"+ft(e,n,it)}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))):Lt(t)?(t.tick0=0,n=1,t.dtick=ft(e,n,ut)):(t.tick0=0,n=a(10),t.dtick=ft(e,n,it));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},Y.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ct:lt,f=t+.01*o,h=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},Y.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=mt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||gt(d)&&vt(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":L)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":L)+h:(e.text=mt(Math.pow(10,l),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,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,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),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Lt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=mt(e.x,t,i,n);else{var a=e.x/180;if(0===a)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,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=mt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=L+e.text)}}}}(t,o,r,c,g):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=mt(e.x,t,i,n)}(t,o,0,c,g),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var 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},Y.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return Y.hoverLabelText(t,n,r)+" - "+Y.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=Y.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":L+o:o};var pt=["f","p","n","\u03bc","m","","k","M","G","T"];function gt(t){return"SI"===t||"B"===t}function vt(t){return t>14||t<-15}function mt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=Y.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};ht(h),o=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,L);var d,p=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+d+"":"B"===l&&9===c?t+="B":gt(l)&&(t+=pt[c/3+5]));return a?L+t:t}function yt(t,e){if(t){var r=Object.keys(N).reduce((function(t,r){return-1!==e.indexOf(r)&&N[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function bt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),d.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"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[g]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==c._dfltTitle[p]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=h),!0===e.mirror||"ticks"===e.mirror?i[g]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[g]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}it&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(yt(n,e.automargin),yt(i,e.automargin)),a.autoMargin(t,Tt(e),n),a.autoMargin(t,kt(e),i),a.autoMargin(t,St(e),s)})),r.skipTitle||it&&"bottom"===e.side||rt.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+wt(e);else{var s=Rt(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"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,d,p,g=Y.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,d="top"===e.side?g-r:g+r):(d=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(p={selection:v,side:e.side},v&&v.node()&&v.node().parentNode){var m=h.getTranslate(v.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:p,transform:c,attributes:{x:f,y:d,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function at(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=Mt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},Y.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},Y.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},Y.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=h*U,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=h*(1-U));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(xt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(xt(e)))}},Y.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},Y.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,g=h?t.ticklen:0;if(f?g*=-1:u&&(g=0),h&&(d+=g,r)){var v=s.deg2rad(r);d=g*Math.cos(v)+1,p=g*Math.sin(v)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},A=0,M=t.side,T=t._id.charAt(0),k=t.tickangle;if("x"===T)x=(_=!f&&"bottom"===M||f&&"top"===M)?1:-1,f&&(x*=-1),m=p*x,y=e+d*x,b=_?1:-.2,90===Math.abs(k)&&(f?b+=j:b=-90===k&&"bottom"===M?U:90===k&&"top"===M?j:.5,A=j/2*(k/90)),w.xFn=function(t){return t.dx+m+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*x<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"===T){if(x=(_=!f&&"left"===M||f&&"right"===M)?1:-1,f&&(x*=-1),m=d,y=p*x,b=0,f||90!==Math.abs(k)||(b=-90===k&&"left"===M||90===k&&"right"===M?U:.5),f){var S=i(k)?+k:0;if(0!==S){var C=s.deg2rad(S);A=Math.abs(Math.sin(C))*U*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+A*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*j},w.anchorFn=function(t,e){return i(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},Y.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,_t);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),It(e,[F]),o.attr("transform",r.transFn)},Y.drawGrid=function(t,e,r){r=r||{};var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&Y.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;m--){var y=m?g:v;if(y){var b=y.selectAll("path."+i).data(m?s:o,_t);b.exit().remove(),b.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),b.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?p:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&b.attr("d",r.path)}}It(e,[I,P])},Y.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=Y.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.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 W(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),It(e,[R])},Y.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",d=r.vals.filter((function(t){return t.text})),p=r.labelFns,g=r.secondary?0:e.tickangle,v=(e._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(e.showticklabels?d:[],_t),y=[];function b(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),u=p.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),d=c.lineCount(o),g=H*t.fontSize,v=p.heightFn(t,i(a)?+a:0,(d-1)*g);if(v&&(f+=l(0,v)),s.empty()){var m=o.select("text");m.attr({transform:f,"text-anchor":u}),m.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var y=h.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(y,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,p.xFn(e),p.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){b(r,g)}))):b(r,g)})),It(e,[z]),m.exit().remove(),r.repositionOnUpdate&&m.each((function(t){n.select(this).select("text").call(c.positionText,p.xFn(t),p.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),d=Math.max(l,c),p=e.side,g=1/0,v=-1/0;for(var y in m.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=h.bBox(r.node()),s=0;o?(a.right>d||a.leftd||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},b(m,v+1?v:g);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===v?(x=90,_.push((function(){b(m,v)}))):_.push((function(){if(b(m,g),d.length&&"x"===u&&!i(g)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,a=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=Mt(this),o=h.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,l=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},p=f("top"),v=f("left"),y=f("right"),_=f("bottom")||v||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var v="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,v)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=x(o[s])){u=v;break}var f=i("pattern",u);if(f===v)for(s=0;s<2;s++)(c=x(o[s]))&&(e.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case v: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 m: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 h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]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 a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":490,"./constants":457}],455:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function v(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*b)||A)for(r=0;rR&&zL&&(L=z);h/=(L-O)/(2*D),O=l.l2r(O),L=l.l2r(L),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,i,a)}function H(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 V(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Y(t){D&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),D=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,L)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function q(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},h={},d=(a||{}).xaHash,p=(a||{}).yaHash,g=0;g=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(V(i),2!==t||mt||Yt(),vt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Lt),o.indexOf("event")>-1&&d.click(i,r,e.id);else if(1===t&&mt){var s=g?R:D,c="s"===g||"w"===m?0:1,f=s._name+".range["+c+"]",h=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),p="left",v="middle";if(s.fixedrange)return;g?(v="n"===g?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),i._context.showAxisRangeEntryBoxes&&n.select(xt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:v}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function It(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),i=Math.max(0,Math.min(et,pt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",At.r=At.l,At.t=At.b,Et.attr("d","M0,0Z")}if(At.l=Math.min(_t,n),At.r=Math.max(_t,n),At.t=Math.min(wt,i),At.b=Math.max(wt,i),rt.isSubplotConstrained)a>L||o>L?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?At.t=wt-o:At.b=wt+o):(a=o*tt/et,_t>n?At.l=_t-a:At.r=_t+a),Et.attr("d",G(At))):s();else if(nt.isSubplotConstrained)if(a>L||o>L){St="xy";var l=Math.min(At.l/tt,(et-At.b)/et),c=Math.max(At.r/tt,(et-At.t)/et);At.l=l*tt,At.r=c*tt,At.b=(1-l)*et,At.t=(1-c)*et,Et.attr("d",G(At))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;ug[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":400,"fast-isnumeric":121}],467:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":470}],468:[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 i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":373}],469:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,g=d.BADNUM,v=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,b=d.ONEHOUR,x=d.ONEMIN,_=d.ONESEC,w=t("./axis_ids"),A=t("./constants"),M=A.HOUR_PATTERN,T=A.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function C(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*v*Math.abs(n-i))}return g}function E(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===g){if(!s(e))return g;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function O(e,r,n){return c(e,r,n||t.calendar)}function L(e){return t._categories[Math.round(e)]}function D(e){if(S(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 g}function R(e){if(t._categoriesMap)return t._categoriesMap[e]}function I(t){var e=R(t);return void 0!==e?e:s(t)?+t:void 0}function P(t){return s(t)?+t:R(t)}function F(t,e,r){return n.round(r+e*t,2)}function z(t,e,r){return(t-r)/e}var N=function(e){return s(e)?F(e,t._m,t._b):g},B=function(e){return z(e,t._m,t._b)};if(t.rangebreaks){var j="y"===d;N=function(e){if(!s(e))return g;var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?F(e,t._m2,f):0},B=function(e){var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return z(e,t._m2,t._B[n])}}t.c2l="log"===t.type?C:f,t.l2c="log"===t.type?k:f,t.l2p=N,t.p2l=B,t.c2p="log"===t.type?function(t,e){return N(C(t,e))}:N,t.p2c="log"===t.type?function(t){return k(B(t))}:B,-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=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return C(l(t),e)},t.r2d=t.r2c=function(t){return k(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=C,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=O,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return O(B(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,g,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=D,t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=P(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=L,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=R,t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return L(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(i=0;ip&&(o[n]=p),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][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(s=0;su&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=a.simpleMap(e.xr0,i.r2l),g=a.simpleMap(e.xr1,i.r2l),v=p[1]-p[0],m=g[1]-g[0];d[0]=(p[0]*(1-r)+r*g[0]-p[0])/(p[1]-p[0])*c,d[2]=c*(1-r+r*m/v),i.range[0]=i.l2r(p[0]*(1-r)+r*g[0]),i.range[1]=i.l2r(p[1]*(1-r)+r*g[1])}else d[0]=0,d[2]=c;if(h){var y=a.simpleMap(e.yr0,l.r2l),b=a.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*u,d[3]=u*(1-r+r*_/x),l.range[0]=i.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/d[2]:1,A=h?u/d[3]:1,M=f?d[0]:0,T=h?d[1]:0,k=f?d[0]/d[2]*c:0,S=h?d[1]/d[3]*u:0,C=i._offset-k,E=l._offset-S;n.clipRect.call(o.setTranslate,M,T).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,C,E).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":279,"../../lib":400,"../../registry":490,"./axes":450,"@plotly/d3":14}],475:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],h={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(c,l)){var d=a(c),p=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(v(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(v(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.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"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var A=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&I.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&I.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,f,n),x.cleanPlot(h,l,f,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,H=!(!l._has||!l._has("cartesian"))||j;U&&!H?n._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&p({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=x.layoutAttributes.width.min,d=x.layoutAttributes.height.min;n1,g=!e.height&&Math.abs(r.height-i)>1;(g||p)&&(p&&(r.width=n),g&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a1&&(r.l/=m,r.r/=m)}if(d){var y=(r.t+r.b)/d;y>1&&(r.t/=y,r.b/=y)}var b=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,A=void 0!==r.yb?r.yb:r.y;p[e]={l:{val:b,size:r.l+v},r:{val:_,size:r.r+v},b:{val:A,size:r.b+v},t:{val:w,size:r.t+v}},g[e]=1}else delete p[e],delete g[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={}),O(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,h=a.t,p=a.b,g=e._pushmargin,v=e._pushmarginIds,m=e.minreducedwidth,y=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var b in g)v[b]||delete g[b];for(var _ in g.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},g){var w=g[_].l||{},A=g[_].b||{},M=w.val,T=w.size,k=A.val,S=A.size;for(var C in g){if(o(T)&&g[C].r){var E=g[C].r.val,L=g[C].r.size;if(E>M){var D=(T*E+(L-r)*M)/(E-M),R=(L*(1-M)+(T-r)*(1-E))/(E-M);D+R>c+f&&(c=D,f=R)}}if(o(S)&&g[C].t){var I=g[C].t.val,P=g[C].t.size;if(I>k){var F=(S*I+(P-n)*k)/(I-k),z=(P*(1-k)+(S-n)*(1-I))/(I-k);F+z>p+h&&(p=F,h=z)}}}}}var N=u.constrain(r-a.l-a.r,2,m),B=u.constrain(n-a.t-a.b,2,y),j=Math.max(0,r-N),U=Math.max(0,n-B);if(j){var H=(c+f)/j;H>1&&(c/=H,f/=H)}if(U){var V=(p+h)/U;V>1&&(p/=V,h/=V)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(h),i.b=Math.round(p),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&x.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var Y=3*(1+Object.keys(v).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(I(o,c,f),i=0;i0){for(var n=[],i=0;i-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":257,"../components/drawing":279,"../constants/xmlns_namespaces":379,"../lib":400,"@plotly/d3":14}],499:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rP){R("x scale is not linear");break}}if(b.length&&"fast"===L){var F=(b[b.length-1]-b[0])/(b.length-1),z=Math.abs(F/100);for(M=0;Mz){R("y scale is not linear");break}}}var N=i.maxRowLength(A),B="scaled"===e.xtype?"":r,j=d(e,B,v,m,N,k),U="scaled"===e.ytype?"":b,H=d(e,U,x,_,A.length,S);O||(e._extremes[k._id]=a.findExtremes(k,j),e._extremes[S._id]=a.findExtremes(S,H));var V={x:j,y:H,z:A,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===j.length-1&&(V.xCenter=B),U&&U.length===H.length-1&&(V.yCenter=U),E&&(V.xRanges=T.xRanges,V.yRanges=T.yRanges,V.pts=T.pts),C||l(t,e,{vals:A,cLetter:"z"}),C&&e.contours&&"heatmap"===e.contours.coloring){var Y={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};V.xfill=d(Y,B,v,m,N,k),V.yfill=d(Y,U,x,_,A.length,S)}return[V]}},{"../../components/colorscale/calc":265,"../../constants/numerical":378,"../../lib":400,"../../plots/cartesian/align_period":447,"../../plots/cartesian/axes":450,"../../registry":490,"../histogram2d/calc":518,"./clean_2d_array":502,"./convert_column_xyz":504,"./find_empties":505,"./interp2d":506,"./make_bound_array":507}],502:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,f,h;function d(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||g)[2]+(f[[r+1,i]]||g)[2]+(f[[r,i-1]]||g)[2]+(f[[r,i+1]]||g)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":400}],506:[function(t,e,r){"use strict";var n=t("../../lib"),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,c,u,f,h,d,p,g,v,m=0;for(s=0;sg&&(m=Math.max(m,Math.abs(t[a][o]-p)/(v-g))))}return m}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":400}],507:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,f=[],h=n.traceIs(t,"contour"),d=n.traceIs(t,"histogram"),p=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!d&&"category"!==s.type){var g=e.length;if(!(g<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||p)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;u0&&(a=!0);for(var l=0;la){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function d(t,e,r,n,a,s){if(n&&t>o){var l=p(e,a,s),c=p(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function p(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,h=-.1*e,d=t-h,p=r[0],g=r[1],v=Math.min(f(p+h,p+d,n,a),f(g+h,g+d,n,a)),m=Math.min(f(p+c,p+h,n,a),f(g+c,g+h,n,a));if(v>m&&mo){var y=s===i?1:6,b=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(N)&&(j=o.tickIncrement(j,x.size,!0,d)),I.start=r.l2r(j),z||i.nestedProperty(e,m+".start").set(I.start)}var U=x.end,H=r.r2l(R.end),V=void 0!==H;if((x.endFound||V)&&H!==r.r2l(U)){var Y=V?H:i.aggNums(Math.max,null,p);I.end=r.l2r(Y),V||i.nestedProperty(e,m+".start").set(I.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[m]=i.extendFlat({},e[m]||{}),delete e._input[G],delete e[G]),[I,p]}e.exports={calc:function(t,e){var r,a,d,p,g=[],v=[],m="h"===e.orientation,y=o.getFromId(t,m?e.yaxis:e.xaxis),b=m?"y":"x",x={x:"y",y:"x"}[b],_=e[b+"calendar"],w=e.cumulative,A=h(t,e,y,b),M=A[0],T=A[1],k="string"==typeof M.size,S=[],C=k?S:M,E=[],O=[],L=[],D=0,R=e.histnorm,I=e.histfunc,P=-1!==R.indexOf("density");w.enabled&&P&&(R=R.replace(/ ?density$/,""),P=!1);var F,z="max"===I||"min"===I?null:0,N=l.count,B=c[R],j=!1,U=function(t){return y.r2c(t,0,_)};for(i.isArrayOrTypedArray(e[x])&&"count"!==I&&(F=e[x],j="avg"===I,N=l[I]),r=U(M.start),d=U(M.end)+(r-o.tickIncrement(r,M.size,!1,_))/1e6;r=0&&p=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(v,w.direction,w.currentbin);var K=Math.min(g.length,v.length),Q=[],$=0,tt=K-1;for(r=0;r=$;r--)if(v[r]){tt=r;break}for(r=$;r<=tt;r++)if(n(g[r])&&n(v[r])){var et={p:g[r],s:v[r],b:0};w.enabled||(et.pts=L[r],q?et.ph0=et.ph1=L[r].length?T[L[r][0]]:g[r]:(e._computePh=!0,et.ph0=Y(S[r]),et.ph1=Y(S[r+1],!0))),Q.push(et)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,M.size,!1,_)-Q[0].p),s(Q,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(Q,e,Z),Q},calcAllAutoBins:h}},{"../../lib":400,"../../plots/cartesian/axes":450,"../../registry":490,"../bar/arrays_to_calcdata":499,"./average":513,"./bin_functions":514,"./bin_label_vals":515,"./norm_functions":517,"fast-isnumeric":121}],517:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;iS&&A.splice(S,A.length-S),k.length>S&&k.splice(S,k.length-S);var C=[],E=[],O=[],L="string"==typeof w.size,D="string"==typeof T.size,R=[],I=[],P=L?R:w,F=D?I:T,z=0,N=[],B=[],j=e.histnorm,U=e.histfunc,H=-1!==j.indexOf("density"),V="max"===U||"min"===U?null:0,Y=a.count,G=o[j],q=!1,W=[],X=[],Z="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";Z&&"count"!==U&&(q="avg"===U,Y=a[U]);var J=w.size,K=b(w.start),Q=b(w.end)+(K-i.tickIncrement(K,J,!1,m))/1e6;for(r=K;r=0&&d=0&&p=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*fe){h=r;break}}if(a=u,isNaN(a)&&(a=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-c[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(p,e);g&&(o.interval=l[a],o.intervalPix=p,o.region=g)}}if(t.ordinal&&!o.region){var v=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&y<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),x(t.parentNode)}function A(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function M(t){t.on("mousemove",(function(t){i.event.preventDefault(),t.parent.inBrushDrag||A(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(i.behavior.drag().on("dragstart",(function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(A(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&k(r)):k(r),a.brushCallback(e),x(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||k(r),a.brushCallback(e),c?x(t.parentNode,s):(s(),x(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function T(t,e){return t[0]-e[0]}function k(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(T)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,r){var i=t.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e,r){var i=r._context.staticPlot,a=t.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(p).call(g).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(M).attr("height",(function(t){return t.height-n.verticalPadding}));var s=t.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(t){return t.height})).call(b);var c=t.selectAll(".highlight").data(o);c.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(b)}(i,e,r)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?S(t.sort(T)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[d(0,r,t[0],[]),d(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":400,"../../lib/gup":397,"./constants":524,"@plotly/d3":14}],521:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":519,"./base_plot":522,"./calc":523,"./defaults":525}],522:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":379,"../../plots/get_data":480,"./plot":531,"@plotly/d3":14}],523:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale"),a=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),p.splice(f));var g=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:d}),v=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(g)&&g.length||(e.visible=!1),h(e,g,"values",v);var m={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",m),n.coerceFont(u,"tickfont",m),n.coerceFont(u,"rangefont",m),u("labelangle"),u("labelside"),u("unselected.line.color"),u("unselected.line.opacity")}},{"../../components/colorscale/defaults":267,"../../components/colorscale/helpers":268,"../../lib":400,"../../plots/array_container_defaults":445,"../../plots/cartesian/axes":450,"../../plots/domain":477,"./attributes":519,"./axisbrush":520,"./constants":524,"./merge_length":529}],526:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":400}],527:[function(t,e,r){"use strict";var n=t("./base_index");n.plot=t("./plot"),e.exports=n},{"./base_index":521,"./plot":531}],528:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function g(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[i].dim1.canvasX,o=i);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var d=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&no._length&&(S=S.slice(0,o._length));var E,O=o.tickvals;function L(t,e){return{val:t,text:E[e]}}function D(t,e){return t.val-e.val}if(Array.isArray(O)&&O.length){E=o.ticktext,Array.isArray(E)&&E.length?E.length>O.length?E=E.slice(0,O.length):O.length>E.length&&(O=O.slice(0,E.length)):E=O.map(a(o.tickformat));for(var R=1;R=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==B&&(u?a.hover(h):a.unhover&&a.unhover(h),B=f)}})),N.style("opacity",(function(t){return t.pick?0:1})),d.style("background","rgba(255, 255, 255, 0)");var j=d.selectAll("."+y.cn.parcoords).data(z,p);j.exit().remove(),j.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var U=j.selectAll("."+y.cn.parcoordsControlView).data(g,p);U.enter().append("g").classed(y.cn.parcoordsControlView,!0),U.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var H=U.selectAll("."+y.cn.yAxis).data((function(t){return t.dimensions}),p);H.enter().append("g").classed(y.cn.yAxis,!0),U.each((function(t){R(H,t,A)})),N.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=x(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),H.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),H.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;F.linePickActive(!1),t.x=Math.max(-y.overdrag,Math.min(t.model.width+y.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,H.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),R(H,e,A),H.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",c(t.x,0)),H.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!C(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,R(H,e,A),n.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!C(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),F.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),H.exit().remove();var V=H.selectAll("."+y.cn.axisOverlays).data(g,p);V.enter().append("g").classed(y.cn.axisOverlays,!0),V.selectAll("."+y.cn.axis).remove();var Y=V.selectAll("."+y.cn.axis).data(g,p);Y.enter().append("g").classed(y.cn.axis,!0),Y.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return m.isOrdinal(t)?e:I(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(Y.selectAll("text"),t.model.tickFont)})),Y.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),Y.selectAll("text").style("text-shadow",u.makeTextShadow(T)).style("cursor","default");var G=V.selectAll("."+y.cn.axisHeading).data(g,p);G.enter().append("g").classed(y.cn.axisHeading,!0);var q=G.selectAll("."+y.cn.axisTitle).data(g,p);q.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),q.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=D(t.model.labelAngle,t.model.labelSide),r=y.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=D(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var W=V.selectAll("."+y.cn.axisExtent).data(g,p);W.enter().append("g").classed(y.cn.axisExtent,!0);var X=W.selectAll("."+y.cn.axisExtentTop).data(g,p);X.enter().append("g").classed(y.cn.axisExtentTop,!0),X.attr("transform",c(0,-y.axisExtentOffset));var Z=X.selectAll("."+y.cn.axisExtentTopText).data(g,p);Z.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(L),Z.text((function(t){return P(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var J=W.selectAll("."+y.cn.axisExtentBottom).data(g,p);J.enter().append("g").classed(y.cn.axisExtentBottom,!0),J.attr("transform",(function(t){return c(0,t.model.height+y.axisExtentOffset)}));var K=J.selectAll("."+y.cn.axisExtentBottomText).data(g,p);K.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(L),K.text((function(t){return P(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),b.ensureAxisBrush(V,T,t)}},{"../../components/colorscale":269,"../../components/drawing":279,"../../lib":400,"../../lib/gup":397,"../../lib/svg_text_utils":426,"../../plots/cartesian/axes":450,"./axisbrush":520,"./constants":524,"./helpers":526,"./lines":528,"@plotly/d3":14,"color-rgba":37}],531:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl"),a=t("./helpers").isVisible,o={};function s(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var r=t._fullLayout;if(i(t,[],o)){var l={},c={},u={},f={},h=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=f[r]=n._fullInput.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()}));n(t,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,n,i){var a=c[e][n],o=i.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[s]){var h=a.constraintrange;l[s]=h||null}var d=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,d.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete d.constraintrange,o=null);var p={};p[s]=o,t.emit("plotly_restyle",[p,[f[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return s(t,e,r)-s(t,e,n)}}(r,c[e].filter(a));l[e].sort(n),c[e].filter((function(t){return!a(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[f[e]]])}})}}).reglPrecompiled=o},{"../../lib/prepare_regl":413,"./helpers":526,"./parcoords":530}],532:[function(t,e,r){"use strict";var n=t("../../lib");function i(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=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r>>1,h)p[0]=t.xbounds[0],p[2]=t.xbounds[1],p[1]=t.ybounds[0],p[3]=t.ybounds[1];else for(l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);if(d)r=d;else for(r=new Int32Array(e),l=0;lp[2]&&(p[2]=o),sp[3]&&(p[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var g=i(t.marker.color),v=i(t.marker.border.color),m=t.opacity*t.marker.opacity;g[3]*=m,this.pointcloudOptions.color=g;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,v[3]*=m,this.pointcloudOptions.borderColor=v;var b=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=a(_,[p[0],p[2]],{ppad:A}),t._extremes[w._id]=a(w,[p[1],p[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../../stackgl_modules":600,"../../lib/str2rgbarray":425,"../../plots/cartesian/autorange":449,"../scatter/get_trace_color":549}],536:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),e._length=null}},{"../../lib":400,"./attributes":534}],537:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":483,"../scatter3d/calc":567,"./attributes":534,"./convert":535,"./defaults":536}],538:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rl&&O[m].gap;)m--;for(b=O[m].s,g=O.length-1;g>m;g--)O[g].s=b;for(;lk[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],546:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),g=t("./fillcolor_defaults"),v=t("../../lib").coercePattern;e.exports=function(t,e,r,m){function y(r,i){return n.coerce(t,e,a,r,i)}var b=l(t,e,m,y);if(b||(e.visible=!1),e.visible){c(t,e,m,y),y("xhoverformat"),y("yhoverformat");var x=u(t,e,m,y),_=!x&&b=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-p);return a=Math.min(e,r)&&g<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(d.c2p(t.y)-g);return aW!=(B=I[D][1])>=W&&(F=I[D-1][0],z=I[D][0],B-N&&(P=F+(z-F)*(W-N)/(B-N),V=Math.min(V,P),Y=Math.max(Y,P)));V=Math.max(V,0),Y=Math.min(Y,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:V,x1:Y,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":257,"../../components/fx":297,"../../lib":400,"../../registry":490,"./get_trace_color":549}],551:[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":462,"./arrays_to_calcdata":538,"./attributes":539,"./calc":540,"./cross_trace_calc":544,"./cross_trace_defaults":545,"./defaults":546,"./format_labels":548,"./hover":550,"./marker_colorbar":557,"./plot":560,"./select":561,"./style":563,"./subtypes":564}],552:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){l||(l={});var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":267,"../../components/colorscale/helpers":268,"../../lib":400}],553:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../../constants/numerical"),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,c=t("../../lib"),u=c.segmentsIntersect,f=c.constrain,h=t("./constants");e.exports=function(t,e){var r,i,o,d,p,g,v,m,y,b,x,_,w,A,M,T,k,S,C=e.trace||{},E=e.xaxis,O=e.yaxis,L="log"===E.type,D="log"===O.type,R=E._length,I=O._length,P=e.backoff,F=C.marker,z=e.connectGaps,N=e.baseTolerance,B=e.shape,j="linear"===B,U=C.fill&&"none"!==C.fill,H=[],V=h.minTolerance,Y=t.length,G=new Array(Y),q=0;function W(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),o=e.linearized?O.l2p(n.y):O.c2p(n.y);if(i===a){if(L&&(i=E.c2p(n.x,!0)),i===a)return!1;D&&o===a&&(i*=Math.abs(E._m*I*(E._m>0?s:l)/(O._m*R*(O._m>0?s:l)))),i*=1e3}if(o===a){if(D&&(o=O.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function X(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function ht(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l);return s}}function dt(t){var e=t[0],r=t[1],n=e===G[q-1][0],i=r===G[q-1][1];if(!n||!i)if(q>1){var a=e===G[q-2][0],o=r===G[q-2][1];n&&(e===at||e===ot)&&a?o?q--:G[q-1]=t:i&&(r===st||r===lt)&&o?a?q--:G[q-1]=t:G[q++]=t}else G[q++]=t}function pt(t){G[q-1][0]!==t[0]&&G[q-1][1]!==t[1]&&dt([$,tt]),dt(t),et=null,$=tt=0}"linear"===B||"spline"===B?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(q)if(et){var n=nt(et,e);n.length>1&&(pt(n[0]),G[q++]=n[1])}else rt=nt(G[q-1],e)[0],G[q++]=rt;else G[q++]=[K||e[0],Q||e[1]];var i=G[q-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?dt($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&dt([$,tt])),dt([K,Q])):$-K&&tt-Q&&dt([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&pt(nt(et,e)[0]),G[q++]=e;var a,o,s,l}for(r=0;rZ(g,mt))break;o=g,(w=y[0]*m[0]+y[1]*m[1])>x?(x=w,d=g,v=!1):w<_&&(_=w,p=g,v=!0)}if(v?(vt(d),o!==p&&vt(p)):(p!==i&&vt(p),o!==d&&vt(d)),vt(o),r>=t.length||!g)break;vt(g),i=g}}else vt(d)}et&&dt([$||et[0],tt||et[1]]),H.push(G.slice(0,q))}var yt=B.slice(B.length-1);if(P&&"h"!==yt&&"v"!==yt){for(var bt=!1,xt=-1,_t=[],wt=0;wt=0?l=d:(l=d=h,h++),l0?Math.max(r,a):0}}},{"fast-isnumeric":121}],557:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],558:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":257,"../../components/colorscale/defaults":267,"../../components/colorscale/helpers":268,"./subtypes":564}],559:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":378,"../../lib":400}],560:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,g){var v;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!c.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),g=Math.ceil(p.length/d),v=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(p),M=o(A,"g","errorbars"),T=o(A,"g","lines"),k=o(A,"g","points"),S=o(A,"g","text");if(i.getComponentMethod("errorbars","plot")(t,M,r,g),!0===_.visible){var C,E;y(A).style("opacity",_.opacity);var O=_.fill.charAt(_.fill.length-1);"x"!==O&&"y"!==O&&(O=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var L,D,R="",I=[],P=_._prevtrace;P&&(R=P._prevRevpath||"",E=P._nextFill,I=P._polygons);var F,z,N,B,j,U,H,V="",Y="",G=[],q=a.noop;if(C=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(F=l.steps(w.shape),z=l.steps(w.shape.split("").reverse().join(""))):F=z="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return z(t.reverse())},G=u(f,{xaxis:b,yaxis:x,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),H=_._polygons=new Array(G.length),v=0;v1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",L).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",L),l.singleLineStyle(f,i)}}}}}var W=T.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(q(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(q(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(C?(C.datum(f),B&&U&&(O?("y"===O?B[1]=U[1]=x.c2p(0,!0):"x"===O&&(B[0]=U[0]=b.c2p(0,!0)),y(C).attr("d","M"+U+"L"+B+"L"+V.substr(1)).call(l.singleFillStyle,t)):y(C).attr("d",V+"Z").call(l.singleFillStyle,t))):E&&("tonext"===_.fill.substr(0,6)&&V&&R?("tonext"===_.fill?y(E).attr("d",V+"Z"+R+"Z").call(l.singleFillStyle,t):y(E).attr("d",V+"L"+R.substr(1)+"Z").call(l.singleFillStyle,t),_._polygons=_._polygons.concat(I)):(Z(E),_._polygons=null)),_._prevRevpath=Y,_._prevPolygons=H):(C?Z(C):E&&Z(E),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),S.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),h=c.hasText(u),d=tt(u),p=et,g=et;if(f||h){var v=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?v=w?K:J:_&&!w&&(v=Q),f&&(p=v),h&&(g=v)}var A,M=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&M.call(l.pointStyle,u,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,u,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(g,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,S,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,X,t),l.setClipUrl(S,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,h,p=!a,g=!!a&&a.duration>0,v=f(t,e,r);((u=i.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 i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),g)?(c&&(h=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){d(t,n,e,r,v,this,a)}))}))):u.each((function(r,n){d(t,n,e,r,v,this,a)}));p&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":279,"../../lib":400,"../../lib/polygon":412,"../../registry":490,"./line_points":553,"./link_traces":555,"./subtypes":564,"@plotly/d3":14}],561:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=v,w=2*x,A={},M=l.makeCalcdata(e,"x"),T=y.makeCalcdata(e,"y"),k=s(e,l,"x",M),S=s(e,y,"y",T),C=k.vals,E=S.vals;e._x=C,e._y=E,e.xperiodalignment&&(e._origX=M,e._xStarts=k.starts,e._xEnds=k.ends),e.yperiodalignment&&(e._origY=T,e._yStarts=S.starts,e._yEnds=S.ends);var O=new Array(w),L=new Array(x);for(r=0;r1&&i.extendFlat(s.line,d.linePositions(t,r,n));if(s.errorX||s.errorY){var l=d.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}s.text&&(i.extendFlat(s.text,{positions:n},d.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},d.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},d.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,O,C,E),I=p(t,b);return f(o,e),_?R.marker&&(D=R.marker.sizeAvg||Math.max(R.marker.size,3)):D=c(e,x),u(t,e,l,y,C,E,D),R.errorX&&m(e,l,R.errorX),R.errorY&&m(e,y,R.errorY),R.fill&&!I.fill2d&&(I.fill2d=!0),R.marker&&!I.scatter2d&&(I.scatter2d=!0),R.line&&!I.line2d&&(I.line2d=!0),!R.errorX&&!R.errorY||I.error2d||(I.error2d=!0),R.text&&!I.glText&&(I.glText=!0),R.marker&&(R.marker.snap=x),I.lineOptions.push(R.line),I.errorXOptions.push(R.errorX),I.errorYOptions.push(R.errorY),I.fillOptions.push(R.fill),I.markerOptions.push(R.marker),I.markerSelectedOptions.push(R.markerSel),I.markerUnselectedOptions.push(R.markerUnsel),I.textOptions.push(R.text),I.textSelectedOptions.push(R.textSel),I.textUnselectedOptions.push(R.textUnsel),I.selectBatch.push([]),I.unselectBatch.push([]),A._scene=I,A.index=I.count,A.x=C,A.y=E,A.positions=O,I.count++,[{x:!1,y:!1,t:A,trace:e}]}},{"../../constants/numerical":378,"../../lib":400,"../../plots/cartesian/align_period":447,"../../plots/cartesian/autorange":449,"../../plots/cartesian/axis_ids":454,"../scatter/calc":540,"../scatter/colorscale_calc":542,"./constants":571,"./convert":572,"./scene_update":580,"@plotly/point-cluster":15}],571:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],572:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("svg-path-sdf"),a=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),d=t("./helpers"),p=t("./constants"),g=t("../../constants/interactions").DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,i=t._fullLayout,a=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,h=o.family,d={},p=t._context.plotGlPixelRatio,g=e.texttemplate;if(g){d.text=[];var v=i._d3locale,y=Array.isArray(g),b=y?Math.min(g.length,a):a,x=y?function(t){return g[t]}:function(){return g};for(r=0;rp.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var h=n[0],d=n[1];for(i=0;i1?l[i]:l[0]:l,p=Array.isArray(c)?c.length>1?c[i]:c[0]:c,g=v[d],m=v[p],y=u?u/.8+1:0,b=-m*y-.5*m;o.offset[i]=[g*y/h,b/h]}}return o}}},{"../../components/drawing":279,"../../components/fx/helpers":293,"../../constants/interactions":377,"../../lib":400,"../../lib/gl_format_color":396,"../../plots/cartesian/axis_ids":454,"../../registry":490,"../scatter/make_bubble_size_func":556,"../scatter/subtypes":564,"./constants":571,"./helpers":576,"color-normalize":35,"fast-isnumeric":121,"svg-path-sdf":203}],573:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),d=t("../scatter/fillcolor_defaults"),p=t("../scatter/text_defaults");e.exports=function(t,e,r,g){function v(r,i){return n.coerce(t,e,o,r,i)}var m=!!t.marker&&a.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),b=c(t,e,g,v);if(b){u(t,e,g,v),v("xhoverformat"),v("yhoverformat");var x=b100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":571}],577:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var d=o.textfont;d&&(h.ts=i.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.tc=Array.isArray(d.color)?d.color[f]:d.color,h.tf=Array.isArray(d.family)?d.family[f]:d.family);var p=o.marker;p&&(h.ms=i.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.mo=i.isArrayOrTypedArray(p.opacity)?p.opacity[f]:p.opacity,h.mx=i.isArrayOrTypedArray(p.symbol)?p.symbol[f]:p.symbol,h.ma=i.isArrayOrTypedArray(p.angle)?p.angle[f]:p.angle,h.mc=i.isArrayOrTypedArray(p.color)?p.color[f]:p.color);var g=p&&p.line;g&&(h.mlc=Array.isArray(g.color)?g.color[f]:g.color,h.mlw=i.isArrayOrTypedArray(g.width)?g.width[f]:g.width);var v=p&&p.gradient;v&&"none"!==v.type&&(h.mgt=Array.isArray(v.type)?v.type[f]:v.type,h.mgc=Array.isArray(v.color)?v.color[f]:v.color);var m=s.c2p(h.x,!0),y=l.c2p(h.y,!0),b=h.mrc||1,x=o.hoverlabel;x&&(h.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,h.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,h.hts=i.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,h.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,h.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,h.hnl=i.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=h;var M=o._origX,T=o._origY,k=i.extendFlat({},t,{color:a(o,h),x0:m-b,x1:m+b,xLabelVal:M?M[f]:h.x,y0:y-b,y1:y+b,yLabelVal:T?T[f]:h.y,cd:A,distance:c,spikeDistance:u,hovertemplate:h.ht});return h.htx?k.text=h.htx:h.tx?k.text=h.tx:o.text&&(k.text=o.text),i.fillText(h,o,k),n.getComponentMethod("errorbars","hoverInfo")(h,o,k),k}e.exports={hoverPoints:function(t,e,r,n){var i,a,s,l,c,u,f,h,d,p,g=t.cd,v=g[0].t,m=g[0].trace,y=t.xa,b=t.ya,x=v.x,_=v.y,w=y.c2p(e),A=b.c2p(r),M=t.distance;if(v.tree){var T=y.p2c(w-M),k=y.p2c(w+M),S=b.p2c(A-M),C=b.p2c(A+M);i="x"===n?v.tree.range(Math.min(T,k),Math.min(b._rl[0],b._rl[1]),Math.max(T,k),Math.max(b._rl[0],b._rl[1])):v.tree.range(Math.min(T,k),Math.min(S,C),Math.max(T,k),Math.max(S,C))}else i=v.ids;var E=M;if("x"===n){var O=!!m.xperiodalignment,L=!!m.yperiodalignment;for(u=0;u=Math.min(D,R)&&w<=Math.max(D,R)?0:1/0}if(f=Math.min(I,P)&&A<=Math.max(I,P)?0:1/0}p=Math.sqrt(f*f+h*h),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=x[a=i[u]],c=_[a],f=y.c2p(l)-w,h=b.c2p(c)-A,(d=Math.sqrt(f*f+h*h))y.glText.length){var A=_-y.glText.length;for(g=0;gr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),y.line2d.update(y.lineOptions)),y.error2d){var T=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(T)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=s.repeat(null,_),y.fill2d&&(y.fillOptions=y.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,c=y.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(y.fillOrder[e]=u);var f,h,d=[],p=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(p[h+1]);)h-=2;0!==p[f+1]&&(d=[p[f],0]),d=d.concat(p.slice(f,h+2)),0!==p[h+1]&&(d=d.concat([p[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(p[h]);)h-=2;0!==p[f]&&(d=[0,p[f+1]]),d=d.concat(p.slice(f,h+2)),0!==p[h]&&(d=d.concat([0,p[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(d=[],i=0,t.splitNull=!0,a=0;a-1;for(g=0;g<_;g++){var E=r[g][0],O=E.trace,L=E.t,D=L.index,R=O._length,I=L.x,P=L.y;if(O.selectedpoints||S||C){if(S||(S=!0),O.selectedpoints){var F=y.selectBatch[D]=s.selIndices2selPoints(O),z={};for(v=0;vh?x.sizeAvg||Math.max(x.size,3):a(e,b),d=0;da&&l||i-1,L=!0;if(o(b)||!!d.selectedpoints||O){var D=d._length;if(d.selectedpoints){g.selectBatch=d.selectedpoints;var R=d.selectedpoints,I={};for(l=0;li&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),b={},x={},_=0;p?(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(v=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),M(v);for(var w=o(e.transforms,r),A=0;A1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)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 i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * diff --git a/dist/plotly-gl3d.js b/dist/plotly-gl3d.js index 7d1d0fe9997..ee8a0387cf7 100644 --- a/dist/plotly-gl3d.js +++ b/dist/plotly-gl3d.js @@ -1,5 +1,5 @@ /** -* plotly.js (gl3d) v2.16.4 +* plotly.js (gl3d) v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -42677,6 +42677,8 @@ function setActive(gd, sliderGroup, sliderOpts, index, doCallback, doTransition) } function attachGripEvents(item, gd, sliderGroup) { + if(gd._context.staticPlot) return; + var node = sliderGroup.node(); var $gd = d3.select(gd); @@ -89070,7 +89072,7 @@ function getSortFunc(opts, d2c) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.16.4'; +exports.version = '2.16.5'; },{}],444:[function(_dereq_,module,exports){ (function (global){(function (){ diff --git a/dist/plotly-gl3d.min.js b/dist/plotly-gl3d.min.js index 2b9ed0e9613..8bdc93cd5b6 100644 --- a/dist/plotly-gl3d.min.js +++ b/dist/plotly-gl3d.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (gl3d - minified) v2.16.4 +* plotly.js (gl3d - minified) v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -21,7 +21,7 @@ object-assign * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=i():!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:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(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 h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":75,"./lib/epsilon":76,"./lib/geojson":77,"./lib/intersecter":78,"./lib/segment-chainer":80,"./lib/segment-selector":81}],75:[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")}}}},{}],76:[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 i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],77:[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]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),v=!d&&e.pointBetween(s,c,u);if(h)return v?l(n,s):l(t,u),n;p&&(d||(v?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=c(h),p=d.before?d.before.ev:null,v=d.after?d.after.ev:null;function g(){if(p){var t=u(h,p);if(t)return t}return!!v&&u(h,v)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!v&&v.seg);var m,y=g();if(y){var b;if(t)(b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=v?v.seg.myFill.above:i,h.seg.myFill.above=b?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)m=v?h.primary===v.primary?v.seg.otherFill.above:v.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m};r&&r.status(h.seg,!!p&&p.seg,!!v&&v.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l1)for(var r=1;r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":82,timers:83}],84:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(L[t])t=L[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),a:z(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),a:z(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,v=e.b,i={r:255*C(d,255),g:255*C(p,255),b:255*C(v,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=P(e.s),c=P(e.v),i=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=P(e.s),u=P(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,v;return a=E(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function k(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%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,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=a(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=a(360*t.h),r=a(100*t.s),n=a(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=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[D(a(t).toString(16)),D(a(e).toString(16)),D(a(r).toString(16)),D(I(n))];if(i&&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:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+d(i._r,i._g,i._b,i._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(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,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]:P(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:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!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":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(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 E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function R(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function z(t){return R(t)/255}var N,F,B,j=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",B="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+F),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 U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],85:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":32}],86:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(v>>5&15)-1,(31&v)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var d,p=f[a.year-f[0]];for(d=0;d<13;d++){var v=p&1<<12-d?30:29;if(l>13;!g||d=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":100,"object-assign":71}],89:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":100,"object-assign":71}],90:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":100,"object-assign":71}],91:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":100,"object-assign":71}],92:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":100,"object-assign":71}],93:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":100,"object-assign":71}],94:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":100,"object-assign":71}],95:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":100,"object-assign":71}],97:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":100,"object-assign":71}],98:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":100,"object-assign":71}],99:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":100,"object-assign":71}],100:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":71}],101:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),p=function(t,e,r,n){var i=""+e;if(d(t,n))for(;i.length1},b=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(A));return A+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=v;for(var S=this.daysInMonth(h,d);p>S;S=this.daysInMonth(h,d))d++,p-=S}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":100,"object-assign":71}],102:[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}]},{}],103:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=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:i({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",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.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",a.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:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":237,"../../plot_api/plot_template":302,"../../plots/cartesian/constants":320,"../../plots/font_attributes":341,"./arrow_paths":102}],104:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,v=d-h,g=3*t.startarrowsize*t.arrowwidth||0,m=g+h,y=g-h;if(c===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:v}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,p,m),ppadminus:Math.max(f,v,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([a,o],t)}},{"../../lib":264,"../../plots/cartesian/axes":313,"./draw":109}],105:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=it.r2fraction(e["a"+et]))<0||dt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(Q=e[et],J=pt?it._offset+it._length*Q:J=M.l+M.w*Q):(Q=1-e[et],J=pt?it._offset+it._length*Q:J=M.t+M.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var vt=e["a"+et];if(tt=ot*V(.5,e.xanchor)-st*V(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(vt=1-vt),ft.tail=it._offset+it._length*vt):"paper"===gt?"y"===et?(vt=1-vt,ft.tail=M.t+M.h*vt):ft.tail=M.l+M.w*vt:ft.tail=it._offset+it.r2p(vt),K=tt}else ft.tail=J+vt,K=tt+vt;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),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*V($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)z.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(A-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(I-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+xt-1,y:B+_t}).call(u.setClipUrl,U?E:null,t);else{var wt=B+_t-v.top,Mt=B+xt-v.left;G.call(h.positionText,Mt,wt).call(u.setClipUrl,U?E:null,t)}H.select("rect").call(u.setRect,B,B,A,I),j.call(u.setRect,N/2,N/2,F-N,Y-N),z.call(u.setTranslate,Math.round(C.x.text-F/2),Math.round(C.y.text-Y/2)),D.attr({transform:"rotate("+O+","+C.x.text+","+C.y.text+")"});var Tt,At=function(r,n){R.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,d=C.y.tail+n,v=C.x.text+r,x=C.y.text+n,_=o.rotationXYMatrix(O,v,x),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),E=+j.attr("width"),P=+j.attr("height"),I=v-.5*E,N=I+E,F=x-.5*P,B=F+P,U=[[I,F,I,B],[I,B,N,B],[N,B,N,F],[N,F,I,F]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,Y=e.arrowcolor,V=e.arrowside,G=R.append("g").style({opacity:c.opacity(Y)}).classed("annotation-arrow-g",!0),q=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(c.stroke,c.rgb(Y));if(g(q,V,e),T.annotationPosition&&q.node().parentNode&&!a){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-X),transform:s(W,X)}).style("stroke-width",H+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(z);J=t.x,K=t.y,m&&m.autorange&&k(m._name+".autorange",!0),b&&b.autorange&&k(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;z.call(u.setTranslate,i,a),L("x",y(m,t,"x",M,e)),L("y",y(b,r,"y",M,e)),e.axref===e.xref&&L("ax",y(m,t,"ax",M,e)),e.ayref===e.yref&&L("ay",y(b,r,"ay",M,e)),G.attr("transform",s(t,r)),D.attr({transform:"rotate("+O+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&At(0,0),P)p.init({element:z.node(),gd:t,prepFn:function(){Tt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?L("ax",y(m,t,"ax",M,e)):L("ax",e.ax+t),e.ayref===e.yref?L("ay",y(b,r,"ay",M.w,e)):L("ay",e.ay+r),At(t,r);else{if(a)return;var i,o;if(m)i=y(m,t,"x",M,e);else{var l=e._xsize/M.w,c=e.x+(e._xshift-e.xshift)/M.w-l/2;i=p.align(c+t/M.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",M,e);else{var u=e._ysize/M.h,f=e.y-(e._yshift+e.yshift)/M.h-u/2;o=p.align(f-r/M.h,u,0,1,e.yanchor)}L("x",i),L("y",o),m&&b||(n=p.getCursor(m?.5:i,b?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+Tt}),d(z,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),i.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=0,b=e.indexOf("end")>=0,x=p.backoff*g+r.standoff,_=v.backoff*m+r.startstandoff;if("line"===d.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,M=o.y-u.y;if(h=(f=Math.atan2(M,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+M*M))return void P();if(x){if(x*x>w*w+M*M)return void P();var T=x*Math.cos(f),A=x*Math.sin(f);u.x+=T,u.y+=A,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+M*M)return void P();var k=_*Math.cos(f),L=_*Math.sin(f);o.x-=k,o.y-=L,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var S=d.getTotalLength(),E="";if(S1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":353,"../annotations/draw":109}],116:[function(t,e,r){"use strict";var n=t("../../registry"),i=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 a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ct=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ct*c.roundUp(lt/ct,[2,5,10]),(Math.abs(V.start)/V.size+1e-6)%1<2e-6&&(it.tick0=0)}it.dtick=ot}it.domain=o?[rt+R/z.h,rt+K-R/z.h]:[rt+O/z.w,rt+K-O/z.w],it.setScale(),t.attr("transform",u(Math.round(z.l),Math.round(z.t)));var ut,ft=t.select("."+A.cbtitleunshift).attr("transform",u(-Math.round(z.l),-Math.round(z.t))),ht=it.ticklabelposition,dt=it.title.font.size,pt=t.select("."+A.cbaxis),vt=0,gt=0;function mt(n,i){var a={propContainer:it,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:I._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),v.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&at||!o&&!at)&&("top"===j&&(t=O+z.l+z.w*D,e=R+z.t+z.h*(1-rt-K)+3+.75*dt),"bottom"===j&&(t=O+z.l+z.w*D,e=R+z.t+z.h*(1-rt)-3-.25*dt),"right"===j&&(e=R+z.t+z.h*P+3+.75*dt,t=O+z.l+z.w*rt),mt(it._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!at||o&&at){var a,l=t.select("."+A.cbtitle),f=l.select("text"),h=[-k/2,k/2],p=l.select(".h"+it._id+"title-math-group").node(),v=15.6;if(f.node()&&(v=parseInt(f.node().style.fontSize,10)*w),p?(a=d.bBox(p),gt=a.width,(vt=a.height)>v&&(h[1]-=(vt-v)/2)):f.node()&&!f.classed(A.jsPlaceholder)&&(a=d.bBox(f.node()),gt=a.width,vt=a.height),o){if(vt){if(vt+=5,"top"===j)it.domain[1]-=vt/z.h,h[1]*=-1;else{it.domain[0]+=vt/z.h;var m=g.lineCount(f);h[1]+=(1-m)*v}l.attr("transform",u(h[0],h[1])),it.setScale()}}else gt&&("right"===j&&(it.domain[0]+=(gt+dt/2)/z.w),l.attr("transform",u(h[0],h[1])),it.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",o?u(0,Math.round(z.h*(1-it.domain[1]))):u(Math.round(z.w*it.domain[0]),0)),pt.attr("transform",o?u(0,Math.round(-z.t)):u(Math.round(-z.l),0));var y=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(q);y.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),y.exit().remove();var b=U.map(it.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var s=[0===a?U[0]:(q[a]+q[a-1])/2,a===q.length-1?U[1]:(q[a]+q[a+1])/2].map(it.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,b[0],b[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)d.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=Y(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var x=t.select("."+A.cblines).selectAll("path."+A.cbline).data(F.color&&F.width?W:[]);x.enter().append("path").classed(A.cbline,!0),x.exit().remove(),x.each((function(t){var e=Q,r=Math.round(it.c2p(t))+F.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+X).call(d.lineGroupStyle,F.width,H(t),F.dash)})),pt.selectAll("g."+it._id+"tick,path").remove();var _=Q+X+(k||0)/2-("outside"===e.ticks?1:0),M=s.calcTicks(it),T=s.getTickSigns(it)[2];return s.drawTicks(r,it,{vals:"inside"===it.ticks?s.clipEnds(it,M):M,layer:pt,path:s.makeTickPath(it,_,T),transFn:s.makeTransTickFn(it)}),s.drawLabels(r,it,{vals:M,layer:pt,transFn:s.makeTransTickLabelFn(it),labelFns:s.makeLabelFns(it,_)})},function(){if(o&&!at||!o&&at){var t,i,a=it.position||0,s=it._offset+it._length/2;if("right"===j)i=s,t=z.l+z.w*a+10+dt*(it.showticklabels?1:.5);else if(t=s,"bottom"===j&&(i=z.t+z.h*a+10+(-1===ht.indexOf("inside")?it.tickfont.size:0)+("intside"!==it.ticks&&e.ticklen||0)),"top"===j){var l=B.text.split("
").length;i=z.t+z.h*a+10-X-w*dt*l}mt((o?"h":"v")+it._id+"title",{avoid:{selection:n.select(r).selectAll("g."+it._id+"tick"),side:j,offsetTop:o?0:z.t,offsetLeft:o?z.l:0,maxShift:o?I.width:I.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=X+k/2;-1===ht.indexOf("inside")&&(n=d.bBox(pt.node()),s+=o?n.width:n.height),ut=ft.select("text");var c=0,f=o&&"top"===j,v=!o&&"right"===j,g=0;if(ut.node()&&!ut.classed(A.jsPlaceholder)){var y,b=ft.select(".h"+it._id+"title-math-group").node();b&&(o&&at||!o&&!at)?(c=(n=d.bBox(b)).width,y=n.height):(c=(n=d.bBox(ft.node())).right-z.l-(o?Q:nt),y=n.bottom-z.t-(o?nt:Q),o||"top"!==j||(s+=n.height,g=n.height)),v&&(ut.attr("transform",u(c/2+dt/2,0)),c*=2),s=Math.max(s,o?c:y)}var x=2*(o?O:R)+s+L+k/2,w=0;!o&&B.text&&"bottom"===C&&P<=0&&(x+=w=x/2,g+=w),I._hColorbarMoveTitle=w,I._hColorbarMoveCBTitle=g;var N=L+k;t.select("."+A.cbbg).attr("x",(o?Q:nt)-N/2-(o?O:0)).attr("y",(o?nt:Q)-(o?J:R+g-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(J+N,2)).call(p.fill,S).call(p.stroke,e.bordercolor).style("stroke-width",L);var F=v?Math.max(c-10,0):0;if(t.selectAll("."+A.cboutline).attr("x",(o?Q:nt+O)+F).attr("y",(o?nt+R-J:Q)+(f?vt:0)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(J-(o?2*R+vt:2*O+F),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":k}),t.attr("transform",u(z.l-(o?$*x:0),z.t-(o?0:(1-tt)*x-g))),!o&&(L||i(S).getAlpha()&&!i.equals(I.paper_bgcolor,S))){var U=pt.selectAll("text"),H=U[0].length,Y=t.select("."+A.cbbg).node(),V=d.bBox(Y),G=d.getTranslate(t);U.each((function(t,e){var r=H-1;if(0===e||e===r){var n,i=d.bBox(this),a=d.getTranslate(this);if(e===r){var o=i.right+a.x;(n=V.right+G.x+nt-L-2+D-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=V.left+G.x+nt+L+2-s)<0&&(n=0)}n&&(H<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var q={},W=M[E],Z=T[E],K=M[C],et=T[C],rt=x-X;o?("pixels"===h?(q.y=P,q.t=J*K,q.b=J*et):(q.t=q.b=0,q.yt=P+l*K,q.yb=P-l*et),"pixels"===_?(q.x=D,q.l=x*W,q.r=x*Z):(q.l=rt*W,q.r=rt*Z,q.xl=D-m*W,q.xr=D+m*Z)):("pixels"===h?(q.x=D,q.l=J*W,q.r=J*Z):(q.l=q.r=0,q.xl=D+l*W,q.xr=D-l*Z),"pixels"===_?(q.y=1-P,q.t=x*K,q.b=x*et):(q.t=rt*K,q.b=rt*et,q.yt=P-m*K,q.yb=P+m*et)),a.autoMargin(r,e._id,q)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,f)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":236,"../../lib":264,"../../lib/extend":257,"../../lib/setcursor":284,"../../lib/svg_text_utils":289,"../../plots/cartesian/axes":313,"../../plots/cartesian/axis_defaults":315,"../../plots/cartesian/layout_attributes":326,"../../plots/cartesian/position_defaults":329,"../../plots/plots":358,"../../registry":361,"../color":120,"../colorscale/helpers":131,"../dragelement":139,"../drawing":142,"../titles":229,"./constants":122,"@plotly/d3":16,tinycolor2:84}],125:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":264}],126:[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":121,"./defaults":123,"./draw":124,"./has_colorbar":125}],127:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var d=a+"auto",p=a+"min",v=a+"max",g=a+"mid",m=(s(h+d),s(h+p),s(h+v),{});m[p]=m[v]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":280,"../../lib/sort_object_keys":286,"../colorbar/attributes":121,"./scales.js":135}],128:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),h=!1!==f.auto,d=f.min,p=f.max,v=f.mid,g=function(){return i.aggNums(Math.min,null,l)},m=function(){return i.aggNums(Math.max,null,l)};(void 0===d?d=g():h&&(d=u._colorAx&&n(d)?Math.min(d,g()):g()),void 0===p?p=m():h&&(p=u._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==v&&(p-v>v-d?d=v-(p-v):p-v=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":264,"./helpers":131,"fast-isnumeric":31}],129:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=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,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],137:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":264}],138:[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)}},{}],139:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var 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)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,h,d,p,v,g=t.gd,m=1,y=g._context.doubleClickDelay,b=t.element;g._mouseDownTime||(g._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!v){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)}p.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":264,"../../plots/cartesian/constants":320,"./align":136,"./cursor":137,"./unhover":140,"has-hover":63,"has-passive-events":64,"mouse-event-offset":69}],140:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":255,"../../lib/events":256,"../../lib/throttle":290,"../fx/constants":154}],141:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],142:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,h=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,v=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};function x(t,e,r){var n=e.fillpattern,i=n&&b.getPatternAttr(n.shape,0,"");if(i){var a=b.getPatternAttr(n.bgcolor,0,null),o=b.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=b.getPatternAttr(n.size,0,8),u=b.getPatternAttr(n.solidity,0,.3),f=e.uid;b.pattern(t,"point",r,f,i,l,u,void 0,n.fillmode,a,o,s)}else e.fillcolor&&t.call(c.fill,e.fillcolor)}b.font=function(t,e,r,n){i.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(c.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,i){t.call(b.setPosition,e,r).call(b.setSize,n,i)},b.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);b.translatePoint(t,i,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.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},b.singleFillStyle=function(t,e){var r=n.select(t.node());x(t,((r.data()[0]||[])[0]||{}).trace||{},e)},b.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&x(r,t[0].trace,e)}))};var _=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolBackOffs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,b.symbolBackOffs[r]=e.backoff||0,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var w=b.symbolNames.length;function M(t,e,r,n){var i=t%100;return b.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},A={x1:0,x2:0,y1:1,y2:0},k=a("~f"),L={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:A},verticalreversed:{node:"linearGradient",attrs:A,reversed:!0}};b.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=L[a],h=new Array(u),d=0;d=100;var f=rt(t,r),h=G(t,r);e.attr("d",M(u,l,f,h))}var d,p,v,g=!1;if(t.so)v=s.outlierwidth,p=s.outliercolor,d=o.outliercolor;else{var m=(s||{}).width;v=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,p="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(d=c.defaultLine,g=!0),d="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,d).style({"stroke-width":(v||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:v)+"px");var y=o.gradient,x=t.mgt;x?g=!0:x=y&&y.type,i.isArrayOrTypedArray(x)&&(x=x[0],L[x]||(x=0));var _=o.pattern,w=_&&b.getPatternAttr(_.shape,t.i,"");if(x&&"none"!==x){var T=t.mgc;T?g=!0:T=y.color;var A=r.uid;g&&(A+="-"+t.i),b.gradient(e,a,A,x,[[0,T],[1,d]],"fill")}else if(w){var k=b.getPatternAttr(_.bgcolor,t.i,null),S=b.getPatternAttr(_.fgcolor,t.i,null),E=_.fgopacity,C=b.getPatternAttr(_.size,t.i,8),O=b.getPatternAttr(_.solidity,t.i,.3),R=t.mcc||i.isArrayOrTypedArray(_.shape)||i.isArrayOrTypedArray(_.bgcolor)||i.isArrayOrTypedArray(_.size)||i.isArrayOrTypedArray(_.solidity),D=r.uid;R&&(D+="-"+t.i),b.pattern(e,"point",a,D,w,C,O,t.mcc,_.fillmode,k,S,E)}else c.fill(e,d);v&&c.stroke(e,p)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,h=void 0!==u,d=void 0!==f;(i.isArrayOrTypedArray(c)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:e:d?f:v*e});var p=a.color,g=o.color,m=s.color;(g||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?g||e:m||e});var y=a.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,v))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",M(b.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,d,t,p)}var v=t.tp||e.textposition,g=C(t,e),m=a?a(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,g,m).text(c).call(h.convertToTspans,r).call(E,v,g,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=C(t,e);c.fill(i,a);var u=l.traceIs(e,"bar-like");E(i,o,s,t.mrc2||t.mrc,u)}))}};var O,R;function D(t,e,r){return r&&(t=B(t)),e?I(t[1]):P(t[0])}function P(t){var e=n.round(t,2);return O=e,e}function I(t){var e=n.round(t,2);return R=e,e}function z(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,h=3*c*(l+c),d=3*l*(l+c);return[[P(e[0]+(h&&u/h)),I(e[1]+(h&&f/h))],[P(e[0]-(d&&u/d)),I(e[1]-(d&&f/d))]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||x>=f&&x<=c)&&(_<=h&&_>=u||_>=h&&_<=u)&&(t=[x,_])}return t}b.steps=function(t){var e=N[t]||F;return function(t){for(var r="M"+P(t[0][0])+","+I(t[0][1]),n=t.length,i=1;i=1e4&&(b.savedBBoxes={},j=0),r&&(b.savedBBoxes[r]=g),j++,i.extendFlat({},g)},b.setClipUrl=function(t,e,r){t.attr("clip-path",H(e,r))},b.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}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},b.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}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var Y=/\s*sc.*/;b.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(Y,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var V=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(V);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},b.getMarkerStandoff=G;var q,W,X,Z,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,c=e._yA;if(!l||!c)return 90;r=l.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var u,f=t.lonlat[0],h=t.lonlat[1],d=e._geo.project([f,h+1e-5]),p=e._geo.project([f+1e-5,h]),v=Q(p[1]-n,p[0]-r),g=Q(d[1]-n,d[0]-r);if("north"===a)u=i/180*Math.PI;else if("previous"===a){var m=f/180*Math.PI,y=h/180*Math.PI,b=q/180*Math.PI,x=W/180*Math.PI,_=b-m,w=$(x)*tt(_),M=tt(x)*$(y)-$(x)*tt(y)*$(_);u=-Q(w,M)-Math.PI,q=f,W=h}var T=et(v,[$(u),0]),A=et(g,[tt(u),0]);i=Q(T[1]+A[1],T[0]+A[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var k=r-X,L=n-Z,S=e.line&&e.line.shape||"",E=S.slice(S.length-1);"h"===E&&(L=0),"v"===E&&(k=0),i+=Q(L,k)/Math.PI*180+90}else i=null}return X=r,Z=n,J=t.i,K=e.uid,i}b.getMarkerAngle=rt},{"../../components/fx/helpers":156,"../../constants/alignment":236,"../../constants/interactions":242,"../../constants/xmlns_namespaces":244,"../../lib":264,"../../lib/svg_text_utils":289,"../../registry":361,"../../traces/scatter/make_bubble_size_func":407,"../../traces/scatter/subtypes":415,"../color":120,"../colorscale":132,"./symbol_defs":143,"@plotly/d3":16,"fast-isnumeric":31,tinycolor2:84}],143:[function(t,e,r){"use strict";var n,i,a,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,h=Math.cos,d=Math.sin;function p(t){return null===t}function v(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=h(t),i=d(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,p=0,v=s(r),g="",m=0;m0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var v=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,f);if(g.exit().remove(),e.length){d.visible||g.selectAll("path.xerror").remove(),p.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var m=g.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!v||t.vis){var a,o=e.select("path.yerror");if(p.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=p.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="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(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(d.copy_ystyle?p:d).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":415,"../drawing":142,"@plotly/d3":16,"fast-isnumeric":31}],150:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":120,"@plotly/d3":16}],151:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":257,"../../plots/font_attributes":341,"./layout_attributes":161}],152:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||ot<0||ot>w[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=ot+w[0]._offset,H="xval"in e?m.flat(l,e.xval):m.p2c(_,at),Y="yval"in e?m.flat(l,e.yval):m.p2c(w,ot),!i(H[0])||!i(Y[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(G=0;Gtt&&(et.splice(0,tt),ct=et[0].distance),y&&0!==F&&0===et.length){$.distance=F,$.index=!1;var f=W._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=F}))),f&&f.length){var h,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];i(v.x0)&&i(v.y0)&&(h=ht(v),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>h.spikeDistance)&&(nt.vLinePoint=h))}var g=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(g.length){var b=g[0];i(b.x0)&&i(b.y0)&&(h=ht(b),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>h.spikeDistance)&&(nt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Mt-1;kt--)Ct(et[kt]);et=Lt,gt()}var Ot=t._hoverdata,Rt=[],Dt=j(t),Pt=U(t);for(V=0;V1||et.length>1)||"closest"===O&&it&&et.length>1,Wt=d.combine(u.plot_bgcolor||d.background,u.paper_bgcolor),Xt=R(et,{gd:t,hovermode:O,rotateLabels:qt,bgColor:Wt,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});m.isUnifiedHover(O)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,h=t.size(),d=new Array(h),p=0;function v(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===p&&a&&a[0]>a[1]!==i&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?M:1)/2,pmin:0,pmax:i?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=h;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=i;for(g.push.apply(g,m),d.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(a=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}d.forEach(v)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,qt?"xa":"ya",u),P(Xt,qt,u._invScaleX,u._invScaleY));if(s&&s.tagName){var Zt=g.getComponentMethod("annotations","hasClickToShow")(t,Rt);f(n.select(s),Zt?"pointer":"")}if(!s||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Ot))return;Ot&&t.emit("plotly_unhover",{event:e,points:Ot});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:H,yvals:Y})}(t,e,r,a,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=R(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),p=Math.max(s,l),v=t.trace;if(g.traceIs(v,"gl3d")){var m=i._fullLayout[v.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;u+=y,f+=y,h+=b,p+=b}c.bbox={x0:u+o,x1:f+o,y0:h+a,y1:p+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||d.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,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function R(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,p=e.container,v=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var M=e.fontFamily||y.HOVERFONT,T=e.fontSize||y.HOVERFONTSIZE,A=t[0],S=A.xa,E=A.ya,O=a.charAt(0),R=O+"Label",P=A[R];if(void 0===P&&"multicategory"===S.type)for(var I=0;Ii.width-x?(g=i.width-x,e.attr("d","M"+(x-k)+",0L"+x+","+b+k+"v"+b+(2*L+y.height)+"H-"+x+"V"+b+k+"H"+(x-2*k)+"Z")):e.attr("d","M0,0L"+k+","+b+k+"H"+(L+y.width/2)+"v"+b+(2*L+y.height)+"H-"+(L+y.width/2)+"V"+b+k+"H-"+k+"Z")}else{var _,C,O;"right"===E.side?(_="start",C=1,O="",g=S._offset+S._length):(_="end",C=-1,O="-",g=S._offset),m=E._offset+(A.y0+A.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+O+k+","+k+"V"+(L+y.height/2)+"h"+O+(2*L+y.width)+"V-"+(L+y.height/2)+"H"+O+k+"V-"+k+"Z");var R,D=y.height/2,I=N-y.top-D,z="clip"+i._uid+"commonlabel"+E._id;if(g=0?st:lt+ft=0?lt:bt+ft=0?at:ot+ht=0?ot:xt+ht=0,"top"!==t.idealAlign&&G||!q?G?(R+=z/2,t.anchor="start"):t.anchor="middle":(R-=z/2,t.anchor="end");else if(t.pos=R,G=O+I/2+W<=F,q=O-I/2-W>=0,"left"!==t.idealAlign&&G||!q)if(G)O+=I/2,t.anchor="start";else{t.anchor="middle";var X=W/2,Z=O+X-F,J=O-X;Z>0&&(O-=Z),J<0&&(O+=-J)}else O-=I/2,t.anchor="end";w.attr("text-anchor",t.anchor),S&&A.attr("text-anchor",t.anchor),e.attr("transform",s(O,R)+(c?l(_):""))})),_t}function D(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=F(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(h[c+"other"]=h[c+"Val"],h[c+"otherLabel"]=h[c+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(O,(function(e,r){return s=F(r,t.nameLength),""}))}return[l,s]}function P(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(k+L),d=f+c*(t.txwidth+L),p=0,v=t.offset,g="middle"===s;g&&(f-=t.tx2width/2,d+=t.txwidth/2+L),e&&(v*=-A,p=t.offset*T),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(v-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*k+p)+","+o(k+v)+"v"+o(t.by/2-k)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*k+p)+"V"+o(v-k)+"Z");var m=p+f,y=v+t.ty0-t.by/2+L,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(i.attr("text-anchor","start"),m=g?-t.bx/2-t.tx2width/2+L:-t.bx-L):"right"===b&&"end"!==s&&(i.attr("text-anchor","end"),m=g?t.bx/2-t.tx2width/2-L:t.bx+L)),i.call(u.positionText,a(m),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(d+c*L+p),o(v+t.ty0-t.by/2+L)),r.select("rect").call(h.setRect,a(d+(c-1)*t.tx2width/2+p),o(v-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function I(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}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:v.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:v.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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=v.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+v.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 h=v.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+v.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function z(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var p=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(g=c.pointerX,m=c.pointerY):(g=n._offset+y.x,m=i._offset+y.y);var b,x,_=a.readability(y.color,p)<1.5?d.contrast(p):y.color,w=i.spikemode,M=i.spikethickness,T=i.spikecolor||_,A=v.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=A,x=g),-1!==w.indexOf("across")){var k=i._counterDomainMin,L=i._counterDomainMax;"free"===i.anchor&&(k=Math.min(k,i.position),L=Math.max(L,i.position)),b=l.l+k*l.w,x=l.l+L*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:T,"stroke-dasharray":h.dashStyle(i.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?M:-M),cy:m,r:M,fill:T}).classed("spikeline",!0)}if(f){var S,E,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(S=c.pointerX,E=c.pointerY):(S=n._offset+C.x,E=i._offset+C.y);var O,R,D=a.readability(C.color,p)<1.5?d.contrast(p):C.color,P=n.spikemode,I=n.spikethickness,z=n.spikecolor||D,N=v.getPxPosition(t,n);if(-1!==P.indexOf("toaxis")||-1!==P.indexOf("across")){if(-1!==P.indexOf("toaxis")&&(O=N,R=E),-1!==P.indexOf("across")){var F=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),B=Math.max(B,n.position)),O=l.t+(1-B)*l.h,R=l.t+(1-F)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:R,"stroke-width":I,stroke:z,"stroke-dasharray":h.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:R,"stroke-width":I+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==P.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?I:-I),r:I,fill:z}).classed("spikeline",!0)}}}function N(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function F(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function H(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],h=c[1],d=u[0],p=u[1];return{x:f,y:h,width:d-f,height:p-h,top:Math.min(h,p),left:Math.min(f,d),right:Math.max(f,d),bottom:Math.max(h,p)}}},{"../../lib":264,"../../lib/events":256,"../../lib/override_cursor":275,"../../lib/svg_text_utils":289,"../../plots/cartesian/axes":313,"../../registry":361,"../color":120,"../dragelement":139,"../drawing":142,"../legend/defaults":172,"../legend/draw":173,"./constants":154,"./helpers":156,"@plotly/d3":16,"fast-isnumeric":31,tinycolor2:84}],158:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.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":264,"../color":120,"./helpers":156}],159:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":264,"./layout_attributes":161}],160:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":264,"../dragelement":139,"./attributes":151,"./calc":152,"./click":153,"./constants":154,"./defaults":155,"./helpers":156,"./hover":157,"./layout_attributes":161,"./layout_defaults":162,"./layout_global_defaults":163,"@plotly/d3":16}],161:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes"),a=i({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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),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":341,"./constants":154}],162:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":264,"./hoverlabel_defaults":158,"./hovermode_defaults":159,"./layout_attributes":161}],163:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":264,"./hoverlabel_defaults":158,"./layout_attributes":161}],164:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("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:a({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"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),h=0;h1){if(!h&&!d&&!p)"independent"===T("pattern")&&(h=!0);g._hasSubplotGrid=h;var b,x,_="top to bottom"===T("roworder"),w=h?.2:.1,M=h?.3:.1;v&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),g._domains={x:u("x",T,w,b,y),y:u("y",T,M,x,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,v=r.rows,g=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(v);var x=1;for(n=0;n1);if(!1===_&&(e.legend=void 0),(!1!==_||f.uirevision)&&(d("uirevision",e.uirevision),!1!==_)){d("bgcolor",e.paper_bgcolor),d("bordercolor"),d("borderwidth");var w,M,T,A=i.coerceFont(d,"font",e.font),k="h"===d("orientation");if(k?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(M=1.1,T="bottom"):(M=-.1,T="top")):(w=1.02,M=1,T="auto"),d("traceorder",b),c.isGrouped(e.legend)&&d("tracegroupgap"),d("entrywidth"),d("entrywidthmode"),d("itemsizing"),d("itemwidth"),d("itemclick"),d("itemdoubleclick"),d("groupclick"),d("x",w),d("xanchor"),d("y",M),d("yanchor",T),d("valign"),i.noneOrAll(f,h,["x","y"]),d("title.text")){d("title.side",k?"left":"top");var L=i.extendFlat({},A,{size:i.bigFont(A.size)});i.coerceFont(d,"title.font",L)}}}},{"../../lib":264,"../../plot_api/plot_template":302,"../../plots/attributes":309,"../../plots/layout_attributes":356,"../../registry":361,"./attributes":170,"./helpers":176}],173:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),v=p.LINE_SPACING,g=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function w(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function M(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!u,p=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var v=i.ensureSingle(t,"text","legendtext");v.attr("text-anchor","start").call(c.font,a).text(h?T(n,p):n);var g=r.itemwidth+2*d.itemGap;f.positionText(v,g,0),h?v.call(f.makeEditable,{gd:e,text:n}).call(k,t,e,r).on("edit",(function(n){this.text(T(n,p)).call(k,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),c=h.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):k(v,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 A(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.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||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function k(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,h,p=s.size*v;if(o){var g=c.bBox(o);u=g.height,h=g.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var m=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(u=p*y,h=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),f.positionText(m,l+d.titlePad,l+p);else{var x=2*d.itemGap+r.itemwidth;i.groupTitle&&(x=d.itemGap,h-=r.itemwidth),f.positionText(m,x,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=p,i.height=Math.max(u,16)+3,i.width=h)}(e,r,n,i)}))}function L(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,p=e._inHover;p?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(p){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var v=f.hiddenlabels||[];if(!(p||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),a.autoMargin(t,"legend");var T=i.ensureSingle(r,"g","legend",(function(t){p||t.attr("pointer-events","all")})),E=i.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),C=i.ensureSingle(T,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var O=i.ensureSingle(T,"g","scrollbox"),R=e.title;if(e._titleWidth=0,e._titleHeight=0,R.text){var D=i.ensureSingle(O,"text","legendtitletext");D.attr("text-anchor","start").call(c.font,R.font).text(R.text),k(D,O,t,e,1)}else O.selectAll(".legendtitletext").remove();var P=i.ensureSingle(T,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(u.fill,d.scrollBarColor)})),I=O.selectAll("g.groups").data(s);I.enter().append("g").attr("class","groups"),I.exit().remove();var z=I.selectAll("g.traces").data(i.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==v.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(M,t,e)})).call(b,t,e).each((function(){p||n.select(this).call(A,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),u="fraction"===i.entrywidthmode,f=i.borderwidth,h=2*f,p=d.itemGap,v=i.itemwidth+2*p,g=2*(f+p),m=S(i),y=i.y<0||0===i.y&&"top"===m,b=i.y>1||1===i.y&&"bottom"===m,w=i.tracegroupgap,M={};i._maxHeight=Math.max(y||b?a.height/2:o.h,30);var T=0;i._width=0,i._height=0;var A=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+A[0],f+A[1]+i._height+e/2+p),i._height+=e,i._width=Math.max(i._width,t[0].width)})),T=v+i._width,i._width+=p+v+h,i._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var k=L(i),E=i.x<0||0===i.x&&"right"===k,C=i.x>1||1===i.x&&"left"===k,O=b||y,R=a.width/2;i._maxWidth=Math.max(E?O&&"left"===k?o.l+o.w:R:C?O&&"right"===k?o.r+o.w:R:o.w,2*v);var D=0,P=0;r.each((function(t){var e=_(t,i,v);D=Math.max(D,e),P+=e})),T=null;var I=0;if(l){var z=0,N=0,F=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,i,v),a=r[0].height;c.setTranslate(this,A[0],A[1]+f+p+a/2+e),e+=a,t=Math.max(t,n),M[r[0].trace.legendgroup]=t}));var r=t+p;N>0&&r+f+N>i._maxWidth?(I=Math.max(I,N),N=0,F+=z+w,z=e):z=Math.max(z,e),c.setTranslate(this,N,F),N+=r})),i._width=Math.max(I,N)+f,i._height=F+z+g}else{var B=r.size(),j=P+h+(B-1)*p=i._maxWidth&&(I=Math.max(I,V),H=0,Y+=U,i._height+=U,U=0),c.setTranslate(this,A[0]+f+H,A[1]+f+Y+e/2+p),V=H+r+p,H+=n,U=Math.max(U,e)})),j?(i._width=H+h,i._height=U+g):(i._width=Math.max(I,V)+h,i._height+=U+g)}}i._width=Math.ceil(Math.max(i._width+A[0],i._titleWidth+2*(f+d.titlePad))),i._height=Math.ceil(Math.max(i._height+A[1],i._titleHeight+2*(f+d.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,q=G.legendText||G.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=t[0].trace.legendgroup,o=_(t,i,v);l&&""!==a&&(o=M[a]);var f=q?v:T||o;s||u||(f+=p/2),c.setRect(e,0,-r/2,f,r)}))}(t,I,z,e)},function(){var s,u,v,y,b=f._size,x=e.borderwidth;if(!p){if(function(t){var e=t._fullLayout.legend,r=L(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*g[n]})}(t))return;var _=b.l+b.w*e.x-g[L(e)]*e._width,M=b.t+b.h*(1-e.y)-g[S(e)]*e._effHeight;if(f.margin.autoexpand){var A=_,k=M;_=i.constrain(_,0,f.width-e._width),M=i.constrain(M,0,f.height-e._effHeight),_!==A&&i.log("Constrain legend.x to make legend fit inside graph"),M!==k&&i.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(T,_,M)}if(P.on(".drag",null),T.on("wheel",null),p||e._height<=e._maxHeight||t._context.staticPlot){var R=e._effHeight;p&&(R=e._height),C.attr({width:e._width-x,height:R-x,x:x/2,y:x/2}),c.setTranslate(O,0,0),E.select("rect").attr({width:e._width-2*x,height:R-2*x,x:x,y:x}),c.setClipUrl(O,h,t),c.setRect(P,0,0,0,0),delete e._scrollY}else{var D,I,z,N=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-N-2*d.scrollBarMargin,B=e._height-e._effHeight,j=F/B,U=Math.min(e._scrollY||0,B);C.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),E.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),c.setClipUrl(O,h,t),V(U,N,j),T.on("wheel",(function(){V(U=i.constrain(e._scrollY+n.event.deltaY/F*B,0,B),N,j),0!==U&&U!==B&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;D="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,z=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(I="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,V(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,B)}(z,D,I),N,j))}));P.call(H);var Y=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(D=t.changedTouches[0].clientY,z=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(I=t.changedTouches[0].clientY,V(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,B)}(z,D,I),N,j))}));O.call(Y)}function V(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(O,0,-r),c.setRect(P,e._width,d.scrollBarMargin+r*i,d.scrollBarWidth,n),E.select("rect").attr("y",x+r)}t._context.edits.legendPosition&&(T.classed("cursor-move",!0),l.init({element:T.node(),gd:t,prepFn:function(){var t=c.getTranslate(T);v=t.x,y=t.y},moveFn:function(t,r){var n=v+t,i=y+r;c.setTranslate(T,n,i),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),u=l.align(i,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=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}));i.size()>0&&w(t,T,i,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":236,"../../lib":264,"../../lib/events":256,"../../lib/svg_text_utils":289,"../../plots/plots":358,"../../registry":361,"../color":120,"../dragelement":139,"../drawing":142,"./constants":171,"./get_legend_data":174,"./handle_click":175,"./helpers":176,"./style":178,"@plotly/d3":16}],174:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,h={},d=0,p=0;function v(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+d;u.push(n),c[n]=[r],d++}}for(r=0;rA&&(T=A)}w[r][0]._groupMinRank=T,w[r][0]._preGroupSort=r}var k=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*d.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function M(t,a,o){var u=t[0].trace,f=u.marker||{},h=f.line||{},d=o?u.visible&&u.type===o:i.traceIs(u,"bar"),p=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(d?[t]:[]);p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var d=a.mcc;if(!r._inHover&&"mc"in a){var p=c(f),v=p.mid;void 0===v&&(v=(p.max+p.min)/2),d=s.tryColorscale(f,"")(v)}var m=d||a.mc||f.color,y=f.pattern,b=y&&s.getPatternAttr(y.shape,0,"");if(b){var x=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,T=g(y.size,8,10),A=g(y.solidity,.5,1),k="legend-"+u.uid;i.call(s.pattern,"legend",e,k,b,T,A,d,y.fillmode,x,_,M)}else i.call(l.fill,m);o&&l.stroke(i,a.mlc||h.color)}))}function T(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,d=w(h(u.width,o.pts),u,5,2),p=a.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=u.color;var v=a.minExtend(o,{trace:p});f(c,v,p)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.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,i=t[0].trace,o=[];if(i.visible)switch(i.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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),h=c(i),d=h.colorscale,v=h.reversescale;if(d){if(!r){var g=d.length;u=0===o?d[v?g-1:0][1]:1===o?d[v?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var m=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,p(v,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,M(t,this,"waterfall")}var a=[];e.visible&&r&&(a=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(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){M(t,this,"funnel")})).each((function(t){M(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){T(t,this,"funnelarea")})).each((function(t){T(t,this,"pie")})).each((function(t){var r,i,o=v(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,g=o.anyFill,m=o.anyLine,y=t[0],x=y.trace,_=c(x),M=_.colorscale,T=_.reversescale,A=u.hasMarkers(x)||!g?"M5,0":m?"M5,-2":"M5,-3",k=n.select(this),L=k.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",A+"h"+b+"v6h-"+b+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,p(T),M,"fill")}})),f||h){var S=w(void 0,x.line,10,5);i=a.minExtend(x,{line:{width:S}}),r=[a.minExtend(y,{trace:i})]}var E=k.select(".legendlines").selectAll("path").data(f||h?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",A+(h?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(T),M,"stroke")}})})).each((function(t){var r,i,o=v(t),l=o.anyFill,c=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,g=!h&&!c&&!l&&u.hasText(p);function m(t,e,r,n){var i=a.nestedProperty(p,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||g||f){var x={},w={};if(h){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",a.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",a.mean,[2,16],12);x.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",b,[0,10],5)}),g&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[a.minExtend(d,x)],(i=a.minExtend(p,w)).selectedpoints=null,i.texttemplate=null}var T=n.select(this).select("g.legendpoints"),A=T.selectAll("path.scatterpts").data(h?r:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),A.exit().remove(),A.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var k=T.selectAll("g.pointtext").data(g?r:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),k.exit().remove(),k.selectAll("text").call(s.textPointStyle,i,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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":264,"../../registry":361,"../../traces/pie/helpers":387,"../../traces/pie/style_one":388,"../../traces/scatter/subtypes":415,"../color":120,"../colorscale/helpers":131,"../drawing":142,"./constants":171,"@plotly/d3":16}],179:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":181}],180:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h=c._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,v=(1+p)/2,g=(1-p)/2;for(i=0;i1?(R=["toggleHover"],D=["resetViews"]):m?(O=["zoomInGeo","zoomOutGeo"],R=["hoverClosestGeo"],D=["resetGeo"]):g?(R=["hoverClosest3d"],D=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(O=["zoomInMapbox","zoomOutMapbox"],R=["toggleHover"],D=["resetViewMapbox"]):x?R=["hoverClosestGl2d"]:y?R=["hoverClosestPie"]:A?(R=["hoverClosestCartesian","hoverCompareCartesian"],D=["resetViewSankey"]):R=["toggleHover"];v&&(R=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var v=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=N[r+1];else if(t=n.pmax)e=N[r+1];else if(t=0;T--){var A=r.append("path").attr(g).style("opacity",T?.1:m).call(o.stroke,b).call(o.fill,y).call(s.dashLine,T?"solid":_,T?4+x:x);if(p(A,t,a),w){var k=l(t.layout,"selections",a);A.style({cursor:"move"});var L={element:A.node(),plotinfo:d,gd:t,editHelpers:k,isActiveSelection:!0},S=n(c,t);i(S,A,L)}else A.style("pointer-events",T?"all":"none");M[T]=A}var E=M[0];M[1].node().addEventListener("click",(function(){return function(t,e){if(!h(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void v(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=v,f(t)}}(t,E)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function v(t){h(t)&&(t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t)))}e.exports={draw:f,drawOne:d,activateLastSelection:function(t){if(!h(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=v,f(t)}}},{"../../plot_api/plot_template":302,"../color":120,"../drawing":142,"../shapes/display_outlines":214,"../shapes/draw_newshape/helpers":219,"../shapes/handle_outline":221,"../shapes/helpers":222}],204:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":257,"../../drawing/attributes":141}],205:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],206:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,i=t("../../shapes/handle_outline").clearOutline,a=t("../../shapes/draw_newshape/helpers"),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,f=e.plotinfo,h=f.xaxis,d=f.yaxis,p=e.isActiveSelection,v=e.dragmode,g=(c.layout||{}).selections||[];if(!n(v)&&void 0!==p){var m=c._fullLayout._activeSelectionIndex;if(m-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(m)){q(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=K(_))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=d(r),l=v(r);if(s||l){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&i._fullLayout._outlining)s&&(c=M(f,t)),c&&a.call("_guiRelayout",i,{shapes:c}),l&&!U(t)&&(u=T(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:u}).then((function(){e&&A(i)}))),i._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function X(t){return t._id}function Z(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(X),c=r.map(X);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,dt=et[0].yref;if(nt&&dt){var pt=ct(et);ut([C(t,nt,"x"),C(t,dt,"y")])($,pt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),h._reselect=!1}if(!a&&h._deselect){var vt=h._deselect;(function(t,e,r){for(var n=0;n=0)T._fullLayout._deactivateShape(T);else if(!b){var r=A.clickmode;E.done(At).then((function(){if(E.clear(At),2===t){for(xt.remove(),K=0;K-1&&H(e,T,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&ft(T,void 0);l.click(T,e)})).catch(k.error)}},n.doneFn=function(){Tt.remove(),E.done(At).then((function(){E.clear(At),!L&&J&&n.selectionDefs&&(J.subtract=bt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,X)),(L||b)&&W(n,L),n.doneFnCompleted&&n.doneFnCompleted(kt),x&&ft(T,at)})).catch(k.error)}},clearOutline:b,clearSelectionsCache:W,selectOnClick:H}},{"../../lib":264,"../../lib/clear_gl_canvases":251,"../../lib/polygon":276,"../../lib/throttle":290,"../../plot_api/subroutines":303,"../../plots/cartesian/axis_ids":317,"../../registry":361,"../color":120,"../dragelement/helpers":138,"../drawing":142,"../fx":160,"../fx/helpers":156,"../shapes/constants":212,"../shapes/display_outlines":214,"../shapes/draw_newshape/helpers":219,"../shapes/draw_newshape/newshapes":220,"../shapes/handle_outline":221,"../shapes/helpers":222,"./constants":201,"./draw":203,"./draw_newselection/newselections":206,"./helpers":207,"point-in-polygon/nested":73,polybooljs:74}],210:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{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":237,"../../lib/extend":257,"../../plot_api/plot_template":302,"../../traces/scatter/attributes":390,"../annotations/attributes":103,"../drawing/attributes":141}],211:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,f),d=n.aggNums(Math.min,null,f),p=d<0?Math.abs(d)+c:c,v=h>0?h+c:c;return{ppad:c,ppadplus:u?p:v,ppadminus:u?v:p}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]: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;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===S&&(t[0][0]="M"),e[L]=t,M(),T())}}()}}function F(t,r){!function(t,r){if(e.length)for(var n=0;nb?(T=f,S="y0",A=b,E="y1"):(T=b,S="y1",A=f,E="y0");Z(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===D?J:K,X.altKey=n.altKey},doneFn:function(){if(y(t))return;d(e),$(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(y(t))return;$(s)}};function Z(r){if(y(t))D=null;else if(z)D="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(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";d(e,l),D=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;P?F("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(Y(t)+n)},B&&"date"===B.type&&(o=v.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+i)):(l=function(t){return q(V(t)+i)},U&&"date"===U.type&&(l=v.encodeDate(l))),F("path",r.path=w(R,o,l))}else P?F("xanchor",r.xanchor=G(x+n)):(F("x0",r.x0=G(c+n)),F("x1",r.x1=G(m+n))),I?F("yanchor",r.yanchor=q(M+i)):(F("y0",r.y0=q(f+i)),F("y1",r.y1=q(b+i)));e.attr("d",g(t,r)),Q(s,r)}function K(n,i){if(N){var a=function(t){return t},o=a,l=a;P?F("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(Y(t)+n)},B&&"date"===B.type&&(o=v.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+i)):(l=function(t){return q(V(t)+i)},U&&"date"===U.type&&(l=v.encodeDate(l))),F("path",r.path=w(R,o,l))}else if(z){if("resize-over-start-point"===D){var u=c+n,h=I?f-i:f+i;F("x0",r.x0=P?u:G(u)),F("y0",r.y0=I?h:q(h))}else if("resize-over-end-point"===D){var d=m+n,p=I?b-i:b+i;F("x1",r.x1=P?d:G(d)),F("y1",r.y1=I?p:q(p))}}else{var y=function(t){return-1!==D.indexOf(t)},_=y("n"),j=y("s"),H=y("w"),W=y("e"),X=_?T+i:T,Z=j?A+i:A,J=H?k+n:k,K=W?L+n:L;I&&(_&&(X=T-i),j&&(Z=A-i)),(!I&&Z-X>10||I&&X-Z>10)&&(F(S,r[S]=I?X:q(X)),F(E,r[E]=I?Z:q(Z))),K-J>10&&(F(C,r[C]=P?J:G(J)),F(O,r[O]=P?K:G(K)))}e.attr("d",g(t,r)),Q(s,r)}function Q(t,e){(P||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 a=Y(P?e.xanchor:i.midRange(r?[e.x0,e.x1]:v.extractPathCoords(e.path,p.paramIsX))),o=V(I?e.yanchor:i.midRange(r?[e.y0,e.y1]:v.extractPathCoords(e.path,p.paramIsY)));if(a=v.roundPositionForSharpStrokeRendering(a,1),o=v.roundPositionForSharpStrokeRendering(o,1),P&&I){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(P){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,P,l,e,r,D):!0===l.editable&&P.style("pointer-events",O||c.opacity(L)*k<=.5?"stroke":"all");P.node().addEventListener("click",(function(){return function(t,e){if(!b(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void M(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=M,m(t)}}(t,P)}))}}function _(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 w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,i=t.charAt(0),a=p.paramIsX[i],o=p.paramIsY[i],s=p.numParams[i];return i+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function M(t){b(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,m(t)))}e.exports={draw:m,drawOne:x,eraseActiveShape:function(t){if(!b(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&ld&&(t="X"),t}));return a>d&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+p}))}(e,s,c);if("pixel"===e.xsizemode){var x=s(e.xanchor);u=x+e.x0,f=x+e.x1}else u=s(e.x0),f=s(e.x1);if("pixel"===e.ysizemode){var _=c(e.yanchor);h=_-e.y0,d=_-e.y1}else h=c(e.y0),d=c(e.y1);if("line"===p)return"M"+u+","+h+"L"+f+","+d;if("rect"===p)return"M"+u+","+h+"H"+f+"V"+d+"H"+u+"Z";var w=(u+f)/2,M=(h+d)/2,T=Math.abs(w-u),A=Math.abs(M-h),k="A"+T+","+A,L=w+T+","+M;return"M"+L+k+" 0 1,1 "+(w+","+(M-A))+k+" 0 0,1 "+L+"Z"}},{"../../lib":264,"../../plots/cartesian/axes":313,"./constants":212}],223:[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":324,"./attributes":210,"./calc_autorange":211,"./defaults":213,"./draw":215,"./draw_newshape/defaults":218}],224:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps: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:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt: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":257,"../../plot_api/edit_types":295,"../../plot_api/plot_template":302,"../../plots/animation_attributes":307,"../../plots/font_attributes":341,"../../plots/pad_attributes":357,"./constants":225}],225:[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}},{}],226:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(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 E(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 C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function O(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,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=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return z.call(N),D&&(S?z.on(".opacity",null):(A=0,k=!0,z.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(N)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),z.classed("js-placeholder",k),M}}},{"../../constants/alignment":236,"../../constants/interactions":242,"../../lib":264,"../../lib/svg_text_utils":289,"../../plots/plots":358,"../../registry":361,"../color":120,"../drawing":142,"@plotly/d3":16,"fast-isnumeric":31}],230:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":257,"../../plot_api/edit_types":295,"../../plot_api/plot_template":302,"../../plots/font_attributes":341,"../../plots/pad_attributes":357,"../color/attributes":119}],231:[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"}}},{}],232:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(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,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":264,"../../plots/array_container_defaults":308,"./attributes":230,"./constants":231}],233:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function v(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||m(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(k,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(L,String(p(r,i)?-1:i._index)),m(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(M,i)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=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(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),d=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,g=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?g=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(k,o,x),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(v(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(v(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(M,o),u.call(_,o)}))})),u.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,d=i.active;if(u)for(s=0,l=0;l0?[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(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,A=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,L=p,S=g+m;S+k>c&&(S=c-k);var E=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),T?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:L,y:S,width:A,height:k}),this._hbarXMin=L+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>M,O=s.barWidth+2*s.barPad,R=s.barLength+2*s.barPad,D=p+v,P=g;D+O>l&&(D=l-O);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:P,width:O,height:R}),this._vbarYMin=P+R/2,this._vbarTranslateMax=M-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,N=u-.5,F=C?f+O+.5:f+.5,B=h-.5,j=T?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+z).data(T||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",z).append("rect"),T||C?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(B),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(j)-Math.floor(B)}),this.container.call(a.setClipUrl,z,this.gd),this.bg.attr({x:p,y:g,width:v,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),T||C){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(Y),C&&this.vbar.on(".drag",null).call(Y)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":264,"../color":120,"../drawing":142,"@plotly/d3":16}],236:[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"}}},{}],237:[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(" ")}}},{}],238:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],239:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],240:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],241:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],242:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],243:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],244:[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}},{}],245:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],247:[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}},{}],248:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,h,d,p,v=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}v?(u=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":271}],249:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(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(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?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),M=t.match(w?b:y);if(!M)return u;var T=M[1],A=M[3]||"1",k=Number(M[5]||1),L=Number(M[7]||0),S=Number(M[9]||0),E=Number(M[11]||0);if(c){if(2===T.length)return u;var C;T=Number(T);try{var O=g.getComponentMethod("calendars","getCal")(e);if(w){var R="i"===A.charAt(A.length-1);A=parseInt(A,10),C=O.newDate(T,O.toMonthIndex(T,A,R),k)}else C=O.newDate(T,Number(A),k)}catch(t){return u}return C?(C.toJD()-v)*f+L*h+S*d+E*p:u}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),A-=1;var D=new Date(Date.UTC(2e3,A,k,L,S));return D.setUTCFullYear(T),D.getUTCMonth()!==A||D.getUTCDate()!==k?u:D.getTime()+E*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var M=90*f,T=3*h,A=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var L=Math.floor(w/f)+v,S=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a("%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 s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var L=/%\d?f/g,S=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function C(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 i=new Date(Math.floor(e+.05));if(t=t.replace(S,(function(){return E[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var O=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),O[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var R=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+v,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-v)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+R);return c.setUTCMonth(c.getUTCMonth()+e)+n-R},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u1||v<0||v>1?null:{x:t+l*v,y:e+f*v}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,d=c-a,p=u*u+f*f,v=h*h+d*d,g=Math.min(l(u,f,p,i-t,a-e),l(u,f,p,o-t,c-e),l(h,d,v,t-i,e-a),l(h,d,v,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var d=h(c);d;){if((c+=d+r)>f)return;d=h(c)}for(d=h(f);d;){if(c>(f-=d+r))return;d=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":271}],261:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,d,p,v=t.color,g=l(v),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=g?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||m)for(var x=0;x1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],264:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var d=t("./array");f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=t("./mod");f.mod=p.mod,f.modHalf=p.modHalf;var v=t("./coerce");f.valObjectMeta=v.valObjectMeta,f.coerce=v.coerce,f.coerce2=v.coerce2,f.coerceFont=v.coerceFont,f.coercePattern=v.coercePattern,f.coerceHoverinfo=v.coerceHoverinfo,f.coerceSelectionMarkerOpacity=v.coerceSelectionMarkerOpacity,f.validate=v.validate;var g=t("./dates");f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var m=t("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=t("./extend");f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var T=t("./loggers");f.log=T.log,f.warn=T.warn,f.error=T.error;var A=t("./regex");f.counterRegex=A.counter;var k=t("./throttle");f.throttle=k.throttle,f.throttleDone=k.done,f.clearThrottle=k.clear;var L=t("./dom");function S(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.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},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var P=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return P.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var I={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(I,arguments)};var z={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(z,arguments)};var N=/^[:|\|]/;function F(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,h,d="_xother"===s||"_yother"===s,p="_xother_"===s||"_yother_"===s,v="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||d||v||p,m=s;if((d||p)&&(m=m.substring(1)),(v||p)&&(m=m.substring(0,m.length-1)),g){if(void 0===(c=e[m]))return""}else for(h=3;h=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var B=2e9;f.seedPseudoRandom=function(){B=2e9},f.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?f.pseudoRandom():B/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.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;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.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)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":243,"./anchor_utils":247,"./angles":248,"./array":249,"./clean_number":250,"./clear_responsive":252,"./coerce":253,"./dates":254,"./dom":255,"./extend":257,"./filter_unique":258,"./filter_visible":259,"./geometry2d":260,"./identity":262,"./increment":263,"./is_plain_object":265,"./keyed_container":266,"./localize":267,"./loggers":268,"./make_trace_groups":269,"./matrix":270,"./mod":271,"./nested_property":272,"./noop":273,"./notifier":274,"./preserve_drawing_buffer":277,"./push_unique":278,"./regex":280,"./relative_attr":281,"./relink_private":282,"./search":283,"./sort_object_keys":286,"./stats":287,"./throttle":290,"./to_log_range":291,"@plotly/d3":16,"d3-format":25,"d3-time-format":26,"fast-isnumeric":31}],265:[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).hasOwnProperty("hasOwnProperty")}},{}],266:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":300,"./notifier":274}],269:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":16}],270:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],272:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,h,d,p,v=r.length,g=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,m)))if(cu||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":243,"./matrix":270}],277:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":31,"is-mobile":66}],278:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}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 a,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?u:c,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":249,"fast-isnumeric":31}],288:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":20}],289:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,v){var k=t.text(),L=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&k.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),L?(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 a,o,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2!==h&&3!==h)return void i.warn("No MathJax version:",MathJax.version);var d=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(a):MathJax.typeset([a])},p=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),d,p,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){d(),p(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}(L[2],o,(function(n,i,o){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return R(),void e();var l=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:O,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",h=s.select("g");h.attr({fill:f,stroke:f});var d=h.node().getBoundingClientRect(),p=d.width,g=d.height;(p>c||g>u)&&(s.style("overflow","hidden"),p=(d=s.node().getBoundingClientRect()).width,g=d.height);var m=+t.attr("x"),y=+t.attr("y"),b=-(r||t.node().getBoundingClientRect().height)/4;if("y"===O[0])l.attr({transform:"rotate("+[-90,m,y]+")"+a(-p/2,b-g/2)});else if("l"===O[0])y=b-g/2;else if("a"===O[0]&&0!==O.indexOf("atitle"))m=0,y=b;else{var x=t.attr("text-anchor");m-=p*("middle"===x?.5:"end"===x?1:0),y=y+b-g/2}s.attr({x:m,y:y}),v&&v.call(t,l),e(l)}))}))):R(),t}function R(){C.empty()||(O=t.attr("class")+"-math",C.select("svg."+O).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?u():(r=t,l=[{node:t}]);for(var L=e.split(m),C=0;C|>|>)/g;var f=[["$","$"],["\\(","\\)"]];var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},v=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var A=/(^|;)\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"],i="...".length,a=t.split(m),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,p-i)+"..."):o.push(u.substr(0,p));break}s=""}}return o.join("")};var k={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)):k[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==v.indexOf(i)&&-1!==v.indexOf(a)?e:""}function C(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(m),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.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)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],291:[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":31}],292:[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"}}},{}],293:[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"}}},{}],294:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&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 a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.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 a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!v&&(h(g,m),d(t),!0)}var b,x,_,w,M,T,A,k,L=Object.keys(r).map(Number).sort(o),S=e.get(),E=S||[],C=u(m,f).get(),O=[],R=-1,D=E.length;for(b=0;bE.length-(A?0:1))a.warn("index out of range",f,_);else if(void 0!==T)M.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?O.push(_):A?("add"===T&&(T={}),E.splice(_,0,T),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,T),-1===R&&(R=_);else for(x=0;x=0;b--)E.splice(O[b],1),C&&C.splice(O[b],1);if(E.length?S||e.set(E):e.set(null),v)return!1;if(h(g,m),p!==i){var P;if(-1===R)P=L;else{for(D=Math.max(E.length,D),P=[],b=0;b=R);b++)P.push(_);for(b=R;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function R(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),O(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&O(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in O(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var v=0;v-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(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 i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(H(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&Y(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(k)),s.push(h.rehover,h.redrag,h.reselect),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[d.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function Y(t,e){var r=e?function(t){var r=[];for(var n in e){var i=d.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return d.draw(t,r,{skipTitle:!0})}:function(t){return d.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var V=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,h=N(l._preGUI,c),p=Object.keys(e),v=d.list(t),g=o.extendDeepAll({},e),m={};for(j(e),p=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[I];)I--;var F=D.parts[I],B=D.parts[I-1]+"."+F,U=D.parts.slice(0,I).join("."),H=s(t.layout,U).get(),Y=s(l,U).get(),W=D.get();if(void 0!==P){k[R]=P,L[R]="reverse"===F?P:z(W);var Z=f.getLayoutValObject(l,D.parts);if(Z&&Z.impliedEdits&&null!==P)for(var J in Z.impliedEdits)S(o.relativeAttr(R,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(R))if(P){S("autosize",null);var K="height"===R?"width":"height";S(K,l[K])}else l[R]=t._initialAutoSize[R];else if("autosize"===R)S("width",P?null:l.width),S("height",P?null:l.height);else if(B.match(V))O(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){O(B),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else B.match(q)&&s(l,U+"._inputDomain").set(null);if("type"===F){E=H;var $="linear"===Y.type&&"log"===P,tt="log"===Y.type&&"linear"===P;if($||tt){if(E&&E.range)if(Y.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&S(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(U+".range[0]",Math.log(et)/Math.LN10),S(U+".range[1]",Math.log(rt)/Math.LN10)):(S(U+".range[0]",Math.pow(10,et)),S(U+".range[1]",Math.pow(10,rt)))}else S(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,Y,P,S),u.getComponentMethod("images","convertCoords")(t,Y,P,S)}else S(U+".autorange",!0),S(U+".range",null);s(l,U+"._inputRange").set(null)}else if(F.match(T)){var nt=s(l,R).get(),it=(P||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,S),u.getComponentMethod("images","convertCoords")(t,nt,it,S)}var at=x.containerArrayMatch(R);if(at){r=at.array,n=at.index;var ot=at.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(P)?L[R]=null:x.isRemoveVal(P)?L[R]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(A,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=P,delete e[R]}else"reverse"===F?(H.range?H.range.reverse():(S(U+".autorange",!0),H.range=[1,0]),Y.autorange?A.calc=!0:A.plot=!0):("dragmode"===R&&(!1===P&&!1!==W||!1!==P&&!1===W)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===R&&("lasso"===P||"select"===P)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?A.plot=!0:Z?M.update(A,Z):A.calc=!0,D.set(P))}}for(r in m){x.applyContainerArrayChanges(t,h(a,r),m[r],A,h)||(A.plot=!0)}for(var ct in C){var ut=(E=d.getFromId(t,ct))&&E._constraintGroup;if(ut)for(var ft in A.calc=!0,ut)C[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(A.plot=!0),(A.plot||A.calc)&&(A.layoutReplot=!0),{flags:A,rangesAltered:C,undoit:L,redoit:k,eventData:g}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=B(t,o.extendFlat({},e),a),l=s.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var d=[];f.layoutReplot?d.push(w.layoutReplot):l.fullReplot?d.push(r._doPlot):(d.push(h.previousPromises),H(t,f,u)||h.supplyDefaults(t),l.style&&d.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&d.push(w.doColorBars),f.legend&&d.push(w.doLegend),f.layoutstyle&&d.push(w.layoutStyles),f.axrange&&Y(d,u.rangesAltered),f.ticks&&d.push(w.doTicksRelayout),f.modebar&&d.push(w.doModeBar),f.camera&&d.push(w.doCamera),d.push(k)),d.push(h.rehover,h.redrag,h.reselect),c.add(t,Z,[t,s.undoit,u.undoit,s.traces],Z,[t,s.redoit,u.redoit,s.traces]);var p=o.syncOrAsync(d,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}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(a,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,h.transition(t,e.frame.data,e.frame.layout,_.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 d(){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 p,v,g=0;function m(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&TT)&&A.push(v);y=A}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var v=e[n].name,g=(u[v]||p[v]||{}).name,m=e[n].name,y=u[g]||p[g];g&&m&&"number"==typeof m&&y&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(u[g]||p[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[v]={name:v},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,s],d=[t,a];return c&&c.add(t,l,f,u,d),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return m(i,e,s)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":264,"../plots/attributes":309}],303:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),v=p.enforce,g=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function b(t){var e,i,s,u,p,v,g=t._fullLayout,m=g._size,b=m.p,_=h.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return a.previousPromises(t);function M(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var T=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=M(u,T,u.side),u._mainMirrorPosition=u.mirror&&T?M(u,T,d.OPPOSITE_SIDE[u.side]):null}var A=[],k=[],L=[],S=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,C=s.yaxis.domain,O=s.plotgroup;if(y(E,C,L)){var R=O.node(),D=s.bg=o.ensureSingle(O,"rect","bg");R.insertBefore(D.node(),R.childNodes[0]),k.push(i)}else O.select("rect.bg").remove(),L.push([E,C]),S||(A.push(i),k.push(i))}var P,I,z,N,F,B,j,U,H,Y,V,G,q,W=g._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){g._plots[t].bg=n.select(this)})),e=0;eM?u.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=v(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:d,layout:h},""),u.length)return u.map(m)}},{"../lib":264,"../plots/attributes":309,"../plots/plots":358,"./plot_config":300,"./plot_schema":301,"./plot_template":302}],305:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=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,h,d,p;function v(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!v("width")&&null!==e.width||!v("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!v("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function m(t,r){return o.coerce(e,g,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var A=o.extendFlat({},h);b?A.width=b:null===e.width&&n(p.width)&&(A.width=p.width),x?A.height=x:null===e.height&&n(p.height)&&(A.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=s.getRedrawFunc(T);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(T._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function h(){i.purge(T),document.body.removeChild(T)}if("full-json"===y){var d=a.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=u,d=JSON.stringify(d),h(),t(M?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(M?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(T,r,A,k).then(L).then(S).then(E).then((function(e){t(function(t){return M?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":264,"../plots/plots":358,"../snapshot/helpers":365,"../snapshot/svgtoimg":367,"../snapshot/tosvg":369,"../version":443,"./plot_api":299,"fast-isnumeric":31}],306:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&i.push(p("unused",a,m.concat(b.length)));var A,k,L,S,E,C=b.length,O=Array.isArray(T);if(O&&(C=Math.min(C,T.length)),2===x.dimensions)for(k=0;kb[k].length&&i.push(p("unused",a,m.concat(k,b[k].length)));var R=b[k].length;for(A=0;A<(O?Math.min(R,T[k].length):R);A++)L=O?T[k][A]:T,S=y[k][A],E=b[k][A],n.validate(S,L)?E!==S&&E!==+S&&i.push(p("dynamic",a,m.concat(k,A),S,E)):i.push(p("value",a,m.concat(k,A),S))}else i.push(p("array",a,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),i.supplyDefaults(v);for(var g=v._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:i};c=f}for(var h=e.calendar,d="start"===l,p="end"===l,v=t[r+"period0"],g=a(v,h)||0,m=[],y=[],b=[],x=i.length,_=0;_A;)T=o(T,-c,h);for(;T<=A;)T=o(T,c,h);M=o(T,-c,h)}else{for(T=g+(w=Math.round((A-g)/u))*u;T>A;)T-=u;for(;T<=A;)T+=u;M=T-u}m[_]=d?M:p?T:(M+T)/2,y[_]=M,b[_]=T}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":243,"../../lib":264,"fast-isnumeric":31}],311:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],312:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),c=v(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=u[0].val,g=f[0].val;for(r=1;r0&&((M=S-s(b)-l(x))>E?T/M>C&&(_=b,w=x,C=T/M):T/S>C&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},C=T/S));if(h===g){var O=h-1,R=h+1;if(k)if(0===h)i=[0,1];else{var D=(h>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),P=h/(1-Math.min(.5,D/S));i=h>0?[0,P]:[P,0]}else i=L?[Math.max(0,O),Math.max(1,R)]:[O,R]}else k?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-d(e,b.val,x.val))/(S-s(_)-l(w)),i=[_.val-C*s(_),w.val+C*l(w)];return m&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),L=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=A(r.vpadplus||r.vpad),E=A(r.vpadminus||r.vpad);if(!M){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=a),a>d&&a-o&&(h=a),a>d&&a=R;n--)O(n);return{min:p,max:v,opts:r}},concatExtremes:v};function v(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function h(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function b(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":142,"../../constants/numerical":243,"../../lib":264,"../../registry":361,"./axis_ids":317,"@plotly/d3":16,"fast-isnumeric":31}],313:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),v=t("../../constants/numerical"),g=v.ONEMAXYEAR,m=v.ONEAVGYEAR,y=v.ONEMINYEAR,b=v.ONEMAXQUARTER,x=v.ONEAVGQUARTER,_=v.ONEMINQUARTER,w=v.ONEMAXMONTH,M=v.ONEAVGMONTH,T=v.ONEMINMONTH,A=v.ONEWEEK,k=v.ONEDAY,L=k/2,S=v.ONEHOUR,E=v.ONEMIN,C=v.ONESEC,O=v.MINUS_SIGN,R=v.BADNUM,D={K:"zeroline"},P={K:"gridline",L:"path"},I={K:"minor-gridline",L:"path"},z={K:"tick",L:"path"},N={K:"tick",L:"text"},F={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},B=t("../../constants/alignment"),j=B.MID_SHIFT,U=B.CAP_SHIFT,H=B.LINE_SPACING,Y=B.OPPOSITE_SIDE,V=e.exports={};V.setConvert=t("./set_convert");var G=t("./axis_autotype"),q=t("./axis_ids"),W=q.idSort,X=q.isLinked;V.id2name=q.id2name,V.name2id=q.name2id,V.cleanId=q.cleanId,V.list=q.list,V.listIds=q.listIds,V.getFromId=q.getFromId,V.getFromTrace=q.getFromTrace;var Z=t("./autorange");V.getAutoRange=Z.getAutoRange,V.findExtremes=Z.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}V.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},V.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},V.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==V.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=V.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},V.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:V.getFromId(e,r).cleanPos)(t)},V.redrawComponents=function(t,e){e=e||V.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;ur&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},V.saveRangeInitial=function(t,e){for(var r=V.list(t,"",!0),n=!1,i=0;i.3*h||u(n)||u(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=V.tickIncrement(t,"M6","reverse")+1.5*k:a.exactMonths>.8?t=V.tickIncrement(t,"M1","reverse")+15.5*k:t-=L;var l=V.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,c,a)),g=y,0;g<=u;)g=V.tickIncrement(g,m,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(g,0,a),size:m,_dataSpan:u-c}},V.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=V.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,V.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),f=c?e.dtick:+e.dtick.substring(1),h=u?t.dtick:+t.dtick.substring(1);c&&u?tt(f,h)?f===2*A&&h===2*k&&(t.dtick=A):f===2*A&&h===3*k?t.dtick=A:f!==A||(e._input.minor||{}).nticks?et(f/h,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=k:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":tt(f,h)?f>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,h)||(t.dtick=et(f/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},V.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,V.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!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=V.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=S,o&&!n&&t.dtick=(D?0:1);P--){var I=!P;P?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var z=P?t:s.extendFlat({},t,t.minor);if(I?V.prepMinorTicks(z,t,e):V.prepTicks(z,e),"array"!==z.tickmode){var N=J(u),F=N[0],B=N[1],j=i(z.dtick),U="log"===a&&!(j||"L"===z.dtick.charAt(0)),H=V.tickFirst(z,e);if(P){if(t._tmin=H,H=B:W<=B;W=V.tickIncrement(W,X,f,o)){if(P&&Y++,z.rangebreaks&&!f){if(W=d)break}if(C.length>p||W===q)break;q=W;var Z={value:W};P?(U&&W!==(0|W)&&(Z.simpleLabel=!0),l>1&&Y%l&&(Z.skipLabel=!0),C.push(Z)):(Z.minor=!0,O.push(Z))}}else P?(C=[],v=nt(t)):(O=[],E=nt(t))}if(D&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=C.map((function(t){return t.value})),Q=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,h=0;f>=y?h=u>=y&&u<=g?u:m:r===x&&f>=_?h=u>=_&&u<=b?u:x:f>=T?h=u>=T&&u<=w?u:M:r===A&&f>=A?h=A:f>=k?h=k:r===L&&f>=L?h=L:r===S&&f>=S&&(h=S),h>=u&&(h=u,s=!0);var d=i+h;if(e.rangebreaks&&h>0){for(var p=0,v=0;v<84;v++){var E=(v+.5)/84;e.maskBreaks(i*(1-E)+E*d)!==R&&p++}(h*=p/84)||(t[n].drop=!0),s&&u>A&&(h=u)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(C,t,t._definedDelta),t.rangebreaks){var at="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=C.length-1;r>-1;r--)if(C[r].drop)C.splice(r,1);else{C[r].value=Rt(C[r].value,t);var lt=t.c2p(C[r].value);(at?st>lt-ot:std||utd&&(ct.periodX=d),ut10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=k&&a<=10||e>=15*k)t._tickround="d";else if(e>=E&&a<=16||e>=S)t._tickround="M";else if(e>=C&&a<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(vt(t.exponentformat)&&!gt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function dt(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}}V.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>m)e/=m,n=a(10),t.dtick="M"+12*ft(e,n,it);else if(o>M)e/=M,t.dtick="M"+ft(e,1,at);else if(o>k){if(t.dtick=ft(e,k,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=V.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>S?t.dtick=ft(e,S,at):o>E?t.dtick=ft(e,E,ot):o>C?t.dtick=ft(e,C,ot):(n=a(10),t.dtick=ft(e,n,it))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=a(10),t.dtick="L"+ft(e,n,it)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Ot(t)?(t.tick0=0,n=1,t.dtick=ft(e,n,ut)):(t.tick0=0,n=a(10),t.dtick=ft(e,n,it));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},V.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ct:lt,f=t+.01*o,h=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},V.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=mt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||vt(d)&>(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":O)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":O)+h:(e.text=mt(Math.pow(10,l),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,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,c,v):"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),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Ot(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=mt(e.x,t,i,n);else{var a=e.x/180;if(0===a)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,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=mt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=O+e.text)}}}}(t,o,r,c,v):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=mt(e.x,t,i,n)}(t,o,0,c,v),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},V.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return V.hoverLabelText(t,n,r)+" - "+V.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=V.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":O+o:o};var pt=["f","p","n","\u03bc","m","","k","M","G","T"];function vt(t){return"SI"===t||"B"===t}function gt(t){return t>14||t<-15}function mt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=V.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};ht(h),o=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,O);var d,p=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+d+"":"B"===l&&9===c?t+="B":vt(l)&&(t+=pt[c/3+5]));return a?O+t:t}function yt(t,e){if(t){var r=Object.keys(F).reduce((function(t,r){return-1!==e.indexOf(r)&&F[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function bt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),d.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[v]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==c._dfltTitle[p]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=h),!0===e.mirror||"ticks"===e.mirror?i[v]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[v]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}it&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(yt(n,e.automargin),yt(i,e.automargin)),a.autoMargin(t,At(e),n),a.autoMargin(t,kt(e),i),a.autoMargin(t,Lt(e),s)})),r.skipTitle||it&&"bottom"===e.side||rt.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+wt(e);else{var s=Dt(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"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,d,p,v=V.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,d="top"===e.side?v-r:v+r):(d=e._offset+e._length/2,f="right"===e.side?v+r:v-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(p={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var m=h.getTranslate(g.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:p,transform:c,attributes:{x:f,y:d,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function at(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=Tt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},V.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},V.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},V.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=h*U,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=h*(1-U));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(xt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(xt(e)))}},V.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},V.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,v=h?t.ticklen:0;if(f?v*=-1:u&&(v=0),h&&(d+=v,r)){var g=s.deg2rad(r);d=v*Math.cos(g)+1,p=v*Math.sin(g)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},M=0,T=t.side,A=t._id.charAt(0),k=t.tickangle;if("x"===A)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=p*x,y=e+d*x,b=_?1:-.2,90===Math.abs(k)&&(f?b+=j:b=-90===k&&"bottom"===T?U:90===k&&"top"===T?j:.5,M=j/2*(k/90)),w.xFn=function(t){return t.dx+m+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*x<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"===A){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=d,y=p*x,b=0,f||90!==Math.abs(k)||(b=-90===k&&"left"===T||90===k&&"right"===T?U:.5),f){var L=i(k)?+k:0;if(0!==L){var S=s.deg2rad(L);M=Math.abs(Math.sin(S))*U*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*j},w.anchorFn=function(t,e){return i(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},V.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,_t);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Pt(e,[z]),o.attr("transform",r.transFn)},V.drawGrid=function(t,e,r){r=r||{};var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&V.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;m--){var y=m?v:g;if(y){var b=y.selectAll("path."+i).data(m?s:o,_t);b.exit().remove(),b.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),b.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?p:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&b.attr("d",r.path)}}Pt(e,[P,I])},V.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=V.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.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 W(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Pt(e,[D])},V.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",d=r.vals.filter((function(t){return t.text})),p=r.labelFns,v=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(e.showticklabels?d:[],_t),y=[];function b(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),u=p.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),d=c.lineCount(o),v=H*t.fontSize,g=p.heightFn(t,i(a)?+a:0,(d-1)*v);if(g&&(f+=l(0,g)),s.empty()){var m=o.select("text");m.attr({transform:f,"text-anchor":u}),m.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var y=h.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(y,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,p.xFn(e),p.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){b(r,v)}))):b(r,v)})),Pt(e,[N]),m.exit().remove(),r.repositionOnUpdate&&m.each((function(t){n.select(this).select("text").call(c.positionText,p.xFn(t),p.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),d=Math.max(l,c),p=e.side,v=1/0,g=-1/0;for(var y in m.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=h.bBox(r.node()),s=0;o?(a.right>d||a.leftd||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},b(m,g+1?g:v);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(x=90,_.push((function(){b(m,g)}))):_.push((function(){if(b(m,v),d.length&&"x"===u&&!i(v)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,a=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=Tt(this),o=h.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,l=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},p=f("top"),g=f("left"),y=f("right"),_=f("bottom")||g||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=x(o[s])){u=g;break}var f=i("pattern",u);if(f===g)for(s=0;s<2;s++)(c=x(o[s]))&&(e.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case g: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 m: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 h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]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 a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":361,"./constants":320}],318:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*b)||M)for(r=0;rD&&NO&&(O=N);h/=(O-C)/(2*R),C=l.l2r(C),O=l.l2r(O),l.range=l._input.range=L=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,i,a)}function H(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 Y(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){R&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),R=!1)}function G(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 q(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},h={},d=(a||{}).xaHash,p=(a||{}).yaHash,v=0;v=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(Y(i),2!==t||mt||Vt(),gt)o.indexOf("select")>-1&&L(r,i,J,K,e.id,Ot),o.indexOf("event")>-1&&d.click(i,r,e.id);else if(1===t&&mt){var s=v?D:R,c="s"===v||"w"===m?0:1,f=s._name+".range["+c+"]",h=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),p="left",g="middle";if(s.fixedrange)return;v?(g="n"===v?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),i._context.showAxisRangeEntryBoxes&&n.select(xt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),i=Math.max(0,Math.min(et,pt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){Lt="",Mt.r=Mt.l,Mt.t=Mt.b,Et.attr("d","M0,0Z")}if(Mt.l=Math.min(_t,n),Mt.r=Math.max(_t,n),Mt.t=Math.min(wt,i),Mt.b=Math.max(wt,i),rt.isSubplotConstrained)a>O||o>O?(Lt="xy",a/tt>o/et?(o=a*et/tt,wt>i?Mt.t=wt-o:Mt.b=wt+o):(a=o*tt/et,_t>n?Mt.l=_t-a:Mt.r=_t+a),Et.attr("d",G(Mt))):s();else if(nt.isSubplotConstrained)if(a>O||o>O){Lt="xy";var l=Math.min(Mt.l/tt,(et-Mt.b)/et),c=Math.max(Mt.r/tt,(et-Mt.t)/et);Mt.l=l*tt,Mt.r=c*tt,Mt.b=(1-l)*et,Mt.t=(1-c)*et,Et.attr("d",G(Mt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;uv[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":264,"fast-isnumeric":31}],330:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":333}],331:[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 i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":236}],332:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,v=d.BADNUM,g=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,b=d.ONEHOUR,x=d.ONEMIN,_=d.ONESEC,w=t("./axis_ids"),M=t("./constants"),T=M.HOUR_PATTERN,A=M.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function L(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function S(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return v}function E(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===v){if(!s(e))return v;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function C(e,r,n){return c(e,r,n||t.calendar)}function O(e){return t._categories[Math.round(e)]}function R(e){if(L(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 v}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function I(t){return s(t)?+t:D(t)}function z(t,e,r){return n.round(r+e*t,2)}function N(t,e,r){return(t-r)/e}var F=function(e){return s(e)?z(e,t._m,t._b):v},B=function(e){return N(e,t._m,t._b)};if(t.rangebreaks){var j="y"===d;F=function(e){if(!s(e))return v;var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?z(e,t._m2,f):0},B=function(e){var r=t._rangebreaks.length;if(!r)return N(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return N(e,t._m2,t._B[n])}}t.c2l="log"===t.type?S:f,t.l2c="log"===t.type?k:f,t.l2p=F,t.p2l=B,t.c2p="log"===t.type?function(t,e){return F(S(t,e))}:F,t.p2c="log"===t.type?function(t){return k(B(t))}:B,-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=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return S(l(t),e)},t.r2d=t.r2c=function(t){return k(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=S,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(B(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,v,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=R,t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(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=D,t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(i=0;ip&&(o[n]=p),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][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(s=0;su&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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 g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=a.simpleMap(e.xr0,i.r2l),v=a.simpleMap(e.xr1,i.r2l),g=p[1]-p[0],m=v[1]-v[0];d[0]=(p[0]*(1-r)+r*v[0]-p[0])/(p[1]-p[0])*c,d[2]=c*(1-r+r*m/g),i.range[0]=i.l2r(p[0]*(1-r)+r*v[0]),i.range[1]=i.l2r(p[1]*(1-r)+r*v[1])}else d[0]=0,d[2]=c;if(h){var y=a.simpleMap(e.yr0,l.r2l),b=a.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*u,d[3]=u*(1-r+r*_/x),l.range[0]=i.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/d[2]:1,M=h?u/d[3]:1,T=f?d[0]:0,A=h?d[1]:0,k=f?d[0]/d[2]*c:0,L=h?d[1]/d[3]*u:0,S=i._offset-k,E=l._offset-L;n.clipRect.call(o.setTranslate,T,A).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,S,E).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}s.redrawComponents(t)}},{"../../components/drawing":142,"../../lib":264,"../../registry":361,"./axes":313,"@plotly/d3":16}],338:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],h={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(c,l)){var d=a(c),p=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f.999&&(v="turntable"):v="turntable")}else v="turntable";r("dragmode",v),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":120,"../../../lib":264,"../../../registry":361,"../../get_data":343,"../../subplot_defaults":359,"./axis_defaults":347,"./layout_attributes":350}],350:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":264,"../../../lib/extend":257,"../../domain":340,"./axis_attributes":346}],351:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":288}],352:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var h=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/h)}for(var d=n.calcTicks(u,{msUTC:!0}),p=0;p/g," "));l[c]=d,u.tickmode=f}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(p=0;p<2;++p)e.bounds[p][c]=t.glplot.bounds[p][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),u=null,h=e.glplot.selection,v=0;v")):"isosurface"===t.type||"volume"===t.type?(M.valueLabel=d.hoverLabelText(e._mockAxis,e._mockAxis.d2l(h.traceCoordinate[3]),t.valuehoverformat),L.push("value: "+M.valueLabel),h.textLabel&&L.push(h.textLabel),b=L.join("
")):b=h.textLabel;var S={x:h.traceCoordinate[0],y:h.traceCoordinate[1],z:h.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};p.appendArrayPointValue(S,_,w),t._module.eventData&&(S=_._module.eventData(S,h,_,{},w));var E={points:[S]};if(e.fullSceneLayout.hovermode){var C=[];p.loneHover({trace:_,x:(.5+.5*y[0]/y[3])*s,y:(.5-.5*y[1]/y[3])*l,xLabel:M.xLabel,yLabel:M.yLabel,zLabel:M.zLabel,text:b,name:u.name,color:p.castHoverOption(_,w,"bgcolor")||u.color,borderColor:p.castHoverOption(_,w,"bordercolor"),fontFamily:p.castHoverOption(_,w,"font.family"),fontSize:p.castHoverOption(_,w,"font.size"),fontColor:p.castHoverOption(_,w,"font.color"),nameLength:p.castHoverOption(_,w,"namelength"),textAlign:p.castHoverOption(_,w,"align"),hovertemplate:f.castOption(_,w,"hovertemplate"),hovertemplateLabels:f.extendFlat({},S,M),eventData:[S]},{container:n,gd:r,inOut_bbox:C}),S.bbox=C[0]}h.buttons&&h.distance<5?r.emit("plotly_click",E):r.emit("plotly_hover",E),this.oldEventData=E}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var T=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=T[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,d=0;d<(u||l.length);d++)if(f.isArrayOrTypedArray(l[d]))for(var p=0;pg[1][a])g[0][a]=-1,g[1][a]=1;else{var E=g[1][a]-g[0][a];g[0][a]-=E/32,g[1][a]+=E/32}if("reversed"===s.autorange){var C=g[0][a];g[0][a]=g[1][a],g[1][a]=C}}else{var O=s.range;g[0][a]=s.r2l(O[0]),g[1][a]=s.r2l(O[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),m[a]=g[1][a]-g[0][a],this.glplot.setBounds(a,{min:g[0][a]*h[a],max:g[1][a]*h[a]})}var R=c.aspectmode;if("cube"===R)p=[1,1,1];else if("manual"===R){var D=c.aspectratio;p=[D.x,D.y,D.z]}else{if("auto"!==R&&"data"!==R)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=[1,1,1];for(a=0;a<3;++a){var I=y[l=(s=c[T[a]]).type];P[a]=Math.pow(I.acc,1/I.count)/h[a]}p="data"===R||Math.max.apply(null,P)/Math.min.apply(null,P)<=4?P:[1,1,1]}c.aspectratio.x=u.aspectratio.x=p[0],c.aspectratio.y=u.aspectratio.y=p[1],c.aspectratio.z=u.aspectratio.z=p[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var z=c.domain||null,N=e._size||null;if(z&&N){var F=this.container.style;F.position="absolute",F.left=N.l+z.x[0]*N.w+"px",F.top=N.t+(1-z.y[1])*N.h+"px",F.width=N.w*(z.x[1]-z.x[0])+"px",F.height=N.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),h=l||c;if(h){var d={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),d[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),d[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,d),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",h={x:0,y:0,z:1},d={};d[c]=h;var p=n.layout;u.call("_storeDirectGUIEdit",p,i._preGUI,d),a.up=h,f.nestedProperty(p,c).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d",{willReadFrequently:!0}),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[T[t]];d.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(this._mockAxis,t)},e.exports=_},{"../../../stackgl_modules":444,"../../components/fx":160,"../../lib":264,"../../lib/show_no_webgl_msg":285,"../../lib/str2rgbarray":288,"../../plots/cartesian/axes":313,"../../registry":361,"./layout/convert":348,"./layout/spikes":351,"./layout/tick_marks":352,"./project":353,"has-passive-events":64,"webgl-context":85}],355:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;a=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.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"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&P.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&P.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,f,n),x.cleanPlot(h,l,f,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,H=!(!l._has||!l._has("cartesian"))||j;U&&!H?n._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&p({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=x.layoutAttributes.width.min,d=x.layoutAttributes.height.min;n1,v=!e.height&&Math.abs(r.height-i)>1;(v||p)&&(p&&(r.width=n),v&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a1&&(r.l/=m,r.r/=m)}if(d){var y=(r.t+r.b)/d;y>1&&(r.t/=y,r.b/=y)}var b=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,M=void 0!==r.yb?r.yb:r.y;p[e]={l:{val:b,size:r.l+g},r:{val:_,size:r.r+g},b:{val:M,size:r.b+g},t:{val:w,size:r.t+g}},v[e]=1}else delete p[e],delete v[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 i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,h=a.t,p=a.b,v=e._pushmargin,g=e._pushmarginIds,m=e.minreducedwidth,y=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var b in v)g[b]||delete v[b];for(var _ in v.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},v){var w=v[_].l||{},M=v[_].b||{},T=w.val,A=w.size,k=M.val,L=M.size;for(var S in v){if(o(A)&&v[S].r){var E=v[S].r.val,O=v[S].r.size;if(E>T){var R=(A*E+(O-r)*T)/(E-T),D=(O*(1-T)+(A-r)*(1-E))/(E-T);R+D>c+f&&(c=R,f=D)}}if(o(L)&&v[S].t){var P=v[S].t.val,I=v[S].t.size;if(P>k){var z=(L*P+(I-n)*k)/(P-k),N=(I*(1-k)+(L-n)*(1-P))/(P-k);z+N>p+h&&(p=z,h=N)}}}}}var F=u.constrain(r-a.l-a.r,2,m),B=u.constrain(n-a.t-a.b,2,y),j=Math.max(0,r-F),U=Math.max(0,n-B);if(j){var H=(c+f)/j;H>1&&(c/=H,f/=H)}if(U){var Y=(p+h)/U;Y>1&&(p/=Y,h/=Y)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(h),i.b=Math.round(p),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&x.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(P(o,c,f),i=0;i0){for(var n=[],i=0;i-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":120,"../components/drawing":142,"../constants/xmlns_namespaces":244,"../lib":264,"@plotly/d3":16}],370:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":127,"../../lib/extend":257,"../../plots/attributes":309,"../../plots/cartesian/axis_format_attributes":316,"../../plots/template_attributes":360,"../mesh3d/attributes":382}],371:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;c=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||v)[2]+(f[[r+1,i]]||v)[2]+(f[[r,i-1]]||v)[2]+(f[[r,i+1]]||v)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":264}],376:[function(t,e,r){"use strict";var n=t("../../lib"),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,c,u,f,h,d,p,v,g,m=0;for(s=0;sv&&(m=Math.max(m,Math.abs(t[a][o]-p)/(g-v))))}return m}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":264}],377:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":127,"../../lib/extend":257,"../../plot_api/edit_types":295,"../../plots/attributes":309,"../../plots/cartesian/axis_format_attributes":316,"../../plots/template_attributes":360,"../mesh3d/attributes":382}],378:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function z(t,e){return null===t?e:t}function N(e,r,n){C();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[d]:E(p,v,m);h[d]=b>-1?b:R(p,v,m,z(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function F(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function B(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(S-L);return t>=L-e&&t<=S+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function H(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(e[0][3],n,i),B(e[1][3],n,i),B(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(N(t,e,r),!0):a<3&&H(t,e,r,L,S,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],d=F(h,u,n,i),p=F(h,f,n,i);o=l(t,[p,d,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,f,p],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],d=F(f,u,n,i),p=F(h,u,n,i);o=l(t,[p,d,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function Y(t,e,r,n){var i=!1,a=U(e),o=[B(a[0][3],r,n),B(a[1][3],r,n),B(a[2][3],r,n),B(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return v&&(i=function(t,e,r){var n=function(n,i,a){N(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]];if(v)i=N(t,[c,u,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var d=F(h,c,r,n),p=F(h,u,r,n),g=F(h,f,r,n);i=N(null,[d,p,g],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],d=F(f,c,r,n),p=F(f,u,r,n),g=F(h,u,r,n),m=F(h,c,r,n);v?(i=N(t,[c,m,d],[e[l[0]],-1,-1])||i,i=N(t,[u,p,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){N(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[d,p,g,m],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],d=F(u,c,r,n),p=F(f,c,r,n),g=F(h,c,r,n);v?(i=N(t,[c,d,p],[e[l[0]],-1,-1])||i,i=N(t,[c,p,g],[e[l[0]],-1,-1])||i,i=N(t,[c,g,d],[e[l[0]],-1,-1])||i):i=N(null,[d,p,g],[-1,-1,-1])||i,s=!0}})),i)}function V(t,e,r,n,i,a,o,s,l,c,u){var f=!1;return p&&(I(t,"A")&&(f=Y(null,[e,r,n,a],c,u)||f),I(t,"B")&&(f=Y(null,[r,n,i,l],c,u)||f),I(t,"C")&&(f=Y(null,[r,a,o,l],c,u)||f),I(t,"D")&&(f=Y(null,[n,a,s,l],c,u)||f),I(t,"E")&&(f=Y(null,[r,n,a,l],c,u)||f)),v&&(f=Y(t,[r,n,a,l],c,u)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||H(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||H(t,U([n,i,e]),[n,i,e],a,o)]}function q(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,c,u,f=!1,h=function(){f=H(t,[s,l,c],[-1,-1,-1],i,a)||f,f=H(t,[c,u,s],[-1,-1,-1],i,a)||f},d=o[0],p=o[1],v=o[2];return d&&(s=D(U([T(e,r-0,n-0)])[0],U([T(e-1,r-0,n-0)])[0],d),l=D(U([T(e,r-0,n-1)])[0],U([T(e-1,r-0,n-1)])[0],d),c=D(U([T(e,r-1,n-1)])[0],U([T(e-1,r-1,n-1)])[0],d),u=D(U([T(e,r-1,n-0)])[0],U([T(e-1,r-1,n-0)])[0],d),h()),p&&(s=D(U([T(e-0,r,n-0)])[0],U([T(e-0,r-1,n-0)])[0],p),l=D(U([T(e-0,r,n-1)])[0],U([T(e-0,r-1,n-1)])[0],p),c=D(U([T(e-1,r,n-1)])[0],U([T(e-1,r-1,n-1)])[0],p),u=D(U([T(e-1,r,n-0)])[0],U([T(e-1,r-1,n-0)])[0],p),h()),v&&(s=D(U([T(e-0,r-0,n)])[0],U([T(e-0,r-0,n-1)])[0],v),l=D(U([T(e-0,r-1,n)])[0],U([T(e-0,r-1,n-1)])[0],v),c=D(U([T(e-1,r-1,n)])[0],U([T(e-1,r-1,n-1)])[0],v),u=D(U([T(e-1,r-0,n)])[0],U([T(e-1,r-0,n-1)])[0],v),h()),f}function X(t,e,r,n,i,a,o,s,l,c,u,f){var h=t;return f?(p&&"even"===t&&(h=null),V(h,e,r,n,i,a,o,s,l,c,u)):(p&&"odd"===t&&(h=null),V(h,l,s,o,a,i,n,r,e,c,u))}function Z(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(p-k)?[A,p]:[p,k];$(e,M[0],M[1])}}var E=[[Math.min(L,k),Math.max(L,k)],[Math.min(A,S),Math.max(A,S)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(d.id),"x"===e?f.push([d.distRatio,0,0]):"y"===e?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else c=nt(1,"x"===e?x-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),c.length>0&&(r[i]="x"===e?Z(null,c,a,o,r[i]):"y"===e?J(null,c,a,o,r[i]):K(null,c,a,o,r[i]),i++)}var p=t.caps[e];p.show&&p.fill&&(P(p.fill),r[i]="x"===e?Z(null,[0,x-1],a,o,r[i]):"y"===e?J(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===g&&O(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=m,t._Ys=y,t._Zs=b}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../../stackgl_modules":444,"../../components/colorscale":132,"../../lib/gl_format_color":261,"../../lib/str2rgbarray":288,"../../plots/gl3d/zip3":355}],380:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),f=a("z"),h=a("value");c&&c.length&&u&&u.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":130,"../../lib":264,"../../registry":361,"./attributes":377}],381:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":344,"./attributes":377,"./calc":378,"./convert":379,"./defaults":380}],382:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":127,"../../lib/extend":257,"../../plots/attributes":309,"../../plots/cartesian/axis_format_attributes":316,"../../plots/template_attributes":360,"../surface/attributes":429}],383:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":128}],384:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_mesh3d,i=t("../../../stackgl_modules").delaunay_triangulate,a=t("../../../stackgl_modules").alpha_shape,o=t("../../../stackgl_modules").convex_hull,s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function d(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=u(p(r.xaxis,t.x,e.dataScale[0],t.xcalendar),p(r.yaxis,t.y,e.dataScale[1],t.ycalendar),p(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=u(v(t.i),v(t.j),v(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;ol&&C[m].gap;)m--;for(b=C[m].s,v=C.length-1;v>m;v--)C[v].s=b;for(;lk[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],397:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),v=t("./fillcolor_defaults"),g=t("../../lib").coercePattern;e.exports=function(t,e,r,m){function y(r,i){return n.coerce(t,e,a,r,i)}var b=l(t,e,m,y);if(b||(e.visible=!1),e.visible){c(t,e,m,y),y("xhoverformat"),y("yhoverformat");var x=u(t,e,m,y),_=!x&&b=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-p);return a=Math.min(e,r)&&v<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(d.c2p(t.y)-v);return aW!=(B=P[R][1])>=W&&(z=P[R-1][0],N=P[R][0],B-F&&(I=z+(N-z)*(W-F)/(B-F),Y=Math.min(Y,I),V=Math.max(V,I)));Y=Math.max(Y,0),V=Math.min(V,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:Y,x1:V,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":120,"../../components/fx":160,"../../lib":264,"../../registry":361,"./get_trace_color":400}],402:[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":325,"./arrays_to_calcdata":389,"./attributes":390,"./calc":391,"./cross_trace_calc":395,"./cross_trace_defaults":396,"./defaults":397,"./format_labels":399,"./hover":401,"./marker_colorbar":408,"./plot":411,"./select":412,"./style":414,"./subtypes":415}],403:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){l||(l={});var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":130,"../../components/colorscale/helpers":131,"../../lib":264}],404:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../../constants/numerical"),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,c=t("../../lib"),u=c.segmentsIntersect,f=c.constrain,h=t("./constants");e.exports=function(t,e){var r,i,o,d,p,v,g,m,y,b,x,_,w,M,T,A,k,L,S=e.trace||{},E=e.xaxis,C=e.yaxis,O="log"===E.type,R="log"===C.type,D=E._length,P=C._length,I=e.backoff,z=S.marker,N=e.connectGaps,F=e.baseTolerance,B=e.shape,j="linear"===B,U=S.fill&&"none"!==S.fill,H=[],Y=h.minTolerance,V=t.length,G=new Array(V),q=0;function W(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),o=e.linearized?C.l2p(n.y):C.c2p(n.y);if(i===a){if(O&&(i=E.c2p(n.x,!0)),i===a)return!1;R&&o===a&&(i*=Math.abs(E._m*P*(E._m>0?s:l)/(C._m*D*(C._m>0?s:l)))),i*=1e3}if(o===a){if(R&&(o=C.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function X(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function ht(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l);return s}}function dt(t){var e=t[0],r=t[1],n=e===G[q-1][0],i=r===G[q-1][1];if(!n||!i)if(q>1){var a=e===G[q-2][0],o=r===G[q-2][1];n&&(e===at||e===ot)&&a?o?q--:G[q-1]=t:i&&(r===st||r===lt)&&o?a?q--:G[q-1]=t:G[q++]=t}else G[q++]=t}function pt(t){G[q-1][0]!==t[0]&&G[q-1][1]!==t[1]&&dt([$,tt]),dt(t),et=null,$=tt=0}"linear"===B||"spline"===B?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(q)if(et){var n=nt(et,e);n.length>1&&(pt(n[0]),G[q++]=n[1])}else rt=nt(G[q-1],e)[0],G[q++]=rt;else G[q++]=[K||e[0],Q||e[1]];var i=G[q-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?dt($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&dt([$,tt])),dt([K,Q])):$-K&&tt-Q&&dt([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&pt(nt(et,e)[0]),G[q++]=e;var a,o,s,l}for(r=0;rZ(v,mt))break;o=v,(w=y[0]*m[0]+y[1]*m[1])>x?(x=w,d=v,g=!1):w<_&&(_=w,p=v,g=!0)}if(g?(gt(d),o!==p&>(p)):(p!==i&>(p),o!==d&>(d)),gt(o),r>=t.length||!v)break;gt(v),i=v}}else gt(d)}et&&dt([$||et[0],tt||et[1]]),H.push(G.slice(0,q))}var yt=B.slice(B.length-1);if(I&&"h"!==yt&&"v"!==yt){for(var bt=!1,xt=-1,_t=[],wt=0;wt=0?l=d:(l=d=h,h++),l0?Math.max(r,a):0}}},{"fast-isnumeric":31}],408:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],409:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":120,"../../components/colorscale/defaults":130,"../../components/colorscale/helpers":131,"./subtypes":415}],410:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":243,"../../lib":264}],411:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,v){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!c.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),v=Math.ceil(p.length/d),g=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(p),T=o(M,"g","errorbars"),A=o(M,"g","lines"),k=o(M,"g","points"),L=o(M,"g","text");if(i.getComponentMethod("errorbars","plot")(t,T,r,v),!0===_.visible){var S,E;y(M).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var O,R,D="",P=[],I=_._prevtrace;I&&(D=I._prevRevpath||"",E=I._nextFill,P=I._polygons);var z,N,F,B,j,U,H,Y="",V="",G=[],q=a.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(z=l.steps(w.shape),N=l.steps(w.shape.split("").reverse().join(""))):z=N="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return N(t.reverse())},G=u(f,{xaxis:b,yaxis:x,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),H=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",O),l.singleLineStyle(f,i)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(q(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(q(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(S?(S.datum(f),B&&U&&(C?("y"===C?B[1]=U[1]=x.c2p(0,!0):"x"===C&&(B[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+B+"L"+Y.substr(1)).call(l.singleFillStyle,t)):y(S).attr("d",Y+"Z").call(l.singleFillStyle,t))):E&&("tonext"===_.fill.substr(0,6)&&Y&&D?("tonext"===_.fill?y(E).attr("d",Y+"Z"+D+"Z").call(l.singleFillStyle,t):y(E).attr("d",Y+"L"+D.substr(1)+"Z").call(l.singleFillStyle,t),_._polygons=_._polygons.concat(P)):(Z(E),_._polygons=null)),_._prevRevpath=V,_._prevPolygons=H):(S?Z(S):E&&Z(E),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),L.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),h=c.hasText(u),d=tt(u),p=et,v=et;if(f||h){var g=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?K:J:_&&!w&&(g=Q),f&&(p=g),h&&(v=g)}var M,T=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,u,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,u,M,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(v,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,X,t),l.setClipUrl(L,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,h,p=!a,v=!!a&&a.duration>0,g=f(t,e,r);((u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),v)?(c&&(h=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){d(t,n,e,r,g,this,a)}))}))):u.each((function(r,n){d(t,n,e,r,g,this,a)}));p&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":142,"../../lib":264,"../../lib/polygon":276,"../../registry":361,"./line_points":404,"./link_traces":406,"./subtypes":415,"@plotly/d3":16}],412:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return d[t]}function M(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var v=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||d);for(var p=["x","y","z"],v=0;v<3;++v){var g="projection."+p[v];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,h||d||r,{axis:"z"}),m(t,e,h||d||r,{axis:"y",inherit:"z"}),m(t,e,h||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":264,"../../registry":361,"../scatter/line_defaults":403,"../scatter/marker_defaults":409,"../scatter/subtypes":415,"../scatter/text_defaults":416,"./attributes":418}],423:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":241,"../../plots/gl3d":344,"./attributes":418,"./calc":419,"./convert":421,"./defaults":422}],424:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":127,"../../lib/extend":257,"../../plots/attributes":309,"../../plots/cartesian/axis_format_attributes":316,"../../plots/template_attributes":360,"../mesh3d/attributes":382}],425:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/calc");function a(t){var e,r,i,a,s,l,c,u,f,h,d,p,v=t._x,g=t._y,m=t._z,y=t._len,b=-1/0,x=1/0,_=-1/0,w=1/0,M=-1/0,T=1/0,A="";for(y&&(c=v[0],f=g[0],d=m[0]),y>1&&(u=v[y-1],h=g[y-1],p=m[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(d>p?"-":"+")+"z");var E=function(){y=0,k=[],L=[],S=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,f={};function p(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(p(e._u,"xaxis"),p(e._v,"yaxis"),p(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var v=p(e._Xs,"xaxis"),g=p(e._Ys,"yaxis"),m=p(e._Zs,"zaxis");if(f.meshgrid=[v,g,m],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(p(e._startsX,"xaxis"),p(e._startsY,"yaxis"),p(e._startsZ,"zaxis"));else{for(var y=g[0],b=h(v),x=h(m),_=new Array(b.length*x.length),w=0,M=0;M0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=m(r),++r1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]i&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),b={},x={},_=0;p?(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),T(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)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 i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){(function(){ +var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=i():!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:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(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 h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":75,"./lib/epsilon":76,"./lib/geojson":77,"./lib/intersecter":78,"./lib/segment-chainer":80,"./lib/segment-selector":81}],75:[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")}}}},{}],76:[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 i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],77:[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]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),v=!d&&e.pointBetween(s,c,u);if(h)return v?l(n,s):l(t,u),n;p&&(d||(v?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=c(h),p=d.before?d.before.ev:null,v=d.after?d.after.ev:null;function g(){if(p){var t=u(h,p);if(t)return t}return!!v&&u(h,v)}r&&r.tempStatus(h.seg,!!p&&p.seg,!!v&&v.seg);var m,y=g();if(y){var b;if(t)(b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)b=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=v?v.seg.myFill.above:i,h.seg.myFill.above=b?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)m=v?h.primary===v.primary?v.seg.otherFill.above:v.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:m,below:m};r&&r.status(h.seg,!!p&&p.seg,!!v&&v.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l1)for(var r=1;r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":82,timers:83}],84:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(L[t])t=L[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),a:z(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:R(e[1]),g:R(e[2]),b:R(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),a:z(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:R(e[1]+""+e[1]),g:R(e[2]+""+e[2]),b:R(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(d=e.r,p=e.g,v=e.b,i={r:255*C(d,255),g:255*C(p,255),b:255*C(v,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=P(e.s),c=P(e.v),i=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=P(e.s),u=P(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var d,p,v;return a=E(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function k(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%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,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=a(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=a(360*t.h),r=a(100*t.s),n=a(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=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[D(a(t).toString(16)),D(a(e).toString(16)),D(a(r).toString(16)),D(I(n))];if(i&&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:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+d(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+d(i._r,i._g,i._b,i._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(b,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(M,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]:P(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:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!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":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(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 E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function O(t){return o(1,s(0,t))}function R(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function P(t){return t<=1&&(t=100*t+"%"),t}function I(e){return t.round(255*parseFloat(e)).toString(16)}function z(t){return R(t)/255}var N,F,B,j=(F="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",B="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{CSS_UNIT:new RegExp(N),rgb:new RegExp("rgb"+F),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+F),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+F),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 U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],85:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":32}],86:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),i=t.month(),a=""+this.toChineseMonth(n,i);return e&&a.length<2&&(a="0"+a),this.isIntercalaryMonth(n,i)&&(a+="i"),a},monthNames:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var p=0;p>9&4095,(v>>5&15)-1,(31&v)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var d,p=f[a.year-f[0]];for(d=0;d<13;d++){var v=p&1<<12-d?30:29;if(l>13;!g||d=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":100,"object-assign":71}],89:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":100,"object-assign":71}],90:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":100,"object-assign":71}],91:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":100,"object-assign":71}],92:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":100,"object-assign":71}],93:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":100,"object-assign":71}],94:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":100,"object-assign":71}],95:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":100,"object-assign":71}],97:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":100,"object-assign":71}],98:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":100,"object-assign":71}],99:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":100,"object-assign":71}],100:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":71}],101:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,d=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),p=function(t,e,r,n){var i=""+e;if(d(t,n))for(;i.length1},b=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(A));return A+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=v;for(var S=this.daysInMonth(h,d);p>S;S=this.daysInMonth(h,d))d++,p-=S}return f>-1?this.fromJD(f):this.newDate(h,d,p)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":100,"object-assign":71}],102:[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}]},{}],103:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=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:i({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",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.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",a.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:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":237,"../../plot_api/plot_template":302,"../../plots/cartesian/constants":320,"../../plots/font_attributes":341,"./arrow_paths":102}],104:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],d=3*t.arrowsize*t.arrowwidth||0,p=d+h,v=d-h,g=3*t.startarrowsize*t.arrowwidth||0,m=g+h,y=g-h;if(c===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:p,ppadminus:v}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,m),ppadminus:Math.max(f,y)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else m=s?m+s:m,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,p,m),ppadminus:Math.max(f,v,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([a,o],t)}},{"../../lib":264,"../../plots/cartesian/axes":313,"./draw":109}],105:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,X=["x","y"],Z=0;Z1)&&(nt===rt?((dt=it.r2fraction(e["a"+et]))<0||dt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var pt="domain"===ht;"x"===et?(Q=e[et],J=pt?it._offset+it._length*Q:J=M.l+M.w*Q):(Q=1-e[et],J=pt?it._offset+it._length*Q:J=M.t+M.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var vt=e["a"+et];if(tt=ot*V(.5,e.xanchor)-st*V(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(vt=1-vt),ft.tail=it._offset+it._length*vt):"paper"===gt?"y"===et?(vt=1-vt,ft.tail=M.t+M.h*vt):ft.tail=M.l+M.w*vt:ft.tail=it._offset+it.r2p(vt),K=tt}else ft.tail=J+vt,K=tt+vt;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),bt=Math.min(ft.tail+3,ft.text)-mt;yt>0?(ft.tail+=yt,ft.text+=yt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*V($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)z.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(A-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(I-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:B+xt-1,y:B+_t}).call(u.setClipUrl,U?E:null,t);else{var wt=B+_t-v.top,Mt=B+xt-v.left;G.call(h.positionText,Mt,wt).call(u.setClipUrl,U?E:null,t)}H.select("rect").call(u.setRect,B,B,A,I),j.call(u.setRect,N/2,N/2,F-N,Y-N),z.call(u.setTranslate,Math.round(C.x.text-F/2),Math.round(C.y.text-Y/2)),D.attr({transform:"rotate("+O+","+C.x.text+","+C.y.text+")"});var Tt,At=function(r,n){R.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,d=C.y.tail+n,v=C.x.text+r,x=C.y.text+n,_=o.rotationXYMatrix(O,v,x),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),E=+j.attr("width"),P=+j.attr("height"),I=v-.5*E,N=I+E,F=x-.5*P,B=F+P,U=[[I,F,I,B],[I,B,N,B],[N,B,N,F],[N,F,I,F]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,d,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,d=e.y)}));var H=e.arrowwidth,Y=e.arrowcolor,V=e.arrowside,G=R.append("g").style({opacity:c.opacity(Y)}).classed("annotation-arrow-g",!0),q=G.append("path").attr("d","M"+h+","+d+"L"+l+","+f).style("stroke-width",H+"px").call(c.stroke,c.rgb(Y));if(g(q,V,e),T.annotationPosition&&q.node().parentNode&&!a){var W=l,X=f;if(e.standoff){var Z=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-d,2));W+=e.standoff*(h-l)/Z,X+=e.standoff*(d-f)/Z}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(d-X),transform:s(W,X)}).style("stroke-width",H+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");p.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(z);J=t.x,K=t.y,m&&m.autorange&&k(m._name+".autorange",!0),b&&b.autorange&&k(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;z.call(u.setTranslate,i,a),L("x",y(m,t,"x",M,e)),L("y",y(b,r,"y",M,e)),e.axref===e.xref&&L("ax",y(m,t,"ax",M,e)),e.ayref===e.yref&&L("ay",y(b,r,"ay",M,e)),G.attr("transform",s(t,r)),D.attr({transform:"rotate("+O+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,S());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&At(0,0),P)p.init({element:z.node(),gd:t,prepFn:function(){Tt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?L("ax",y(m,t,"ax",M,e)):L("ax",e.ax+t),e.ayref===e.yref?L("ay",y(b,r,"ay",M.w,e)):L("ay",e.ay+r),At(t,r);else{if(a)return;var i,o;if(m)i=y(m,t,"x",M,e);else{var l=e._xsize/M.w,c=e.x+(e._xshift-e.xshift)/M.w-l/2;i=p.align(c+t/M.w,l,0,1,e.xanchor)}if(b)o=y(b,r,"y",M,e);else{var u=e._ysize/M.h,f=e.y-(e._yshift+e.yshift)/M.h-u/2;o=p.align(f-r/M.h,u,0,1,e.yanchor)}L("x",i),L("y",o),m&&b||(n=p.getCursor(m?.5:i,b?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+Tt}),d(z,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",q(n))},doneFn:function(){d(z),i.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=0,b=e.indexOf("end")>=0,x=p.backoff*g+r.standoff,_=v.backoff*m+r.startstandoff;if("line"===d.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,M=o.y-u.y;if(h=(f=Math.atan2(M,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+M*M))return void P();if(x){if(x*x>w*w+M*M)return void P();var T=x*Math.cos(f),A=x*Math.sin(f);u.x+=T,u.y+=A,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+M*M)return void P();var k=_*Math.cos(f),L=_*Math.sin(f);o.x-=k,o.y-=L,t.attr({x1:o.x,y1:o.y})}}else if("path"===d.nodeName){var S=d.getTotalLength(),E="";if(S1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":353,"../annotations/draw":109}],116:[function(t,e,r){"use strict";var n=t("../../registry"),i=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 a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ct=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ct*c.roundUp(lt/ct,[2,5,10]),(Math.abs(V.start)/V.size+1e-6)%1<2e-6&&(it.tick0=0)}it.dtick=ot}it.domain=o?[rt+R/z.h,rt+K-R/z.h]:[rt+O/z.w,rt+K-O/z.w],it.setScale(),t.attr("transform",u(Math.round(z.l),Math.round(z.t)));var ut,ft=t.select("."+A.cbtitleunshift).attr("transform",u(-Math.round(z.l),-Math.round(z.t))),ht=it.ticklabelposition,dt=it.title.font.size,pt=t.select("."+A.cbaxis),vt=0,gt=0;function mt(n,i){var a={propContainer:it,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:I._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),v.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&at||!o&&!at)&&("top"===j&&(t=O+z.l+z.w*D,e=R+z.t+z.h*(1-rt-K)+3+.75*dt),"bottom"===j&&(t=O+z.l+z.w*D,e=R+z.t+z.h*(1-rt)-3-.25*dt),"right"===j&&(e=R+z.t+z.h*P+3+.75*dt,t=O+z.l+z.w*rt),mt(it._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!at||o&&at){var a,l=t.select("."+A.cbtitle),f=l.select("text"),h=[-k/2,k/2],p=l.select(".h"+it._id+"title-math-group").node(),v=15.6;if(f.node()&&(v=parseInt(f.node().style.fontSize,10)*w),p?(a=d.bBox(p),gt=a.width,(vt=a.height)>v&&(h[1]-=(vt-v)/2)):f.node()&&!f.classed(A.jsPlaceholder)&&(a=d.bBox(f.node()),gt=a.width,vt=a.height),o){if(vt){if(vt+=5,"top"===j)it.domain[1]-=vt/z.h,h[1]*=-1;else{it.domain[0]+=vt/z.h;var m=g.lineCount(f);h[1]+=(1-m)*v}l.attr("transform",u(h[0],h[1])),it.setScale()}}else gt&&("right"===j&&(it.domain[0]+=(gt+dt/2)/z.w),l.attr("transform",u(h[0],h[1])),it.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",o?u(0,Math.round(z.h*(1-it.domain[1]))):u(Math.round(z.w*it.domain[0]),0)),pt.attr("transform",o?u(0,Math.round(-z.t)):u(Math.round(-z.l),0));var y=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(q);y.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),y.exit().remove();var b=U.map(it.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var s=[0===a?U[0]:(q[a]+q[a-1])/2,a===q.length-1?U[1]:(q[a]+q[a+1])/2].map(it.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,b[0],b[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)d.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=Y(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var x=t.select("."+A.cblines).selectAll("path."+A.cbline).data(F.color&&F.width?W:[]);x.enter().append("path").classed(A.cbline,!0),x.exit().remove(),x.each((function(t){var e=Q,r=Math.round(it.c2p(t))+F.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+X).call(d.lineGroupStyle,F.width,H(t),F.dash)})),pt.selectAll("g."+it._id+"tick,path").remove();var _=Q+X+(k||0)/2-("outside"===e.ticks?1:0),M=s.calcTicks(it),T=s.getTickSigns(it)[2];return s.drawTicks(r,it,{vals:"inside"===it.ticks?s.clipEnds(it,M):M,layer:pt,path:s.makeTickPath(it,_,T),transFn:s.makeTransTickFn(it)}),s.drawLabels(r,it,{vals:M,layer:pt,transFn:s.makeTransTickLabelFn(it),labelFns:s.makeLabelFns(it,_)})},function(){if(o&&!at||!o&&at){var t,i,a=it.position||0,s=it._offset+it._length/2;if("right"===j)i=s,t=z.l+z.w*a+10+dt*(it.showticklabels?1:.5);else if(t=s,"bottom"===j&&(i=z.t+z.h*a+10+(-1===ht.indexOf("inside")?it.tickfont.size:0)+("intside"!==it.ticks&&e.ticklen||0)),"top"===j){var l=B.text.split("
").length;i=z.t+z.h*a+10-X-w*dt*l}mt((o?"h":"v")+it._id+"title",{avoid:{selection:n.select(r).selectAll("g."+it._id+"tick"),side:j,offsetTop:o?0:z.t,offsetLeft:o?z.l:0,maxShift:o?I.width:I.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=X+k/2;-1===ht.indexOf("inside")&&(n=d.bBox(pt.node()),s+=o?n.width:n.height),ut=ft.select("text");var c=0,f=o&&"top"===j,v=!o&&"right"===j,g=0;if(ut.node()&&!ut.classed(A.jsPlaceholder)){var y,b=ft.select(".h"+it._id+"title-math-group").node();b&&(o&&at||!o&&!at)?(c=(n=d.bBox(b)).width,y=n.height):(c=(n=d.bBox(ft.node())).right-z.l-(o?Q:nt),y=n.bottom-z.t-(o?nt:Q),o||"top"!==j||(s+=n.height,g=n.height)),v&&(ut.attr("transform",u(c/2+dt/2,0)),c*=2),s=Math.max(s,o?c:y)}var x=2*(o?O:R)+s+L+k/2,w=0;!o&&B.text&&"bottom"===C&&P<=0&&(x+=w=x/2,g+=w),I._hColorbarMoveTitle=w,I._hColorbarMoveCBTitle=g;var N=L+k;t.select("."+A.cbbg).attr("x",(o?Q:nt)-N/2-(o?O:0)).attr("y",(o?nt:Q)-(o?J:R+g-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(J+N,2)).call(p.fill,S).call(p.stroke,e.bordercolor).style("stroke-width",L);var F=v?Math.max(c-10,0):0;if(t.selectAll("."+A.cboutline).attr("x",(o?Q:nt+O)+F).attr("y",(o?nt+R-J:Q)+(f?vt:0)).attr(o?"width":"height",Math.max(X,2)).attr(o?"height":"width",Math.max(J-(o?2*R+vt:2*O+F),2)).call(p.stroke,e.outlinecolor).style({fill:"none","stroke-width":k}),t.attr("transform",u(z.l-(o?$*x:0),z.t-(o?0:(1-tt)*x-g))),!o&&(L||i(S).getAlpha()&&!i.equals(I.paper_bgcolor,S))){var U=pt.selectAll("text"),H=U[0].length,Y=t.select("."+A.cbbg).node(),V=d.bBox(Y),G=d.getTranslate(t);U.each((function(t,e){var r=H-1;if(0===e||e===r){var n,i=d.bBox(this),a=d.getTranslate(this);if(e===r){var o=i.right+a.x;(n=V.right+G.x+nt-L-2+D-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=V.left+G.x+nt+L+2-s)<0&&(n=0)}n&&(H<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var q={},W=M[E],Z=T[E],K=M[C],et=T[C],rt=x-X;o?("pixels"===h?(q.y=P,q.t=J*K,q.b=J*et):(q.t=q.b=0,q.yt=P+l*K,q.yb=P-l*et),"pixels"===_?(q.x=D,q.l=x*W,q.r=x*Z):(q.l=rt*W,q.r=rt*Z,q.xl=D-m*W,q.xr=D+m*Z)):("pixels"===h?(q.x=D,q.l=J*W,q.r=J*Z):(q.l=q.r=0,q.xl=D+l*W,q.xr=D-l*Z),"pixels"===_?(q.y=1-P,q.t=x*K,q.b=x*et):(q.t=rt*K,q.b=rt*et,q.yt=P-m*K,q.yb=P+m*et)),a.autoMargin(r,e._id,q)}],r)}(r,e,t);m&&m.then&&(t._promises||[]).push(m),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,f)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":236,"../../lib":264,"../../lib/extend":257,"../../lib/setcursor":284,"../../lib/svg_text_utils":289,"../../plots/cartesian/axes":313,"../../plots/cartesian/axis_defaults":315,"../../plots/cartesian/layout_attributes":326,"../../plots/cartesian/position_defaults":329,"../../plots/plots":358,"../../registry":361,"../color":120,"../colorscale/helpers":131,"../dragelement":139,"../drawing":142,"../titles":229,"./constants":122,"@plotly/d3":16,tinycolor2:84}],125:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":264}],126:[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":121,"./defaults":123,"./draw":124,"./has_colorbar":125}],127:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var d=a+"auto",p=a+"min",v=a+"max",g=a+"mid",m=(s(h+d),s(h+p),s(h+v),{});m[p]=m[v]=void 0;var y={};y[d]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:m},b[p]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[v]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},b[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:m},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":280,"../../lib/sort_object_keys":286,"../colorbar/attributes":121,"./scales.js":135}],128:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),h=!1!==f.auto,d=f.min,p=f.max,v=f.mid,g=function(){return i.aggNums(Math.min,null,l)},m=function(){return i.aggNums(Math.max,null,l)};(void 0===d?d=g():h&&(d=u._colorAx&&n(d)?Math.min(d,g()):g()),void 0===p?p=m():h&&(p=u._colorAx&&n(p)?Math.max(p,m()):m()),h&&void 0!==v&&(p-v>v-d?d=v-(p-v):p-v=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":264,"./helpers":131,"fast-isnumeric":31}],129:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=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,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function p(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],137:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":264}],138:[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)}},{}],139:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var 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)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,h,d,p,v,g=t.gd,m=1,y=g._context.doubleClickDelay,b=t.element;g._mouseDownTime||(g._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)y&&(m=Math.max(m-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(m,d),!v){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)}p.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":264,"../../plots/cartesian/constants":320,"./align":136,"./cursor":137,"./unhover":140,"has-hover":63,"has-passive-events":64,"mouse-event-offset":69}],140:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":255,"../../lib/events":256,"../../lib/throttle":290,"../fx/constants":154}],141:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],142:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,h=t("../../lib/svg_text_utils"),d=t("../../constants/xmlns_namespaces"),p=t("../../constants/alignment").LINE_SPACING,v=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),m=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};function x(t,e,r){var n=e.fillpattern,i=n&&b.getPatternAttr(n.shape,0,"");if(i){var a=b.getPatternAttr(n.bgcolor,0,null),o=b.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=b.getPatternAttr(n.size,0,8),u=b.getPatternAttr(n.solidity,0,.3),f=e.uid;b.pattern(t,"point",r,f,i,l,u,void 0,n.fillmode,a,o,s)}else e.fillcolor&&t.call(c.fill,e.fillcolor)}b.font=function(t,e,r,n){i.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(c.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,i){t.call(b.setPosition,e,r).call(b.setSize,n,i)},b.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);b.translatePoint(t,i,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.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},b.singleFillStyle=function(t,e){var r=n.select(t.node());x(t,((r.data()[0]||[])[0]||{}).trace||{},e)},b.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&x(r,t[0].trace,e)}))};var _=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolBackOffs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,b.symbolBackOffs[r]=e.backoff||0,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var w=b.symbolNames.length;function M(t,e,r,n){var i=t%100;return b.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},A={x1:0,x2:0,y1:1,y2:0},k=a("~f"),L={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:T},horizontalreversed:{node:"linearGradient",attrs:T,reversed:!0},vertical:{node:"linearGradient",attrs:A},verticalreversed:{node:"linearGradient",attrs:A,reversed:!0}};b.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=L[a],h=new Array(u),d=0;d=100;var f=rt(t,r),h=G(t,r);e.attr("d",M(u,l,f,h))}var d,p,v,g=!1;if(t.so)v=s.outlierwidth,p=s.outliercolor,d=o.outliercolor;else{var m=(s||{}).width;v=(t.mlw+1||m+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,p="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(d=c.defaultLine,g=!0),d="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(d=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,d).style({"stroke-width":(v||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:v)+"px");var y=o.gradient,x=t.mgt;x?g=!0:x=y&&y.type,i.isArrayOrTypedArray(x)&&(x=x[0],L[x]||(x=0));var _=o.pattern,w=_&&b.getPatternAttr(_.shape,t.i,"");if(x&&"none"!==x){var T=t.mgc;T?g=!0:T=y.color;var A=r.uid;g&&(A+="-"+t.i),b.gradient(e,a,A,x,[[0,T],[1,d]],"fill")}else if(w){var k=b.getPatternAttr(_.bgcolor,t.i,null),S=b.getPatternAttr(_.fgcolor,t.i,null),E=_.fgopacity,C=b.getPatternAttr(_.size,t.i,8),O=b.getPatternAttr(_.solidity,t.i,.3),R=t.mcc||i.isArrayOrTypedArray(_.shape)||i.isArrayOrTypedArray(_.bgcolor)||i.isArrayOrTypedArray(_.size)||i.isArrayOrTypedArray(_.solidity),D=r.uid;R&&(D+="-"+t.i),b.pattern(e,"point",a,D,w,C,O,t.mcc,_.fillmode,k,S,E)}else c.fill(e,d);v&&c.stroke(e,p)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?m(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,h=void 0!==u,d=void 0!==f;(i.isArrayOrTypedArray(c)||h||d)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:e:d?f:v*e});var p=a.color,g=o.color,m=s.color;(g||m)&&(e.selectedColorFn=function(t){var e=t.mcc||p;return t.selected?g||e:m||e});var y=a.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||y/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,v))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",M(b.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},d={};y(d,e,t.i);var p=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,d,t,p)}var v=t.tp||e.textposition,g=C(t,e),m=a?a(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,g,m).text(c).call(h.convertToTspans,r).call(E,v,g,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=C(t,e);c.fill(i,a);var u=l.traceIs(e,"bar-like");E(i,o,s,t.mrc2||t.mrc,u)}))}};var O,R;function D(t,e,r){return r&&(t=B(t)),e?I(t[1]):P(t[0])}function P(t){var e=n.round(t,2);return O=e,e}function I(t){var e=n.round(t,2);return R=e,e}function z(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,h=3*c*(l+c),d=3*l*(l+c);return[[P(e[0]+(h&&u/h)),I(e[1]+(h&&f/h))],[P(e[0]-(d&&u/d)),I(e[1]-(d&&f/d))]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||x>=f&&x<=c)&&(_<=h&&_>=u||_>=h&&_<=u)&&(t=[x,_])}return t}b.steps=function(t){var e=N[t]||F;return function(t){for(var r="M"+P(t[0][0])+","+I(t[0][1]),n=t.length,i=1;i=1e4&&(b.savedBBoxes={},j=0),r&&(b.savedBBoxes[r]=g),j++,i.extendFlat({},g)},b.setClipUrl=function(t,e,r){t.attr("clip-path",H(e,r))},b.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}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},b.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}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var Y=/\s*sc.*/;b.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(Y,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var V=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(V);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},b.getMarkerStandoff=G;var q,W,X,Z,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,c=e._yA;if(!l||!c)return 90;r=l.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var u,f=t.lonlat[0],h=t.lonlat[1],d=e._geo.project([f,h+1e-5]),p=e._geo.project([f+1e-5,h]),v=Q(p[1]-n,p[0]-r),g=Q(d[1]-n,d[0]-r);if("north"===a)u=i/180*Math.PI;else if("previous"===a){var m=f/180*Math.PI,y=h/180*Math.PI,b=q/180*Math.PI,x=W/180*Math.PI,_=b-m,w=$(x)*tt(_),M=tt(x)*$(y)-$(x)*tt(y)*$(_);u=-Q(w,M)-Math.PI,q=f,W=h}var T=et(v,[$(u),0]),A=et(g,[tt(u),0]);i=Q(T[1]+A[1],T[0]+A[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var k=r-X,L=n-Z,S=e.line&&e.line.shape||"",E=S.slice(S.length-1);"h"===E&&(L=0),"v"===E&&(k=0),i+=Q(L,k)/Math.PI*180+90}else i=null}return X=r,Z=n,J=t.i,K=e.uid,i}b.getMarkerAngle=rt},{"../../components/fx/helpers":156,"../../constants/alignment":236,"../../constants/interactions":242,"../../constants/xmlns_namespaces":244,"../../lib":264,"../../lib/svg_text_utils":289,"../../registry":361,"../../traces/scatter/make_bubble_size_func":407,"../../traces/scatter/subtypes":415,"../color":120,"../colorscale":132,"./symbol_defs":143,"@plotly/d3":16,"fast-isnumeric":31,tinycolor2:84}],143:[function(t,e,r){"use strict";var n,i,a,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,h=Math.cos,d=Math.sin;function p(t){return null===t}function v(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=h(t),i=d(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,p=0,v=s(r),g="",m=0;m0;e.each((function(e){var f,h=e[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var v=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,f);if(g.exit().remove(),e.length){d.visible||g.selectAll("path.xerror").remove(),p.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var m=g.enter().append("g").classed("errorbar",!0);u&&m.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!v||t.vis){var a,o=e.select("path.yerror");if(p.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=p.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="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(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(d.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(d.copy_ystyle?p:d).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":415,"../drawing":142,"@plotly/d3":16,"fast-isnumeric":31}],150:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":120,"@plotly/d3":16}],151:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":257,"../../plots/font_attributes":341,"./layout_attributes":161}],152:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||ot<0||ot>w[0]._length)return p.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=ot+w[0]._offset,H="xval"in e?m.flat(l,e.xval):m.p2c(_,at),Y="yval"in e?m.flat(l,e.yval):m.p2c(w,ot),!i(H[0])||!i(Y[0]))return o.warn("Fx.hover failed",e,t),p.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(G=0;Gtt&&(et.splice(0,tt),ct=et[0].distance),y&&0!==F&&0===et.length){$.distance=F,$.index=!1;var f=W._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=F}))),f&&f.length){var h,p=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(p.length){var v=p[0];i(v.x0)&&i(v.y0)&&(h=ht(v),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>h.spikeDistance)&&(nt.vLinePoint=h))}var g=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(g.length){var b=g[0];i(b.x0)&&i(b.y0)&&(h=ht(b),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>h.spikeDistance)&&(nt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Mt-1;kt--)Ct(et[kt]);et=Lt,gt()}var Ot=t._hoverdata,Rt=[],Dt=j(t),Pt=U(t);for(V=0;V1||et.length>1)||"closest"===O&&it&&et.length>1,Wt=d.combine(u.plot_bgcolor||d.background,u.paper_bgcolor),Xt=R(et,{gd:t,hovermode:O,rotateLabels:qt,bgColor:Wt,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});m.isUnifiedHover(O)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,h=t.size(),d=new Array(h),p=0;function v(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===p&&a&&a[0]>a[1]!==i&&(f=-1),d[p++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?M:1)/2,pmin:0,pmax:i?r.width:r.height}]})),d.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=h;){for(u++,n=!0,o=0;o.01&&y.pmin===b.pmin&&y.pmax===b.pmax){for(s=m.length-1;s>=0;s--)m[s].dp+=i;for(g.push.apply(g,m),d.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(a=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}d.forEach(v)}for(o=d.length-1;o>=0;o--){var x=d[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Xt,qt?"xa":"ya",u),P(Xt,qt,u._invScaleX,u._invScaleY));if(s&&s.tagName){var Zt=g.getComponentMethod("annotations","hasClickToShow")(t,Rt);f(n.select(s),Zt?"pointer":"")}if(!s||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Ot))return;Ot&&t.emit("plotly_unhover",{event:e,points:Ot});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:H,yvals:Y})}(t,e,r,a,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=R(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),p=Math.max(s,l),v=t.trace;if(g.traceIs(v,"gl3d")){var m=i._fullLayout[v.scene]._scene.container,y=m.offsetLeft,b=m.offsetTop;u+=y,f+=y,h+=b,p+=b}c.bbox={x0:u+o,x1:f+o,y0:h+a,y1:p+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||d.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,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||d.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function R(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,p=e.container,v=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var M=e.fontFamily||y.HOVERFONT,T=e.fontSize||y.HOVERFONTSIZE,A=t[0],S=A.xa,E=A.ya,O=a.charAt(0),R=O+"Label",P=A[R];if(void 0===P&&"multicategory"===S.type)for(var I=0;Ii.width-x?(g=i.width-x,e.attr("d","M"+(x-k)+",0L"+x+","+b+k+"v"+b+(2*L+y.height)+"H-"+x+"V"+b+k+"H"+(x-2*k)+"Z")):e.attr("d","M0,0L"+k+","+b+k+"H"+(L+y.width/2)+"v"+b+(2*L+y.height)+"H-"+(L+y.width/2)+"V"+b+k+"H-"+k+"Z")}else{var _,C,O;"right"===E.side?(_="start",C=1,O="",g=S._offset+S._length):(_="end",C=-1,O="-",g=S._offset),m=E._offset+(A.y0+A.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+O+k+","+k+"V"+(L+y.height/2)+"h"+O+(2*L+y.width)+"V-"+(L+y.height/2)+"H"+O+k+"V-"+k+"Z");var R,D=y.height/2,I=N-y.top-D,z="clip"+i._uid+"commonlabel"+E._id;if(g=0?st:lt+ft=0?lt:bt+ft=0?at:ot+ht=0?ot:xt+ht=0,"top"!==t.idealAlign&&G||!q?G?(R+=z/2,t.anchor="start"):t.anchor="middle":(R-=z/2,t.anchor="end");else if(t.pos=R,G=O+I/2+W<=F,q=O-I/2-W>=0,"left"!==t.idealAlign&&G||!q)if(G)O+=I/2,t.anchor="start";else{t.anchor="middle";var X=W/2,Z=O+X-F,J=O-X;Z>0&&(O-=Z),J<0&&(O+=-J)}else O-=I/2,t.anchor="end";w.attr("text-anchor",t.anchor),S&&A.attr("text-anchor",t.anchor),e.attr("transform",s(O,R)+(c?l(_):""))})),_t}function D(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=F(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(h[c+"other"]=h[c+"Val"],h[c+"otherLabel"]=h[c+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(O,(function(e,r){return s=F(r,t.nameLength),""}))}return[l,s]}function P(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(k+L),d=f+c*(t.txwidth+L),p=0,v=t.offset,g="middle"===s;g&&(f-=t.tx2width/2,d+=t.txwidth/2+L),e&&(v*=-A,p=t.offset*T),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(v-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*k+p)+","+o(k+v)+"v"+o(t.by/2-k)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*k+p)+"V"+o(v-k)+"Z");var m=p+f,y=v+t.ty0-t.by/2+L,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(i.attr("text-anchor","start"),m=g?-t.bx/2-t.tx2width/2+L:-t.bx-L):"right"===b&&"end"!==s&&(i.attr("text-anchor","end"),m=g?t.bx/2-t.tx2width/2-L:t.bx+L)),i.call(u.positionText,a(m),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(d+c*L+p),o(v+t.ty0-t.by/2+L)),r.select("rect").call(h.setRect,a(d+(c-1)*t.tx2width/2+p),o(v-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function I(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}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:v.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:v.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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=v.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+v.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 h=v.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+v.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var d=t.hoverinfo||t.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===d.indexOf("y")&&(t.yLabel=void 0),-1===d.indexOf("z")&&(t.zLabel=void 0),-1===d.indexOf("text")&&(t.text=void 0),-1===d.indexOf("name")&&(t.name=void 0)),t}function z(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var p=d.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,m,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(g=c.pointerX,m=c.pointerY):(g=n._offset+y.x,m=i._offset+y.y);var b,x,_=a.readability(y.color,p)<1.5?d.contrast(p):y.color,w=i.spikemode,M=i.spikethickness,T=i.spikecolor||_,A=v.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=A,x=g),-1!==w.indexOf("across")){var k=i._counterDomainMin,L=i._counterDomainMax;"free"===i.anchor&&(k=Math.min(k,i.position),L=Math.max(L,i.position)),b=l.l+k*l.w,x=l.l+L*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M,stroke:T,"stroke-dasharray":h.dashStyle(i.spikedash,M)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:m,y2:m,"stroke-width":M+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?M:-M),cy:m,r:M,fill:T}).classed("spikeline",!0)}if(f){var S,E,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(S=c.pointerX,E=c.pointerY):(S=n._offset+C.x,E=i._offset+C.y);var O,R,D=a.readability(C.color,p)<1.5?d.contrast(p):C.color,P=n.spikemode,I=n.spikethickness,z=n.spikecolor||D,N=v.getPxPosition(t,n);if(-1!==P.indexOf("toaxis")||-1!==P.indexOf("across")){if(-1!==P.indexOf("toaxis")&&(O=N,R=E),-1!==P.indexOf("across")){var F=n._counterDomainMin,B=n._counterDomainMax;"free"===n.anchor&&(F=Math.min(F,n.position),B=Math.max(B,n.position)),O=l.t+(1-B)*l.h,R=l.t+(1-F)*l.h}o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:R,"stroke-width":I,stroke:z,"stroke-dasharray":h.dashStyle(n.spikedash,I)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:S,x2:S,y1:O,y2:R,"stroke-width":I+2,stroke:p}).classed("spikeline",!0).classed("crisp",!0)}-1!==P.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S,cy:N-("top"!==n.side?I:-I),r:I,fill:z}).classed("spikeline",!0)}}}function N(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function F(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function B(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function H(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],h=c[1],d=u[0],p=u[1];return{x:f,y:h,width:d-f,height:p-h,top:Math.min(h,p),left:Math.min(f,d),right:Math.max(f,d),bottom:Math.max(h,p)}}},{"../../lib":264,"../../lib/events":256,"../../lib/override_cursor":275,"../../lib/svg_text_utils":289,"../../plots/cartesian/axes":313,"../../registry":361,"../color":120,"../dragelement":139,"../drawing":142,"../legend/defaults":172,"../legend/draw":173,"./constants":154,"./helpers":156,"@plotly/d3":16,"fast-isnumeric":31,tinycolor2:84}],158:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.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":264,"../color":120,"./helpers":156}],159:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":264,"./layout_attributes":161}],160:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":264,"../dragelement":139,"./attributes":151,"./calc":152,"./click":153,"./constants":154,"./defaults":155,"./helpers":156,"./hover":157,"./layout_attributes":161,"./layout_defaults":162,"./layout_global_defaults":163,"@plotly/d3":16}],161:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes"),a=i({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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),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":341,"./constants":154}],162:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":264,"./hoverlabel_defaults":158,"./hovermode_defaults":159,"./layout_attributes":161}],163:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":264,"./hoverlabel_defaults":158,"./layout_attributes":161}],164:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("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:a({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"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),h=0;h1){if(!h&&!d&&!p)"independent"===T("pattern")&&(h=!0);g._hasSubplotGrid=h;var b,x,_="top to bottom"===T("roworder"),w=h?.2:.1,M=h?.3:.1;v&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),g._domains={x:u("x",T,w,b,y),y:u("y",T,M,x,m,_)}}else delete e.grid}function T(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,h=t.grid||{},d=e._subplots,p=r._hasSubplotGrid,v=r.rows,g=r.columns,m="independent"===r.pattern,y=r._axisMap={};if(p){var b=h.subplots||[];l=r.subplots=new Array(v);var x=1;for(n=0;n1);if(!1===_&&(e.legend=void 0),(!1!==_||f.uirevision)&&(d("uirevision",e.uirevision),!1!==_)){d("bgcolor",e.paper_bgcolor),d("bordercolor"),d("borderwidth");var w,M,T,A=i.coerceFont(d,"font",e.font),k="h"===d("orientation");if(k?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(M=1.1,T="bottom"):(M=-.1,T="top")):(w=1.02,M=1,T="auto"),d("traceorder",b),c.isGrouped(e.legend)&&d("tracegroupgap"),d("entrywidth"),d("entrywidthmode"),d("itemsizing"),d("itemwidth"),d("itemclick"),d("itemdoubleclick"),d("groupclick"),d("x",w),d("xanchor"),d("y",M),d("yanchor",T),d("valign"),i.noneOrAll(f,h,["x","y"]),d("title.text")){d("title.side",k?"left":"top");var L=i.extendFlat({},A,{size:i.bigFont(A.size)});i.coerceFont(d,"title.font",L)}}}},{"../../lib":264,"../../plot_api/plot_template":302,"../../plots/attributes":309,"../../plots/layout_attributes":356,"../../registry":361,"./attributes":170,"./helpers":176}],173:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),d=t("./constants"),p=t("../../constants/alignment"),v=p.LINE_SPACING,g=p.FROM_TL,m=p.FROM_BR,y=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function w(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function M(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!u,p=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var v=i.ensureSingle(t,"text","legendtext");v.attr("text-anchor","start").call(c.font,a).text(h?T(n,p):n);var g=r.itemwidth+2*d.itemGap;f.positionText(v,g,0),h?v.call(f.makeEditable,{gd:e,text:n}).call(k,t,e,r).on("edit",(function(n){this.text(T(n,p)).call(k,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),c=h.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):k(v,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 A(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.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||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function k(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,h,p=s.size*v;if(o){var g=c.bBox(o);u=g.height,h=g.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var m=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(m),b=m.node();if(u=p*y,h=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*d.itemGap),f.positionText(m,l+d.titlePad,l+p);else{var x=2*d.itemGap+r.itemwidth;i.groupTitle&&(x=d.itemGap,h-=r.itemwidth),f.positionText(m,x,-p*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=p,i.height=Math.max(u,16)+3,i.width=h)}(e,r,n,i)}))}function L(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function S(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,p=e._inHover;p?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(p){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var v=f.hiddenlabels||[];if(!(p||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),a.autoMargin(t,"legend");var T=i.ensureSingle(r,"g","legend",(function(t){p||t.attr("pointer-events","all")})),E=i.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),C=i.ensureSingle(T,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var O=i.ensureSingle(T,"g","scrollbox"),R=e.title;if(e._titleWidth=0,e._titleHeight=0,R.text){var D=i.ensureSingle(O,"text","legendtitletext");D.attr("text-anchor","start").call(c.font,R.font).text(R.text),k(D,O,t,e,1)}else O.selectAll(".legendtitletext").remove();var P=i.ensureSingle(T,"rect","scrollbar",(function(t){t.attr(d.scrollBarEnterAttrs).call(u.fill,d.scrollBarColor)})),I=O.selectAll("g.groups").data(s);I.enter().append("g").attr("class","groups"),I.exit().remove();var z=I.selectAll("g.traces").data(i.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==v.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(M,t,e)})).call(b,t,e).each((function(){p||n.select(this).call(A,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),u="fraction"===i.entrywidthmode,f=i.borderwidth,h=2*f,p=d.itemGap,v=i.itemwidth+2*p,g=2*(f+p),m=S(i),y=i.y<0||0===i.y&&"top"===m,b=i.y>1||1===i.y&&"bottom"===m,w=i.tracegroupgap,M={};i._maxHeight=Math.max(y||b?a.height/2:o.h,30);var T=0;i._width=0,i._height=0;var A=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+A[0],f+A[1]+i._height+e/2+p),i._height+=e,i._width=Math.max(i._width,t[0].width)})),T=v+i._width,i._width+=p+v+h,i._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var k=L(i),E=i.x<0||0===i.x&&"right"===k,C=i.x>1||1===i.x&&"left"===k,O=b||y,R=a.width/2;i._maxWidth=Math.max(E?O&&"left"===k?o.l+o.w:R:C?O&&"right"===k?o.r+o.w:R:o.w,2*v);var D=0,P=0;r.each((function(t){var e=_(t,i,v);D=Math.max(D,e),P+=e})),T=null;var I=0;if(l){var z=0,N=0,F=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,i,v),a=r[0].height;c.setTranslate(this,A[0],A[1]+f+p+a/2+e),e+=a,t=Math.max(t,n),M[r[0].trace.legendgroup]=t}));var r=t+p;N>0&&r+f+N>i._maxWidth?(I=Math.max(I,N),N=0,F+=z+w,z=e):z=Math.max(z,e),c.setTranslate(this,N,F),N+=r})),i._width=Math.max(I,N)+f,i._height=F+z+g}else{var B=r.size(),j=P+h+(B-1)*p=i._maxWidth&&(I=Math.max(I,V),H=0,Y+=U,i._height+=U,U=0),c.setTranslate(this,A[0]+f+H,A[1]+f+Y+e/2+p),V=H+r+p,H+=n,U=Math.max(U,e)})),j?(i._width=H+h,i._height=U+g):(i._width=Math.max(I,V)+h,i._height+=U+g)}}i._width=Math.ceil(Math.max(i._width+A[0],i._titleWidth+2*(f+d.titlePad))),i._height=Math.ceil(Math.max(i._height+A[1],i._titleHeight+2*(f+d.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,q=G.legendText||G.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=t[0].trace.legendgroup,o=_(t,i,v);l&&""!==a&&(o=M[a]);var f=q?v:T||o;s||u||(f+=p/2),c.setRect(e,0,-r/2,f,r)}))}(t,I,z,e)},function(){var s,u,v,y,b=f._size,x=e.borderwidth;if(!p){if(function(t){var e=t._fullLayout.legend,r=L(e),n=S(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*m[r],b:e._effHeight*m[n],t:e._effHeight*g[n]})}(t))return;var _=b.l+b.w*e.x-g[L(e)]*e._width,M=b.t+b.h*(1-e.y)-g[S(e)]*e._effHeight;if(f.margin.autoexpand){var A=_,k=M;_=i.constrain(_,0,f.width-e._width),M=i.constrain(M,0,f.height-e._effHeight),_!==A&&i.log("Constrain legend.x to make legend fit inside graph"),M!==k&&i.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(T,_,M)}if(P.on(".drag",null),T.on("wheel",null),p||e._height<=e._maxHeight||t._context.staticPlot){var R=e._effHeight;p&&(R=e._height),C.attr({width:e._width-x,height:R-x,x:x/2,y:x/2}),c.setTranslate(O,0,0),E.select("rect").attr({width:e._width-2*x,height:R-2*x,x:x,y:x}),c.setClipUrl(O,h,t),c.setRect(P,0,0,0,0),delete e._scrollY}else{var D,I,z,N=Math.max(d.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),F=e._effHeight-N-2*d.scrollBarMargin,B=e._height-e._effHeight,j=F/B,U=Math.min(e._scrollY||0,B);C.attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),E.select("rect").attr({width:e._width-2*x+d.scrollBarWidth+d.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),c.setClipUrl(O,h,t),V(U,N,j),T.on("wheel",(function(){V(U=i.constrain(e._scrollY+n.event.deltaY/F*B,0,B),N,j),0!==U&&U!==B&&n.event.preventDefault()}));var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;D="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,z=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(I="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,V(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,B)}(z,D,I),N,j))}));P.call(H);var Y=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(D=t.changedTouches[0].clientY,z=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(I=t.changedTouches[0].clientY,V(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,B)}(z,D,I),N,j))}));O.call(Y)}function V(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(O,0,-r),c.setRect(P,e._width,d.scrollBarMargin+r*i,d.scrollBarWidth,n),E.select("rect").attr("y",x+r)}t._context.edits.legendPosition&&(T.classed("cursor-move",!0),l.init({element:T.node(),gd:t,prepFn:function(){var t=c.getTranslate(T);v=t.x,y=t.y},moveFn:function(t,r){var n=v+t,i=y+r;c.setTranslate(T,n,i),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),u=l.align(i,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=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}));i.size()>0&&w(t,T,i,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":236,"../../lib":264,"../../lib/events":256,"../../lib/svg_text_utils":289,"../../plots/plots":358,"../../registry":361,"../color":120,"../dragelement":139,"../drawing":142,"./constants":171,"./get_legend_data":174,"./handle_click":175,"./helpers":176,"./style":178,"@plotly/d3":16}],174:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,h={},d=0,p=0;function v(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+d;u.push(n),c[n]=[r],d++}}for(r=0;rA&&(T=A)}w[r][0]._groupMinRank=T,w[r][0]._preGroupSort=r}var k=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var m=e._fullLayout;r||(r=m.legend);var y="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*d.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function M(t,a,o){var u=t[0].trace,f=u.marker||{},h=f.line||{},d=o?u.visible&&u.type===o:i.traceIs(u,"bar"),p=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(d?[t]:[]);p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var d=a.mcc;if(!r._inHover&&"mc"in a){var p=c(f),v=p.mid;void 0===v&&(v=(p.max+p.min)/2),d=s.tryColorscale(f,"")(v)}var m=d||a.mc||f.color,y=f.pattern,b=y&&s.getPatternAttr(y.shape,0,"");if(b){var x=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),M=y.fgopacity,T=g(y.size,8,10),A=g(y.solidity,.5,1),k="legend-"+u.uid;i.call(s.pattern,"legend",e,k,b,T,A,d,y.fillmode,x,_,M)}else i.call(l.fill,m);o&&l.stroke(i,a.mlc||h.color)}))}function T(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,d=w(h(u.width,o.pts),u,5,2),p=a.minExtend(s,{marker:{line:{width:d}}});p.marker.line.color=u.color;var v=a.minExtend(o,{trace:p});f(c,v,p)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.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,i=t[0].trace,o=[];if(i.visible)switch(i.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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),h=c(i),d=h.colorscale,v=h.reversescale;if(d){if(!r){var g=d.length;u=0===o?d[v?g-1:0][1]:1===o?d[v?0:g-1][1]:d[Math.floor((g-1)/2)][1]}}else{var m=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(m)?m[o]||m[0]:m}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,p(v,"radial"===r),d,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,M(t,this,"waterfall")}var a=[];e.visible&&r&&(a=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(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){M(t,this,"funnel")})).each((function(t){M(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){T(t,this,"funnelarea")})).each((function(t){T(t,this,"pie")})).each((function(t){var r,i,o=v(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,d=o.showGradientFill,g=o.anyFill,m=o.anyLine,y=t[0],x=y.trace,_=c(x),M=_.colorscale,T=_.reversescale,A=u.hasMarkers(x)||!g?"M5,0":m?"M5,-2":"M5,-3",k=n.select(this),L=k.select(".legendfill").selectAll("path").data(l||d?[t]:[]);if(L.enter().append("path").classed("js-fill",!0),L.exit().remove(),L.attr("d",A+"h"+b+"v6h-"+b+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,p(T),M,"fill")}})),f||h){var S=w(void 0,x.line,10,5);i=a.minExtend(x,{line:{width:S}}),r=[a.minExtend(y,{trace:i})]}var E=k.select(".legendlines").selectAll("path").data(f||h?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",A+(h?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,p(T),M,"stroke")}})})).each((function(t){var r,i,o=v(t),l=o.anyFill,c=o.anyLine,f=o.showLine,h=o.showMarker,d=t[0],p=d.trace,g=!h&&!c&&!l&&u.hasText(p);function m(t,e,r,n){var i=a.nestedProperty(p,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return d._distinct&&d.index&&t[d.index]?t[d.index]:t[0]}if(h||g||f){var x={},w={};if(h){x.mc=m("marker.color",b),x.mx=m("marker.symbol",b),x.mo=m("marker.opacity",a.mean,[.2,1]),x.mlc=m("marker.line.color",b),x.mlw=m("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var M=m("marker.size",a.mean,[2,16],12);x.ms=M,w.marker.size=M}f&&(w.line={width:m("line.width",b,[0,10],5)}),g&&(x.tx="Aa",x.tp=m("textposition",b),x.ts=10,x.tc=m("textfont.color",b),x.tf=m("textfont.family",b)),r=[a.minExtend(d,x)],(i=a.minExtend(p,w)).selectedpoints=null,i.texttemplate=null}var T=n.select(this).select("g.legendpoints"),A=T.selectAll("path.scatterpts").data(h?r:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),A.exit().remove(),A.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var k=T.selectAll("g.pointtext").data(g?r:[]);k.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),k.exit().remove(),k.selectAll("text").call(s.textPointStyle,i,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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":264,"../../registry":361,"../../traces/pie/helpers":387,"../../traces/pie/style_one":388,"../../traces/scatter/subtypes":415,"../color":120,"../colorscale/helpers":131,"../drawing":142,"./constants":171,"@plotly/d3":16}],179:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":181}],180:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h=c._cartesianSpikesEnabled;if("zoom"===s){var d,p="in"===l?.5:2,v=(1+p)/2,g=(1-p)/2;for(i=0;i1?(R=["toggleHover"],D=["resetViews"]):m?(O=["zoomInGeo","zoomOutGeo"],R=["hoverClosestGeo"],D=["resetGeo"]):g?(R=["hoverClosest3d"],D=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(O=["zoomInMapbox","zoomOutMapbox"],R=["toggleHover"],D=["resetViewMapbox"]):x?R=["hoverClosestGl2d"]:y?R=["hoverClosestPie"]:A?(R=["hoverClosestCartesian","hoverCompareCartesian"],D=["resetViewSankey"]):R=["toggleHover"];v&&(R=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var v=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=N[r+1];else if(t=n.pmax)e=N[r+1];else if(t=0;T--){var A=r.append("path").attr(g).style("opacity",T?.1:m).call(o.stroke,b).call(o.fill,y).call(s.dashLine,T?"solid":_,T?4+x:x);if(p(A,t,a),w){var k=l(t.layout,"selections",a);A.style({cursor:"move"});var L={element:A.node(),plotinfo:d,gd:t,editHelpers:k,isActiveSelection:!0},S=n(c,t);i(S,A,L)}else A.style("pointer-events",T?"all":"none");M[T]=A}var E=M[0];M[1].node().addEventListener("click",(function(){return function(t,e){if(!h(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void v(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=v,f(t)}}(t,E)}))}(t._fullLayout._selectionLayer)}function p(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function v(t){h(t)&&(t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t)))}e.exports={draw:f,drawOne:d,activateLastSelection:function(t){if(!h(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=v,f(t)}}},{"../../plot_api/plot_template":302,"../color":120,"../drawing":142,"../shapes/display_outlines":214,"../shapes/draw_newshape/helpers":219,"../shapes/handle_outline":221,"../shapes/helpers":222}],204:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":257,"../../drawing/attributes":141}],205:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],206:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,i=t("../../shapes/handle_outline").clearOutline,a=t("../../shapes/draw_newshape/helpers"),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,f=e.plotinfo,h=f.xaxis,d=f.yaxis,p=e.isActiveSelection,v=e.dragmode,g=(c.layout||{}).selections||[];if(!n(v)&&void 0!==p){var m=c._fullLayout._activeSelectionIndex;if(m-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(m)){q(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=K(_))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=d(r),l=v(r);if(s||l){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&i._fullLayout._outlining)s&&(c=M(f,t)),c&&a.call("_guiRelayout",i,{shapes:c}),l&&!U(t)&&(u=T(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:u}).then((function(){e&&A(i)}))),i._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function X(t){return t._id}function Z(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(X),c=r.map(X);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,dt=et[0].yref;if(nt&&dt){var pt=ct(et);ut([C(t,nt,"x"),C(t,dt,"y")])($,pt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),h._reselect=!1}if(!a&&h._deselect){var vt=h._deselect;(function(t,e,r){for(var n=0;n=0)T._fullLayout._deactivateShape(T);else if(!b){var r=A.clickmode;E.done(At).then((function(){if(E.clear(At),2===t){for(xt.remove(),K=0;K-1&&H(e,T,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&ft(T,void 0);l.click(T,e)})).catch(k.error)}},n.doneFn=function(){Tt.remove(),E.done(At).then((function(){E.clear(At),!L&&J&&n.selectionDefs&&(J.subtract=bt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,X)),(L||b)&&W(n,L),n.doneFnCompleted&&n.doneFnCompleted(kt),x&&ft(T,at)})).catch(k.error)}},clearOutline:b,clearSelectionsCache:W,selectOnClick:H}},{"../../lib":264,"../../lib/clear_gl_canvases":251,"../../lib/polygon":276,"../../lib/throttle":290,"../../plot_api/subroutines":303,"../../plots/cartesian/axis_ids":317,"../../registry":361,"../color":120,"../dragelement/helpers":138,"../drawing":142,"../fx":160,"../fx/helpers":156,"../shapes/constants":212,"../shapes/display_outlines":214,"../shapes/draw_newshape/helpers":219,"../shapes/draw_newshape/newshapes":220,"../shapes/handle_outline":221,"../shapes/helpers":222,"./constants":201,"./draw":203,"./draw_newselection/newselections":206,"./helpers":207,"point-in-polygon/nested":73,polybooljs:74}],210:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{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":237,"../../lib/extend":257,"../../plot_api/plot_template":302,"../../traces/scatter/attributes":390,"../annotations/attributes":103,"../drawing/attributes":141}],211:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,f),d=n.aggNums(Math.min,null,f),p=d<0?Math.abs(d)+c:c,v=h>0?h+c:c;return{ppad:c,ppadplus:u?p:v,ppadminus:u?v:p}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,d=-1/0,p=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;ld&&(d=f)));return d>=h?[h,d]: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;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===S&&(t[0][0]="M"),e[L]=t,M(),T())}}()}}function F(t,r){!function(t,r){if(e.length)for(var n=0;nb?(T=f,S="y0",A=b,E="y1"):(T=b,S="y1",A=f,E="y0");Z(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),X.moveFn="move"===D?J:K,X.altKey=n.altKey},doneFn:function(){if(y(t))return;d(e),$(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(y(t))return;$(s)}};function Z(r){if(y(t))D=null;else if(z)D="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(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!N&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";d(e,l),D=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;P?F("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(Y(t)+n)},B&&"date"===B.type&&(o=v.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+i)):(l=function(t){return q(V(t)+i)},U&&"date"===U.type&&(l=v.encodeDate(l))),F("path",r.path=w(R,o,l))}else P?F("xanchor",r.xanchor=G(x+n)):(F("x0",r.x0=G(c+n)),F("x1",r.x1=G(m+n))),I?F("yanchor",r.yanchor=q(M+i)):(F("y0",r.y0=q(f+i)),F("y1",r.y1=q(b+i)));e.attr("d",g(t,r)),Q(s,r)}function K(n,i){if(N){var a=function(t){return t},o=a,l=a;P?F("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(Y(t)+n)},B&&"date"===B.type&&(o=v.encodeDate(o))),I?F("yanchor",r.yanchor=q(M+i)):(l=function(t){return q(V(t)+i)},U&&"date"===U.type&&(l=v.encodeDate(l))),F("path",r.path=w(R,o,l))}else if(z){if("resize-over-start-point"===D){var u=c+n,h=I?f-i:f+i;F("x0",r.x0=P?u:G(u)),F("y0",r.y0=I?h:q(h))}else if("resize-over-end-point"===D){var d=m+n,p=I?b-i:b+i;F("x1",r.x1=P?d:G(d)),F("y1",r.y1=I?p:q(p))}}else{var y=function(t){return-1!==D.indexOf(t)},_=y("n"),j=y("s"),H=y("w"),W=y("e"),X=_?T+i:T,Z=j?A+i:A,J=H?k+n:k,K=W?L+n:L;I&&(_&&(X=T-i),j&&(Z=A-i)),(!I&&Z-X>10||I&&X-Z>10)&&(F(S,r[S]=I?X:q(X)),F(E,r[E]=I?Z:q(Z))),K-J>10&&(F(C,r[C]=P?J:G(J)),F(O,r[O]=P?K:G(K)))}e.attr("d",g(t,r)),Q(s,r)}function Q(t,e){(P||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 a=Y(P?e.xanchor:i.midRange(r?[e.x0,e.x1]:v.extractPathCoords(e.path,p.paramIsX))),o=V(I?e.yanchor:i.midRange(r?[e.y0,e.y1]:v.extractPathCoords(e.path,p.paramIsY)));if(a=v.roundPositionForSharpStrokeRendering(a,1),o=v.roundPositionForSharpStrokeRendering(o,1),P&&I){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(P){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(X),W.node().onmousemove=Z}(t,P,l,e,r,D):!0===l.editable&&P.style("pointer-events",O||c.opacity(L)*k<=.5?"stroke":"all");P.node().addEventListener("click",(function(){return function(t,e){if(!b(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void M(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=M,m(t)}}(t,P)}))}}function _(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 w(t,e,r){return t.replace(p.segmentRE,(function(t){var n=0,i=t.charAt(0),a=p.paramIsX[i],o=p.paramIsY[i],s=p.numParams[i];return i+t.substr(1).replace(p.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function M(t){b(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,m(t)))}e.exports={draw:m,drawOne:x,eraseActiveShape:function(t){if(!b(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&ld&&(t="X"),t}));return a>d&&(p=p.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+p}))}(e,s,c);if("pixel"===e.xsizemode){var x=s(e.xanchor);u=x+e.x0,f=x+e.x1}else u=s(e.x0),f=s(e.x1);if("pixel"===e.ysizemode){var _=c(e.yanchor);h=_-e.y0,d=_-e.y1}else h=c(e.y0),d=c(e.y1);if("line"===p)return"M"+u+","+h+"L"+f+","+d;if("rect"===p)return"M"+u+","+h+"H"+f+"V"+d+"H"+u+"Z";var w=(u+f)/2,M=(h+d)/2,T=Math.abs(w-u),A=Math.abs(M-h),k="A"+T+","+A,L=w+T+","+M;return"M"+L+k+" 0 1,1 "+(w+","+(M-A))+k+" 0 0,1 "+L+"Z"}},{"../../lib":264,"../../plots/cartesian/axes":313,"./constants":212}],223:[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":324,"./attributes":210,"./calc_autorange":211,"./defaults":213,"./draw":215,"./draw_newshape/defaults":218}],224:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps: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:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt: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":257,"../../plot_api/edit_types":295,"../../plot_api/plot_template":302,"../../plots/animation_attributes":307,"../../plots/font_attributes":341,"../../plots/pad_attributes":357,"./constants":225}],225:[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}},{}],226:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(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 E(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 C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function O(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,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=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,m);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var m={left:[-p,0],right:[p,0],top:[0,-p],bottom:[0,p]}[x.side];e.attr("transform",l(m[0],m[1]))}}}return z.call(N),D&&(S?z.on(".opacity",null):(A=0,k=!0,z.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),z.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,m,e,b):o.call("_guiRelayout",t,m,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(N)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),z.classed("js-placeholder",k),M}}},{"../../constants/alignment":236,"../../constants/interactions":242,"../../lib":264,"../../lib/svg_text_utils":289,"../../plots/plots":358,"../../registry":361,"../color":120,"../drawing":142,"@plotly/d3":16,"fast-isnumeric":31}],230:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":257,"../../plot_api/edit_types":295,"../../plot_api/plot_template":302,"../../plots/font_attributes":341,"../../plots/pad_attributes":357,"../color/attributes":119}],231:[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"}}},{}],232:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(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,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":264,"../../plots/array_container_defaults":308,"./attributes":230,"./constants":231}],233:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function d(t){return t._index}function p(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function v(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?m(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||m(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},d={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(k,i,h,d),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(L,String(p(r,i)?-1:i._index)),m(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(M,i)})),o.setTranslate(e,l.lx,l.ly)}function m(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=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(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),d=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var p=0,g=0,m=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?g=m.headerHeight+f.gapButtonHeader:p=m.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-m.openHeight),"dropdown"===o.type&&"left"===o.direction&&(p=-f.gapButtonHeader+f.gapButton-m.openWidth);var x={x:m.lx+p+o.pad.l,y:m.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},T={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(y,o,s,t).call(k,o,x),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(v(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(v(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(M,o),u.call(_,o)}))})),u.call(_,o),b?(T.w=Math.max(m.openWidth,m.headerWidth),T.h=x.y-T.t):(T.w=x.x-T.l,T.h=Math.max(m.openHeight,m.headerHeight)),T.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,d=i.active;if(u)for(s=0,l=0;l0?[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(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,d);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,A=s.barLength+2*s.barPad,k=s.barWidth+2*s.barPad,L=p,S=g+m;S+k>c&&(S=c-k);var E=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),T?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:L,y:S,width:A,height:k}),this._hbarXMin=L+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=m>M,O=s.barWidth+2*s.barPad,R=s.barLength+2*s.barPad,D=p+v,P=g;D+O>l&&(D=l-O);var I=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);I.exit().on(".drag",null).remove(),I.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=I.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:P,width:O,height:R}),this._vbarYMin=P+R/2,this._vbarTranslateMax=M-R):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var z=this.id,N=u-.5,F=C?f+O+.5:f+.5,B=h-.5,j=T?d+k+.5:d+.5,U=o._topdefs.selectAll("#"+z).data(T||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",z).append("rect"),T||C?(this._clipRect=U.select("rect").attr({x:Math.floor(N),y:Math.floor(B),width:Math.ceil(F)-Math.floor(N),height:Math.ceil(j)-Math.floor(B)}),this.container.call(a.setClipUrl,z,this.gd),this.bg.attr({x:p,y:g,width:v,height:m})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),T||C){var H=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(H);var Y=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(Y),C&&this.vbar.on(".drag",null).call(Y)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":264,"../color":120,"../drawing":142,"@plotly/d3":16}],236:[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"}}},{}],237:[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(" ")}}},{}],238:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],239:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],240:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],241:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],242:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],243:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],244:[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}},{}],245:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],247:[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}},{}],248:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,h,d,p,v=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}v?(u=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":271}],249:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(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(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?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),M=t.match(w?b:y);if(!M)return u;var T=M[1],A=M[3]||"1",k=Number(M[5]||1),L=Number(M[7]||0),S=Number(M[9]||0),E=Number(M[11]||0);if(c){if(2===T.length)return u;var C;T=Number(T);try{var O=g.getComponentMethod("calendars","getCal")(e);if(w){var R="i"===A.charAt(A.length-1);A=parseInt(A,10),C=O.newDate(T,O.toMonthIndex(T,A,R),k)}else C=O.newDate(T,Number(A),k)}catch(t){return u}return C?(C.toJD()-v)*f+L*h+S*d+E*p:u}T=2===T.length?(Number(T)+2e3-x)%100+x:Number(T),A-=1;var D=new Date(Date.UTC(2e3,A,k,L,S));return D.setUTCFullYear(T),D.getUTCMonth()!==A||D.getUTCDate()!==k?u:D.getTime()+E*p},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var M=90*f,T=3*h,A=5*d;function k(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var L=Math.floor(w/f)+v,S=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(L).formatDate("yyyy-mm-dd")}catch(t){a=m("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return k(a("%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 s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var L=/%\d?f/g,S=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function C(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 i=new Date(Math.floor(e+.05));if(t=t.replace(S,(function(){return E[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var O=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/d),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/p,60),O[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var R=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+v,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-v)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+R);return c.setUTCMonth(c.getUTCMonth()+e)+n-R},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u1||v<0||v>1?null:{x:t+l*v,y:e+f*v}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,d=c-a,p=u*u+f*f,v=h*h+d*d,g=Math.min(l(u,f,p,i-t,a-e),l(u,f,p,o-t,c-e),l(h,d,v,t-i,e-a),l(h,d,v,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var d=h(c);d;){if((c+=d+r)>f)return;d=h(c)}for(d=h(f);d;){if(c>(f-=d+r))return;d=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":271}],261:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,d,p,v=t.color,g=l(v),m=l(e),y=o.extractOpts(t),b=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=g?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=m?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||m)for(var x=0;x1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],264:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var d=t("./array");f.isTypedArray=d.isTypedArray,f.isArrayOrTypedArray=d.isArrayOrTypedArray,f.isArray1D=d.isArray1D,f.ensureArray=d.ensureArray,f.concat=d.concat,f.maxRowLength=d.maxRowLength,f.minRowLength=d.minRowLength;var p=t("./mod");f.mod=p.mod,f.modHalf=p.modHalf;var v=t("./coerce");f.valObjectMeta=v.valObjectMeta,f.coerce=v.coerce,f.coerce2=v.coerce2,f.coerceFont=v.coerceFont,f.coercePattern=v.coercePattern,f.coerceHoverinfo=v.coerceHoverinfo,f.coerceSelectionMarkerOpacity=v.coerceSelectionMarkerOpacity,f.validate=v.validate;var g=t("./dates");f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var m=t("./search");f.findBin=m.findBin,f.sorterAsc=m.sorterAsc,f.sorterDes=m.sorterDes,f.distinctVals=m.distinctVals,f.roundUp=m.roundUp,f.sort=m.sort,f.findIndexOfMin=m.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var M=t("./extend");f.extendFlat=M.extendFlat,f.extendDeep=M.extendDeep,f.extendDeepAll=M.extendDeepAll,f.extendDeepNoArrays=M.extendDeepNoArrays;var T=t("./loggers");f.log=T.log,f.warn=T.warn,f.error=T.error;var A=t("./regex");f.counterRegex=A.counter;var k=t("./throttle");f.throttle=k.throttle,f.throttleDone=k.done,f.clearThrottle=k.clear;var L=t("./dom");function S(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.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},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var P=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return P.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var I={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return F.apply(I,arguments)};var z={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return F.apply(z,arguments)};var N=/^[:|\|]/;function F(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,h,d="_xother"===s||"_yother"===s,p="_xother_"===s||"_yother_"===s,v="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||d||v||p,m=s;if((d||p)&&(m=m.substring(1)),(v||p)&&(m=m.substring(0,m.length-1)),g){if(void 0===(c=e[m]))return""}else for(h=3;h=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var B=2e9;f.seedPseudoRandom=function(){B=2e9},f.pseudoRandom=function(){var t=B;return B=(69069*B+1)%4294967296,Math.abs(B-t)<429496729?f.pseudoRandom():B/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.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;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.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)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":243,"./anchor_utils":247,"./angles":248,"./array":249,"./clean_number":250,"./clear_responsive":252,"./coerce":253,"./dates":254,"./dom":255,"./extend":257,"./filter_unique":258,"./filter_visible":259,"./geometry2d":260,"./identity":262,"./increment":263,"./is_plain_object":265,"./keyed_container":266,"./localize":267,"./loggers":268,"./make_trace_groups":269,"./matrix":270,"./mod":271,"./nested_property":272,"./noop":273,"./notifier":274,"./preserve_drawing_buffer":277,"./push_unique":278,"./regex":280,"./relative_attr":281,"./relink_private":282,"./search":283,"./sort_object_keys":286,"./stats":287,"./throttle":290,"./to_log_range":291,"@plotly/d3":16,"d3-format":25,"d3-time-format":26,"fast-isnumeric":31}],265:[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).hasOwnProperty("hasOwnProperty")}},{}],266:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":300,"./notifier":274}],269:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":16}],270:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],272:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,h,d,p,v=r.length,g=r[0][0],m=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,m)))if(cu||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":243,"./matrix":270}],277:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":31,"is-mobile":66}],278:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}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 a,o,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(o=p>=0?r?s:l:r?u:c,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":249,"fast-isnumeric":31}],288:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":20}],289:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,v){var k=t.text(),L=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&k.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var O=t.attr("class")?t.attr("class").split(" ")[0]:"text";return O+="-math",C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove(),t.style("display",null).attr({"data-unformatted":k,"data-math":"N"}),L?(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 a,o,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2!==h&&3!==h)return void i.warn("No MathJax version:",MathJax.version);var d=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(a):MathJax.typeset([a])},p=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),d,p,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){d(),p(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}(L[2],o,(function(n,i,o){C.selectAll("svg."+O).remove(),C.selectAll("g."+O+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return R(),void e();var l=C.append("g").classed(O+"-group",!0).attr({"pointer-events":"none","data-unformatted":k,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:O,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",h=s.select("g");h.attr({fill:f,stroke:f});var d=h.node().getBoundingClientRect(),p=d.width,g=d.height;(p>c||g>u)&&(s.style("overflow","hidden"),p=(d=s.node().getBoundingClientRect()).width,g=d.height);var m=+t.attr("x"),y=+t.attr("y"),b=-(r||t.node().getBoundingClientRect().height)/4;if("y"===O[0])l.attr({transform:"rotate("+[-90,m,y]+")"+a(-p/2,b-g/2)});else if("l"===O[0])y=b-g/2;else if("a"===O[0]&&0!==O.indexOf("atitle"))m=0,y=b;else{var x=t.attr("text-anchor");m-=p*("middle"===x?.5:"end"===x?1:0),y=y+b-g/2}s.attr({x:m,y:y}),v&&v.call(t,l),e(l)}))}))):R(),t}function R(){C.empty()||(O=t.attr("class")+"-math",C.select("svg."+O).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?u():(r=t,l=[{node:t}]);for(var L=e.split(m),C=0;C|>|>)/g;var f=[["$","$"],["\\(","\\)"]];var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},d={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},v=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,M=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(t,e){if(!t)return null;var r=t.match(e),n=r&&(r[3]||r[4]);return n&&S(n)}var A=/(^|;)\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"],i="...".length,a=t.split(m),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,p-i)+"..."):o.push(u.substr(0,p));break}s=""}}return o.join("")};var k={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)):k[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==v.indexOf(i)&&-1!==v.indexOf(a)?e:""}function C(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=S,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(m),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.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)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],291:[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":31}],292:[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"}}},{}],293:[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"}}},{}],294:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&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 a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,v=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),p(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),c.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.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 a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!v&&(h(g,m),d(t),!0)}var b,x,_,w,M,T,A,k,L=Object.keys(r).map(Number).sort(o),S=e.get(),E=S||[],C=u(m,f).get(),O=[],R=-1,D=E.length;for(b=0;bE.length-(A?0:1))a.warn("index out of range",f,_);else if(void 0!==T)M.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(T)?O.push(_):A?("add"===T&&(T={}),E.splice(_,0,T),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,T),-1===R&&(R=_);else for(x=0;x=0;b--)E.splice(O[b],1),C&&C.splice(O[b],1);if(E.length?S||e.set(E):e.set(null),v)return!1;if(h(g,m),p!==i){var P;if(-1===R)P=L;else{for(D=Math.max(E.length,D),P=[],b=0;b=R);b++)P.push(_);for(b=R;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function R(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),O(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&O(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in O(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,h=o.isPlainObject(n),d=[];for(var p in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var v=0;v-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(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 i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(H(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&Y(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(k)),s.push(h.rehover,h.redrag,h.reselect),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function H(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=d.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[d.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function Y(t,e){var r=e?function(t){var r=[];for(var n in e){var i=d.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return d.draw(t,r,{skipTitle:!0})}:function(t){return d.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var V=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,q=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,h=N(l._preGUI,c),p=Object.keys(e),v=d.list(t),g=o.extendDeepAll({},e),m={};for(j(e),p=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[I];)I--;var F=D.parts[I],B=D.parts[I-1]+"."+F,U=D.parts.slice(0,I).join("."),H=s(t.layout,U).get(),Y=s(l,U).get(),W=D.get();if(void 0!==P){k[R]=P,L[R]="reverse"===F?P:z(W);var Z=f.getLayoutValObject(l,D.parts);if(Z&&Z.impliedEdits&&null!==P)for(var J in Z.impliedEdits)S(o.relativeAttr(R,J),Z.impliedEdits[J]);if(-1!==["width","height"].indexOf(R))if(P){S("autosize",null);var K="height"===R?"width":"height";S(K,l[K])}else l[R]=t._initialAutoSize[R];else if("autosize"===R)S("width",P?null:l.width),S("height",P?null:l.height);else if(B.match(V))O(B),s(l,U+"._inputRange").set(null);else if(B.match(G)){O(B),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else B.match(q)&&s(l,U+"._inputDomain").set(null);if("type"===F){E=H;var $="linear"===Y.type&&"log"===P,tt="log"===Y.type&&"linear"===P;if($||tt){if(E&&E.range)if(Y.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&S(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),S(U+".range[0]",Math.log(et)/Math.LN10),S(U+".range[1]",Math.log(rt)/Math.LN10)):(S(U+".range[0]",Math.pow(10,et)),S(U+".range[1]",Math.pow(10,rt)))}else S(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,Y,P,S),u.getComponentMethod("images","convertCoords")(t,Y,P,S)}else S(U+".autorange",!0),S(U+".range",null);s(l,U+"._inputRange").set(null)}else if(F.match(T)){var nt=s(l,R).get(),it=(P||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,S),u.getComponentMethod("images","convertCoords")(t,nt,it,S)}var at=x.containerArrayMatch(R);if(at){r=at.array,n=at.index;var ot=at.property,st=Z||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(P)?L[R]=null:x.isRemoveVal(P)?L[R]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),M.update(A,st),m[r]||(m[r]={});var lt=m[r][n];lt||(lt=m[r][n]={}),lt[ot]=P,delete e[R]}else"reverse"===F?(H.range?H.range.reverse():(S(U+".autorange",!0),H.range=[1,0]),Y.autorange?A.calc=!0:A.plot=!0):("dragmode"===R&&(!1===P&&!1!==W||!1!==P&&!1===W)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===R&&("lasso"===P||"select"===P)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?A.plot=!0:Z?M.update(A,Z):A.calc=!0,D.set(P))}}for(r in m){x.applyContainerArrayChanges(t,h(a,r),m[r],A,h)||(A.plot=!0)}for(var ct in C){var ut=(E=d.getFromId(t,ct))&&E._constraintGroup;if(ut)for(var ft in A.calc=!0,ut)C[ft]||(d.getFromId(t,ft)._constraintShrinkable=!0)}return(X(t)||e.height||e.width)&&(A.plot=!0),(A.plot||A.calc)&&(A.layoutReplot=!0),{flags:A,rangesAltered:C,undoit:L,redoit:k,eventData:g}}function X(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function Z(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=B(t,o.extendFlat({},e),a),l=s.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var d=[];f.layoutReplot?d.push(w.layoutReplot):l.fullReplot?d.push(r._doPlot):(d.push(h.previousPromises),H(t,f,u)||h.supplyDefaults(t),l.style&&d.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&d.push(w.doColorBars),f.legend&&d.push(w.doLegend),f.layoutstyle&&d.push(w.layoutStyles),f.axrange&&Y(d,u.rangesAltered),f.ticks&&d.push(w.doTicksRelayout),f.modebar&&d.push(w.doModeBar),f.camera&&d.push(w.doCamera),d.push(k)),d.push(h.rehover,h.redrag,h.reselect),c.add(t,Z,[t,s.undoit,u.undoit,s.traces],Z,[t,s.redoit,u.redoit,s.traces]);var p=o.syncOrAsync(d,t);return p&&p.then||(p=Promise.resolve(t)),p.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}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(a,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,h.transition(t,e.frame.data,e.frame.layout,_.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 d(){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 p,v,g=0;function m(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var y=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))y.push({type:"object",data:m(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(p=0;p0&&TT)&&A.push(v);y=A}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var v=e[n].name,g=(u[v]||p[v]||{}).name,m=e[n].name,y=u[g]||p[g];g&&m&&"number"==typeof m&&y&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(u[g]||p[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),p[v]={name:v},d.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}d.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=d[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,s],d=[t,a];return c&&c.add(t,l,f,u,d),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,h=[e,l],d=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return m(i,e,s)},r.getLayoutValObject=function(t,e){return m(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":264,"../plots/attributes":309}],303:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),d=t("../constants/alignment"),p=t("../plots/cartesian/constraints"),v=p.enforce,g=p.clean,m=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function b(t){var e,i,s,u,p,v,g=t._fullLayout,m=g._size,b=m.p,_=h.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return a.previousPromises(t);function M(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:m.t+m.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:m.l+m.w*(t.position||0)+n%1}for(e=0;e<_.length;e++){var T=(u=_[e])._anchorAxis;u._linepositions={},u._lw=c.crispRound(t,u.linewidth,1),u._mainLinePosition=M(u,T,u.side),u._mainMirrorPosition=u.mirror&&T?M(u,T,d.OPPOSITE_SIDE[u.side]):null}var A=[],k=[],L=[],S=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,C=s.yaxis.domain,O=s.plotgroup;if(y(E,C,L)){var R=O.node(),D=s.bg=o.ensureSingle(O,"rect","bg");R.insertBefore(D.node(),R.childNodes[0]),k.push(i)}else O.select("rect.bg").remove(),L.push([E,C]),S||(A.push(i),k.push(i))}var P,I,z,N,F,B,j,U,H,Y,V,G,q,W=g._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){g._plots[t].bg=n.select(this)})),e=0;eM?u.push({code:"unused",traceType:y,templateCount:w,dataCount:M}):M>w&&u.push({code:"reused",traceType:y,templateCount:w,dataCount:M})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=v(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:d,layout:h},""),u.length)return u.map(m)}},{"../lib":264,"../plots/attributes":309,"../plots/plots":358,"./plot_config":300,"./plot_schema":301,"./plot_template":302}],305:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=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,h,d,p;function v(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},d=t.config||{},p={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),d=t._context,p=t._fullLayout||{}),!v("width")&&null!==e.width||!v("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!v("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function m(t,r){return o.coerce(e,g,f,t,r)}var y=m("format"),b=m("width"),x=m("height"),_=m("scale"),w=m("setBackground"),M=m("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var A=o.extendFlat({},h);b?A.width=b:null===e.width&&n(p.width)&&(A.width=p.width),x?A.height=x:null===e.height&&n(p.height)&&(A.height=p.height);var k=o.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),L=s.getRedrawFunc(T);function S(){return new Promise((function(t){setTimeout(t,s.getDelay(T._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(T,y,_),n=T._fullLayout.width,f=T._fullLayout.height;function h(){i.purge(T),document.body.removeChild(T)}if("full-json"===y){var d=a.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=u,d=JSON.stringify(d),h(),t(M?d:s.encodeJSON(d))}if(h(),"svg"===y)return t(M?r:s.encodeSVG(r));var p=document.createElement("canvas");p.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:p,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(T,r,A,k).then(L).then(S).then(E).then((function(e){t(function(t){return M?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":264,"../plots/plots":358,"../snapshot/helpers":365,"../snapshot/svgtoimg":367,"../snapshot/tosvg":369,"../version":443,"./plot_api":299,"fast-isnumeric":31}],306:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hb.length&&i.push(p("unused",a,m.concat(b.length)));var A,k,L,S,E,C=b.length,O=Array.isArray(T);if(O&&(C=Math.min(C,T.length)),2===x.dimensions)for(k=0;kb[k].length&&i.push(p("unused",a,m.concat(k,b[k].length)));var R=b[k].length;for(A=0;A<(O?Math.min(R,T[k].length):R);A++)L=O?T[k][A]:T,S=y[k][A],E=b[k][A],n.validate(S,L)?E!==S&&E!==+S&&i.push(p("dynamic",a,m.concat(k,A),S,E)):i.push(p("value",a,m.concat(k,A),S))}else i.push(p("array",a,m.concat(k),y[k]));else for(k=0;k1&&d.push(p("object","layout"))),i.supplyDefaults(v);for(var g=v._fullData,m=r.length,y=0;y0&&Math.round(f)===f))return{vals:i};c=f}for(var h=e.calendar,d="start"===l,p="end"===l,v=t[r+"period0"],g=a(v,h)||0,m=[],y=[],b=[],x=i.length,_=0;_A;)T=o(T,-c,h);for(;T<=A;)T=o(T,c,h);M=o(T,-c,h)}else{for(T=g+(w=Math.round((A-g)/u))*u;T>A;)T-=u;for(;T<=A;)T+=u;M=T-u}m[_]=d?M:p?T:(M+T)/2,y[_]=M,b[_]=T}return{vals:m,starts:y,ends:b}}},{"../../constants/numerical":243,"../../lib":264,"fast-isnumeric":31}],311:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],312:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=p(o,e,0),l=p(o,e,1),c=v(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=u[0].val,g=f[0].val;for(r=1;r0&&((M=S-s(b)-l(x))>E?T/M>C&&(_=b,w=x,C=T/M):T/S>C&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},C=T/S));if(h===g){var O=h-1,R=h+1;if(k)if(0===h)i=[0,1];else{var D=(h>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),P=h/(1-Math.min(.5,D/S));i=h>0?[0,P]:[P,0]}else i=L?[Math.max(0,O),Math.max(1,R)]:[O,R]}else k?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):L&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-d(e,b.val,x.val))/(S-s(_)-l(w)),i=[_.val-C*s(_),w.val+C*l(w)];return m&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function d(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),L=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),S=A(r.vpadplus||r.vpad),E=A(r.vpadminus||r.vpad);if(!M){if(h=1/0,d=-1/0,w)for(n=0;n0&&(h=a),a>d&&a-o&&(h=a),a>d&&a=R;n--)O(n);return{min:p,max:v,opts:r}},concatExtremes:v};function v(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function h(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function b(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":142,"../../constants/numerical":243,"../../lib":264,"../../registry":361,"./axis_ids":317,"@plotly/d3":16,"fast-isnumeric":31}],313:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("./layout_attributes"),p=t("./clean_ticks"),v=t("../../constants/numerical"),g=v.ONEMAXYEAR,m=v.ONEAVGYEAR,y=v.ONEMINYEAR,b=v.ONEMAXQUARTER,x=v.ONEAVGQUARTER,_=v.ONEMINQUARTER,w=v.ONEMAXMONTH,M=v.ONEAVGMONTH,T=v.ONEMINMONTH,A=v.ONEWEEK,k=v.ONEDAY,L=k/2,S=v.ONEHOUR,E=v.ONEMIN,C=v.ONESEC,O=v.MINUS_SIGN,R=v.BADNUM,D={K:"zeroline"},P={K:"gridline",L:"path"},I={K:"minor-gridline",L:"path"},z={K:"tick",L:"path"},N={K:"tick",L:"text"},F={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},B=t("../../constants/alignment"),j=B.MID_SHIFT,U=B.CAP_SHIFT,H=B.LINE_SPACING,Y=B.OPPOSITE_SIDE,V=e.exports={};V.setConvert=t("./set_convert");var G=t("./axis_autotype"),q=t("./axis_ids"),W=q.idSort,X=q.isLinked;V.id2name=q.id2name,V.name2id=q.name2id,V.cleanId=q.cleanId,V.list=q.list,V.listIds=q.listIds,V.getFromId=q.getFromId,V.getFromTrace=q.getFromTrace;var Z=t("./autorange");V.getAutoRange=Z.getAutoRange,V.findExtremes=Z.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}V.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},V.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},V.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==V.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=V.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},V.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:V.getFromId(e,r).cleanPos)(t)},V.redrawComponents=function(t,e){e=e||V.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;ur&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},V.saveRangeInitial=function(t,e){for(var r=V.list(t,"",!0),n=!1,i=0;i.3*h||u(n)||u(a))){var d=r.dtick/2;t+=t+d.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=V.tickIncrement(t,"M6","reverse")+1.5*k:a.exactMonths>.8?t=V.tickIncrement(t,"M1","reverse")+15.5*k:t-=L;var l=V.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,m,c,a)),g=y,0;g<=u;)g=V.tickIncrement(g,m,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(g,0,a),size:m,_dataSpan:u-c}},V.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=V.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,V.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),f=c?e.dtick:+e.dtick.substring(1),h=u?t.dtick:+t.dtick.substring(1);c&&u?tt(f,h)?f===2*A&&h===2*k&&(t.dtick=A):f===2*A&&h===3*k?t.dtick=A:f!==A||(e._input.minor||{}).nticks?et(f/h,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=k:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":tt(f,h)?f>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,h)||(t.dtick=et(f/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},V.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,V.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!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=V.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=S,o&&!n&&t.dtick=(D?0:1);P--){var I=!P;P?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var z=P?t:s.extendFlat({},t,t.minor);if(I?V.prepMinorTicks(z,t,e):V.prepTicks(z,e),"array"!==z.tickmode){var N=J(u),F=N[0],B=N[1],j=i(z.dtick),U="log"===a&&!(j||"L"===z.dtick.charAt(0)),H=V.tickFirst(z,e);if(P){if(t._tmin=H,H=B:W<=B;W=V.tickIncrement(W,X,f,o)){if(P&&Y++,z.rangebreaks&&!f){if(W=d)break}if(C.length>p||W===q)break;q=W;var Z={value:W};P?(U&&W!==(0|W)&&(Z.simpleLabel=!0),l>1&&Y%l&&(Z.skipLabel=!0),C.push(Z)):(Z.minor=!0,O.push(Z))}}else P?(C=[],v=nt(t)):(O=[],E=nt(t))}if(D&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=C.map((function(t){return t.value})),Q=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,h=0;f>=y?h=u>=y&&u<=g?u:m:r===x&&f>=_?h=u>=_&&u<=b?u:x:f>=T?h=u>=T&&u<=w?u:M:r===A&&f>=A?h=A:f>=k?h=k:r===L&&f>=L?h=L:r===S&&f>=S&&(h=S),h>=u&&(h=u,s=!0);var d=i+h;if(e.rangebreaks&&h>0){for(var p=0,v=0;v<84;v++){var E=(v+.5)/84;e.maskBreaks(i*(1-E)+E*d)!==R&&p++}(h*=p/84)||(t[n].drop=!0),s&&u>A&&(h=u)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(C,t,t._definedDelta),t.rangebreaks){var at="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=C.length-1;r>-1;r--)if(C[r].drop)C.splice(r,1);else{C[r].value=Rt(C[r].value,t);var lt=t.c2p(C[r].value);(at?st>lt-ot:std||utd&&(ct.periodX=d),ut10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=k&&a<=10||e>=15*k)t._tickround="d";else if(e>=E&&a<=16||e>=S)t._tickround="M";else if(e>=C&&a<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(vt(t.exponentformat)&&!gt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function dt(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}}V.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>m)e/=m,n=a(10),t.dtick="M"+12*ft(e,n,it);else if(o>M)e/=M,t.dtick="M"+ft(e,1,at);else if(o>k){if(t.dtick=ft(e,k,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=V.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>S?t.dtick=ft(e,S,at):o>E?t.dtick=ft(e,E,ot):o>C?t.dtick=ft(e,C,ot):(n=a(10),t.dtick=ft(e,n,it))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=a(10),t.dtick="L"+ft(e,n,it)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type||"multicategory"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):Ot(t)?(t.tick0=0,n=1,t.dtick=ft(e,n,ut)):(t.tick0=0,n=a(10),t.dtick=ft(e,n,it));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},V.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ct:lt,f=t+.01*o,h=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},V.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=mt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),d=t.exponentformat;"power"===d||vt(d)&>(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":O)+h+"",e.fontSize*=1.25):("e"===d||"E"===d)&&h>2?e.text="1"+d+(f>0?"+":O)+h:(e.text=mt(Math.pow(10,l),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,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var p=String(e.text).charAt(0);"0"!==p&&"1"!==p||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,c,v):"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),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Ot(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=mt(e.x,t,i,n);else{var a=e.x/180;if(0===a)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,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=mt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=O+e.text)}}}}(t,o,r,c,v):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=mt(e.x,t,i,n)}(t,o,0,c,v),n||(t.tickprefix&&!p(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!p(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},V.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return V.hoverLabelText(t,n,r)+" - "+V.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=V.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":O+o:o};var pt=["f","p","n","\u03bc","m","","k","M","G","T"];function vt(t){return"SI"===t||"B"===t}function gt(t){return t>14||t<-15}function mt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=V.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};ht(h),o=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,O);var d,p=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+d+"":"B"===l&&9===c?t+="B":vt(l)&&(t+=pt[c/3+5]));return a?O+t:t}function yt(t,e){if(t){var r=Object.keys(F).reduce((function(t,r){return-1!==e.indexOf(r)&&F[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function bt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var d=[0,1];if("x"===p){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),d.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var m=e._offset-r.left;m>0&&(n.xl=0,n.l=m)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),d.reverse()),r.height>0){var y=r.bottom-(e._offset+e._length);y>0&&(n.yb=0,n.b=y);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[v]="free"===e.anchor?e.position:e._anchorAxis.domain[d[0]],e.title.text!==c._dfltTitle[p]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=h),!0===e.mirror||"ticks"===e.mirror?i[v]=e._anchorAxis.domain[d[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[v]=[e._counterDomainMin,e._counterDomainMax][d[1]]))}it&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(yt(n,e.automargin),yt(i,e.automargin)),a.autoMargin(t,At(e),n),a.autoMargin(t,kt(e),i),a.autoMargin(t,Lt(e),s)})),r.skipTitle||it&&"bottom"===e.side||rt.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+wt(e);else{var s=Dt(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"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,d,p,v=V.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,d="top"===e.side?v-r:v+r):(d=e._offset+e._length/2,f="right"===e.side?v+r:v-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(p={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var m=h.getTranslate(g.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}e.title.hasOwnProperty("standoff")&&(p.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:p,transform:c,attributes:{x:f,y:d,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function at(t){var r=d+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=Tt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},V.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},V.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},V.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=h*U,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=h*(1-U));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(xt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(xt(e)))}},V.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},V.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,d=0,p=0,v=h?t.ticklen:0;if(f?v*=-1:u&&(v=0),h&&(d+=v,r)){var g=s.deg2rad(r);d=v*Math.cos(g)+1,p=v*Math.sin(g)}t.showticklabels&&(h||t.showline)&&(d+=.2*t.tickfont.size);var m,y,b,x,_,w={labelStandoff:d+=(t.linewidth||1)/2*(f?-1:1),labelShift:p},M=0,T=t.side,A=t._id.charAt(0),k=t.tickangle;if("x"===A)x=(_=!f&&"bottom"===T||f&&"top"===T)?1:-1,f&&(x*=-1),m=p*x,y=e+d*x,b=_?1:-.2,90===Math.abs(k)&&(f?b+=j:b=-90===k&&"bottom"===T?U:90===k&&"top"===T?j:.5,M=j/2*(k/90)),w.xFn=function(t){return t.dx+m+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*b},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*x<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"===A){if(x=(_=!f&&"left"===T||f&&"right"===T)?1:-1,f&&(x*=-1),m=d,y=p*x,b=0,f||90!==Math.abs(k)||(b=-90===k&&"left"===T||90===k&&"right"===T?U:.5),f){var L=i(k)?+k:0;if(0!==L){var S=s.deg2rad(L);M=Math.abs(Math.sin(S))*U*x,b=0}}w.xFn=function(t){return t.dx+e-(m+t.fontSize*b)*x+M*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*j},w.anchorFn=function(t,e){return i(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},V.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,_t);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),Pt(e,[z]),o.attr("transform",r.transFn)},V.drawGrid=function(t,e,r){r=r||{};var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&V.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;m--){var y=m?v:g;if(y){var b=y.selectAll("path."+i).data(m?s:o,_t);b.exit().remove(),b.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),b.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?p:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&b.attr("d",r.path)}}Pt(e,[P,I])},V.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=V.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.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 W(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),Pt(e,[D])},V.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",d=r.vals.filter((function(t){return t.text})),p=r.labelFns,v=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[f],m=r.layer.selectAll("g."+f).data(e.showticklabels?d:[],_t),y=[];function b(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),u=p.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+p.xFn(t)+","+(p.yFn(t)-t.fontSize/2)+")":""),d=c.lineCount(o),v=H*t.fontSize,g=p.heightFn(t,i(a)?+a:0,(d-1)*v);if(g&&(f+=l(0,g)),s.empty()){var m=o.select("text");m.attr({transform:f,"text-anchor":u}),m.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var y=h.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(y,0))}}))}m.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,p.xFn(e),p.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){b(r,v)}))):b(r,v)})),Pt(e,[N]),m.exit().remove(),r.repositionOnUpdate&&m.each((function(t){n.select(this).select("text").call(c.positionText,p.xFn(t),p.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),d=Math.max(l,c),p=e.side,v=1/0,g=-1/0;for(var y in m.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=h.bBox(r.node()),s=0;o?(a.right>d||a.leftd||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},b(m,g+1?g:v);var x=null;e._selections&&(e._selections[f]=m);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(x=90,_.push((function(){b(m,g)}))):_.push((function(){if(b(m,v),d.length&&"x"===u&&!i(v)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,a=[];if(m.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=Tt(this),o=h.bBox(i.node());a.push({top:0,bottom:10,height:10,left:r-o.width/2,right:r+o.width/2+2,width:o.width+2})})),"boundaries"!==e.tickson&&!e.showdividers||r.secondary){var o=d.length,l=Math.abs((d[o-1].x-d[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},p=f("top"),g=f("left"),y=f("right"),_=f("bottom")||g||p||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=x(o[s])){u=g;break}var f=i("pattern",u);if(f===g)for(s=0;s<2;s++)(c=x(o[s]))&&(e.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case g: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 m: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 h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]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 a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":361,"./constants":320}],318:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*b)||M)for(r=0;rD&&NO&&(O=N);h/=(O-C)/(2*R),C=l.l2r(C),O=l.l2r(O),l.range=l._input.range=L=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function B(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(t,e,i,a)}function H(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 Y(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function V(t){R&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),R=!1)}function G(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 q(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},h={},d=(a||{}).xaHash,p=(a||{}).yaHash,v=0;v=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(Y(i),2!==t||mt||Vt(),gt)o.indexOf("select")>-1&&L(r,i,J,K,e.id,Ot),o.indexOf("event")>-1&&d.click(i,r,e.id);else if(1===t&&mt){var s=v?D:R,c="s"===v||"w"===m?0:1,f=s._name+".range["+c+"]",h=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),p="left",g="middle";if(s.fixedrange)return;v?(g="n"===v?"top":"bottom","right"===s.side&&(p="right")):"e"===m&&(p="right"),i._context.showAxisRangeEntryBoxes&&n.select(xt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:p,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function Pt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,dt*e+_t)),i=Math.max(0,Math.min(et,pt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){Lt="",Mt.r=Mt.l,Mt.t=Mt.b,Et.attr("d","M0,0Z")}if(Mt.l=Math.min(_t,n),Mt.r=Math.max(_t,n),Mt.t=Math.min(wt,i),Mt.b=Math.max(wt,i),rt.isSubplotConstrained)a>O||o>O?(Lt="xy",a/tt>o/et?(o=a*et/tt,wt>i?Mt.t=wt-o:Mt.b=wt+o):(a=o*tt/et,_t>n?Mt.l=_t-a:Mt.r=_t+a),Et.attr("d",G(Mt))):s();else if(nt.isSubplotConstrained)if(a>O||o>O){Lt="xy";var l=Math.min(Mt.l/tt,(et-Mt.b)/et),c=Math.max(Mt.r/tt,(et-Mt.t)/et);Mt.l=l*tt,Mt.r=c*tt,Mt.b=(1-l)*et,Mt.t=(1-c)*et,Et.attr("d",G(Mt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;uv[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":264,"fast-isnumeric":31}],330:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":333}],331:[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 i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":236}],332:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,d=t("../../constants/numerical"),p=d.FP_SAFE,v=d.BADNUM,g=d.LOG_CLIP,m=d.ONEWEEK,y=d.ONEDAY,b=d.ONEHOUR,x=d.ONEMIN,_=d.ONESEC,w=t("./axis_ids"),M=t("./constants"),T=M.HOUR_PATTERN,A=M.WEEKDAY_PATTERN;function k(t){return Math.pow(10,t)}function L(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",d=r.charAt(0);function S(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return v}function E(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===v){if(!s(e))return v;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function C(e,r,n){return c(e,r,n||t.calendar)}function O(e){return t._categories[Math.round(e)]}function R(e){if(L(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 v}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function P(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function I(t){return s(t)?+t:D(t)}function z(t,e,r){return n.round(r+e*t,2)}function N(t,e,r){return(t-r)/e}var F=function(e){return s(e)?z(e,t._m,t._b):v},B=function(e){return N(e,t._m,t._b)};if(t.rangebreaks){var j="y"===d;F=function(e){if(!s(e))return v;var r=t._rangebreaks.length;if(!r)return z(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?z(e,t._m2,f):0},B=function(e){var r=t._rangebreaks.length;if(!r)return N(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return N(e,t._m2,t._B[n])}}t.c2l="log"===t.type?S:f,t.l2c="log"===t.type?k:f,t.l2p=F,t.p2l=B,t.c2p="log"===t.type?function(t,e){return F(S(t,e))}:F,t.p2c="log"===t.type?function(t){return k(B(t))}:B,-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=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=B,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return S(l(t),e)},t.r2d=t.r2c=function(t){return k(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=S,t.l2d=k,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return k(B(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=B,t.cleanPos=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(B(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,v,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=R,t.r2d=t.c2d=t.l2d=O,t.d2r=t.d2l_noadd=P,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(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=D,t.l2r=t.c2r=f,t.r2l=P,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return O(B(t))},t.r2p=t.d2p,t.p2r=B,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],p=[];for(i=0;ip&&(o[n]=p),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][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(s=0;su&&(h=!h),h&&t._rangebreaks.reverse();var p=h?-1:1;for(t._m2=p*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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 g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,h=!!e.yr1,d=[];if(f){var p=a.simpleMap(e.xr0,i.r2l),v=a.simpleMap(e.xr1,i.r2l),g=p[1]-p[0],m=v[1]-v[0];d[0]=(p[0]*(1-r)+r*v[0]-p[0])/(p[1]-p[0])*c,d[2]=c*(1-r+r*m/g),i.range[0]=i.l2r(p[0]*(1-r)+r*v[0]),i.range[1]=i.l2r(p[1]*(1-r)+r*v[1])}else d[0]=0,d[2]=c;if(h){var y=a.simpleMap(e.yr0,l.r2l),b=a.simpleMap(e.yr1,l.r2l),x=y[1]-y[0],_=b[1]-b[0];d[1]=(y[1]*(1-r)+r*b[1]-y[1])/(y[0]-y[1])*u,d[3]=u*(1-r+r*_/x),l.range[0]=i.l2r(y[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*b[1])}else d[1]=0,d[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/d[2]:1,M=h?u/d[3]:1,T=f?d[0]:0,A=h?d[1]:0,k=f?d[0]/d[2]*c:0,L=h?d[1]/d[3]*u:0,S=i._offset-k,E=l._offset-L;n.clipRect.call(o.setTranslate,T,A).call(o.setScale,1/w,1/M),n.plot.call(o.setTranslate,S,E).call(o.setScale,w,M),o.setPointGroupScale(n.zoomScalePts,1/w,1/M),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/M)}s.redrawComponents(t)}},{"../../components/drawing":142,"../../lib":264,"../../registry":361,"./axes":313,"@plotly/d3":16}],338:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],h={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(c,l)){var d=a(c),p=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f.999&&(v="turntable"):v="turntable")}else v="turntable";r("dragmode",v),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":120,"../../../lib":264,"../../../registry":361,"../../get_data":343,"../../subplot_defaults":359,"./axis_defaults":347,"./layout_attributes":350}],350:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":264,"../../../lib/extend":257,"../../domain":340,"./axis_attributes":346}],351:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":288}],352:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var h=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/h)}for(var d=n.calcTicks(u,{msUTC:!0}),p=0;p/g," "));l[c]=d,u.tickmode=f}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(p=0;p<2;++p)e.bounds[p][c]=t.glplot.bounds[p][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),u=null,h=e.glplot.selection,v=0;v")):"isosurface"===t.type||"volume"===t.type?(M.valueLabel=d.hoverLabelText(e._mockAxis,e._mockAxis.d2l(h.traceCoordinate[3]),t.valuehoverformat),L.push("value: "+M.valueLabel),h.textLabel&&L.push(h.textLabel),b=L.join("
")):b=h.textLabel;var S={x:h.traceCoordinate[0],y:h.traceCoordinate[1],z:h.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};p.appendArrayPointValue(S,_,w),t._module.eventData&&(S=_._module.eventData(S,h,_,{},w));var E={points:[S]};if(e.fullSceneLayout.hovermode){var C=[];p.loneHover({trace:_,x:(.5+.5*y[0]/y[3])*s,y:(.5-.5*y[1]/y[3])*l,xLabel:M.xLabel,yLabel:M.yLabel,zLabel:M.zLabel,text:b,name:u.name,color:p.castHoverOption(_,w,"bgcolor")||u.color,borderColor:p.castHoverOption(_,w,"bordercolor"),fontFamily:p.castHoverOption(_,w,"font.family"),fontSize:p.castHoverOption(_,w,"font.size"),fontColor:p.castHoverOption(_,w,"font.color"),nameLength:p.castHoverOption(_,w,"namelength"),textAlign:p.castHoverOption(_,w,"align"),hovertemplate:f.castOption(_,w,"hovertemplate"),hovertemplateLabels:f.extendFlat({},S,M),eventData:[S]},{container:n,gd:r,inOut_bbox:C}),S.bbox=C[0]}h.buttons&&h.distance<5?r.emit("plotly_click",E):r.emit("plotly_hover",E),this.oldEventData=E}else p.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var T=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=T[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,d=0;d<(u||l.length);d++)if(f.isArrayOrTypedArray(l[d]))for(var p=0;pg[1][a])g[0][a]=-1,g[1][a]=1;else{var E=g[1][a]-g[0][a];g[0][a]-=E/32,g[1][a]+=E/32}if("reversed"===s.autorange){var C=g[0][a];g[0][a]=g[1][a],g[1][a]=C}}else{var O=s.range;g[0][a]=s.r2l(O[0]),g[1][a]=s.r2l(O[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),m[a]=g[1][a]-g[0][a],this.glplot.setBounds(a,{min:g[0][a]*h[a],max:g[1][a]*h[a]})}var R=c.aspectmode;if("cube"===R)p=[1,1,1];else if("manual"===R){var D=c.aspectratio;p=[D.x,D.y,D.z]}else{if("auto"!==R&&"data"!==R)throw new Error("scene.js aspectRatio was not one of the enumerated types");var P=[1,1,1];for(a=0;a<3;++a){var I=y[l=(s=c[T[a]]).type];P[a]=Math.pow(I.acc,1/I.count)/h[a]}p="data"===R||Math.max.apply(null,P)/Math.min.apply(null,P)<=4?P:[1,1,1]}c.aspectratio.x=u.aspectratio.x=p[0],c.aspectratio.y=u.aspectratio.y=p[1],c.aspectratio.z=u.aspectratio.z=p[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var z=c.domain||null,N=e._size||null;if(z&&N){var F=this.container.style;F.position="absolute",F.left=N.l+z.x[0]*N.w+"px",F.top=N.t+(1-z.y[1])*N.h+"px",F.width=N.w*(z.x[1]-z.x[0])+"px",F.height=N.h*(z.y[1]-z.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),h=l||c;if(h){var d={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),d[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),d[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,d),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",h={x:0,y:0,z:1},d={};d[c]=h;var p=n.layout;u.call("_storeDirectGUIEdit",p,i._preGUI,d),a.up=h,f.nestedProperty(p,c).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d",{willReadFrequently:!0}),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[T[t]];d.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},d.setConvert(this._mockAxis,t)},e.exports=_},{"../../../stackgl_modules":444,"../../components/fx":160,"../../lib":264,"../../lib/show_no_webgl_msg":285,"../../lib/str2rgbarray":288,"../../plots/cartesian/axes":313,"../../registry":361,"./layout/convert":348,"./layout/spikes":351,"./layout/tick_marks":352,"./project":353,"has-passive-events":64,"webgl-context":85}],355:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;a=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.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"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var M=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],T=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&P.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&P.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,f,n),x.cleanPlot(h,l,f,n);var B=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||B,H=!(!l._has||!l._has("cartesian"))||j;U&&!H?n._bgLayer.remove():H&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&p({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=x.layoutAttributes.width.min,d=x.layoutAttributes.height.min;n1,v=!e.height&&Math.abs(r.height-i)>1;(v||p)&&(p&&(r.width=n),v&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a1&&(r.l/=m,r.r/=m)}if(d){var y=(r.t+r.b)/d;y>1&&(r.t/=y,r.b/=y)}var b=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,M=void 0!==r.yb?r.yb:r.y;p[e]={l:{val:b,size:r.l+g},r:{val:_,size:r.r+g},b:{val:M,size:r.b+g},t:{val:w,size:r.t+g}},v[e]=1}else delete p[e],delete v[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 i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,h=a.t,p=a.b,v=e._pushmargin,g=e._pushmarginIds,m=e.minreducedwidth,y=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var b in v)g[b]||delete v[b];for(var _ in v.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:p}},v){var w=v[_].l||{},M=v[_].b||{},T=w.val,A=w.size,k=M.val,L=M.size;for(var S in v){if(o(A)&&v[S].r){var E=v[S].r.val,O=v[S].r.size;if(E>T){var R=(A*E+(O-r)*T)/(E-T),D=(O*(1-T)+(A-r)*(1-E))/(E-T);R+D>c+f&&(c=R,f=D)}}if(o(L)&&v[S].t){var P=v[S].t.val,I=v[S].t.size;if(P>k){var z=(L*P+(I-n)*k)/(P-k),N=(I*(1-k)+(L-n)*(1-P))/(P-k);z+N>p+h&&(p=z,h=N)}}}}}var F=u.constrain(r-a.l-a.r,2,m),B=u.constrain(n-a.t-a.b,2,y),j=Math.max(0,r-F),U=Math.max(0,n-B);if(j){var H=(c+f)/j;H>1&&(c/=H,f/=H)}if(U){var Y=(p+h)/U;Y>1&&(p/=Y,h/=Y)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(h),i.b=Math.round(p),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&x.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var V=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,p[e]=o}}for(P(o,c,f),i=0;i0){for(var n=[],i=0;i-1&&(f[d[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":120,"../components/drawing":142,"../constants/xmlns_namespaces":244,"../lib":264,"@plotly/d3":16}],370:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":127,"../../lib/extend":257,"../../plots/attributes":309,"../../plots/cartesian/axis_format_attributes":316,"../../plots/template_attributes":360,"../mesh3d/attributes":382}],371:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;c=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||v)[2]+(f[[r+1,i]]||v)[2]+(f[[r,i-1]]||v)[2]+(f[[r,i+1]]||v)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":264}],376:[function(t,e,r){"use strict";var n=t("../../lib"),i=[[-1,0],[1,0],[0,-1],[0,1]];function a(t){return.5-.25*Math.min(1,.5*t)}function o(t,e,r){var n,a,o,s,l,c,u,f,h,d,p,v,g,m=0;for(s=0;sv&&(m=Math.max(m,Math.abs(t[a][o]-p)/(g-v))))}return m}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":264}],377:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":127,"../../lib/extend":257,"../../plot_api/edit_types":295,"../../plots/attributes":309,"../../plots/cartesian/axis_format_attributes":316,"../../plots/template_attributes":360,"../mesh3d/attributes":382}],378:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function z(t,e){return null===t?e:t}function N(e,r,n){C();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[d]:E(p,v,m);h[d]=b>-1?b:R(p,v,m,z(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function F(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function B(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(S-L);return t>=L-e&&t<=S+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function H(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(e[0][3],n,i),B(e[1][3],n,i),B(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(N(t,e,r),!0):a<3&&H(t,e,r,L,S,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],d=F(h,u,n,i),p=F(h,f,n,i);o=l(t,[p,d,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,f,p],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],d=F(f,u,n,i),p=F(h,u,n,i);o=l(t,[p,d,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function Y(t,e,r,n){var i=!1,a=U(e),o=[B(a[0][3],r,n),B(a[1][3],r,n),B(a[2][3],r,n),B(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return v&&(i=function(t,e,r){var n=function(n,i,a){N(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]];if(v)i=N(t,[c,u,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var d=F(h,c,r,n),p=F(h,u,r,n),g=F(h,f,r,n);i=N(null,[d,p,g],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],d=F(f,c,r,n),p=F(f,u,r,n),g=F(h,u,r,n),m=F(h,c,r,n);v?(i=N(t,[c,m,d],[e[l[0]],-1,-1])||i,i=N(t,[u,p,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){N(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[d,p,g,m],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],d=F(u,c,r,n),p=F(f,c,r,n),g=F(h,c,r,n);v?(i=N(t,[c,d,p],[e[l[0]],-1,-1])||i,i=N(t,[c,p,g],[e[l[0]],-1,-1])||i,i=N(t,[c,g,d],[e[l[0]],-1,-1])||i):i=N(null,[d,p,g],[-1,-1,-1])||i,s=!0}})),i)}function V(t,e,r,n,i,a,o,s,l,c,u){var f=!1;return p&&(I(t,"A")&&(f=Y(null,[e,r,n,a],c,u)||f),I(t,"B")&&(f=Y(null,[r,n,i,l],c,u)||f),I(t,"C")&&(f=Y(null,[r,a,o,l],c,u)||f),I(t,"D")&&(f=Y(null,[n,a,s,l],c,u)||f),I(t,"E")&&(f=Y(null,[r,n,a,l],c,u)||f)),v&&(f=Y(t,[r,n,a,l],c,u)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||H(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||H(t,U([n,i,e]),[n,i,e],a,o)]}function q(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,c,u,f=!1,h=function(){f=H(t,[s,l,c],[-1,-1,-1],i,a)||f,f=H(t,[c,u,s],[-1,-1,-1],i,a)||f},d=o[0],p=o[1],v=o[2];return d&&(s=D(U([T(e,r-0,n-0)])[0],U([T(e-1,r-0,n-0)])[0],d),l=D(U([T(e,r-0,n-1)])[0],U([T(e-1,r-0,n-1)])[0],d),c=D(U([T(e,r-1,n-1)])[0],U([T(e-1,r-1,n-1)])[0],d),u=D(U([T(e,r-1,n-0)])[0],U([T(e-1,r-1,n-0)])[0],d),h()),p&&(s=D(U([T(e-0,r,n-0)])[0],U([T(e-0,r-1,n-0)])[0],p),l=D(U([T(e-0,r,n-1)])[0],U([T(e-0,r-1,n-1)])[0],p),c=D(U([T(e-1,r,n-1)])[0],U([T(e-1,r-1,n-1)])[0],p),u=D(U([T(e-1,r,n-0)])[0],U([T(e-1,r-1,n-0)])[0],p),h()),v&&(s=D(U([T(e-0,r-0,n)])[0],U([T(e-0,r-0,n-1)])[0],v),l=D(U([T(e-0,r-1,n)])[0],U([T(e-0,r-1,n-1)])[0],v),c=D(U([T(e-1,r-1,n)])[0],U([T(e-1,r-1,n-1)])[0],v),u=D(U([T(e-1,r-0,n)])[0],U([T(e-1,r-0,n-1)])[0],v),h()),f}function X(t,e,r,n,i,a,o,s,l,c,u,f){var h=t;return f?(p&&"even"===t&&(h=null),V(h,e,r,n,i,a,o,s,l,c,u)):(p&&"odd"===t&&(h=null),V(h,l,s,o,a,i,n,r,e,c,u))}function Z(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(p-k)?[A,p]:[p,k];$(e,M[0],M[1])}}var E=[[Math.min(L,k),Math.max(L,k)],[Math.min(A,S),Math.max(A,S)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(d.id),"x"===e?f.push([d.distRatio,0,0]):"y"===e?f.push([0,d.distRatio,0]):f.push([0,0,d.distRatio]))}else c=nt(1,"x"===e?x-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),c.length>0&&(r[i]="x"===e?Z(null,c,a,o,r[i]):"y"===e?J(null,c,a,o,r[i]):K(null,c,a,o,r[i]),i++)}var p=t.caps[e];p.show&&p.fill&&(P(p.fill),r[i]="x"===e?Z(null,[0,x-1],a,o,r[i]):"y"===e?J(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===g&&O(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=m,t._Ys=y,t._Zs=b}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../../stackgl_modules":444,"../../components/colorscale":132,"../../lib/gl_format_color":261,"../../lib/str2rgbarray":288,"../../plots/gl3d/zip3":355}],380:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),f=a("z"),h=a("value");c&&c.length&&u&&u.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":130,"../../lib":264,"../../registry":361,"./attributes":377}],381:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":344,"./attributes":377,"./calc":378,"./convert":379,"./defaults":380}],382:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":127,"../../lib/extend":257,"../../plots/attributes":309,"../../plots/cartesian/axis_format_attributes":316,"../../plots/template_attributes":360,"../surface/attributes":429}],383:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":128}],384:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_mesh3d,i=t("../../../stackgl_modules").delaunay_triangulate,a=t("../../../stackgl_modules").alpha_shape,o=t("../../../stackgl_modules").convex_hull,s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function d(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=u(p(r.xaxis,t.x,e.dataScale[0],t.xcalendar),p(r.yaxis,t.y,e.dataScale[1],t.ycalendar),p(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=u(v(t.i),v(t.j),v(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;ol&&C[m].gap;)m--;for(b=C[m].s,v=C.length-1;v>m;v--)C[v].s=b;for(;lk[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],397:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),d=t("./line_shape_defaults"),p=t("./text_defaults"),v=t("./fillcolor_defaults"),g=t("../../lib").coercePattern;e.exports=function(t,e,r,m){function y(r,i){return n.coerce(t,e,a,r,i)}var b=l(t,e,m,y);if(b||(e.visible=!1),e.visible){c(t,e,m,y),y("xhoverformat"),y("yhoverformat");var x=u(t,e,m,y),_=!x&&b=Math.min(e,r)&&p<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-p);return a=Math.min(e,r)&&v<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(d.c2p(t.y)-v);return aW!=(B=P[R][1])>=W&&(z=P[R-1][0],N=P[R][0],B-F&&(I=z+(N-z)*(W-F)/(B-F),Y=Math.min(Y,I),V=Math.max(V,I)));Y=Math.max(Y,0),V=Math.min(V,h._length);var X=s.defaultLine;return s.opacity(f.fillcolor)?X=f.fillcolor:s.opacity((f.line||{}).color)&&(X=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:Y,x1:V,y0:W,y1:W,color:X,hovertemplate:!1}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":120,"../../components/fx":160,"../../lib":264,"../../registry":361,"./get_trace_color":400}],402:[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":325,"./arrays_to_calcdata":389,"./attributes":390,"./calc":391,"./cross_trace_calc":395,"./cross_trace_defaults":396,"./defaults":397,"./format_labels":399,"./hover":401,"./marker_colorbar":408,"./plot":411,"./select":412,"./style":414,"./subtypes":415}],403:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){l||(l={});var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":130,"../../components/colorscale/helpers":131,"../../lib":264}],404:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../../constants/numerical"),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,c=t("../../lib"),u=c.segmentsIntersect,f=c.constrain,h=t("./constants");e.exports=function(t,e){var r,i,o,d,p,v,g,m,y,b,x,_,w,M,T,A,k,L,S=e.trace||{},E=e.xaxis,C=e.yaxis,O="log"===E.type,R="log"===C.type,D=E._length,P=C._length,I=e.backoff,z=S.marker,N=e.connectGaps,F=e.baseTolerance,B=e.shape,j="linear"===B,U=S.fill&&"none"!==S.fill,H=[],Y=h.minTolerance,V=t.length,G=new Array(V),q=0;function W(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),o=e.linearized?C.l2p(n.y):C.c2p(n.y);if(i===a){if(O&&(i=E.c2p(n.x,!0)),i===a)return!1;R&&o===a&&(i*=Math.abs(E._m*P*(E._m>0?s:l)/(C._m*D*(C._m>0?s:l)))),i*=1e3}if(o===a){if(R&&(o=C.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function X(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function ht(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l);return s}}function dt(t){var e=t[0],r=t[1],n=e===G[q-1][0],i=r===G[q-1][1];if(!n||!i)if(q>1){var a=e===G[q-2][0],o=r===G[q-2][1];n&&(e===at||e===ot)&&a?o?q--:G[q-1]=t:i&&(r===st||r===lt)&&o?a?q--:G[q-1]=t:G[q++]=t}else G[q++]=t}function pt(t){G[q-1][0]!==t[0]&&G[q-1][1]!==t[1]&&dt([$,tt]),dt(t),et=null,$=tt=0}"linear"===B||"spline"===B?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(q)if(et){var n=nt(et,e);n.length>1&&(pt(n[0]),G[q++]=n[1])}else rt=nt(G[q-1],e)[0],G[q++]=rt;else G[q++]=[K||e[0],Q||e[1]];var i=G[q-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?dt($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&dt([$,tt])),dt([K,Q])):$-K&&tt-Q&&dt([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&pt(nt(et,e)[0]),G[q++]=e;var a,o,s,l}for(r=0;rZ(v,mt))break;o=v,(w=y[0]*m[0]+y[1]*m[1])>x?(x=w,d=v,g=!1):w<_&&(_=w,p=v,g=!0)}if(g?(gt(d),o!==p&>(p)):(p!==i&>(p),o!==d&>(d)),gt(o),r>=t.length||!v)break;gt(v),i=v}}else gt(d)}et&&dt([$||et[0],tt||et[1]]),H.push(G.slice(0,q))}var yt=B.slice(B.length-1);if(I&&"h"!==yt&&"v"!==yt){for(var bt=!1,xt=-1,_t=[],wt=0;wt=0?l=d:(l=d=h,h++),l0?Math.max(r,a):0}}},{"fast-isnumeric":31}],408:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],409:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":120,"../../components/colorscale/defaults":130,"../../components/colorscale/helpers":131,"./subtypes":415}],410:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":243,"../../lib":264}],411:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function d(t,e,r,f,d,p,v){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!c.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),v=Math.ceil(p.length/d),g=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return m?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,M=n.select(p),T=o(M,"g","errorbars"),A=o(M,"g","lines"),k=o(M,"g","points"),L=o(M,"g","text");if(i.getComponentMethod("errorbars","plot")(t,T,r,v),!0===_.visible){var S,E;y(M).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=M;var O,R,D="",P=[],I=_._prevtrace;I&&(D=I._prevRevpath||"",E=I._nextFill,P=I._polygons);var z,N,F,B,j,U,H,Y="",V="",G=[],q=a.noop;if(S=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(z=l.steps(w.shape),N=l.steps(w.shape.split("").reverse().join(""))):z=N="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},F=function(t){return N(t.reverse())},G=u(f,{xaxis:b,yaxis:x,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),H=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",O),l.singleLineStyle(f,i)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(q(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(q(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(S?(S.datum(f),B&&U&&(C?("y"===C?B[1]=U[1]=x.c2p(0,!0):"x"===C&&(B[0]=U[0]=b.c2p(0,!0)),y(S).attr("d","M"+U+"L"+B+"L"+Y.substr(1)).call(l.singleFillStyle,t)):y(S).attr("d",Y+"Z").call(l.singleFillStyle,t))):E&&("tonext"===_.fill.substr(0,6)&&Y&&D?("tonext"===_.fill?y(E).attr("d",Y+"Z"+D+"Z").call(l.singleFillStyle,t):y(E).attr("d",Y+"L"+D.substr(1)+"Z").call(l.singleFillStyle,t),_._polygons=_._polygons.concat(P)):(Z(E),_._polygons=null)),_._prevRevpath=V,_._prevPolygons=H):(S?Z(S):E&&Z(E),_._polygons=_._prevRevpath=_._prevPolygons=null),k.datum(f),L.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),h=c.hasText(u),d=tt(u),p=et,v=et;if(f||h){var g=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?K:J:_&&!w&&(g=Q),f&&(p=g),h&&(v=g)}var M,T=(o=e.selectAll("path.point").data(p,d)).enter().append("path").classed("point",!0);m&&T.call(l.pointStyle,u,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(M=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,u,M,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),m?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(v,d)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){y(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(k,L,f);var X=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(k,X,t),l.setClipUrl(L,X,t)}function Z(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,h,p=!a,v=!!a&&a.duration>0,g=f(t,e,r);((u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),v)?(c&&(h=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){d(t,n,e,r,g,this,a)}))}))):u.each((function(r,n){d(t,n,e,r,g,this,a)}));p&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":142,"../../lib":264,"../../lib/polygon":276,"../../registry":361,"./line_points":404,"./link_traces":406,"./subtypes":415,"@plotly/d3":16}],412:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return d[t]}function M(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var v=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||d);for(var p=["x","y","z"],v=0;v<3;++v){var g="projection."+p[v];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var m=n.getComponentMethod("errorbars","supplyDefaults");m(t,e,h||d||r,{axis:"z"}),m(t,e,h||d||r,{axis:"y",inherit:"z"}),m(t,e,h||d||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":264,"../../registry":361,"../scatter/line_defaults":403,"../scatter/marker_defaults":409,"../scatter/subtypes":415,"../scatter/text_defaults":416,"./attributes":418}],423:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":241,"../../plots/gl3d":344,"./attributes":418,"./calc":419,"./convert":421,"./defaults":422}],424:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":127,"../../lib/extend":257,"../../plots/attributes":309,"../../plots/cartesian/axis_format_attributes":316,"../../plots/template_attributes":360,"../mesh3d/attributes":382}],425:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/calc");function a(t){var e,r,i,a,s,l,c,u,f,h,d,p,v=t._x,g=t._y,m=t._z,y=t._len,b=-1/0,x=1/0,_=-1/0,w=1/0,M=-1/0,T=1/0,A="";for(y&&(c=v[0],f=g[0],d=m[0]),y>1&&(u=v[y-1],h=g[y-1],p=m[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(d>p?"-":"+")+"z");var E=function(){y=0,k=[],L=[],S=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function d(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function p(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,f={};function p(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(p(e._u,"xaxis"),p(e._v,"yaxis"),p(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var v=p(e._Xs,"xaxis"),g=p(e._Ys,"yaxis"),m=p(e._Zs,"zaxis");if(f.meshgrid=[v,g,m],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(p(e._startsX,"xaxis"),p(e._startsY,"yaxis"),p(e._startsZ,"zaxis"));else{for(var y=g[0],b=h(v),x=h(m),_=new Array(b.length*x.length),w=0,M=0;M0){r=p[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=m(r),++r1?n:1},d.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]i&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),b={},x={},_=0;p?(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},m=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},m=function(t,e){var r=b[t.astr][e];t.get().push(r)}),T(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)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 i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * diff --git a/dist/plotly-mapbox.js b/dist/plotly-mapbox.js index 18b2ac2b355..226c8e09125 100644 --- a/dist/plotly-mapbox.js +++ b/dist/plotly-mapbox.js @@ -1,5 +1,5 @@ /** -* plotly.js (mapbox) v2.16.4 +* plotly.js (mapbox) v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -89250,6 +89250,8 @@ function setActive(gd, sliderGroup, sliderOpts, index, doCallback, doTransition) } function attachGripEvents(item, gd, sliderGroup) { + if(gd._context.staticPlot) return; + var node = sliderGroup.node(); var $gd = d3.select(gd); @@ -132869,7 +132871,7 @@ function getSortFunc(opts, d2c) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.16.4'; +exports.version = '2.16.5'; },{}]},{},[9])(9) }); diff --git a/dist/plotly-mapbox.min.js b/dist/plotly-mapbox.min.js index 70f7535dc73..d3fdbe417d9 100644 --- a/dist/plotly-mapbox.min.js +++ b/dist/plotly-mapbox.min.js @@ -1,5 +1,5 @@ /** -* plotly.js (mapbox - minified) v2.16.4 +* plotly.js (mapbox - minified) v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -21,4 +21,4 @@ object-assign * @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"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),u=t("./lib/geojson"),c=!1,p=i();function h(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?c=a():!1===t&&(c=!1),!1!==c&&c.list},epsilon:function(t){return p.epsilon(t)},segments:function(t){var e=o(!0,p,c);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,p,c).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,c),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,c),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,c),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,c),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,c),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,p,c),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(n,t)},polygonToGeoJSON:function(t){return u.fromPolygon(n,p,t)},union:function(t,e){return h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":71,"./lib/epsilon":72,"./lib/geojson":73,"./lib/intersecter":74,"./lib/segment-chainer":76,"./lib/segment-selector":77}],71:[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")}}}},{}],72:[function(t,e,r){e.exports=function(t){"number"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return"number"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var a=r[0],i=r[1],o=n[0],s=n[1],l=e[0];return(o-a)*(e[1]-i)-(s-i)*(l-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],73:[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;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var p=e.linesIntersect(o,s,u,c);if(!1===p){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),f=e.pointsSame(s,c);if(h&&f)return n;var d=!h&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(h)return m?l(n,s):l(t,c),n;d&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,u):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,c)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=u(h),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function y(){if(d){var t=c(h,d);if(t)return t}return!!m&&c(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var g,v=y();if(v){var _;if(t)(_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(v.seg),h.other.remove(),h.remove()}if(i.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:a,h.seg.myFill.above=_?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)g=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:a,h.seg.otherFill={above:g,below:g};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=f.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}p.push(h.seg)}i.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l1)for(var r=1;r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":78,timers:79}],80:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,p=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(S[t])t=S[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:E(e[1]),g:E(e[2]),b:E(e[3]),a:R(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:E(e[1]),g:E(e[2]),b:E(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:E(e[1]+""+e[1]),g:E(e[2]+""+e[2]),b:E(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:E(e[1]+""+e[1]),g:E(e[2]+""+e[2]),b:E(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(f=e.r,d=e.g,m=e.b,a={r:255*I(f,255),g:255*I(d,255),b:255*I(m,255)},p=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),u=z(e.v),a=function(e,r,n){e=6*I(e,360),r=I(r,100),n=I(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),p=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),c=z(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=I(t,360),e=I(e,100),r=I(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),p=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var f,d,m;return i=L(i),{ok:p,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function A(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(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=[D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16)),D(O(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*I(this._r,255))+"%",g:i(100*I(this._g,255))+"%",b:i(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*I(this._r,255))+"%, "+i(100*I(this._g,255))+"%, "+i(100*I(this._b,255))+"%)":"rgba("+i(100*I(this._r,255))+"%, "+i(100*I(this._g,255))+"%, "+i(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(b,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)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;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},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function E(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return E(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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 U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],81:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var a=e[e.length-1];r="i"===a||"I"===a}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var p=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(p/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=p[t-p[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=p[o.year-p[0]],f=c>>13;u=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=h[a.year-h[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=h[i.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var f,d=p[i.year-p[0]];for(f=0;f<13;f++){var m=d&1<<12-f?30:29;if(l>13;!y||f=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":95,"object-assign":67}],84:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":95,"object-assign":67}],85:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":95,"object-assign":67}],86:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=i},{"../main":95,"object-assign":67}],87:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":95,"object-assign":67}],88:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=i},{"../main":95,"object-assign":67}],89:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=i},{"../main":95,"object-assign":67}],90:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+1}var l=a+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),p=t-this.toJD(l,c,1)+1;return this.newDate(l,c,p)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":95,"object-assign":67}],92:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":95,"object-assign":67}],93:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":95,"object-assign":67}],94:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":95,"object-assign":67}],95:[function(t,e,r){var n=t("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=a-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":67}],96:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,p=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,f=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var a=""+e;if(f(t,n))for(;a.length1},_=function(t,r){var n=v(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(M).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,b=function(){if("function"==typeof l){v("m");var t=l.call(x,e.substring(M));return M+=t.length,t}return _("m")},w=function(t,r,n,i){for(var o=v(t,i)?n:r,s=0;s-1){f=1,d=m;for(var C=this.daysInMonth(h,f);d>C;C=this.daysInMonth(h,f))f++,d-=C}return p>-1?this.fromJD(p):this.newDate(h,f,d)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":95,"object-assign":67}],97:[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}]},{}],98:[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":232,"../../plot_api/plot_template":294,"../../plots/cartesian/constants":312,"../../plots/font_attributes":333,"./arrow_paths":97}],99:[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&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],p=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],f=3*t.arrowsize*t.arrowwidth||0,d=f+h,m=f-h,y=3*t.startarrowsize*t.arrowwidth||0,g=y+h,v=y-h;if(u===l){var _=a.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,g),ppadminus:Math.max(p,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else g=s?g+s:g,v=s?v-s:v,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,g),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":258,"../../plots/cartesian/axes":305,"./draw":104}],100:[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,l,u,c=t._fullLayout.annotations,p=[],h=[],f=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),p={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,W=["x","y"],X=0;X1)&&(nt===rt?((ft=at.r2fraction(e["a"+et]))<0||ft>1)&&(Y=!0):Y=!0),J=at._offset+at.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],J=dt?at._offset+at._length*Q:J=T.l+T.w*Q):(Q=1-e[et],J=dt?at._offset+at._length*Q:J=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){pt.head=J;var mt=e["a"+et];if(tt=ot*Z(.5,e.xanchor)-st*Z(.5,e.yanchor),nt===rt){var yt=l.getRefType(nt);"domain"===yt?("y"===et&&(mt=1-mt),pt.tail=at._offset+at._length*mt):"paper"===yt?"y"===et?(mt=1-mt,pt.tail=T.t+T.h*mt):pt.tail=T.l+T.w*mt:pt.tail=at._offset+at.r2p(mt),K=tt}else pt.tail=J+mt,K=tt+mt;pt.text=pt.tail+tt;var gt=w["x"===et?"width":"height"];if("paper"===rt&&(pt.head=o.constrain(pt.head,1,gt-1)),"pixel"===nt){var vt=-Math.max(pt.tail-3,pt.text),_t=Math.min(pt.tail+3,pt.text)-gt;vt>0?(pt.tail+=vt,pt.text+=vt):_t>0&&(pt.tail-=_t,pt.text-=_t)}pt.tail+=ct,pt.head+=ct}else K=tt=lt*Z($,ut),pt.text=J+tt;pt.text+=ct,tt+=ct,K+=ct,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var xt=0,bt=0;if("left"!==e.align&&(xt=(M-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),p)n.select("svg").attr({x:N+xt-1,y:N+bt}).call(c.setClipUrl,U?L:null,t);else{var wt=N+bt-m.top,Tt=N+xt-m.left;H.call(h.positionText,Tt,wt).call(c.setClipUrl,U?L:null,t)}V.select("rect").call(c.setRect,N,N,M,O),j.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.setTranslate,Math.round(I.x.text-B/2),Math.round(I.y.text-q/2)),D.attr({transform:"rotate("+P+","+I.x.text+","+I.y.text+")"});var kt,Mt=function(r,n){E.selectAll(".annotation-arrow-g").remove();var l=I.x.head,p=I.y.head,h=I.x.tail+r,f=I.y.tail+n,m=I.x.text+r,x=I.y.text+n,b=o.rotationXYMatrix(P,m,x),w=o.apply2DTransform(b),M=o.apply2DTransform2(b),L=+j.attr("width"),z=+j.attr("height"),O=m-.5*L,F=O+L,B=x-.5*z,N=B+z,U=[[O,B,O,N],[O,N,F,N],[F,N,F,B],[F,B,O,B]].map(M);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,p,l+1e6,p+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,f,l,p,t[0],t[1],t[2],t[3]);e&&(h=e.x,f=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,Z=e.arrowside,H=E.append("g").style({opacity:u.opacity(q)}).classed("annotation-arrow-g",!0),G=H.append("path").attr("d","M"+h+","+f+"L"+l+","+p).style("stroke-width",V+"px").call(u.stroke,u.rgb(q));if(y(G,Z,e),k.annotationPosition&&G.node().parentNode&&!i){var Y=l,W=p;if(e.standoff){var X=Math.sqrt(Math.pow(l-h,2)+Math.pow(p-f,2));Y+=e.standoff*(h-l)/X,W+=e.standoff*(f-p)/X}var J,K,Q=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-Y)+","+(f-W),transform:s(Y,W)}).style("stroke-width",V+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);J=t.x,K=t.y,g&&g.autorange&&A(g._name+".autorange",!0),_&&_.autorange&&A(_._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),a=n[0]+t,i=n[1]+r;R.call(c.setTranslate,a,i),S("x",v(g,t,"x",T,e)),S("y",v(_,r,"y",T,e)),e.axref===e.xref&&S("ax",v(g,t,"ax",T,e)),e.ayref===e.yref&&S("ay",v(_,r,"ay",T,e)),H.attr("transform",s(t,r)),D.attr({transform:"rotate("+P+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",v(g,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",v(_,r,"ay",T.w,e)):S("ay",e.ay+r),Mt(t,r);else{if(i)return;var a,o;if(g)a=v(g,t,"x",T,e);else{var l=e._xsize/T.w,u=e.x+(e._xshift-e.xshift)/T.w-l/2;a=d.align(u+t/T.w,l,0,1,e.xanchor)}if(_)o=v(_,r,"y",T,e);else{var c=e._ysize/T.h,p=e.y-(e._yshift+e.yshift)/T.h-c/2;o=d.align(p-r/T.h,c,0,1,e.yanchor)}S("x",a),S("y",o),g&&_||(n=d.getCursor(g?.5:a,_?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+kt}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",G(n))},doneFn:function(){f(R),a.call("_guiRelayout",t,C());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=0,_=e.indexOf("end")>=0,x=d.backoff*y+r.standoff,b=m.backoff*g+r.startstandoff;if("line"===f.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,T=o.y-c.y;if(h=(p=Math.atan2(T,w))+Math.PI,x&&b&&x+b>Math.sqrt(w*w+T*T))return void z();if(x){if(x*x>w*w+T*T)return void z();var k=x*Math.cos(p),M=x*Math.sin(p);c.x+=k,c.y+=M,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>w*w+T*T)return void z();var A=b*Math.cos(p),S=b*Math.sin(p);o.x-=A,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===f.nodeName){var C=f.getTotalLength(),L="";if(C1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":336,"../annotations/draw":104}],111:[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),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||u).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()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,u))),(a.isDark()?e?a.lighten(e):u:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var ut=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ut*u.roundUp(lt/ut,[2,5,10]),(Math.abs(Z.start)/Z.size+1e-6)%1<2e-6&&(at.tick0=0)}at.dtick=ot}at.domain=o?[rt+E/R.h,rt+K-E/R.h]:[rt+P/R.w,rt+K-P/R.w],at.setScale(),t.attr("transform",c(Math.round(R.l),Math.round(R.t)));var ct,pt=t.select("."+M.cbtitleunshift).attr("transform",c(-Math.round(R.l),-Math.round(R.t))),ht=at.ticklabelposition,ft=at.title.font.size,dt=t.select("."+M.cbaxis),mt=0,yt=0;function gt(n,a){var i={propContainer:at,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:O._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,p(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){var t,e;(o&&it||!o&&!it)&&("top"===j&&(t=P+R.l+R.w*D,e=E+R.t+R.h*(1-rt-K)+3+.75*ft),"bottom"===j&&(t=P+R.l+R.w*D,e=E+R.t+R.h*(1-rt)-3-.25*ft),"right"===j&&(e=E+R.t+R.h*z+3+.75*ft,t=P+R.l+R.w*rt),gt(at._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!it||o&&it){var i,l=t.select("."+M.cbtitle),p=l.select("text"),h=[-A/2,A/2],d=l.select(".h"+at._id+"title-math-group").node(),m=15.6;if(p.node()&&(m=parseInt(p.node().style.fontSize,10)*w),d?(i=f.bBox(d),yt=i.width,(mt=i.height)>m&&(h[1]-=(mt-m)/2)):p.node()&&!p.classed(M.jsPlaceholder)&&(i=f.bBox(p.node()),yt=i.width,mt=i.height),o){if(mt){if(mt+=5,"top"===j)at.domain[1]-=mt/R.h,h[1]*=-1;else{at.domain[0]+=mt/R.h;var g=y.lineCount(p);h[1]+=(1-g)*m}l.attr("transform",c(h[0],h[1])),at.setScale()}}else yt&&("right"===j&&(at.domain[0]+=(yt+ft/2)/R.w),l.attr("transform",c(h[0],h[1])),at.setScale())}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",o?c(0,Math.round(R.h*(1-at.domain[1]))):c(Math.round(R.w*at.domain[0]),0)),dt.attr("transform",o?c(0,Math.round(-R.t)):c(Math.round(-R.l),0));var v=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(G);v.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),v.exit().remove();var _=U.map(at.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var s=[0===i?U[0]:(G[i]+G[i-1])/2,i===G.length-1?U[1]:(G[i]+G[i+1])/2].map(at.c2p).map(Math.round);o&&(s[1]=u.constrain(s[1]+(s[1]>s[0])?1:-1,_[0],_[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)f.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var c=q(t).replace("e-","");l.attr("fill",a(c).toHexString())}}));var x=t.select("."+M.cblines).selectAll("path."+M.cbline).data(B.color&&B.width?Y:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each((function(t){var e=Q,r=Math.round(at.c2p(t))+B.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+W).call(f.lineGroupStyle,B.width,V(t),B.dash)})),dt.selectAll("g."+at._id+"tick,path").remove();var b=Q+W+(A||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(at),k=s.getTickSigns(at)[2];return s.drawTicks(r,at,{vals:"inside"===at.ticks?s.clipEnds(at,T):T,layer:dt,path:s.makeTickPath(at,b,k),transFn:s.makeTransTickFn(at)}),s.drawLabels(r,at,{vals:T,layer:dt,transFn:s.makeTransTickLabelFn(at),labelFns:s.makeLabelFns(at,b)})},function(){if(o&&!it||!o&&it){var t,a,i=at.position||0,s=at._offset+at._length/2;if("right"===j)a=s,t=R.l+R.w*i+10+ft*(at.showticklabels?1:.5);else if(t=s,"bottom"===j&&(a=R.t+R.h*i+10+(-1===ht.indexOf("inside")?at.tickfont.size:0)+("intside"!==at.ticks&&e.ticklen||0)),"top"===j){var l=N.text.split("
").length;a=R.t+R.h*i+10-W-w*ft*l}gt((o?"h":"v")+at._id+"title",{avoid:{selection:n.select(r).selectAll("g."+at._id+"tick"),side:j,offsetTop:o?0:R.t,offsetLeft:o?R.l:0,maxShift:o?O.width:O.height},attributes:{x:t,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,s=W+A/2;-1===ht.indexOf("inside")&&(n=f.bBox(dt.node()),s+=o?n.width:n.height),ct=pt.select("text");var u=0,p=o&&"top"===j,m=!o&&"right"===j,y=0;if(ct.node()&&!ct.classed(M.jsPlaceholder)){var v,_=pt.select(".h"+at._id+"title-math-group").node();_&&(o&&it||!o&&!it)?(u=(n=f.bBox(_)).width,v=n.height):(u=(n=f.bBox(pt.node())).right-R.l-(o?Q:nt),v=n.bottom-R.t-(o?nt:Q),o||"top"!==j||(s+=n.height,y=n.height)),m&&(ct.attr("transform",c(u/2+ft/2,0)),u*=2),s=Math.max(s,o?u:v)}var x=2*(o?P:E)+s+S+A/2,w=0;!o&&N.text&&"bottom"===I&&z<=0&&(x+=w=x/2,y+=w),O._hColorbarMoveTitle=w,O._hColorbarMoveCBTitle=y;var F=S+A;t.select("."+M.cbbg).attr("x",(o?Q:nt)-F/2-(o?P:0)).attr("y",(o?nt:Q)-(o?J:E+y-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(J+F,2)).call(d.fill,C).call(d.stroke,e.bordercolor).style("stroke-width",S);var B=m?Math.max(u-10,0):0;if(t.selectAll("."+M.cboutline).attr("x",(o?Q:nt+P)+B).attr("y",(o?nt+E-J:Q)+(p?mt:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(J-(o?2*E+mt:2*P+B),2)).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":A}),t.attr("transform",c(R.l-(o?$*x:0),R.t-(o?0:(1-tt)*x-y))),!o&&(S||a(C).getAlpha()&&!a.equals(O.paper_bgcolor,C))){var U=dt.selectAll("text"),V=U[0].length,q=t.select("."+M.cbbg).node(),Z=f.bBox(q),H=f.getTranslate(t);U.each((function(t,e){var r=V-1;if(0===e||e===r){var n,a=f.bBox(this),i=f.getTranslate(this);if(e===r){var o=a.right+i.x;(n=Z.right+H.x+nt-S-2+D-o)>0&&(n=0)}else if(0===e){var s=a.left+i.x;(n=Z.left+H.x+nt+S+2-s)<0&&(n=0)}n&&(V<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var G={},Y=T[L],X=k[L],K=T[I],et=k[I],rt=x-W;o?("pixels"===h?(G.y=z,G.t=J*K,G.b=J*et):(G.t=G.b=0,G.yt=z+l*K,G.yb=z-l*et),"pixels"===b?(G.x=D,G.l=x*Y,G.r=x*X):(G.l=rt*Y,G.r=rt*X,G.xl=D-g*Y,G.xr=D+g*X)):("pixels"===h?(G.x=D,G.l=J*Y,G.r=J*X):(G.l=G.r=0,G.xl=D+l*Y,G.xr=D-l*X),"pixels"===b?(G.y=1-z,G.t=x*K,G.b=x*et):(G.t=rt*K,G.b=rt*et,G.yt=z-g*K,G.yb=z+g*et)),i.autoMargin(r,e._id,G)}],r)}(r,e,t);g&&g.then&&(t._promises||[]).push(g),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s="v"===e.orientation,u=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align((s?e._uFrac:e._vFrac)+r/u.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),i=l.align((s?e._vFrac:1-e._uFrac)-o/u.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var p=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,p)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":231,"../../lib":258,"../../lib/extend":250,"../../lib/setcursor":278,"../../lib/svg_text_utils":281,"../../plots/cartesian/axes":305,"../../plots/cartesian/axis_defaults":307,"../../plots/cartesian/layout_attributes":318,"../../plots/cartesian/position_defaults":321,"../../plots/plots":346,"../../registry":349,"../color":115,"../colorscale/helpers":126,"../dragelement":134,"../drawing":137,"../titles":224,"./constants":117,"@plotly/d3":12,tinycolor2:80}],120:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":258}],121:[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":116,"./defaults":118,"./draw":119,"./has_colorbar":120}],122:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===i,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,p=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[i]));var f=i+"auto",d=i+"min",m=i+"max",y=i+"mid",g=(s(h+f),s(h+d),s(h+m),{});g[d]=g[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},_[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":274,"../../lib/sort_object_keys":279,"../colorbar/attributes":116,"./scales.js":130}],123:[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,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,p=i(c),h=!1!==p.auto,f=p.min,d=p.max,m=p.mid,y=function(){return a.aggNums(Math.min,null,l)},g=function(){return a.aggNums(Math.max,null,l)};(void 0===f?f=y():h&&(f=c._colorAx&&n(f)?Math.min(f,y()):y()),void 0===d?d=g():h&&(d=c._colorAx&&n(d)?Math.max(d,g()):g()),h&&void 0!==m&&(d-m>m-f?f=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":258,"./helpers":126,"fast-isnumeric":28}],124:[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 s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],132:[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":258}],133:[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)}},{}],134:[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,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,f,d,m,y=t.gd,g=1,v=y._context.doubleClickDelay,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,i?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)v&&(g=Math.max(g-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(g,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(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)}d.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},l.coverSlip=c},{"../../lib":258,"../../plots/cartesian/constants":312,"./align":131,"./cursor":132,"./unhover":135,"has-hover":59,"has-passive-events":60,"mouse-event-offset":65}],135:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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":248,"../../lib/events":249,"../../lib/throttle":282,"../fx/constants":149}],136:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],137:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),p=a.strTranslate,h=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,y=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,_=e.exports={};function x(t,e,r){var n=e.fillpattern,a=n&&_.getPatternAttr(n.shape,0,"");if(a){var i=_.getPatternAttr(n.bgcolor,0,null),o=_.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=_.getPatternAttr(n.size,0,8),c=_.getPatternAttr(n.solidity,0,.3),p=e.uid;_.pattern(t,"point",r,p,a,l,c,void 0,n.fillmode,i,o,s)}else e.fillcolor&&t.call(u.fill,e.fillcolor)}_.font=function(t,e,r,n){a.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(u.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,a){t.call(_.setPosition,e,r).call(_.setSize,n,a)},_.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",p(a,i)),!0)},_.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);_.translatePoint(t,a,e,r)}))},_.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,u=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){_.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},_.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.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||"";u.stroke(e,n||i.color),_.dashLine(e,s,o)},_.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(u.stroke,r||i.color).call(_.dashLine,s,o)}))},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.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},_.singleFillStyle=function(t,e){var r=n.select(t.node());x(t,((r.data()[0]||[])[0]||{}).trace||{},e)},_.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&x(r,t[0].trace,e)}))};var b=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolBackOffs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(b).forEach((function(t){var e=b[t],r=e.n;_.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),_.symbolNames[r]=t,_.symbolFuncs[r]=e.f,_.symbolBackOffs[r]=e.backoff||0,e.needLine&&(_.symbolNeedLines[r]=!0),e.noDot?_.symbolNoDot[r]=!0:_.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(_.symbolNoFill[r]=!0)}));var w=_.symbolNames.length;function T(t,e,r,n){var a=t%100;return _.symbolFuncs[a](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}_.symbolNumber=function(t){if(o(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=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var k={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},A=i("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};_.gradient=function(t,e,r,i,o,l){for(var c=o.length,p=S[i],h=new Array(c),f=0;f=100;var p=rt(t,r),h=H(t,r);e.attr("d",T(c,l,p,h))}var f,d,m,y=!1;if(t.so)m=s.outlierwidth,d=s.outliercolor,f=o.outliercolor;else{var g=(s||{}).width;m=(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):a.isArrayOrTypedArray(s.color)?u.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(f=u.defaultLine,y=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,f).style({"stroke-width":(m||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:m)+"px");var v=o.gradient,x=t.mgt;x?y=!0:x=v&&v.type,a.isArrayOrTypedArray(x)&&(x=x[0],S[x]||(x=0));var b=o.pattern,w=b&&_.getPatternAttr(b.shape,t.i,"");if(x&&"none"!==x){var k=t.mgc;k?y=!0:k=v.color;var M=r.uid;y&&(M+="-"+t.i),_.gradient(e,i,M,x,[[0,k],[1,f]],"fill")}else if(w){var A=_.getPatternAttr(b.bgcolor,t.i,null),C=_.getPatternAttr(b.fgcolor,t.i,null),L=b.fgopacity,I=_.getPatternAttr(b.size,t.i,8),P=_.getPatternAttr(b.solidity,t.i,.3),E=t.mcc||a.isArrayOrTypedArray(b.shape)||a.isArrayOrTypedArray(b.bgcolor)||a.isArrayOrTypedArray(b.size)||a.isArrayOrTypedArray(b.solidity),D=r.uid;E&&(D+="-"+t.i),_.pattern(e,"point",i,D,w,I,P,t.mcc,b.fillmode,A,C,L)}else u.fill(e,f);m&&u.stroke(e,d)}},_.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=_.tryColorscale(r,""),e.lineScale=_.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=y.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,_.makeSelectedPointStyleFns(t)),e},_.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},u=i.opacity,c=o.opacity,p=s.opacity,h=void 0!==c,f=void 0!==p;(a.isArrayOrTypedArray(u)||h||f)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:f?p:m*e});var d=i.color,y=o.color,g=s.color;(y||g)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?y||e:g||e});var v=i.size,_=o.size,x=s.size,b=void 0!==_,w=void 0!==x;return l.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},_.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,m))},e},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=_.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){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);t.attr("d",T(_.symbolNumber(i),o,rt(n,e),H(n,e))),n.mrc2=o})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}_.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=_.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,p=c?c(t,e,l):{},f={};v(f,e,t.i);var d=e._meta||{};u=a.texttemplateString(u,p,l._d3locale,f,t,d)}var m=t.tp||e.textposition,y=I(t,e),g=i?i(t):t.tc||e.textfont.color;o.call(_.font,t.tf||e.textfont.family,y,g).text(u).call(h.convertToTspans,r).call(L,m,y,t.mrc)}else o.remove()}))}},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=_.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=I(t,e);u.fill(a,i);var c=l.traceIs(e,"bar-like");L(a,o,s,t.mrc2||t.mrc,c)}))}};var P,E;function D(t,e,r){return r&&(t=N(t)),e?O(t[1]):z(t[0])}function z(t){var e=n.round(t,2);return P=e,e}function O(t){var e=n.round(t,2);return E=e,e}function R(t,e,r,n){var a=t[0]-e[0],i=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(a*a+i*i,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*a-l*l*o)*n,p=(u*u*i-l*l*s)*n,h=3*u*(l+u),f=3*l*(l+u);return[[z(e[0]+(h&&c/h)),O(e[1]+(h&&p/h))],[z(e[0]-(f&&c/f)),O(e[1]-(f&&p/f))]]}_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=u||x>=p&&x<=u)&&(b<=h&&b>=c||b>=h&&b<=c)&&(t=[x,b])}return t}_.steps=function(t){var e=F[t]||B;return function(t){for(var r="M"+z(t[0][0])+","+O(t[0][1]),n=t.length,a=1;a=1e4&&(_.savedBBoxes={},j=0),r&&(_.savedBBoxes[r]=y),j++,a.extendFlat({},y)},_.setClipUrl=function(t,e,r){t.attr("clip-path",V(e,r))},_.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}},_.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+=p(e,r)).trim(),t[a]("transform",i),i},_.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}},_.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 q=/\s*sc.*/;_.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(q,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var Z=/translate\([^)]*\)\s*$/;function H(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}_.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(Z);t=1===e&&1===r?[]:[p(o,s),"scale("+e+","+r+")",p(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))},_.getMarkerStandoff=H;var G,Y,W,X,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,a=t.ma;void 0===a&&(a=e.marker.angle||0);var i=e.marker.angleref;if("previous"===i||"north"===i){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,u=e._yA;if(!l||!u)return 90;r=l.c2p(t.x),n=u.c2p(t.y)}if(e._geo){var c,p=t.lonlat[0],h=t.lonlat[1],f=e._geo.project([p,h+1e-5]),d=e._geo.project([p+1e-5,h]),m=Q(d[1]-n,d[0]-r),y=Q(f[1]-n,f[0]-r);if("north"===i)c=a/180*Math.PI;else if("previous"===i){var g=p/180*Math.PI,v=h/180*Math.PI,_=G/180*Math.PI,x=Y/180*Math.PI,b=_-g,w=$(x)*tt(b),T=tt(x)*$(v)-$(x)*tt(v)*$(b);c=-Q(w,T)-Math.PI,G=p,Y=h}var k=et(m,[$(c),0]),M=et(y,[tt(c),0]);a=Q(k[1]+M[1],k[0]+M[0])/Math.PI*180,"previous"!==i||K===e.uid&&t.i===J+1||(a=null)}if("previous"===i&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var A=r-W,S=n-X,C=e.line&&e.line.shape||"",L=C.slice(C.length-1);"h"===L&&(S=0),"v"===L&&(A=0),a+=Q(S,A)/Math.PI*180+90}else a=null}return W=r,X=n,J=t.i,K=e.uid,a}_.getMarkerAngle=rt},{"../../components/fx/helpers":151,"../../constants/alignment":231,"../../constants/interactions":235,"../../constants/xmlns_namespaces":237,"../../lib":258,"../../lib/svg_text_utils":281,"../../registry":349,"../../traces/scatter/make_bubble_size_func":397,"../../traces/scatter/subtypes":405,"../color":115,"../colorscale":127,"./symbol_defs":138,"@plotly/d3":12,"fast-isnumeric":28,tinycolor2:80}],138:[function(t,e,r){"use strict";var n,a,i,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,u=Math.sqrt(2),c=Math.sqrt(3),p=Math.PI,h=Math.cos,f=Math.sin;function d(t){return null===t}function m(t,e,r){if(!(t&&t%360!=0||e))return r;if(i===t&&o===e&&n===r)return a;function l(t,r){var n=h(t),a=f(t),i=r[0],o=r[1]+(e||0);return[i*n-o*a,i*a+o*n]}i=t,o=e,n=r;for(var u=t/180*p,c=0,d=0,m=s(r),y="",g=0;g0;e.each((function(e){var p,h=e[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(p=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){f.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,t),y.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,l,u);if(!m||t.vis){var i,o=e.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var p=d.width;i="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(i+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(f.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(f.copy_ystyle?d:f).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":405,"../drawing":137,"@plotly/d3":12,"fast-isnumeric":28}],145:[function(t,e,r){"use strict";var n=t("@plotly/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":115,"@plotly/d3":12}],146:[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":250,"../../plots/font_attributes":333,"./layout_attributes":156}],147:[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 s=0;s=0&&r.indexb[0]._length||ot<0||ot>w[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=it+b[0]._offset,e.pointerY=ot+w[0]._offset,V="xval"in e?g.flat(l,e.xval):g.p2c(b,it),q="yval"in e?g.flat(l,e.yval):g.p2c(w,ot),!a(V[0])||!a(q[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ut=1/0;function ct(t,r){for(H=0;Htt&&(et.splice(0,tt),ut=et[0].distance),v&&0!==B&&0===et.length){$.distance=B,$.index=!1;var p=Y._module.hoverPoints($,K,Q,"closest",{hoverLayer:c._hoverlayer});if(p&&(p=p.filter((function(t){return t.spikeDistance<=B}))),p&&p.length){var h,d=p.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];a(m.x0)&&a(m.y0)&&(h=ht(m),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>h.spikeDistance)&&(nt.vLinePoint=h))}var y=p.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var _=y[0];a(_.x0)&&a(_.y0)&&(h=ht(_),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>h.spikeDistance)&&(nt.hLinePoint=h))}}}}}function pt(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;At--)It(et[At]);et=St,yt()}var Pt=t._hoverdata,Et=[],Dt=j(t),zt=U(t);for(Z=0;Z1||et.length>1)||"closest"===P&&at&&et.length>1,Yt=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),Wt=E(et,{gd:t,hovermode:P,rotateLabels:Gt,bgColor:Yt,container:c._hoverlayer,outerContainer:c._paper.node(),commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance});g.isUnifiedHover(P)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,p=1,h=t.size(),f=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===d&&i&&i[0]>i[1]!==a&&(p=-1),f[d++]=[{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}]})),f.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&v.pmin===_.pmin&&v.pmax===_.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=a;for(y.push.apply(y,g),f.splice(o+1,1),u=0,s=y.length-1;s>=0;s--)u+=y[s].dp;for(i=u/y.length,s=y.length-1;s>=0;s--)y[s].dp-=i;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var x=f[o];for(s=x.length-1;s>=0;s--){var b=x[s],w=b.datum;w.offset=b.dp,w.del=b.del}}}(Wt,Gt?"xa":"ya",c),z(Wt,Gt,c._invScaleX,c._invScaleY));if(s&&s.tagName){var Xt=y.getComponentMethod("annotations","hasClickToShow")(t,Et);p(n.select(s),Xt?"pointer":"")}if(!s||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,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:w,xvals:V,yvals:q})}(t,e,r,i,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=j(a),o=U(a),s=E(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),p=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,_=g.offsetTop;c+=v,p+=v,h+=_,d+=_}u.bbox={x0:c+o,x1:p+o,y0:h+i,y1:d+i},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function E(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,p=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var T=e.fontFamily||v.HOVERFONT,k=e.fontSize||v.HOVERFONTSIZE,M=t[0],C=M.xa,L=M.ya,P=i.charAt(0),E=P+"Label",z=M[E];if(void 0===z&&"multicategory"===C.type)for(var O=0;Oa.width-x?(y=a.width-x,e.attr("d","M"+(x-A)+",0L"+x+","+_+A+"v"+_+(2*S+v.height)+"H-"+x+"V"+_+A+"H"+(x-2*A)+"Z")):e.attr("d","M0,0L"+A+","+_+A+"H"+(S+v.width/2)+"v"+_+(2*S+v.height)+"H-"+(S+v.width/2)+"V"+_+A+"H-"+A+"Z")}else{var b,I,P;"right"===L.side?(b="start",I=1,P="",y=C._offset+C._length):(b="end",I=-1,P="-",y=C._offset),g=L._offset+(M.y0+M.y1)/2,l.attr("text-anchor",b),e.attr("d","M0,0L"+P+A+","+A+"V"+(S+v.height/2)+"h"+P+(2*S+v.width)+"V-"+(S+v.height/2)+"H"+P+A+"V-"+A+"Z");var E,D=v.height/2,O=F-v.top-D,R="clip"+a._uid+"commonlabel"+L._id;if(y=0?st:lt+pt=0?lt:_t+pt=0?it:ot+ht=0?ot:xt+ht=0,"top"!==t.idealAlign&&H||!G?H?(E+=R/2,t.anchor="start"):t.anchor="middle":(E-=R/2,t.anchor="end");else if(t.pos=E,H=P+O/2+Y<=B,G=P-O/2-Y>=0,"left"!==t.idealAlign&&H||!G)if(H)P+=O/2,t.anchor="start";else{t.anchor="middle";var W=Y/2,X=P+W-B,J=P-W;X>0&&(P-=X),J<0&&(P+=-J)}else P-=O/2,t.anchor="end";w.attr("text-anchor",t.anchor),C&&M.attr("text-anchor",t.anchor),e.attr("transform",s(P,E)+(u?l(b):""))})),bt}function D(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var p=t.hovertemplate||!1;if(p){var h=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(p,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}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"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],p=u*(A+S),f=p+u*(t.txwidth+S),d=0,m=t.offset,y="middle"===s;y&&(p-=t.tx2width/2,f+=t.txwidth/2+S),e&&(m*=-M,d=t.offset*k),r.select("path").attr("d",y?"M-"+i(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*A+d)+","+o(A+m)+"v"+o(t.by/2-A)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*A+d)+"V"+o(m-A)+"Z");var g=d+p,v=m+t.ty0-t.by/2+S,_=t.textAlign||"auto";"auto"!==_&&("left"===_&&"start"!==s?(a.attr("text-anchor","start"),g=y?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===_&&"end"!==s&&(a.attr("text-anchor","end"),g=y?t.bx/2-t.tx2width/2-S:t.bx+S)),a.call(c.positionText,i(g),o(v)),t.tx2width&&(r.select("text.name").call(c.positionText,i(f+u*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,i(f+(u-1)*t.tx2width/2+d),o(m-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function O(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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 p=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+m.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||c){var d=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var y,g,v=e.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=u.pointerX,g=u.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var _,x,b=i.readability(v.color,d)<1.5?f.contrast(d):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,M=m.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(_=M,x=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),_=l.l+A*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:g,r:T,fill:k}).classed("spikeline",!0)}if(p){var C,L,I=e.vLinePoint;n=I&&I.xa,a=I&&I.ya,"cursor"===n.spikesnap?(C=u.pointerX,L=u.pointerY):(C=n._offset+I.x,L=a._offset+I.y);var P,E,D=i.readability(I.color,d)<1.5?f.contrast(d):I.color,z=n.spikemode,O=n.spikethickness,R=n.spikecolor||D,F=m.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(P=F,E=L),-1!==z.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,E=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:E,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:E,"stroke-width":O+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?a+=c:"middle"===o&&(a+=c/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function V(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.x,i=n.y,s=a+n.width,l=i+n.height,u=o.apply3DTransform(r._invTransform)(a,i),c=o.apply3DTransform(r._invTransform)(s,l),p=u[0],h=u[1],f=c[0],d=c[1];return{x:p,y:h,width:f-p,height:d-h,top:Math.min(h,d),left:Math.min(p,f),right:Math.max(p,f),bottom:Math.max(h,d)}}},{"../../lib":258,"../../lib/events":249,"../../lib/override_cursor":269,"../../lib/svg_text_utils":281,"../../plots/cartesian/axes":305,"../../registry":349,"../color":115,"../dragelement":134,"../drawing":137,"../legend/defaults":167,"../legend/draw":168,"./constants":149,"./helpers":151,"@plotly/d3":12,"fast-isnumeric":28,tinycolor2:80}],153:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&i(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(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":258,"../color":115,"./helpers":151}],154:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":258,"./layout_attributes":156}],155:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":258,"../dragelement":134,"./attributes":146,"./calc":147,"./click":148,"./constants":149,"./defaults":150,"./helpers":151,"./hover":152,"./layout_attributes":156,"./layout_defaults":157,"./layout_global_defaults":158,"@plotly/d3":12}],156:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":333,"./constants":149}],157:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":258,"./hoverlabel_defaults":153,"./hovermode_defaults":154,"./layout_attributes":156}],158:[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":258,"./hoverlabel_defaults":153,"./layout_attributes":156}],159:[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,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),p=c*(1-o),h=0;h1){if(!h&&!f&&!d)"independent"===k("pattern")&&(h=!0);y._hasSubplotGrid=h;var _,x,b="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),y._domains={x:c("x",k,w,_,v),y:c("y",k,T,x,g,b)}}else delete e.grid}function k(t,e){return n.coerce(r,y,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(d){var _=h.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n1);if(!1===b&&(e.legend=void 0),(!1!==b||p.uirevision)&&(f("uirevision",e.uirevision),!1!==b)){f("bgcolor",e.paper_bgcolor),f("bordercolor"),f("borderwidth");var w,T,k,M=a.coerceFont(f,"font",e.font),A="h"===f("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(T=1.1,k="bottom"):(T=-.1,k="top")):(w=1.02,T=1,k="auto"),f("traceorder",_),u.isGrouped(e.legend)&&f("tracegroupgap"),f("entrywidth"),f("entrywidthmode"),f("itemsizing"),f("itemwidth"),f("itemclick"),f("itemdoubleclick"),f("groupclick"),f("x",w),f("xanchor"),f("y",T),f("yanchor",k),f("valign"),a.noneOrAll(p,h,["x","y"]),f("title.text")){f("title.side",A?"left":"top");var S=a.extendFlat({},M,{size:a.bigFont(M.size)});a.coerceFont(f,"title.font",S)}}}},{"../../lib":258,"../../plot_api/plot_template":294,"../../plots/attributes":301,"../../plots/layout_attributes":337,"../../registry":349,"./attributes":165,"./helpers":171}],168:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("./handle_click"),f=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,y=d.FROM_TL,g=d.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r){var n=t[0],a=n.width,i=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===i?e._maxWidth*o:r+(o||a)}function w(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function T(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,c=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!c,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=c?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var m=a.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(u.font,i).text(h?k(n,d):n);var y=r.itemwidth+2*f.itemGap;p.positionText(m,y,0),h?m.call(p.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(k(n,d)).call(A,t,e,r);var i=s.trace._fullInput||{},u={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),p=c[c.length-1],h=a.keyedContainer(i,"transforms["+p+"].styles","target","value.name");h.set(s.trace._group,n),u=h.constructUpdate()}else u.name=n;return o.call("_guiRestyle",e,u,l.index)})):A(m,t,e,r)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function M(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function A(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),p.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var c,h,d=s.size*m;if(o){var y=u.bBox(o);c=y.height,h=y.width,1===n?u.setTranslate(i,l,l+.75*c):u.setTranslate(i,0,.25*c)}else{var g=t.select(1===n?".legendtitletext":".legendtext"),v=p.lineCount(g),_=g.node();if(c=d*v,h=_?u.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*f.itemGap),p.positionText(g,l+f.titlePad,l+d);else{var x=2*f.itemGap+r.itemwidth;a.groupTitle&&(x=f.itemGap,h-=r.itemwidth),p.positionText(g,x,-d*((v-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(a.lineHeight=d,a.height=Math.max(c,16)+3,a.width=h)}(e,r,n,a)}))}function S(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function C(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,p=t._fullLayout,h="legend"+p._uid,d=e._inHover;d?(r=e.layer,h+="-hover"):r=p._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=v(e.entries,e)}else{if(!t.calcdata)return;s=p.showlegend&&v(t.calcdata,e)}var m=p.hiddenlabels||[];if(!(d||p.showlegend&&s.length))return r.selectAll(".legend").remove(),p._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var k=a.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),L=a.ensureSingleById(p._topdefs,"clipPath",h,(function(t){t.append("rect")})),I=a.ensureSingle(k,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));I.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var P=a.ensureSingle(k,"g","scrollbox"),E=e.title;if(e._titleWidth=0,e._titleHeight=0,E.text){var D=a.ensureSingle(P,"text","legendtitletext");D.attr("text-anchor","start").call(u.font,E.font).text(E.text),A(D,P,t,e,1)}else P.selectAll(".legendtitletext").remove();var z=a.ensureSingle(k,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),O=P.selectAll("g.groups").data(s);O.enter().append("g").attr("class","groups"),O.exit().remove();var R=O.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(T,t,e)})).call(_,t,e).each((function(){d||n.select(this).call(M,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c="fraction"===a.entrywidthmode,p=a.borderwidth,h=2*p,d=f.itemGap,m=a.itemwidth+2*d,y=2*(p+d),g=C(a),v=a.y<0||0===a.y&&"top"===g,_=a.y>1||1===a.y&&"bottom"===g,w=a.tracegroupgap,T={};a._maxHeight=Math.max(v||_?i.height/2:o.h,30);var k=0;a._width=0,a._height=0;var M=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(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,p+M[0],p+M[1]+a._height+e/2+d),a._height+=e,a._width=Math.max(a._width,t[0].width)})),k=m+a._width,a._width+=d+m+h,a._height+=y,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=S(a),L=a.x<0||0===a.x&&"right"===A,I=a.x>1||1===a.x&&"left"===A,P=_||v,E=i.width/2;a._maxWidth=Math.max(L?P&&"left"===A?o.l+o.w:E:I?P&&"right"===A?o.r+o.w:E:o.w,2*m);var D=0,z=0;r.each((function(t){var e=b(t,a,m);D=Math.max(D,e),z+=e})),k=null;var O=0;if(l){var R=0,F=0,B=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=b(r,a,m),i=r[0].height;u.setTranslate(this,M[0],M[1]+p+d+i/2+e),e+=i,t=Math.max(t,n),T[r[0].trace.legendgroup]=t}));var r=t+d;F>0&&r+p+F>a._maxWidth?(O=Math.max(O,F),F=0,B+=R+w,R=e):R=Math.max(R,e),u.setTranslate(this,F,B),F+=r})),a._width=Math.max(O,F)+p,a._height=B+R+y}else{var N=r.size(),j=z+h+(N-1)*d=a._maxWidth&&(O=Math.max(O,Z),V=0,q+=U,a._height+=U,U=0),u.setTranslate(this,M[0]+p+V,M[1]+p+q+e/2+d),Z=V+r+d,V+=n,U=Math.max(U,e)})),j?(a._width=V+h,a._height=U+y):(a._width=Math.max(O,Z)+h,a._height+=U+y)}}a._width=Math.ceil(Math.max(a._width+M[0],a._titleWidth+2*(p+f.titlePad))),a._height=Math.ceil(Math.max(a._height+M[1],a._titleHeight+2*(p+f.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=t._context.edits,G=H.legendText||H.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=t[0].trace.legendgroup,o=b(t,a,m);l&&""!==i&&(o=T[i]);var p=G?m:k||o;s||c||(p+=d/2),u.setRect(e,0,-r/2,p,r)}))}(t,O,R,e)},function(){var s,c,m,v,_=p._size,x=e.borderwidth;if(!d){if(function(t){var e=t._fullLayout.legend,r=S(e),n=C(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*g[r],b:e._effHeight*g[n],t:e._effHeight*y[n]})}(t))return;var b=_.l+_.w*e.x-y[S(e)]*e._width,T=_.t+_.h*(1-e.y)-y[C(e)]*e._effHeight;if(p.margin.autoexpand){var M=b,A=T;b=a.constrain(b,0,p.width-e._width),T=a.constrain(T,0,p.height-e._effHeight),b!==M&&a.log("Constrain legend.x to make legend fit inside graph"),T!==A&&a.log("Constrain legend.y to make legend fit inside graph")}u.setTranslate(k,b,T)}if(z.on(".drag",null),k.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var E=e._effHeight;d&&(E=e._height),I.attr({width:e._width-x,height:E-x,x:x/2,y:x/2}),u.setTranslate(P,0,0),L.select("rect").attr({width:e._width-2*x,height:E-2*x,x:x,y:x}),u.setClipUrl(P,h,t),u.setRect(z,0,0,0,0),delete e._scrollY}else{var D,O,R,F=Math.max(f.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*f.scrollBarMargin,N=e._height-e._effHeight,j=B/N,U=Math.min(e._scrollY||0,N);I.attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),L.select("rect").attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(P,h,t),Z(U,F,j),k.on("wheel",(function(){Z(U=a.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==U&&U!==N&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;D="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(O="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Z(U=function(t,e,r){var n=(r-e)/j+t;return a.constrain(n,0,N)}(R,D,O),F,j))}));z.call(V);var q=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(D=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(O=t.changedTouches[0].clientY,Z(U=function(t,e,r){var n=(e-r)/j+t;return a.constrain(n,0,N)}(R,D,O),F,j))}));P.call(q)}function Z(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(P,0,-r),u.setRect(z,e._width,f.scrollBarMargin+r*a,f.scrollBarWidth,n),L.select("rect").attr("y",x+r)}t._context.edits.legendPosition&&(k.classed("cursor-move",!0),l.init({element:k.node(),gd:t,prepFn:function(){var t=u.getTranslate(k);m=t.x,v=t.y},moveFn:function(t,r){var n=m+t,a=v+r;u.setTranslate(k,n,a),s=l.align(n,0,_.l,_.l+_.w,e.xanchor),c=l.align(a,0,_.t+_.h,_.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==c&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":c})},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&&w(t,k,a,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":231,"../../lib":258,"../../lib/events":249,"../../lib/svg_text_utils":281,"../../plots/plots":346,"../../registry":349,"../color":115,"../dragelement":134,"../drawing":137,"./constants":166,"./get_legend_data":169,"./handle_click":170,"./helpers":171,"./style":173,"@plotly/d3":12}],169:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),u={},c=[],p=!1,h={},f=0,d=0;function m(t,r){if(""!==t&&a.isGrouped(e))-1===c.indexOf(t)?(c.push(t),p=!0,u[t]=[r]):u[t].push(r);else{var n="~~i"+f;c.push(n),u[n]=[r],f++}}for(r=0;rM&&(k=M)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var g=e._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,_=r.itemwidth,x=(_+2*f.itemGap)/2,b=o(x,0),w=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(t,i,o){var c=t[0].trace,p=c.marker||{},h=p.line||{},f=o?c.visible&&c.type===o:a.traceIs(c,"bar"),d=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(f?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),d.exit().remove(),d.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,p.line,5,2);a.style("stroke-width",o+"px");var f=i.mcc;if(!r._inHover&&"mc"in i){var d=u(p),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),f=s.tryColorscale(p,"")(m)}var g=f||i.mc||p.color,v=p.pattern,_=v&&s.getPatternAttr(v.shape,0,"");if(_){var x=s.getPatternAttr(v.bgcolor,0,null),b=s.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,k=y(v.size,8,10),M=y(v.solidity,.5,1),A="legend-"+c.uid;a.call(s.pattern,"legend",e,A,_,k,M,f,v.fillmode,x,b,T)}else a.call(l.fill,g);o&&l.stroke(a,i.mlc||h.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),u.exit().remove(),u.size()){var c=(s.marker||{}).line,f=w(h(c.width,o.pts),c,5,2),d=i.minExtend(s,{marker:{line:{width:f}}});d.marker.line.color=c.color;var m=i.minExtend(o,{trace:d});p(u,m,d)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var p=a.selectAll("g.legendsymbols").data([t]);p.enter().append("g").classed("legendsymbols",!0),p.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 c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,p=n.select(this),h=u(a),f=h.colorscale,m=h.reversescale;if(f){if(!r){var y=f.length;c=0===o?f[m?y-1:0][1]:1===o?f[m?0:y-1][1]:f[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}p.attr("d",t[0]),c?p.call(l.fill,c):p.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,d(m,"radial"===r),f,"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(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",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){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",b),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,a,o=m(t),l=o.showFill,p=o.showLine,h=o.showGradientLine,f=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=t[0],x=v.trace,b=u(x),T=b.colorscale,k=b.reversescale,M=c.hasMarkers(x)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(l||f?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+_+"v6h-"+_+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,d(k),T,"fill")}})),p||h){var C=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:C}}),r=[i.minExtend(v,{trace:a})]}var L=A.select(".legendlines").selectAll("path").data(p||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",M+(h?"l"+_+",0.0001":"h"+_)).call(p?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,a,o=m(t),l=o.anyFill,u=o.anyLine,p=o.showLine,h=o.showMarker,f=t[0],d=f.trace,y=!h&&!u&&!l&&c.hasText(d);function g(t,e,r,n){var a=i.nestedProperty(d,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function _(t){return f._distinct&&f.index&&t[f.index]?t[f.index]:t[0]}if(h||y||p){var x={},w={};if(h){x.mc=g("marker.color",_),x.mx=g("marker.symbol",_),x.mo=g("marker.opacity",i.mean,[.2,1]),x.mlc=g("marker.line.color",_),x.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);x.ms=T,w.marker.size=T}p&&(w.line={width:g("line.width",_,[0,10],5)}),y&&(x.tx="Aa",x.tp=g("textposition",_),x.ts=10,x.tc=g("textfont.color",_),x.tf=g("textfont.family",_)),r=[i.minExtend(f,x)],(a=i.minExtend(d,w)).selectedpoints=null,a.texttemplate=null}var k=n.select(this).select("g.legendpoints"),M=k.selectAll("path.scatterpts").data(h?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),M.exit().remove(),M.call(s.pointStyle,a,e),h&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),A.exit().remove(),A.selectAll("text").call(s.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",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(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",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":258,"../../registry":349,"../../traces/pie/helpers":377,"../../traces/pie/style_one":378,"../../traces/scatter/subtypes":405,"../color":115,"../colorscale/helpers":126,"../drawing":137,"./constants":166,"@plotly/d3":12}],174:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":176}],175:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function p(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},p=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var f,d="in"===l?.5:2,m=(1+d)/2,y=(1-d)/2;for(a=0;a1?(E=["toggleHover"],D=["resetViews"]):g?(P=["zoomInGeo","zoomOutGeo"],E=["hoverClosestGeo"],D=["resetGeo"]):y?(E=["hoverClosest3d"],D=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(P=["zoomInMapbox","zoomOutMapbox"],E=["toggleHover"],D=["resetViewMapbox"]):x?E=["hoverClosestGl2d"]:v?E=["hoverClosestPie"]:M?(E=["hoverClosestCartesian","hoverCompareCartesian"],D=["resetViewSankey"]):E=["toggleHover"];m&&(E=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t=0;k--){var M=r.append("path").attr(y).style("opacity",k?.1:g).call(o.stroke,_).call(o.fill,v).call(s.dashLine,k?"solid":b,k?4+x:x);if(d(M,t,i),w){var A=l(t.layout,"selections",i);M.style({cursor:"move"});var S={element:M.node(),plotinfo:f,gd:t,editHelpers:A,isActiveSelection:!0},C=n(u,t);a(C,M,S)}else M.style("pointer-events",k?"all":"none");T[k]=M}var L=T[0];T[1].node().addEventListener("click",(function(){return function(t,e){if(!h(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void m(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=m,p(t)}}(t,L)}))}(t._fullLayout._selectionLayer)}function d(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function m(t){h(t)&&(t._fullLayout._activeSelectionIndex>=0&&(i(t),delete t._fullLayout._activeSelectionIndex,p(t)))}e.exports={draw:p,drawOne:f,activateLastSelection:function(t){if(!h(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=m,p(t)}}},{"../../plot_api/plot_template":294,"../color":115,"../drawing":137,"../shapes/display_outlines":209,"../shapes/draw_newshape/helpers":214,"../shapes/handle_outline":216,"../shapes/helpers":217}],199:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,a=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":250,"../../drawing/attributes":136}],200:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],201:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,a=t("../../shapes/handle_outline").clearOutline,i=t("../../shapes/draw_newshape/helpers"),o=i.readPaths,s=i.writePaths,l=i.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var i=r.getAttribute("d"),u=e.gd,c=u._fullLayout.newselection,p=e.plotinfo,h=p.xaxis,f=p.yaxis,d=e.isActiveSelection,m=e.dragmode,y=(u.layout||{}).selections||[];if(!n(m)&&void 0!==d){var g=u._fullLayout._activeSelectionIndex;if(g-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(g)){G(t,e,i);var b=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&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;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=K(b))){for(o&&o.remove(),y=0;y=0})(a)&&a._fullLayout._deactivateShape(a),function(t){return t._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=f(r),l=m(r);if(s||l){var u,c,p=o.selectAll(".select-outline-"+n.id);if(p&&a._fullLayout._outlining)s&&(u=T(p,t)),u&&i.call("_guiRelayout",a,{shapes:u}),l&&!U(t)&&(c=k(p,t)),c&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:c}).then((function(){e&&M(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function W(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var a,i,o,s=[],l=e.map(W),u=r.map(W);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function Q(t,e,r){var n,a;for(n=0;n-1&&e;if(!i&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,ft=et[0].yref;if(nt&&ft){var dt=ut(et);ct([I(t,nt,"x"),I(t,ft,"y")])($,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&pt(t,$),h._reselect=!1}if(!i&&h._deselect){var mt=h._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!_){var r=M.clickmode;L.done(Mt).then((function(){if(L.clear(Mt),2===t){for(xt.remove(),K=0;K-1&&V(e,k,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&pt(k,void 0);l.click(k,e)})).catch(A.error)}},n.doneFn=function(){kt.remove(),L.done(Mt).then((function(){L.clear(Mt),!S&&J&&n.selectionDefs&&(J.subtract=_t,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,W)),(S||_)&&Y(n,S),n.doneFnCompleted&&n.doneFnCompleted(At),x&&pt(k,it)})).catch(A.error)}},clearOutline:_,clearSelectionsCache:Y,selectOnClick:V}},{"../../lib":258,"../../lib/clear_gl_canvases":244,"../../lib/polygon":270,"../../lib/throttle":282,"../../plot_api/subroutines":295,"../../plots/cartesian/axis_ids":309,"../../registry":349,"../color":115,"../dragelement/helpers":133,"../drawing":137,"../fx":155,"../fx/helpers":151,"../shapes/constants":207,"../shapes/display_outlines":209,"../shapes/draw_newshape/helpers":214,"../shapes/draw_newshape/newshapes":215,"../shapes/handle_outline":216,"../shapes/helpers":217,"./constants":196,"./draw":198,"./draw_newselection/newselections":201,"./helpers":202,"point-in-polygon/nested":69,polybooljs:70}],205:[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,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":232,"../../lib/extend":250,"../../plot_api/plot_template":294,"../../traces/scatter/attributes":380,"../annotations/attributes":98,"../drawing/attributes":136}],206:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./constants"),o=t("./helpers");function s(t){return u(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return u(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function u(t,e,r,a,s,l){var u=t/2,c=l;if("pixel"===e){var p=s?o.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[r,a],h=n.aggNums(Math.max,null,p),f=n.aggNums(Math.min,null,p),d=f<0?Math.abs(f)+u:u,m=h>0?h+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,p,h=1/0,f=-1/0,d=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lf&&(f=p)));return f>=h?[h,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===C&&(t[0][0]="M"),e[S]=t,T(),k())}}()}}function B(t,r){!function(t,r){if(e.length)for(var n=0;n_?(k=p,C="y0",M=_,L="y1"):(k=_,C="y1",M=p,L="y0");X(n),Q(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),W.moveFn="move"===D?J:K,W.altKey=n.altKey},doneFn:function(){if(v(t))return;f(e),$(s),b(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;$(s)}};function X(r){if(v(t))D=null;else if(R)D="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=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";f(e,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;z?B("xanchor",r.xanchor=H(x+n)):(o=function(t){return H(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+a)):(l=function(t){return G(Z(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(E,o,l))}else z?B("xanchor",r.xanchor=H(x+n)):(B("x0",r.x0=H(u+n)),B("x1",r.x1=H(g+n))),O?B("yanchor",r.yanchor=G(T+a)):(B("y0",r.y0=G(p+a)),B("y1",r.y1=G(_+a)));e.attr("d",y(t,r)),Q(s,r)}function K(n,a){if(F){var i=function(t){return t},o=i,l=i;z?B("xanchor",r.xanchor=H(x+n)):(o=function(t){return H(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+a)):(l=function(t){return G(Z(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(E,o,l))}else if(R){if("resize-over-start-point"===D){var c=u+n,h=O?p-a:p+a;B("x0",r.x0=z?c:H(c)),B("y0",r.y0=O?h:G(h))}else if("resize-over-end-point"===D){var f=g+n,d=O?_-a:_+a;B("x1",r.x1=z?f:H(f)),B("y1",r.y1=O?d:G(d))}}else{var v=function(t){return-1!==D.indexOf(t)},b=v("n"),j=v("s"),V=v("w"),Y=v("e"),W=b?k+a:k,X=j?M+a:M,J=V?A+n:A,K=Y?S+n:S;O&&(b&&(W=k-a),j&&(X=M-a)),(!O&&X-W>10||O&&W-X>10)&&(B(C,r[C]=O?W:G(W)),B(L,r[L]=O?X:G(X))),K-J>10&&(B(I,r[I]=z?J:H(J)),B(P,r[P]=z?K:H(K)))}e.attr("d",y(t,r)),Q(s,r)}function Q(t,e){(z||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=q(z?e.xanchor:a.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=Z(O?e.yanchor:a.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),z&&O){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(W),Y.node().onmousemove=X}(t,z,l,e,r,D):!0===l.editable&&z.style("pointer-events",P||u.opacity(S)*A<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!_(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,g(t)}}(t,z)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,a=t.charAt(0),i=d.paramIsX[a],o=d.paramIsY[a],s=d.numParams[a];return a+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){_(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,g(t)))}e.exports={draw:g,drawOne:x,eraseActiveShape:function(t){if(!_(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&lf&&(t="X"),t}));return i>f&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+d}))}(e,s,u);if("pixel"===e.xsizemode){var x=s(e.xanchor);c=x+e.x0,p=x+e.x1}else c=s(e.x0),p=s(e.x1);if("pixel"===e.ysizemode){var b=u(e.yanchor);h=b-e.y0,f=b-e.y1}else h=u(e.y0),f=u(e.y1);if("line"===d)return"M"+c+","+h+"L"+p+","+f;if("rect"===d)return"M"+c+","+h+"H"+p+"V"+f+"H"+c+"Z";var w=(c+p)/2,T=(h+f)/2,k=Math.abs(w-c),M=Math.abs(T-h),A="A"+k+","+M,S=w+k+","+T;return"M"+S+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+S+"Z"}},{"../../lib":258,"../../plots/cartesian/axes":305,"./constants":207}],218:[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":316,"./attributes":205,"./calc_autorange":206,"./defaults":208,"./draw":210,"./draw_newshape/defaults":213}],219:[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,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=t("./constants"),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":250,"../../plot_api/edit_types":287,"../../plot_api/plot_template":294,"../../plots/animation_attributes":299,"../../plots/font_attributes":333,"../../plots/pad_attributes":345,"./constants":220}],220:[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}},{}],221:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.steps;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=a(t,e,{name:"steps",handleItemDefaults:u}),l=0,c=0;c0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*p.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+p.stepInset+(r.inputAreaLength-2*p.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-p.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*p.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",p.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,p.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*p.railInset,a=s.ensureSingle(t,"rect",p.railRectClass);a.attr({width:n,height:p.railWidth,rx:p.railRadius,ry:p.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,p.railInset,.5*(r.inputAreaWidth-p.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[p.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,y(e))}if(i.enter().append("g").classed(p.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+p.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+p.groupClassName).data(r,g);l.enter().append("g").classed(p.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var g={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[x.side];e.attr("transform",l(g[0],g[1]))}}}return R.call(F),D&&(C?R.on(".opacity",null):(M=0,A=!0,R.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(p.makeEditable,{gd:t}).on("edit",(function(e){void 0!==_?o.call("_guiRestyle",t,g,e,_):o.call("_guiRelayout",t,g,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(p.positionText,b.x,b.y)}))),R.classed("js-placeholder",A),T}}},{"../../constants/alignment":231,"../../constants/interactions":235,"../../lib":258,"../../lib/svg_text_utils":281,"../../plots/plots":346,"../../registry":349,"../color":115,"../drawing":137,"@plotly/d3":12,"fast-isnumeric":28}],225:[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,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":250,"../../plot_api/edit_types":287,"../../plot_api/plot_template":294,"../../plots/font_attributes":333,"../../plots/pad_attributes":345,"../color/attributes":114}],226:[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"}}},{}],227:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":258,"../../plots/array_container_defaults":300,"./attributes":225,"./constants":226}],228:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),h=t("./scrollbox");function f(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(a.attr(p.menuIndexAttrName,"-1"),y(t,n,a,i,e),s||g(t,n,a,i,e))}function y(t,e,r,n,a){var i=s.ensureSingle(e,"g",p.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||p.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};i.call(v,a,c,t).call(A,a,h,f),s.ensureSingle(e,"text",p.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(p.arrowSymbol[a.direction])})).attr({x:l.headerWidth-p.arrowOffsetX+a.pad.l,y:l.headerHeight/2+p.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(d(r,a)?-1:a._index)),g(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,l.lx,l.ly)}function g(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var d=0,y=0,g=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?y=g.headerHeight+p.gapButtonHeader:d=g.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-p.gapButtonHeader+p.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-g.openWidth);var x={x:g.lx+d+o.pad.l,y:g.ly+y+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(v,o,s,t).call(A,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(T,o),c.call(b,o)}))})),c.call(b,o),_?(k.w=Math.max(g.openWidth,g.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(g.openHeight,g.headerHeight)),k.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,f=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,f);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,M=s.barLength+2*s.barPad,A=s.barWidth+2*s.barPad,S=d,C=y+g;C+A>u&&(C=u-A);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:M,height:A}),this._hbarXMin=S+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=g>T,P=s.barWidth+2*s.barPad,E=s.barLength+2*s.barPad,D=d+m,z=y;D+P>l&&(D=l-P);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),I?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:z,width:P,height:E}),this._vbarYMin=z+E/2,this._vbarTranslateMax=T-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=I?p+P+.5:p+.5,N=h-.5,j=k?f+A+.5:f+.5,U=o._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||I){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":258,"../color":115,"../drawing":137,"@plotly/d3":12}],231:[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"}}},{}],232:[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(" ")}}},{}],233:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],234:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],235:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],236:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],237:[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}},{}],238:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],240:[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}},{}],241:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function p(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,p,h,f,d,m=l([r,n]);function y(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}m?(c=0,p=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return p(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return p(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return p(t,e,r,n,a,i,1)}}},{"./mod":265}],242:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.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(p(+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(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),g=t.charAt(0);!u||"G"!==g&&"g"!==g||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),T=t.match(w?_:v);if(!T)return c;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),S=Number(T[7]||0),C=Number(T[9]||0),L=Number(T[11]||0);if(u){if(2===k.length)return c;var I;k=Number(k);try{var P=y.getComponentMethod("calendars","getCal")(e);if(w){var E="i"===M.charAt(M.length-1);M=parseInt(M,10),I=P.newDate(k,P.toMonthIndex(k,M,E),A)}else I=P.newDate(k,Number(M),A)}catch(t){return c}return I?(I.toJD()-m)*p+S*h+C*f+L*d:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),M-=1;var D=new Date(Date.UTC(2e3,M,A,S,C));return D.setUTCFullYear(k),D.getUTCMonth()!==M||D.getUTCDate()!==A?c:D.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var T=90*p,k=3*h,M=5*f;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 c;e||(e=0);var i,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var S=Math.floor(w/p)+m,C=Math.floor(l(t,p));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){i=g("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=n+p&&t<=a-p))return c;var e=Math.floor(10*l(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===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,C=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function I(t,e,r,n){t=t.replace(S,(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(t=t.replace(C,(function(){return L[r("%q")(a)]})),b(n))try{t=y.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=b(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+I(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return I(e,t,n,a)};var E=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var a=Math.round(t/p)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+E);return u.setUTCMonth(u.getUTCMonth()+e)+n-E},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=b(e)&&y.getComponentMethod("calendars","getCal")(e),c=0;c0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),a=0;ae?r[n++]=[t[a][0]+360,t[a][1]]:a===e?(r[n++]=t[a],r[n++]=[t[a][0],-90]):r[n++]=t[a];var i=h.tester(r);i.pts.pop(),l.push(i)}:function(t){l.push(h.tester(t))},i.type){case"MultiPolygon":for(r=0;ra&&(a=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+t)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,p=n-e,h=o-a,f=u-i,d=c*c+p*p,m=h*h+f*f,y=Math.min(l(c,p,d,a-t,i-e),l(c,p,d,o-t,u-e),l(h,f,m,t-a,e-i),l(h,f,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),p=t.getPointAtLength(o(r,e)),h={x:(4*p.x+l.x+u.x)/6,y:(4*p.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),p=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,p=r.yl?r.y-l:0;return Math.sqrt(u*u+p*p)}for(var f=h(u);f;){if((u+=f+r)>p)return;f=h(u)}for(f=h(p);f;){if(u>(p-=f+r))return;f=h(p)}return{min:u,max:p,len:p-u,total:c,isClosed:0===u&&p===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,h=0,f=s;p0?f=a:h=a,p++}return i}},{"./mod":265}],256:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],257:[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}},{}],258:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,u=-l,c=s.BADNUM,p=e.exports={};p.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};p.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,p.warn('encountered bad format: "'+e+'"'))},p.noFormat=function(t){return String(t)},p.numberFormat=function(t){var e;try{e=i(p.adjustFormat(t))}catch(e){return p.warnBadFormat(t),p.noFormat}return e},p.nestedProperty=t("./nested_property"),p.keyedContainer=t("./keyed_container"),p.relativeAttr=t("./relative_attr"),p.isPlainObject=t("./is_plain_object"),p.toLogRange=t("./to_log_range"),p.relinkPrivateKeys=t("./relink_private");var f=t("./array");p.isTypedArray=f.isTypedArray,p.isArrayOrTypedArray=f.isArrayOrTypedArray,p.isArray1D=f.isArray1D,p.ensureArray=f.ensureArray,p.concat=f.concat,p.maxRowLength=f.maxRowLength,p.minRowLength=f.minRowLength;var d=t("./mod");p.mod=d.mod,p.modHalf=d.modHalf;var m=t("./coerce");p.valObjectMeta=m.valObjectMeta,p.coerce=m.coerce,p.coerce2=m.coerce2,p.coerceFont=m.coerceFont,p.coercePattern=m.coercePattern,p.coerceHoverinfo=m.coerceHoverinfo,p.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,p.validate=m.validate;var y=t("./dates");p.dateTime2ms=y.dateTime2ms,p.isDateTime=y.isDateTime,p.ms2DateTime=y.ms2DateTime,p.ms2DateTimeLocal=y.ms2DateTimeLocal,p.cleanDate=y.cleanDate,p.isJSDate=y.isJSDate,p.formatDate=y.formatDate,p.incrementMonth=y.incrementMonth,p.dateTick0=y.dateTick0,p.dfltRange=y.dfltRange,p.findExactDates=y.findExactDates,p.MIN_MS=y.MIN_MS,p.MAX_MS=y.MAX_MS;var g=t("./search");p.findBin=g.findBin,p.sorterAsc=g.sorterAsc,p.sorterDes=g.sorterDes,p.distinctVals=g.distinctVals,p.roundUp=g.roundUp,p.sort=g.sort,p.findIndexOfMin=g.findIndexOfMin,p.sortObjectKeys=t("./sort_object_keys");var v=t("./stats");p.aggNums=v.aggNums,p.len=v.len,p.mean=v.mean,p.median=v.median,p.midRange=v.midRange,p.variance=v.variance,p.stdev=v.stdev,p.interp=v.interp;var _=t("./matrix");p.init2dArray=_.init2dArray,p.transposeRagged=_.transposeRagged,p.dot=_.dot,p.translationMatrix=_.translationMatrix,p.rotationMatrix=_.rotationMatrix,p.rotationXYMatrix=_.rotationXYMatrix,p.apply3DTransform=_.apply3DTransform,p.apply2DTransform=_.apply2DTransform,p.apply2DTransform2=_.apply2DTransform2,p.convertCssMatrix=_.convertCssMatrix,p.inverseTransformMatrix=_.inverseTransformMatrix;var x=t("./angles");p.deg2rad=x.deg2rad,p.rad2deg=x.rad2deg,p.angleDelta=x.angleDelta,p.angleDist=x.angleDist,p.isFullCircle=x.isFullCircle,p.isAngleInsideSector=x.isAngleInsideSector,p.isPtInsideSector=x.isPtInsideSector,p.pathArc=x.pathArc,p.pathSector=x.pathSector,p.pathAnnulus=x.pathAnnulus;var b=t("./anchor_utils");p.isLeftAnchor=b.isLeftAnchor,p.isCenterAnchor=b.isCenterAnchor,p.isRightAnchor=b.isRightAnchor,p.isTopAnchor=b.isTopAnchor,p.isMiddleAnchor=b.isMiddleAnchor,p.isBottomAnchor=b.isBottomAnchor;var w=t("./geometry2d");p.segmentsIntersect=w.segmentsIntersect,p.segmentDistance=w.segmentDistance,p.getTextLocation=w.getTextLocation,p.clearLocationCache=w.clearLocationCache,p.getVisibleSegment=w.getVisibleSegment,p.findPointOnPath=w.findPointOnPath;var T=t("./extend");p.extendFlat=T.extendFlat,p.extendDeep=T.extendDeep,p.extendDeepAll=T.extendDeepAll,p.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");p.log=k.log,p.warn=k.warn,p.error=k.error;var M=t("./regex");p.counterRegex=M.counter;var A=t("./throttle");p.throttle=A.throttle,p.throttleDone=A.done,p.clearThrottle=A.clear;var S=t("./dom");function C(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},p.noop=t("./noop"),p.identity=t("./identity"),p.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},p.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},p.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(p.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},p.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},p.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},p.syncOrAsync=function(t,e,r){var n;function a(){return p.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},p.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},p.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},p.fillArray=function(t,e,r,n){if(n=n||p.identity,p.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},p.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;p.templateString=function(t,e){var r={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,n){var a;return z.test(n)?a=e[n]:(r[n]=r[n]||p.nestedProperty(e,n).get,a=r[n]()),p.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};p.hovertemplateString=function(){return B.apply(O,arguments)};var R={max:10,count:0,name:"texttemplate"};p.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,s,l){var u,c,h,f="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,y="xother"===s||"yother"===s||f||m||d,g=s;if((f||d)&&(g=g.substring(1)),(m||d)&&(g=g.substring(0,g.length-1)),y){if(void 0===(u=e[g]))return""}else for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var N=2e9;p.seedPseudoRandom=function(){N=2e9},p.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?p.pseudoRandom():N/4294967296},p.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=p.extractOption(t,e,"htx","hovertext");if(p.isValidTextValue(a))return n(a);var i=p.extractOption(t,e,"tx","text");return p.isValidTextValue(i)?n(i):void 0},p.isValidTextValue=function(t){return t||0===t},p.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;n1&&(u=1):u=0,p.strTranslate(a-u*(r+o),i-u*(n+s))+p.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},p.setTransormAndDisplay=function(t,e){t.attr("transform",p.getTextTransform(e)),t.style("display",e.scale?null:"none")},p.ensureUniformFontSize=function(t,e){var r=p.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},p.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)},p.bigFont=function(t){return Math.round(1.2*t)};var j=p.getFirefoxVersion(),U=null!==j&&j<86;p.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":236,"./anchor_utils":240,"./angles":241,"./array":242,"./clean_number":243,"./clear_responsive":245,"./coerce":246,"./dates":247,"./dom":248,"./extend":250,"./filter_unique":251,"./filter_visible":252,"./geometry2d":255,"./identity":256,"./increment":257,"./is_plain_object":259,"./keyed_container":260,"./localize":261,"./loggers":262,"./make_trace_groups":263,"./matrix":264,"./mod":265,"./nested_property":266,"./noop":267,"./notifier":268,"./preserve_drawing_buffer":271,"./push_unique":272,"./regex":274,"./relative_attr":275,"./relink_private":276,"./search":277,"./sort_object_keys":279,"./stats":280,"./throttle":282,"./to_log_range":283,"@plotly/d3":12,"d3-format":24,"d3-time-format":25,"fast-isnumeric":28}],259:[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).hasOwnProperty("hasOwnProperty")}},{}],260:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(p){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":292,"./notifier":268}],263:[function(t,e,r){"use strict";var n=t("@plotly/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}},{"@plotly/d3":12}],264:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],266:[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,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,p,h,f,d,m=r.length,y=r[0][0],g=r[0][1],v=0;for(c=1;cMath.max(p,y)||u>Math.max(h,g)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":236,"./matrix":264}],271:[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-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":28,"is-mobile":62}],272:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,p=0,h=e.length,f=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?c:u,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p90&&a.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],p=c-a;void 0===a?(l.push(c),a=c):p>s&&(i=Math.min(i,p),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(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;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":242,"fast-isnumeric":28}],281:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var A=t.text(),S=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(l),I=n.select(t.node().parentNode);if(!I.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",I.selectAll("svg."+P).remove(),I.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(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,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2!==h&&3!==h)return void a.warn("No MathJax version:",MathJax.version);var f=function(){var r="math-output-"+a.randstr({},64),i=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(i):MathJax.typeset([i])},d=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),i=!e.empty()&&l.select("svg").node();if(i){var o,s=i.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else a.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:p},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),f,d,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=p,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){f(),d(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(S[2],o,(function(n,a,o){I.selectAll("svg."+P).remove(),I.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return E(),void e();var l=I.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild);var u=o.width,c=o.height;s.attr({class:P,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black",h=s.select("g");h.attr({fill:p,stroke:p});var f=h.node().getBoundingClientRect(),d=f.width,y=f.height;(d>u||y>c)&&(s.style("overflow","hidden"),d=(f=s.node().getBoundingClientRect()).width,y=f.height);var g=+t.attr("x"),v=+t.attr("y"),_=-(r||t.node().getBoundingClientRect().height)/4;if("y"===P[0])l.attr({transform:"rotate("+[-90,g,v]+")"+i(-d/2,_-y/2)});else if("l"===P[0])v=_-y/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))g=0,v=_;else{var x=t.attr("text-anchor");g-=d*("middle"===x?.5:"end"===x?1:0),v=v+_-y/2}s.attr({x:g,y:v}),m&&m.call(t,l),e(l)}))}))):E(),t}function E(){I.empty()||(P=t.attr("class")+"-math",I.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(y," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}_.test(e)?c():(r=t,l=[{node:t}]);for(var S=e.split(g),I=0;I|>|>)/g;var p=[["$","$"],["\\(","\\)"]];var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\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&&C(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(g),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,d-a)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(S,(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 L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?e:""}function I(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=C,r.sanitizeHTML=function(t){t=t.replace(y," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(g),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],283:[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":28}],284:[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"}}},{}],285:[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"}}},{}],286:[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],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(h(y,g),f(t),!0)}var _,x,b,w,T,k,M,A,S=Object.keys(r).map(Number).sort(o),C=e.get(),L=C||[],I=c(g,p).get(),P=[],E=-1,D=L.length;for(_=0;_L.length-(M?0:1))i.warn("index out of range",p,b);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",p,b),u(k)?P.push(b):M?("add"===k&&(k={}),L.splice(b,0,k),I&&I.splice(b,0,{})):i.warn("Unrecognized full object edit value",p,b,k),-1===E&&(E=b);else for(x=0;x=0;_--)L.splice(P[_],1),I&&I.splice(P[_],1);if(L.length?C||e.set(L):e.set(null),m)return!1;if(h(y,g),d!==a){var z;if(-1===E)z=S;else{for(D=Math.max(L.length,D),z=[],_=0;_=E);_++)z.push(b);for(_=E;_=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(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in 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 l=function(t,e,r,n){var i,l,u,c,p,h=o.isPlainObject(n),f=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),b.clearPromiseQueue(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=Y(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&q(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(A)),s.push(h.rehover,h.redrag,h.reselect),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=f.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[f.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[];for(var n in e){var a=f.getFromId(t,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)e[i]||r.push(i)}return f.draw(t,r,{skipTitle:!0})}:function(t){return f.draw(t,"redraw")};t.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,H=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=F(l._preGUI,u),d=Object.keys(e),m=f.list(t),y=o.extendDeepAll({},e),g={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[O];)O--;var B=D.parts[O],N=D.parts[O-1]+"."+B,U=D.parts.slice(0,O).join("."),V=s(t.layout,U).get(),q=s(l,U).get(),Y=D.get();if(void 0!==z){A[E]=z,S[E]="reverse"===B?z:R(Y);var X=p.getLayoutValObject(l,D.parts);if(X&&X.impliedEdits&&null!==z)for(var J in X.impliedEdits)C(o.relativeAttr(E,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(E))if(z){C("autosize",null);var K="height"===E?"width":"height";C(K,l[K])}else l[E]=t._initialAutoSize[E];else if("autosize"===E)C("width",z?null:l.width),C("height",z?null:l.height);else if(N.match(Z))P(N),s(l,U+"._inputRange").set(null);else if(N.match(H)){P(N),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(G)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var $="linear"===q.type&&"log"===z,tt="log"===q.type&&"linear"===z;if($||tt){if(L&&L.range)if(q.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&C(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),C(U+".range[0]",Math.log(et)/Math.LN10),C(U+".range[1]",Math.log(rt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,et)),C(U+".range[1]",Math.pow(10,rt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,z,C),c.getComponentMethod("images","convertCoords")(t,q,z,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,E).get(),at=(z||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,C),c.getComponentMethod("images","convertCoords")(t,nt,at,C)}var it=x.containerArrayMatch(E);if(it){r=it.array,n=it.index;var ot=it.property,st=X||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(z)?S[E]=null:x.isRemoveVal(z)?S[E]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(M,st),g[r]||(g[r]={});var lt=g[r][n];lt||(lt=g[r][n]={}),lt[ot]=z,delete e[E]}else"reverse"===B?(V.range?V.range.reverse():(C(U+".autorange",!0),V.range=[1,0]),q.autorange?M.calc=!0:M.plot=!0):("dragmode"===E&&(!1===z&&!1!==Y||!1!==z&&!1===Y)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===E&&("lasso"===z||"select"===z)&&"lasso"!==Y&&"select"!==Y||l._has("gl2d")?M.plot=!0:X?T.update(M,X):M.calc=!0,D.set(z))}}for(r in g){x.applyContainerArrayChanges(t,h(i,r),g[r],M,h)||(M.plot=!0)}for(var ut in I){var ct=(L=f.getFromId(t,ut))&&L._constraintGroup;if(ct)for(var pt in M.calc=!0,ct)I[pt]||(f.getFromId(t,pt)._constraintShrinkable=!0)}return(W(t)||e.height||e.width)&&(M.plot=!0),(M.plot||M.calc)&&(M.layoutReplot=!0),{flags:M,rangesAltered:I,undoit:S,redoit:A,eventData:y}}function W(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function X(t,e,n,a){t=o.getGraphDiv(t),b.clearPromiseQueue(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=b.coerceTraceIndices(t,a),s=N(t,o.extendFlat({},e),i),l=s.flags,c=Y(t,o.extendFlat({},n)),p=c.flags;(l.calc||p.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&b.clearAxisTypes(t,i,n);var f=[];p.layoutReplot?f.push(w.layoutReplot):l.fullReplot?f.push(r._doPlot):(f.push(h.previousPromises),V(t,p,c)||h.supplyDefaults(t),l.style&&f.push(w.doTraceStyle),(l.colorbars||p.colorbars)&&f.push(w.doColorBars),p.legend&&f.push(w.doLegend),p.layoutstyle&&f.push(w.layoutStyles),p.axrange&&q(f,c.rangesAltered),p.ticks&&f.push(w.doTicksRelayout),p.modebar&&f.push(w.doModeBar),p.camera&&f.push(w.doCamera),f.push(A)),f.push(h.rehover,h.redrag,h.reselect),u.add(t,X,[t,s.undoit,c.undoit,s.traces],X,[t,s.redoit,c.redoit,s.traces]);var d=o.syncOrAsync(f,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function p(){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,h.transition(t,e.frame.data,e.frame.layout,b.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 f(){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&&p()};e()}var d,m,y=0;function g(t){return Array.isArray(a)?y>=a.length?t.transitionOpts=a[y]:t.transitionOpts=a[0]:t.transitionOpts=a,y++,t}var v=[],_=null==e,x=Array.isArray(e);if(!_&&!x&&o.isPlainObject(e))v.push({type:"object",data:g(o.extendFlat({},e))});else if(_||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&M.push(m);v=M}}v.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,y=(c[m]||d[m]||{}).name,g=e[n].name,v=c[y]||d[y];y&&g&&"number"==typeof g&&v&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(c[y]||d[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&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.")),d[m]={name:m},f.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,p=[t,s],f=[t,i];return u&&u.add(t,l,p,c,f),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,p=t,h=[e,l],f=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!v(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function v(t){return t===Math.round(t)&&t>=0}function _(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||i.type.dflt]||{})._module),!c)return!1;if(!(a=(r=c.attributes)&&r[o])){var p=c.basePlotModule;p&&p.attributes&&(a=p.attributes[o])}a||(a=i[o])}return g(a,e,s)},r.getLayoutValObject=function(t,e){return g(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function p(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:p,applyUpdate:function(e,r){e&&c(e,r);var a=p();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":258,"../plots/attributes":301}],295:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),p=t("../components/modebar"),h=t("../plots/cartesian/axes"),f=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,y=d.clean,g=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function _(t){var e,a,s,c,d,m,y=t._fullLayout,g=y._size,_=g.p,b=h.list(t,"",!0);if(y._paperdiv.style({width:t._context.responsive&&y.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":y.width+"px",height:t._context.responsive&&y.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(u.setSize,y.width,y.height),t._context.setBackground(t,y.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!y._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-_-n:e._offset+e._length+_+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+_+n:e._offset-_-n:g.l+g.w*(t.position||0)+n%1}for(e=0;eT?c.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=m(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&y(i)&&t(i,o)}}({data:f,layout:h},""),c.length)return c.map(g)}},{"../lib":258,"../plots/attributes":301,"../plots/plots":346,"./plot_config":292,"./plot_schema":293,"./plot_template":294}],297:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,p={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,h,f,d;function m(t){return!(t in e)||o.validate(e[t],p[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},f=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(p.format.values,", "," or ")+".");var y={};function g(t,r){return o.coerce(e,y,p,t,r)}var v=g("format"),_=g("width"),x=g("height"),b=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},h);_?M.width=_:null===e.width&&n(d.width)&&(M.width=d.width),x?M.height=x:null===e.height&&n(d.height)&&(M.height=d.height);var A=o.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,p=k._fullLayout.height;function h(){a.purge(k),document.body.removeChild(k)}if("full-json"===v){var f=i.graphJson(k,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),h(),t(T?f:s.encodeJSON(f))}if(h(),"svg"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),u({format:v,width:n,height:p,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(k,r,M,A).then(S).then(C).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":258,"../plots/plots":346,"../snapshot/helpers":353,"../snapshot/svgtoimg":355,"../snapshot/tosvg":357,"../version":424,"./plot_api":291,"fast-isnumeric":28}],298:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var p=Object.keys(t),h=0;h_.length&&a.push(d("unused",i,g.concat(_.length)));var M,A,S,C,L,I=_.length,P=Array.isArray(k);if(P&&(I=Math.min(I,k.length)),2===x.dimensions)for(A=0;A_[A].length&&a.push(d("unused",i,g.concat(A,_[A].length)));var E=_[A].length;for(M=0;M<(P?Math.min(E,k[A].length):E);M++)S=P?k[A][M]:k,C=v[A][M],L=_[A][M],n.validate(C,S)?L!==C&&L!==+C&&a.push(d("dynamic",i,g.concat(A,M),C,L)):a.push(d("value",i,g.concat(A,M),C))}else a.push(d("array",i,g.concat(A),v[A]));else for(A=0;A1&&f.push(d("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(p)===p))return{vals:a};u=p}for(var h=e.calendar,f="start"===l,d="end"===l,m=t[r+"period0"],y=i(m,h)||0,g=[],v=[],_=[],x=a.length,b=0;bM;)k=o(k,-u,h);for(;k<=M;)k=o(k,u,h);T=o(k,-u,h)}else{for(k=y+(w=Math.round((M-y)/c))*c;k>M;)k-=c;for(;k<=M;)k+=c;T=k-c}g[b]=f?T:d?k:(T+k)/2,v[b]=T,_[b]=k}return{vals:g,starts:v,ends:_}}},{"../../constants/numerical":236,"../../lib":258,"fast-isnumeric":28}],303:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],304:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),u=t("./axis_ids"),c=u.getFromId,p=u.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),u=m(t,e),c=u.min,p=u.max;if(0===c.length||0===p.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,y=p[0].val;for(r=1;r0&&((T=C-s(_)-l(x))>L?k/T>I&&(b=_,w=x,I=k/T):k/C>I&&(b={val:_.val,nopad:1},w={val:x.val,nopad:1},I=k/C));if(h===y){var P=h-1,E=h+1;if(A)if(0===h)a=[0,1];else{var D=(h>0?p:c).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,D/C));a=h>0?[0,z]:[z,0]}else a=S?[Math.max(0,P),Math.max(1,E)]:[P,E]}else A?(b.val>=0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(b.val-I*s(b)<0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),I=(w.val-b.val-f(e,_.val,x.val))/(C-s(b)-l(w)),a=[b.val-I*s(b),w.val+I*l(w)];return g&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=M(r.vpadplus||r.vpad),L=M(r.vpadminus||r.vpad);if(!T){if(h=1/0,f=-1/0,w)for(n=0;n0&&(h=i),i>f&&i-o&&(h=i),i>f&&i=E;n--)P(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,u=[],p=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function _(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":137,"../../constants/numerical":236,"../../lib":258,"../../registry":349,"./axis_ids":309,"@plotly/d3":12,"fast-isnumeric":28}],305:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),p=t("../../components/color"),h=t("../../components/drawing"),f=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,_=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,b=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,M=m.ONEWEEK,A=m.ONEDAY,S=A/2,C=m.ONEHOUR,L=m.ONEMIN,I=m.ONESEC,P=m.MINUS_SIGN,E=m.BADNUM,D={K:"zeroline"},z={K:"gridline",L:"path"},O={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},B={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},N=t("../../constants/alignment"),j=N.MID_SHIFT,U=N.CAP_SHIFT,V=N.LINE_SPACING,q=N.OPPOSITE_SIDE,Z=e.exports={};Z.setConvert=t("./set_convert");var H=t("./axis_autotype"),G=t("./axis_ids"),Y=G.idSort,W=G.isLinked;Z.id2name=G.id2name,Z.name2id=G.name2id,Z.cleanId=G.cleanId,Z.list=G.list,Z.listIds=G.listIds,Z.getFromId=G.getFromId,Z.getFromTrace=G.getFromTrace;var X=t("./autorange");Z.getAutoRange=X.getAutoRange,Z.findExtremes=X.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}Z.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},Z.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},Z.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==Z.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=Z.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},Z.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:Z.getFromId(e,r).cleanPos)(t)},Z.redrawComponents=function(t,e){e=e||Z.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;cr&&p2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},Z.saveRangeInitial=function(t,e){for(var r=Z.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=Z.tickIncrement(t,"M6","reverse")+1.5*A:i.exactMonths>.8?t=Z.tickIncrement(t,"M1","reverse")+15.5*A:t-=S;var l=Z.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,g,u,i)),y=v,0;y<=c;)y=Z.tickIncrement(y,g,!1,i);return{start:e.c2r(v,0,i),end:e.c2r(y,0,i),size:g,_dataSpan:c-u}},Z.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,i=e.dtick&&a(e._tmin);if(i){var o=Z.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,Z.prepTicks(t,r),i){var u=a(e.dtick),c=a(t.dtick),p=u?e.dtick:+e.dtick.substring(1),h=c?t.dtick:+t.dtick.substring(1);u&&c?tt(p,h)?p===2*M&&h===2*A&&(t.dtick=M):p===2*M&&h===3*A?t.dtick=M:p!==M||(e._input.minor||{}).nticks?et(p/h,2.5)?t.dtick=p/2:t.dtick=p:t.dtick=A:"M"===String(e.dtick).charAt(0)?c?t.dtick="M1":tt(p,h)?p>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(p,h)||(t.dtick=et(p/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},Z.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,Z.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=Z.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=C,o&&!n&&t.dtick=(D?0:1);z--){var O=!z;z?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var R=z?t:s.extendFlat({},t,t.minor);if(O?Z.prepMinorTicks(R,t,e):Z.prepTicks(R,e),"array"!==R.tickmode){var F=J(c),B=F[0],N=F[1],j=a(R.dtick),U="log"===i&&!(j||"L"===R.dtick.charAt(0)),V=Z.tickFirst(R,e);if(z){if(t._tmin=V,V=N:Y<=N;Y=Z.tickIncrement(Y,W,p,o)){if(z&&q++,R.rangebreaks&&!p){if(Y=f)break}if(I.length>d||Y===G)break;G=Y;var X={value:Y};z?(U&&Y!==(0|Y)&&(X.simpleLabel=!0),l>1&&q%l&&(X.skipLabel=!0),I.push(X)):(X.minor=!0,P.push(X))}}else z?(I=[],m=nt(t)):(P=[],L=nt(t))}if(D&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=I.map((function(t){return t.value})),Q=[],$=0;$0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),p=r||c,h=0;p>=v?h=c>=v&&c<=y?c:g:r===x&&p>=b?h=c>=b&&c<=_?c:x:p>=k?h=c>=k&&c<=w?c:T:r===M&&p>=M?h=M:p>=A?h=A:r===S&&p>=S?h=S:r===C&&p>=C&&(h=C),h>=c&&(h=c,s=!0);var f=a+h;if(e.rangebreaks&&h>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(a*(1-L)+L*f)!==E&&d++}(h*=d/84)||(t[n].drop=!0),s&&c>M&&(h=c)}(h>0||0===n)&&(t[n].periodX=a+h/2)}}(I,t,t._definedDelta),t.rangebreaks){var it="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=I.length-1;r>-1;r--)if(I[r].drop)I.splice(r,1);else{I[r].value=Et(I[r].value,t);var lt=t.c2p(I[r].value);(it?st>lt-ot:stf||ctf&&(ut.periodX=f),ct10||"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>=L&&i<=16||e>=C)t._tickround="M";else if(e>=I&&i<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(mt(t.exponentformat)&&!yt(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function ft(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}}Z.autoTicks=function(t,e,r){var n;function i(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>g)e/=g,n=i(10),t.dtick="M"+12*pt(e,n,at);else if(o>T)e/=T,t.dtick="M"+pt(e,1,it);else if(o>A){if(t.dtick=pt(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=Z.getTickFormat(t),u="period"===t.ticklabelmode;u&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),u&&(t._dowTick0=t.tick0)}}else o>C?t.dtick=pt(e,C,it):o>L?t.dtick=pt(e,L,ot):o>I?t.dtick=pt(e,I,ot):(n=i(10),t.dtick=pt(e,n,at))}else if("log"===t.type){t.tick0=0;var c=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var p=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/p,n=i(10),t.dtick="L"+pt(e,n,at)}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))):Pt(t)?(t.tick0=0,n=1,t.dtick=pt(e,n,ct)):(t.tick0=0,n=i(10),t.dtick=pt(e,n,at));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},Z.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?ut:lt,p=t+.01*o,h=s.roundUp(s.mod(p,1),c,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},Z.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=gt(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var p=Math.round(l),h=Math.abs(p),f=t.exponentformat;"power"===f||mt(f)&&yt(p)?(e.text=0===p?1:1===p?"10":"10"+(p>1?"":P)+h+"",e.fontSize*=1.25):("e"===f||"E"===f)&&h>2?e.text="1"+f+(p>0?"+":P)+h:(e.text=gt(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):Pt(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=gt(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=gt(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=gt(e.x,t,a,n)}(t,o,0,u,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},Z.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return Z.hoverLabelText(t,n,r)+" - "+Z.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=Z.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":P+o:o};var dt=["f","p","n","\u03bc","m","","k","M","G","T"];function mt(t){return"SI"===t||"B"===t}function yt(t){return t>14||t<-15}function gt(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=Z.getTickFormat(e),p=e.separatethousands;if(n){var h={exponentformat:l,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]};ht(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,P);var f,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+f+"":"B"===l&&9===u?t+="B":mt(l)&&(t+=dt[u/3+5]));return i?P+t:t}function vt(t,e){if(t){var r=Object.keys(B).reduce((function(t,r){return-1!==e.indexOf(r)&&B[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function _t(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-p:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?p-r.top:0,h),f.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var g=e._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?p-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-p:0,h),f.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var _=e._offset-r.top;_>0&&(n.yt=1,n.t=_)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==u._dfltTitle[d]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[m]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[m]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}at&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(vt(n,e.automargin),vt(a,e.automargin)),i.autoMargin(t,Mt(e),n),i.autoMargin(t,At(e),a),i.autoMargin(t,St(e),s)})),r.skipTitle||at&&"bottom"===e.side||rt.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+wt(e);else{var s=Dt(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(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 u,p,f,d,m=Z.getPxPosition(t,e);"x"===i?(p=e._offset+e._length/2,f="top"===e.side?m-r:m+r):(f=e._offset+e._length/2,p="right"===e.side?m+r:m-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var y=e._selections[e._id+"tick"];if(d={selection:y,side:e.side},y&&y.node()&&y.node().parentNode){var g=h.getTranslate(y.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:u,attributes:{x:p,y:f,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function it(t){var r=f+(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=kt(this),e=h.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]}},Z.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],a=t.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},Z.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},Z.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"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,p=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*U,p+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,p+=3);s&&"top"===u&&(p-=h*(1-U));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(p=-p);return[l?c:0,s?p:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(xt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(xt(e)))}},Z.makeTickPath=function(t,e,r,n){n||(n={});var a=n.minor;if(a&&!t.minor)return"";var i=void 0!==n.len?n.len:a?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+i*r:"M"+(e+s*r)+",0h"+i*r},Z.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,p=i("inside"),h="inside"===n&&"inside"===t.ticks||!p&&"outside"===t.ticks&&"boundaries"!==t.tickson,f=0,d=0,m=h?t.ticklen:0;if(p?m*=-1:c&&(m=0),h&&(f+=m,r)){var y=s.deg2rad(r);f=m*Math.cos(y)+1,d=m*Math.sin(y)}t.showticklabels&&(h||t.showline)&&(f+=.2*t.tickfont.size);var g,v,_,x,b,w={labelStandoff:f+=(t.linewidth||1)/2*(p?-1:1),labelShift:d},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)x=(b=!p&&"bottom"===k||p&&"top"===k)?1:-1,p&&(x*=-1),g=d*x,v=e+f*x,_=b?1:-.2,90===Math.abs(A)&&(p?_+=j:_=-90===A&&"bottom"===k?U:90===A&&"top"===k?j:.5,T=j/2*(A/90)),w.xFn=function(t){return t.dx+g+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*_},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==p?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==p?-n:0};else if("y"===M){if(x=(b=!p&&"left"===k||p&&"right"===k)?1:-1,p&&(x*=-1),g=f,v=d*x,_=0,p||90!==Math.abs(A)||(_=-90===A&&"left"===k||90===A&&"right"===k?U:.5),p){var S=a(A)?+A:0;if(0!==S){var C=s.deg2rad(S);T=Math.abs(Math.sin(C))*U*x,_=0}}w.xFn=function(t){return t.dx+e-(g+t.fontSize*_)*x+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*j},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Z.drawTicks=function(t,e,r){r=r||{};var a=e._id+"tick",i=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,bt);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return p.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),zt(e,[R]),o.attr("transform",r.transFn)},Z.drawGrid=function(t,e,r){r=r||{};var a=e._id+"grid",i=e.minor&&e.minor.showgrid,o=i?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&Z.shouldShowZeroLine(t,e,l))for(var u="array"===e.tickmode,c=0;c=0;g--){var v=g?m:y;if(v){var _=v.selectAll("path."+a).data(g?s:o,bt);_.exit().remove(),_.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),_.attr("transform",r.transFn).attr("d",r.path).each((function(t){return p.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&_.attr("d",r.path)}}zt(e,[z,O])},Z.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",a=Z.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 Y(t.id,e.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(p.stroke,e.zerolinecolor||p.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),zt(e,[D])},Z.drawLabels=function(t,e,r){r=r||{};var i=t._fullLayout,o=e._id,c=o.charAt(0),p=r.cls||o+"tick",f=r.vals.filter((function(t){return t.text})),d=r.labelFns,m=r.secondary?0:e.tickangle,y=(e._prevTickAngles||{})[p],g=r.layer.selectAll("g."+p).data(e.showticklabels?f:[],bt),v=[];function _(t,i){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),c=d.anchorFn(t,i),p=r.transFn.call(o.node(),t)+(a(i)&&0!=+i?" rotate("+i+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),f=u.lineCount(o),m=V*t.fontSize,y=d.heightFn(t,a(i)?+i:0,(f-1)*m);if(y&&(p+=l(0,y)),s.empty()){var g=o.select("text");g.attr({transform:p,"text-anchor":c}),g.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=h.bBox(s.node()).width*{end:-.5,start:.5}[c];s.attr("transform",p+l(v,0))}}))}g.enter().append("g").classed(p,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),a=t._promises.length;r.call(u.positionText,d.xFn(e),d.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(u.convertToTspans,t),t._promises[a]?v.push(t._promises.pop().then((function(){_(r,m)}))):_(r,m)})),zt(e,[F]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(t){n.select(this).select("text").call(u.positionText,d.xFn(t),d.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,u=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var c=s.simpleMap(e.range,e.r2l);l=e.l2p(c[0])+e._offset,u=e.l2p(c[1])+e._offset}var p=Math.min(l,u),f=Math.max(l,u),d=e.side,m=1/0,y=-1/0;for(var v in g.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=h.bBox(r.node()),s=0;o?(i.right>f||i.leftf||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},_(g,y+1?y:m);var x=null;e._selections&&(e._selections[p]=g);var b=[function(){return v.length&&Promise.all(v)}];e.automargin&&i._redrawFromAutoMarginCount&&90===y?(x=90,b.push((function(){_(g,y)}))):b.push((function(){if(_(g,m),f.length&&"x"===c&&!a(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(g.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=kt(this),o=h.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=f.length,l=Math.abs((f[o-1].x-f[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",p=function(t){return-1!==u.indexOf(t)},d=p("top"),y=p("left"),v=p("right"),b=p("bottom")||y||d||v?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var y="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=p(r),a=0,o=0,s={},c=0;c2*a}(a,y)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,u,c="";if(2===o.length)for(s=0;s<2;s++)if(u=x(o[s])){c=y;break}var p=a("pattern",c);if(p===y)for(s=0;s<2;s++)(u=x(o[s]))&&(e.bounds[s]=o[s]=u-1);if(p)for(s=0;s<2;s++)switch(u=o[s],p){case y:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[s]=o[s]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[s]=o[s]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]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":349,"./constants":312}],310:[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 s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function y(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*_)||T)for(r=0;rD&&FP&&(P=F);h/=(P-I)/(2*E),I=l.l2r(I),P=l.l2r(P),l.range=l._input.range=S=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",u(r,n)).attr("d",a+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:p.background,stroke:p.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(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"),V(t,e,a,i)}function V(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 q(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Z(t){E&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),E=!1)}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/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,i){for(var o,s,l,u,c=!1,p={},h={},f=(i||{}).xaHash,d=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(q(a),2!==t||gt||Zt(),yt)o.indexOf("select")>-1&&S(r,a,J,K,e.id,Pt),o.indexOf("event")>-1&&f.click(a,r,e.id);else if(1===t&>){var s=m?D:E,u="s"===m||"w"===g?0:1,p=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,u),d="left",y="middle";if(s.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===g&&(d="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:y}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,p,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ft*e+bt)),a=Math.max(0,Math.min(et,dt*r+wt)),i=Math.abs(n-bt),o=Math.abs(a-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,a),Tt.b=Math.max(wt,a),rt.isSubplotConstrained)i>P||o>P?(St="xy",i/tt>o/et?(o=i*et/tt,wt>a?Tt.t=wt-o:Tt.b=wt+o):(i=o*tt/et,bt>n?Tt.l=bt-i:Tt.r=bt+i),Lt.attr("d",H(Tt))):s();else if(nt.isSubplotConstrained)if(i>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),u=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=u*tt,Tt.b=(1-l)*et,Tt.t=(1-u)*et,Lt.attr("d",H(Tt))}else s();else!it||o0){var c;if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;cm[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":258,"fast-isnumeric":28}],322:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,a,i){i||(i={});var o=i.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":325}],323:[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":231}],324:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,p=i.ensureNumber,h=i.isArrayOrTypedArray,f=t("../../constants/numerical"),d=f.FP_SAFE,m=f.BADNUM,y=f.LOG_CLIP,g=f.ONEWEEK,v=f.ONEDAY,_=f.ONEHOUR,x=f.ONEMIN,b=f.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,M=T.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function C(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*y*Math.abs(n-a))}return m}function L(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function I(e,r,n){return u(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function E(e){if(S(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 m}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function O(t){return s(t)?+t:D(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===f;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lc)){o=i<(u+c)/2?l:l+1;break}o=l+1}var p=t._B[o]||0;return isFinite(p)?R(e,t._m2,p):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?C:p,t.l2c="log"===t.type?A:p,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(C(t,e))}:B,t.p2c="log"===t.type?function(t){return A(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=p,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=p):"log"===t.type?(t.d2r=t.d2l=function(t,e){return C(l(t),e)},t.r2d=t.r2c=function(t){return A(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=p,t.c2r=C,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=p):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=I,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return I(N(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=E,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=p,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:p(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=p,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:p(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var p=[[0,{}],[0,{}]],d=[];for(a=0;ad&&(o[n]=d),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),p="y"===f;if((p?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(p?c:u)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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 y(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,p=!!e.xr1,h=!!e.yr1,f=[];if(p){var d=i.simpleMap(e.xr0,a.r2l),m=i.simpleMap(e.xr1,a.r2l),y=d[1]-d[0],g=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,f[2]=u*(1-r+r*g/y),a.range[0]=a.l2r(d[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=u;if(h){var v=i.simpleMap(e.yr0,l.r2l),_=i.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],b=_[1]-_[0];f[1]=(v[1]*(1-r)+r*_[1]-v[1])/(v[0]-v[1])*c,f[3]=c*(1-r+r*b/x),l.range[0]=a.l2r(v[0]*(1-r)+r*_[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*_[1])}else f[1]=0,f[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=p?u/f[2]:1,T=h?c/f[3]:1,k=p?f[0]:0,M=h?f[1]:0,A=p?f[0]/f[2]*u:0,S=h?f[1]/f[3]*c:0,C=a._offset-A,L=l._offset-S;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,C,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":137,"../../lib":258,"../../registry":349,"./axes":305,"@plotly/d3":12}],330:[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,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(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,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",p=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var f=i(u),d=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;pOpenStreetMap contributors',i=['\xa9 Carto',a].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":279}],339:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(a){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(i){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":258}],340:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),a=t("../../lib"),i=a.strTranslate,o=a.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),u=t("@plotly/d3"),c=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),h=t("./mapbox"),f=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==f.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,i=e._subplots.mapbox;if(n.version!==f.requiredVersion)throw new Error(f.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l1&&a.warn(f.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,i);n.accessToken=o;for(var l=0;lb/2){var w=g.split("|").join("
");_.text(w).attr("data-unformatted",w).call(p.convertToTspans,t),x=c.bBox(_.node())}_.attr("transform",i(-3,8-x.height)),v.insert("rect",".static-attribution").attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;x.width+6>b&&(T=b/(x.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];v.attr("transform",i(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function c(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",i.tileSize=256):"image"===r&&(e="url",i.coordinates=t.coordinates);i[e]=n,t.sourceattribution&&(i.attribution=a(t.sourceattribution));return i}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&y(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&u.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,o=t.dragmode;i=function(t,r){r.isRect?(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(u)};var s=e.dragOptions;e.dragOptions=a.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||p(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){f(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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),s.text(o.text()&&l.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 T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,p,n),x.cleanPlot(h,l,p,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var p=1-2*s;n=Math.round(p*n),a=Math.round(p*a)}}var h=x.layoutAttributes.width.min,f=x.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,u=e._basePlotModules,p=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(p),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var _=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:_,size:r.l+y},r:{val:b,size:r.r+y},b:{val:T,size:r.b+y},t:{val:w,size:r.t+y}},m[e]=1}else delete d[e],delete m[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={}),I(e);var a=e._size,i=e.margin,l=c.extendFlat({},a),u=i.l,p=i.r,h=i.t,d=i.b,m=e._pushmargin,y=e._pushmarginIds,g=e.minreducedwidth,v=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var _ in m)y[_]||delete m[_];for(var b in m.base={l:{val:0,size:u},r:{val:1,size:p},t:{val:1,size:h},b:{val:0,size:d}},m){var w=m[b].l||{},T=m[b].b||{},k=w.val,M=w.size,A=T.val,S=T.size;for(var C in m){if(o(M)&&m[C].r){var L=m[C].r.val,P=m[C].r.size;if(L>k){var E=(M*L+(P-r)*k)/(L-k),D=(P*(1-k)+(M-r)*(1-L))/(L-k);E+D>u+p&&(u=E,p=D)}}if(o(S)&&m[C].t){var z=m[C].t.val,O=m[C].t.size;if(z>A){var R=(S*z+(O-n)*A)/(z-A),F=(O*(1-A)+(S-n)*(1-z))/(z-A);R+F>d+h&&(d=R,h=F)}}}}}var B=c.constrain(r-i.l-i.r,2,g),N=c.constrain(n-i.t-i.b,2,v),j=Math.max(0,r-B),U=Math.max(0,n-N);if(j){var V=(u+p)/j;V>1&&(u/=V,p/=V)}if(U){var q=(d+h)/U;q>1&&(d/=q,h/=q)}if(a.l=Math.round(u),a.r=Math.round(p),a.t=Math.round(h),a.b=Math.round(d),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var Z=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],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;r1)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,s=a?t._fullLayout:t.layout,l=(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 p={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(p.layout=u(s),a)){var h=s._size;p.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(p.frames=u(l)),i&&(p.config=u(t._context,!0)),"object"===n?p:JSON.stringify(p)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,u,p),a=0;a0){for(var n=[],a=0;a-1&&(p[f[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(b),b=(b=b.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(b=(b=(b=b.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),b}},{"../components/color":115,"../components/drawing":137,"../constants/xmlns_namespaces":237,"../lib":258,"@plotly/d3":12}],358:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=a.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},a.geojson,{}),featureidkey:a.featureidkey,text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":114,"../../components/colorscale/attributes":122,"../../lib/extend":250,"../../plots/attributes":301,"../../plots/template_attributes":348,"../scattergeo/attributes":408}],359:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p")}(t,p,o),[t]}},{"../../lib":258,"../../plots/cartesian/axes":305,"./attributes":358}],362:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new o(t,r.uid),i=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":338,"./convert":364}],368:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:a(),showlegend:s({},i.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":122,"../../lib/extend":250,"../../plots/attributes":301,"../../plots/template_attributes":348,"../scattermapbox/attributes":410}],369:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=a(u)&&u.length,p=0;p0?+f[c]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(c=1;c=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new i(t,r.uid),o=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":338,"./convert":370}],376:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],377:[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;rl&&I[g].gap;)g--;for(_=I[g].s,m=I.length-1;m>g;m--)I[m].s=_;for(;lA[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],387:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),p=t("./marker_defaults"),h=t("./line_defaults"),f=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults"),y=t("../../lib").coercePattern;e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,i,r,a)}var _=l(t,e,g,v);if(_||(e.visible=!1),e.visible){u(t,e,g,v),v("xhoverformat"),v("yhoverformat");var x=c(t,e,g,v),b=!x&&_=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.x)-d);return i=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(f.c2p(t.y)-m);return iY!=(N=z[E][1])>=Y&&(R=z[E-1][0],F=z[E][0],N-B&&(O=R+(F-R)*(Y-B)/(N-B),q=Math.min(q,O),Z=Math.max(Z,O)));q=Math.max(q,0),Z=Math.min(Z,h._length);var W=s.defaultLine;return s.opacity(p.fillcolor)?W=p.fillcolor:s.opacity((p.line||{}).color)&&(W=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:q,x1:Z,y0:Y,y1:Y,color:W,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":115,"../../components/fx":155,"../../lib":258,"../../registry":349,"./get_trace_color":390}],392:[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":317,"./arrays_to_calcdata":379,"./attributes":380,"./calc":381,"./cross_trace_calc":385,"./cross_trace_defaults":386,"./defaults":387,"./format_labels":389,"./hover":391,"./marker_colorbar":398,"./plot":401,"./select":402,"./style":404,"./subtypes":405}],393:[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,s,l){l||(l={});var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":125,"../../components/colorscale/helpers":126,"../../lib":258}],394:[function(t,e,r){"use strict";var n=t("../../components/drawing"),a=t("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,s=o+.5,l=o-.5,u=t("../../lib"),c=u.segmentsIntersect,p=u.constrain,h=t("./constants");e.exports=function(t,e){var r,a,o,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S,C=e.trace||{},L=e.xaxis,I=e.yaxis,P="log"===L.type,E="log"===I.type,D=L._length,z=I._length,O=e.backoff,R=C.marker,F=e.connectGaps,B=e.baseTolerance,N=e.shape,j="linear"===N,U=C.fill&&"none"!==C.fill,V=[],q=h.minTolerance,Z=t.length,H=new Array(Z),G=0;function Y(r){var n=t[r];if(!n)return!1;var a=e.linearized?L.l2p(n.x):L.c2p(n.x),o=e.linearized?I.l2p(n.y):I.c2p(n.y);if(a===i){if(P&&(a=L.c2p(n.x,!0)),a===i)return!1;E&&o===i&&(a*=Math.abs(L._m*z*(L._m>0?s:l)/(I._m*D*(I._m>0?s:l)))),a*=1e3}if(o===i){if(E&&(o=I.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function W(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&uot||t[1]lt)return[p(t[0],it,ot),p(t[1],st,lt)]}function pt(t,e){return t[0]===e[0]&&(t[0]===it||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function ht(t,e,r){return function(n,a){var i=ct(n),o=ct(a),s=[];if(i&&o&&pt(i,o))return s;i&&s.push(i),o&&s.push(o);var l=2*u.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);l&&((i&&o?l>0==i[t]>o[t]?i:o:i||o)[t]+=l);return s}}function ft(t){var e=t[0],r=t[1],n=e===H[G-1][0],a=r===H[G-1][1];if(!n||!a)if(G>1){var i=e===H[G-2][0],o=r===H[G-2][1];n&&(e===it||e===ot)&&i?o?G--:H[G-1]=t:a&&(r===st||r===lt)&&o?i?G--:H[G-1]=t:H[G++]=t}else H[G++]=t}function dt(t){H[G-1][0]!==t[0]&&H[G-1][1]!==t[1]&&ft([$,tt]),ft(t),et=null,$=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=ut[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(G)if(et){var n=nt(et,e);n.length>1&&(dt(n[0]),H[G++]=n[1])}else rt=nt(H[G-1],e)[0],H[G++]=rt;else H[G++]=[K||e[0],Q||e[1]];var a=H[G-1];K&&Q&&(a[0]!==K||a[1]!==Q)?(et&&($!==K&&tt!==Q?ft($&&tt?(i=et,s=(o=e)[0]-i[0],l=(o[1]-i[1])/s,(i[1]*o[0]-o[1]*i[0])/s>0?[l>0?it:ot,lt]:[l>0?ot:it,st]):[$||K,tt||Q]):$&&tt&&ft([$,tt])),ft([K,Q])):$-K&&tt-Q&&ft([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&dt(nt(et,e)[0]),H[G++]=e;var i,o,s,l}for(r=0;rX(m,gt))break;o=m,(w=v[0]*g[0]+v[1]*g[1])>x?(x=w,f=m,y=!1):w=t.length||!m)break;yt(m),a=m}}else yt(f)}et&&ft([$||et[0],tt||et[1]]),V.push(H.slice(0,G))}var vt=N.slice(N.length-1);if(O&&"h"!==vt&&"v"!==vt){for(var _t=!1,xt=-1,bt=[],wt=0;wt=0?l=f:(l=f=h,h++),l0?Math.max(r,i):0}}},{"fast-isnumeric":28}],398:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],399:[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,s,l,u){var c=o.isBubble(t),p=(t.line||{}).color;(u=u||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),u.noAngle||(l("marker.angle"),u.noAngleRef||l("marker.angleref"),u.noStandOff||l("marker.standoff")),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:c?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":115,"../../components/colorscale/defaults":125,"../../components/colorscale/helpers":126,"./subtypes":405}],400:[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 s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":236,"../../lib":258}],401:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),p=t("./link_traces"),h=t("../../lib/polygon").tester;function f(t,e,r,p,f,d,m){var y;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),p=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var f=h.marker.maxdisplayed;if(0===f)return;var d=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=p[0]&&t.y<=p[1]})),m=Math.ceil(d.length/f),y=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return g?t.transition():t}var _=r.xaxis,x=r.yaxis,b=p[0].trace,w=b.line,T=n.select(d),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),S=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var C,L;v(T).style("opacity",b.opacity);var I=b.fill.charAt(b.fill.length-1);"x"!==I&&"y"!==I&&(I=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,E,D="",z=[],O=b._prevtrace;O&&(D=O._prevRevpath||"",L=O._nextFill,z=O._polygons);var R,F,B,N,j,U,V,q="",Z="",H=[],G=i.noop;if(C=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(L&&L.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},H=c(p,{xaxis:_,yaxis:x,trace:b,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(H.length),y=0;y1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",P),l.singleLineStyle(p,a)}}}}}var Y=M.selectAll(".js-line").data(H);v(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(G(!0)),l.setClipUrl(Y,r.layerClipId,t),H.length?(C?(C.datum(p),N&&U&&(I?("y"===I?N[1]=U[1]=x.c2p(0,!0):"x"===I&&(N[0]=U[0]=_.c2p(0,!0)),v(C).attr("d","M"+U+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle,t)):v(C).attr("d",q+"Z").call(l.singleFillStyle,t))):L&&("tonext"===b.fill.substr(0,6)&&q&&D?("tonext"===b.fill?v(L).attr("d",q+"Z"+D+"Z").call(l.singleFillStyle,t):v(L).attr("d",q+"L"+D.substr(1)+"Z").call(l.singleFillStyle,t),b._polygons=b._polygons.concat(z)):(X(L),b._polygons=null)),b._prevRevpath=Z,b._prevPolygons=V):(C?X(C):L&&X(L),b._polygons=b._prevRevpath=b._prevPolygons=null),A.datum(p),S.datum(p),function(e,a,i){var o,c=i[0].trace,p=u.hasMarkers(c),h=u.hasText(c),f=tt(c),d=et,m=et;if(p||h){var y=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?y=w?K:J:b&&!w&&(y=Q),p&&(d=y),h&&(m=y)}var T,k=(o=e.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);g&&k.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),p&&(T=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=v(a);l.translatePoint(e,i,_,x)?(l.singlePointStyle(e,i,c,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,_,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=v(e.select("text"));l.translatePoint(t,a,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(A,S,p);var W=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(A,W,t),l.setClipUrl(S,W,t)}function X(t){v(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,d=!i,m=!!i&&i.duration>0,y=p(t,e,r);((c=a.selectAll("g.trace").data(y,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),m)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){f(t,n,e,r,y,this,i)}))}))):c.each((function(r,n){f(t,n,e,r,y,this,i)}));d&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":137,"../../lib":258,"../../lib/polygon":270,"../../registry":349,"./line_points":394,"./link_traces":396,"./subtypes":405,"@plotly/d3":12}],402:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r")}function c(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,c=o[0].trace,p=t.xa,h=t.ya,f=t.subplot,d=[],m=l+c.uid+"-circle",y=c.cluster&&c.cluster.enabled;if(y){var g=f.map.queryRenderedFeatures(null,{layers:[m]});d=g.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),_=e-v;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;if(y&&-1===d.indexOf(t.i+1))return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=f.project([n,i]),l=o.x-p.c2p([_,i]),u=o.y-h.c2p([n,r]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-c,1-3/c)}),t),!1!==t.index){var x=o[t.index],b=x.lonlat,w=[a.modHalf(b[0],360)+v,b[1]],T=p.c2p(w),k=h.c2p(w),M=x.mrc||1;t.x0=T-M,t.x1=T+M,t.y0=k-M,t.y1=k+M;var A={};A[c.subplot]={_subplot:f};var S=c._module.formatLabels(x,c,A);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(c,x),t.extraText=u(c,x,o[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:u}},{"../../components/fx":155,"../../constants/numerical":236,"../../lib":258,"../../plots/mapbox/constants":338,"../scatter/get_trace_color":390}],416:[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("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":340,"../scatter/marker_colorbar":398,"../scattergeo/calc":409,"./attributes":410,"./defaults":412,"./event_data":413,"./format_labels":414,"./hover":415,"./plot":417,"./select":418}],417:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(t,e,r,n){this.type="scattermapbox",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol",cluster:i+e+"-cluster",clusterCount:i+e+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(t,e,r){var a={type:"geojson",data:e.geojson};r&&r.enabled&&n.extendFlat(a,{cluster:!0,clusterMaxZoom:r.maxzoom}),this.subplot.map.addSource(this.sourceIds[t],a)},l.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},l.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter),this.subplot.addLayer(n,r)},l.update=function(t){var e=t[0].trace,r=this.subplot,n=r.map,i=a(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),u=!!this.clusterEnabled,c=this;function p(t){u?function(t){for(var e=o.cluster,r=e.length-1;r>=0;r--){var a=e[r];n.removeLayer(c.layerIds[a])}t||n.removeSource(c.sourceIds.circle)}(t):function(t){for(var e=o.nonCluster,r=e.length-1;r>=0;r--){var a=e[r];n.removeLayer(c.layerIds[a]),t||n.removeSource(c.sourceIds[a])}}(t)}function h(t){l?function(t){t||c.addSource("circle",i.circle,e.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,n,i,l=e[0].trace,u=l.cluster&&l.cluster.enabled,c=!0!==l.visible,p=new s(t,l.uid,u,c),h=a(t.gd,e),f=p.below=t.belowLookup["trace-"+l.uid];if(u)for(p.addSource("circle",h.circle,l.cluster),r=0;ra&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),h),_={},x={},b=0;d?(y=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set(new Array(p))},g=function(t,e){var r=_[t.astr][e];t.get()[e]=r}):(y=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set([])},g=function(t,e){var r=_[t.astr][e];t.get().push(r)}),k(y);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-a>t&&(i-u)*(a-c)/(o-c)+u-n>t&&(s=!s),i=u,o=c}return s}};return e}},{}],73:[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;a0}))}function c(t,n){var a=t.seg,i=n.seg,o=a.start,s=a.end,u=i.start,c=i.end;r&&r.checkIntersection(a,i);var p=e.linesIntersect(o,s,u,c);if(!1===p){if(!e.pointsCollinear(o,s,u))return!1;if(e.pointsSame(o,c)||e.pointsSame(s,u))return!1;var h=e.pointsSame(o,u),f=e.pointsSame(s,c);if(h&&f)return n;var d=!h&&e.pointBetween(o,u,c),m=!f&&e.pointBetween(s,u,c);if(h)return m?l(n,s):l(t,c),n;d&&(f||(m?l(n,s):l(t,c)),l(n,o))}else 0===p.alongA&&(-1===p.alongB?l(t,u):0===p.alongB?l(t,p.pt):1===p.alongB&&l(t,c)),0===p.alongB&&(-1===p.alongA?l(n,o):0===p.alongA?l(n,p.pt):1===p.alongA&&l(n,s));return!1}for(var p=[];!i.isEmpty();){var h=i.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var f=u(h),d=f.before?f.before.ev:null,m=f.after?f.after.ev:null;function y(){if(d){var t=c(h,d);if(t)return t}return!!m&&c(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var g,v=y();if(v){var _;if(t)(_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(v.seg),h.other.remove(),h.remove()}if(i.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)_=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:a,h.seg.myFill.above=_?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)g=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:a,h.seg.otherFill={above:g,below:g};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=f.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&c(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}p.push(h.seg)}i.getHead().remove()}return r&&r.done(),p}return t?{addRegion:function(t){for(var n,a,i,o=t[t.length-1],l=0;l1)for(var r=1;r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,a((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":78,timers:79}],80:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,a=0,i=t.round,o=t.min,s=t.max,l=t.random;function u(e,l){if(l=l||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,l);var c=function(e){var a={r:0,g:0,b:0},i=1,l=null,u=null,c=null,p=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,a=!1;if(S[t])t=S[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:E(e[1]),g:E(e[2]),b:E(e[3]),a:R(e[4]),format:a?"name":"hex8"};if(e=j.hex6.exec(t))return{r:E(e[1]),g:E(e[2]),b:E(e[3]),format:a?"name":"hex"};if(e=j.hex4.exec(t))return{r:E(e[1]+""+e[1]),g:E(e[2]+""+e[2]),b:E(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:a?"name":"hex8"};if(e=j.hex3.exec(t))return{r:E(e[1]+""+e[1]),g:E(e[2]+""+e[2]),b:E(e[3]+""+e[3]),format:a?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(f=e.r,d=e.g,m=e.b,a={r:255*I(f,255),g:255*I(d,255),b:255*I(m,255)},p=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),u=z(e.v),a=function(e,r,n){e=6*I(e,360),r=I(r,100),n=I(n,100);var a=t.floor(e),i=e-a,o=n*(1-r),s=n*(1-i*r),l=n*(1-(1-i)*r),u=a%6;return{r:255*[n,s,o,o,l,n][u],g:255*[l,n,n,s,o,o][u],b:255*[o,o,l,n,n,s][u]}}(e.h,l,u),p=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),c=z(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=I(t,360),e=I(e,100),r=I(r,100),0===e)n=a=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),a=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(e.h,l,c),p=!0,h="hsl"),e.hasOwnProperty("a")&&(i=e.a));var f,d,m;return i=L(i),{ok:p,format:e.format||h,r:o(255,s(a.r,0)),g:o(255,s(a.g,0)),b:o(255,s(a.b,0)),a:i}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=i(100*this._a)/100,this._format=l.format||c.format,this._gradientType=l.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=c.ok,this._tc_id=a++}function c(t,e,r){t=I(t,255),e=I(e,255),r=I(r,255);var n,a,i=s(t,e,r),l=o(t,e,r),u=(i+l)/2;if(i==l)n=a=0;else{var c=i-l;switch(a=u>.5?c/(2-i-l):c/(i+l),i){case t:n=(e-r)/c+(e>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(u(n));return i}function A(t,e){e=e||6;for(var r=u(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/e;e--;)o.push(u({h:n,s:a,v:i})),i=(i+s)%1;return o}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=L(t),this._roundA=i(100*this._a)/100,this},toHsv:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=p(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=i(360*t.h),r=i(100*t.s),n=i(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(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=[D(i(t).toString(16)),D(i(e).toString(16)),D(i(r).toString(16)),D(O(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*I(this._r,255))+"%",g:i(100*I(this._g,255))+"%",b:i(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+i(100*I(this._r,255))+"%, "+i(100*I(this._g,255))+"%, "+i(100*I(this._b,255))+"%)":"rgba("+i(100*I(this._r,255))+"%, "+i(100*I(this._g,255))+"%, "+i(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+f(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(_,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(b,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)}},u.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:z(t[n]));t=r}return u(t,e)},u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},u.mix=function(t,e,r){r=0===r?0:r||50;var n=u(t).toRgb(),a=u(e).toRgb(),i=r/100;return u({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},u.readability=function(e,r){var n=u(e),a=u(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},u.isReadable=function(t,e,r){var n,a,i=u.readability(t,e);switch(a=!1,(n=function(t){var e,r;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},u.mostReadable=function(t,e,r){var n,a,i,o,s=null,l=0;a=(r=r||{}).includeFallbackColors,i=r.level,o=r.size;for(var c=0;cl&&(l=n,s=u(e[c]));return u.isReadable(t,s,{level:i,size:o})||!a?s:(r.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],r))};var S=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=u.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function I(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function E(t){return parseInt(t,16)}function D(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function O(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return E(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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 U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=u:window.tinycolor=u}(Math)},{}],81:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(t,e){if("string"==typeof t){var r=t.match(l);return r?r[0]:""}var n=this._validateYear(t),a=t.month(),i=""+this.toChineseMonth(n,a);return e&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(n,a)&&(i+="i"),i},monthNames:function(t){if("string"==typeof t){var e=t.match(u);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(c);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var a=e[e.length-1];r="i"===a||"I"===a}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var a=this.intercalaryMonth(t);if(r&&e!==a||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return a?!r&&e<=a?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var a,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,u=s>>5&15,c=31&s;(a=i.newDate(l,u,c)).add(4-(a.dayOfWeek()||7),"d");var p=this.toJD(t,e,r)-a.toJD();return 1+Math.floor(p/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=p[t-p[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(a.year()),e=a.month(),r=a.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,a){var i,o,s;if("object"==typeof t)o=t,i=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,i=n):(l=!!n,i=a||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var u,c=p[o.year-p[0]],f=c>>13;u=f&&(o.month>f||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return i.year=y.getFullYear(),i.month=1+y.getMonth(),i.day=y.getDate(),i}(t,s,r,o);return i.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=i.fromJD(t),r=function(t,e,r,n){var a,i;if("object"==typeof t)a=t,i=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");a={year:t,month:e,day:r},i=n||{}}var o=h[a.year-h[0]],s=a.year<<9|a.month<<5|a.day;i.year=s>=o?a.year:a.year-1,o=h[i.year-h[0]];var l,u=new Date(o>>9&4095,(o>>5&15)-1,31&o),c=new Date(a.year,a.month-1,a.day);l=Math.round((c-u)/864e5);var f,d=p[i.year-p[0]];for(f=0;f<13;f++){var m=d&1<<12-f?30:29;if(l>13;!y||f=2&&n<=6},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year()+(a.year()<0?1:0),e=a.month(),(r=a.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=i},{"../main":95,"object-assign":67}],84:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return(t=a.year())<0&&t++,a.day()+30*(a.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,a=e-30*(n-1)+1;return this.newDate(r,n,a)}}),n.calendars.ethiopian=i},{"../main":95,"object-assign":67}],85:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=i},{"../main":95,"object-assign":67}],86:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),t=t<=0?t+1:t,(r=a.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=i},{"../main":95,"object-assign":67}],87:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return t=a.year(),e=a.month(),r=a.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),a=Math.floor((e-n)/30.6001),i=a-Math.floor(a<14?1:13),o=r-Math.floor(i>2?4716:4715),s=e-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,i,s)}}),n.calendars.julian=i},{"../main":95,"object-assign":67}],88:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate).toJD(),i=this._toHaab(a),o=this._toTzolkin(a);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);return a.day()+20*a.month()+360*a.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=i},{"../main":95,"object-assign":67}],89:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar;var o=n.instance("gregorian");a(i.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidMonth);(t=a.year())<0&&t++;for(var i=a.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=i},{"../main":95,"object-assign":67}],90:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var u=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=i.daysInYear(u)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],i.newDate(u,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),a=e.dayOfYear(),i=r+56;this._createMissingCalendarData(i);for(var o=9,s=this.NEPALI_CALENDAR_DATA[i][0],l=this.NEPALI_CALENDAR_DATA[i][o]-s+1;a>l;)++o>12&&(o=1,i++),l+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(l-a);return this.newDate(i,o,u)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=a.year(),e=a.month(),r=a.day();var i=t-(t>=0?474:473),s=474+o(i,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(i/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),a=2820;if(1029982!==n){var i=Math.floor(n/366),s=o(n,366);a=Math.floor((2134*i+2816*s+2815)/1028522)+i+1}var l=a+2820*r+474;l=l<=0?l-1:l;var u=t-this.toJD(l,1,1)+1,c=u<=186?Math.ceil(u/31):Math.ceil((u-6)/30),p=t-this.toJD(l,c,1)+1;return this.newDate(l,c,p)}}),n.calendars.persian=i,n.calendars.jalali=i},{"../main":95,"object-assign":67}],92:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":95,"object-assign":67}],93:[function(t,e,r){var n=t("../main"),a=t("object-assign"),i=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,a(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return i.leapYear(t)},weekOfYear:function(t,e,r){var a=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(a.year());return i.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(a.year());return i.toJD(t,a.month(),a.day())},fromJD:function(t){var e=i.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":95,"object-assign":67}],94:[function(t,e,r){var n=t("../main"),a=t("object-assign");function i(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}i.prototype=new n.baseCalendar,a(i.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,a=0,i=0;ir)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var a=this._validate(t,e,r,n.local.invalidDate),i=12*(a.year()-1)+a.month()-15292;return a.day()+o[i-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var a=r+15292,i=Math.floor((a-1)/12),s=i+1,l=a-12*i,u=e-o[r-1]+1;return this.newDate(s,l,u)},isValid:function(t,e,r){var a=n.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(a=(t=null!=t.year?t.year:t)>=1276&&t<=1500),a},_validate:function(t,e,r,a){var i=n.baseCalendar.prototype._validate.apply(this,arguments);if(i.year<1276||i.year>1500)throw a.replace(/\{0\}/,this.local.name);return i}}),n.calendars.ummalqura=i;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":95,"object-assign":67}],95:[function(t,e,r){var n=t("object-assign");function a(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(a.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,a){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,a):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",a=0;r>0;){var i=r%10;n=(0===i?"":t[i]+e[a])+n,a++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(i.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),a=t.calendar().fromJD(n);return this._validateLevel--,[a.year(),a.month(),a.day()]}try{var i=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);a=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)i++,o-=e,e=t.monthsInYear(i)}(this),a=Math.min(a,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),a];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var a={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],i=r<0?-1:1;e=this._add(t,r*a[0]+i*a[1],a[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),a="m"===r?e:t.month(),i="d"===r?e:t.day();return"y"!==r&&"m"!==r||(i=Math.min(i,this.daysInMonth(n,a))),t.date(n,a,i)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var a=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),u=a-(l>2.5?4716:4715);return u<=0&&u--,this.newDate(u,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,u.local.invalidDate||u.regionalOptions[""].invalidDate),a=new Date(n.year(),n.month()-1,n.day());return a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.setHours(a.getHours()>12?a.getHours()+2:0),a},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var u=e.exports=new a;u.cdate=i,u.baseCalendar=s,u.calendars.gregorian=l},{"object-assign":67}],96:[function(t,e,r){var n=t("object-assign"),a=t("./main");n(a.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),a.local=a.regionalOptions[""],n(a.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(a.baseCalendar.prototype,{UNIX_EPOCH:a.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:a.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw a.local.invalidFormat||a.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,i,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,u=r.dayNames||this.local.dayNames,c=r.monthNumbers||this.local.monthNumbers,p=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,f=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var a=""+e;if(f(t,n))for(;a.length1},_=function(t,r){var n=v(t,r),i=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+i+"}"),s=e.substring(M).match(o);if(!s)throw(a.local.missingNumberAt||a.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,b=function(){if("function"==typeof l){v("m");var t=l.call(x,e.substring(M));return M+=t.length,t}return _("m")},w=function(t,r,n,i){for(var o=v(t,i)?n:r,s=0;s-1){f=1,d=m;for(var C=this.daysInMonth(h,f);d>C;C=this.daysInMonth(h,f))f++,d-=C}return p>-1?this.fromJD(p):this.newDate(h,f,d)},determineDate:function(t,e,r,n,a){r&&"object"!=typeof r&&(a=n,n=r,r=null),"string"!=typeof n&&(a=n,n="");var i=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return i.parseDate(n,t,a)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||i.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:i.today().add(t,"d"):i.newDate(t)}})},{"./main":95,"object-assign":67}],97:[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}]},{}],98:[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":232,"../../plot_api/plot_template":294,"../../plots/cartesian/constants":312,"../../plots/font_attributes":333,"./arrow_paths":97}],99:[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&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,i=n.charAt(0),o=t[i],s=t["a"+i],l=t[i+"ref"],u=t["a"+i+"ref"],c=t["_"+i+"padplus"],p=t["_"+i+"padminus"],h={x:1,y:-1}[i]*t[i+"shift"],f=3*t.arrowsize*t.arrowwidth||0,d=f+h,m=f-h,y=3*t.startarrowsize*t.arrowwidth||0,g=y+h,v=y-h;if(u===l){var _=a.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=a.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(c,g),ppadminus:Math.max(p,v)});r={min:[_.min[0],x.min[0]],max:[_.max[0],x.max[0]]}}else g=s?g+s:g,v=s?v-s:v,r=a.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(c,d,g),ppadminus:Math.max(p,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([i,o],t)}},{"../../lib":258,"../../plots/cartesian/axes":305,"./draw":104}],100:[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,l,u,c=t._fullLayout.annotations,p=[],h=[],f=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),u=l.on,c=l.off.concat(l.explicitOff),p={},h=t._fullLayout.annotations;if(!u.length&&!c.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,W=["x","y"],X=0;X1)&&(nt===rt?((ft=at.r2fraction(e["a"+et]))<0||ft>1)&&(Y=!0):Y=!0),J=at._offset+at.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],J=dt?at._offset+at._length*Q:J=T.l+T.w*Q):(Q=1-e[et],J=dt?at._offset+at._length*Q:J=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){pt.head=J;var mt=e["a"+et];if(tt=ot*Z(.5,e.xanchor)-st*Z(.5,e.yanchor),nt===rt){var yt=l.getRefType(nt);"domain"===yt?("y"===et&&(mt=1-mt),pt.tail=at._offset+at._length*mt):"paper"===yt?"y"===et?(mt=1-mt,pt.tail=T.t+T.h*mt):pt.tail=T.l+T.w*mt:pt.tail=at._offset+at.r2p(mt),K=tt}else pt.tail=J+mt,K=tt+mt;pt.text=pt.tail+tt;var gt=w["x"===et?"width":"height"];if("paper"===rt&&(pt.head=o.constrain(pt.head,1,gt-1)),"pixel"===nt){var vt=-Math.max(pt.tail-3,pt.text),_t=Math.min(pt.tail+3,pt.text)-gt;vt>0?(pt.tail+=vt,pt.text+=vt):_t>0&&(pt.tail-=_t,pt.text-=_t)}pt.tail+=ct,pt.head+=ct}else K=tt=lt*Z($,ut),pt.text=J+tt;pt.text+=ct,tt+=ct,K+=ct,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var xt=0,bt=0;if("left"!==e.align&&(xt=(M-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(bt=(O-b)*("middle"===e.valign?.5:1)),p)n.select("svg").attr({x:N+xt-1,y:N+bt}).call(c.setClipUrl,U?L:null,t);else{var wt=N+bt-m.top,Tt=N+xt-m.left;H.call(h.positionText,Tt,wt).call(c.setClipUrl,U?L:null,t)}V.select("rect").call(c.setRect,N,N,M,O),j.call(c.setRect,F/2,F/2,B-F,q-F),R.call(c.setTranslate,Math.round(I.x.text-B/2),Math.round(I.y.text-q/2)),D.attr({transform:"rotate("+P+","+I.x.text+","+I.y.text+")"});var kt,Mt=function(r,n){E.selectAll(".annotation-arrow-g").remove();var l=I.x.head,p=I.y.head,h=I.x.tail+r,f=I.y.tail+n,m=I.x.text+r,x=I.y.text+n,b=o.rotationXYMatrix(P,m,x),w=o.apply2DTransform(b),M=o.apply2DTransform2(b),L=+j.attr("width"),z=+j.attr("height"),O=m-.5*L,F=O+L,B=x-.5*z,N=B+z,U=[[O,B,O,N],[O,N,F,N],[F,N,F,B],[F,B,O,B]].map(M);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,p,l+1e6,p+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,f,l,p,t[0],t[1],t[2],t[3]);e&&(h=e.x,f=e.y)}));var V=e.arrowwidth,q=e.arrowcolor,Z=e.arrowside,H=E.append("g").style({opacity:u.opacity(q)}).classed("annotation-arrow-g",!0),G=H.append("path").attr("d","M"+h+","+f+"L"+l+","+p).style("stroke-width",V+"px").call(u.stroke,u.rgb(q));if(y(G,Z,e),k.annotationPosition&&G.node().parentNode&&!i){var Y=l,W=p;if(e.standoff){var X=Math.sqrt(Math.pow(l-h,2)+Math.pow(p-f,2));Y+=e.standoff*(h-l)/X,W+=e.standoff*(f-p)/X}var J,K,Q=H.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-Y)+","+(f-W),transform:s(Y,W)}).style("stroke-width",V+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=c.getTranslate(R);J=t.x,K=t.y,g&&g.autorange&&A(g._name+".autorange",!0),_&&_.autorange&&A(_._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),a=n[0]+t,i=n[1]+r;R.call(c.setTranslate,a,i),S("x",v(g,t,"x",T,e)),S("y",v(_,r,"y",T,e)),e.axref===e.xref&&S("ax",v(g,t,"ax",T,e)),e.ayref===e.yref&&S("ay",v(_,r,"ay",T,e)),H.attr("transform",s(t,r)),D.attr({transform:"rotate("+P+","+a+","+i+")"})},doneFn:function(){a.call("_guiRelayout",t,C());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Mt(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=D.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",v(g,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",v(_,r,"ay",T.w,e)):S("ay",e.ay+r),Mt(t,r);else{if(i)return;var a,o;if(g)a=v(g,t,"x",T,e);else{var l=e._xsize/T.w,u=e.x+(e._xshift-e.xshift)/T.w-l/2;a=d.align(u+t/T.w,l,0,1,e.xanchor)}if(_)o=v(_,r,"y",T,e);else{var c=e._ysize/T.h,p=e.y-(e._yshift+e.yshift)/T.h-c/2;o=d.align(p-r/T.h,c,0,1,e.yanchor)}S("x",a),S("y",o),g&&_||(n=d.getCursor(g?.5:a,_?.5:o,e.xanchor,e.yanchor))}D.attr({transform:s(t,r)+kt}),f(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",G(n))},doneFn:function(){f(R),a.call("_guiRelayout",t,C());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=0,_=e.indexOf("end")>=0,x=d.backoff*y+r.standoff,b=m.backoff*g+r.startstandoff;if("line"===f.nodeName){o={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var w=o.x-c.x,T=o.y-c.y;if(h=(p=Math.atan2(T,w))+Math.PI,x&&b&&x+b>Math.sqrt(w*w+T*T))return void z();if(x){if(x*x>w*w+T*T)return void z();var k=x*Math.cos(p),M=x*Math.sin(p);c.x+=k,c.y+=M,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>w*w+T*T)return void z();var A=b*Math.cos(p),S=b*Math.sin(p);o.x-=A,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===f.nodeName){var C=f.getTotalLength(),L="";if(C1){u=!0;break}}u?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=a(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":336,"../annotations/draw":104}],111:[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),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var a=n(e||u).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()},o.contrast=function(t,e,r){var a=n(t);return 1!==a.getAlpha()&&(a=n(o.combine(t,u))),(a.isDark()?e?a.lighten(e):u:r?a.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,a,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));a++)n>c&&n0?n>=l:n<=l));a++)n>r[0]&&n1){var ut=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ut*u.roundUp(lt/ut,[2,5,10]),(Math.abs(Z.start)/Z.size+1e-6)%1<2e-6&&(at.tick0=0)}at.dtick=ot}at.domain=o?[rt+E/R.h,rt+K-E/R.h]:[rt+P/R.w,rt+K-P/R.w],at.setScale(),t.attr("transform",c(Math.round(R.l),Math.round(R.t)));var ct,pt=t.select("."+M.cbtitleunshift).attr("transform",c(-Math.round(R.l),-Math.round(R.t))),ht=at.ticklabelposition,ft=at.title.font.size,dt=t.select("."+M.cbaxis),mt=0,yt=0;function gt(n,a){var i={propContainer:at,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:O._dfltTitle.colorbar,containerGroup:t.select("."+M.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,p(i,a||{}))}return u.syncOrAsync([i.previousPromises,function(){var t,e;(o&&it||!o&&!it)&&("top"===j&&(t=P+R.l+R.w*D,e=E+R.t+R.h*(1-rt-K)+3+.75*ft),"bottom"===j&&(t=P+R.l+R.w*D,e=E+R.t+R.h*(1-rt)-3-.25*ft),"right"===j&&(e=E+R.t+R.h*z+3+.75*ft,t=P+R.l+R.w*rt),gt(at._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!it||o&&it){var i,l=t.select("."+M.cbtitle),p=l.select("text"),h=[-A/2,A/2],d=l.select(".h"+at._id+"title-math-group").node(),m=15.6;if(p.node()&&(m=parseInt(p.node().style.fontSize,10)*w),d?(i=f.bBox(d),yt=i.width,(mt=i.height)>m&&(h[1]-=(mt-m)/2)):p.node()&&!p.classed(M.jsPlaceholder)&&(i=f.bBox(p.node()),yt=i.width,mt=i.height),o){if(mt){if(mt+=5,"top"===j)at.domain[1]-=mt/R.h,h[1]*=-1;else{at.domain[0]+=mt/R.h;var g=y.lineCount(p);h[1]+=(1-g)*m}l.attr("transform",c(h[0],h[1])),at.setScale()}}else yt&&("right"===j&&(at.domain[0]+=(yt+ft/2)/R.w),l.attr("transform",c(h[0],h[1])),at.setScale())}t.selectAll("."+M.cbfills+",."+M.cblines).attr("transform",o?c(0,Math.round(R.h*(1-at.domain[1]))):c(Math.round(R.w*at.domain[0]),0)),dt.attr("transform",o?c(0,Math.round(-R.t)):c(Math.round(-R.l),0));var v=t.select("."+M.cbfills).selectAll("rect."+M.cbfill).attr("style","").data(G);v.enter().append("rect").classed(M.cbfill,!0).style("stroke","none"),v.exit().remove();var _=U.map(at.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,i){var s=[0===i?U[0]:(G[i]+G[i-1])/2,i===G.length-1?U[1]:(G[i]+G[i+1])/2].map(at.c2p).map(Math.round);o&&(s[1]=u.constrain(s[1]+(s[1]>s[0])?1:-1,_[0],_[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)f.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var c=q(t).replace("e-","");l.attr("fill",a(c).toHexString())}}));var x=t.select("."+M.cblines).selectAll("path."+M.cbline).data(B.color&&B.width?Y:[]);x.enter().append("path").classed(M.cbline,!0),x.exit().remove(),x.each((function(t){var e=Q,r=Math.round(at.c2p(t))+B.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+W).call(f.lineGroupStyle,B.width,V(t),B.dash)})),dt.selectAll("g."+at._id+"tick,path").remove();var b=Q+W+(A||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(at),k=s.getTickSigns(at)[2];return s.drawTicks(r,at,{vals:"inside"===at.ticks?s.clipEnds(at,T):T,layer:dt,path:s.makeTickPath(at,b,k),transFn:s.makeTransTickFn(at)}),s.drawLabels(r,at,{vals:T,layer:dt,transFn:s.makeTransTickLabelFn(at),labelFns:s.makeLabelFns(at,b)})},function(){if(o&&!it||!o&&it){var t,a,i=at.position||0,s=at._offset+at._length/2;if("right"===j)a=s,t=R.l+R.w*i+10+ft*(at.showticklabels?1:.5);else if(t=s,"bottom"===j&&(a=R.t+R.h*i+10+(-1===ht.indexOf("inside")?at.tickfont.size:0)+("intside"!==at.ticks&&e.ticklen||0)),"top"===j){var l=N.text.split("
").length;a=R.t+R.h*i+10-W-w*ft*l}gt((o?"h":"v")+at._id+"title",{avoid:{selection:n.select(r).selectAll("g."+at._id+"tick"),side:j,offsetTop:o?0:R.t,offsetLeft:o?R.l:0,maxShift:o?O.width:O.height},attributes:{x:t,y:a,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},i.previousPromises,function(){var n,s=W+A/2;-1===ht.indexOf("inside")&&(n=f.bBox(dt.node()),s+=o?n.width:n.height),ct=pt.select("text");var u=0,p=o&&"top"===j,m=!o&&"right"===j,y=0;if(ct.node()&&!ct.classed(M.jsPlaceholder)){var v,_=pt.select(".h"+at._id+"title-math-group").node();_&&(o&&it||!o&&!it)?(u=(n=f.bBox(_)).width,v=n.height):(u=(n=f.bBox(pt.node())).right-R.l-(o?Q:nt),v=n.bottom-R.t-(o?nt:Q),o||"top"!==j||(s+=n.height,y=n.height)),m&&(ct.attr("transform",c(u/2+ft/2,0)),u*=2),s=Math.max(s,o?u:v)}var x=2*(o?P:E)+s+S+A/2,w=0;!o&&N.text&&"bottom"===I&&z<=0&&(x+=w=x/2,y+=w),O._hColorbarMoveTitle=w,O._hColorbarMoveCBTitle=y;var F=S+A;t.select("."+M.cbbg).attr("x",(o?Q:nt)-F/2-(o?P:0)).attr("y",(o?nt:Q)-(o?J:E+y-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(J+F,2)).call(d.fill,C).call(d.stroke,e.bordercolor).style("stroke-width",S);var B=m?Math.max(u-10,0):0;if(t.selectAll("."+M.cboutline).attr("x",(o?Q:nt+P)+B).attr("y",(o?nt+E-J:Q)+(p?mt:0)).attr(o?"width":"height",Math.max(W,2)).attr(o?"height":"width",Math.max(J-(o?2*E+mt:2*P+B),2)).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":A}),t.attr("transform",c(R.l-(o?$*x:0),R.t-(o?0:(1-tt)*x-y))),!o&&(S||a(C).getAlpha()&&!a.equals(O.paper_bgcolor,C))){var U=dt.selectAll("text"),V=U[0].length,q=t.select("."+M.cbbg).node(),Z=f.bBox(q),H=f.getTranslate(t);U.each((function(t,e){var r=V-1;if(0===e||e===r){var n,a=f.bBox(this),i=f.getTranslate(this);if(e===r){var o=a.right+i.x;(n=Z.right+H.x+nt-S-2+D-o)>0&&(n=0)}else if(0===e){var s=a.left+i.x;(n=Z.left+H.x+nt+S+2-s)<0&&(n=0)}n&&(V<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var G={},Y=T[L],X=k[L],K=T[I],et=k[I],rt=x-W;o?("pixels"===h?(G.y=z,G.t=J*K,G.b=J*et):(G.t=G.b=0,G.yt=z+l*K,G.yb=z-l*et),"pixels"===b?(G.x=D,G.l=x*Y,G.r=x*X):(G.l=rt*Y,G.r=rt*X,G.xl=D-g*Y,G.xr=D+g*X)):("pixels"===h?(G.x=D,G.l=J*Y,G.r=J*X):(G.l=G.r=0,G.xl=D+l*Y,G.xr=D-l*X),"pixels"===b?(G.y=1-z,G.t=x*K,G.b=x*et):(G.t=rt*K,G.b=rt*et,G.yt=z-g*K,G.yb=z+g*et)),i.autoMargin(r,e._id,G)}],r)}(r,e,t);g&&g.then&&(t._promises||[]).push(g),t._context.edits.colorbarPosition&&function(t,e,r){var n,a,i,s="v"===e.orientation,u=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+c(r,o)),a=l.align((s?e._uFrac:e._vFrac)+r/u.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),i=l.align((s?e._vFrac:1-e._uFrac)-o/u.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var p=l.getCursor(a,i,e.xanchor,e.yanchor);h(t,p)},doneFn:function(){if(h(t),void 0!==a&&void 0!==i){var n={};n[e._propPrefix+"x"]=a,n[e._propPrefix+"y"]=i,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){i.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":231,"../../lib":258,"../../lib/extend":250,"../../lib/setcursor":278,"../../lib/svg_text_utils":281,"../../plots/cartesian/axes":305,"../../plots/cartesian/axis_defaults":307,"../../plots/cartesian/layout_attributes":318,"../../plots/cartesian/position_defaults":321,"../../plots/plots":346,"../../registry":349,"../color":115,"../colorscale/helpers":126,"../dragelement":134,"../drawing":137,"../titles":224,"./constants":117,"@plotly/d3":12,tinycolor2:80}],120:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":258}],121:[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":116,"./defaults":118,"./draw":119,"./has_colorbar":120}],122:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),a=t("../../lib/regex").counter,i=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;i(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,i=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),u="showScaleDflt"in e?e.showScaleDflt:"z"===i,c="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,p=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[i]));var f=i+"auto",d=i+"min",m=i+"max",y=i+"mid",g=(s(h+f),s(h+d),s(h+m),{});g[d]=g[m]=void 0;var v={};v[f]=!1;var _={};return"color"===r&&(_.color={valType:"color",arrayOk:!0,editType:p||"style"},e.anim&&(_.color.anim=!0)),_[f]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:g},_[d]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[m]={valType:"number",dflt:null,editType:p||"plot",impliedEdits:v},_[y]={valType:"number",dflt:null,editType:"calc",impliedEdits:g},_.colorscale={valType:"colorscale",editType:"calc",dflt:c,impliedEdits:{autocolorscale:!1}},_.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},_.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(_.showscale={valType:"boolean",dflt:u,editType:"calc"},_.colorbar=n),e.noColorAxis||(_.coloraxis={valType:"subplotid",regex:a("coloraxis"),dflt:null,editType:"calc"}),_}},{"../../lib/regex":274,"../../lib/sort_object_keys":279,"../colorbar/attributes":116,"./scales.js":130}],123:[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,s=t._fullLayout,l=r.vals,u=r.containerStr,c=u?a.nestedProperty(e,u).get():e,p=i(c),h=!1!==p.auto,f=p.min,d=p.max,m=p.mid,y=function(){return a.aggNums(Math.min,null,l)},g=function(){return a.aggNums(Math.max,null,l)};(void 0===f?f=y():h&&(f=c._colorAx&&n(f)?Math.min(f,y()):y()),void 0===d?d=g():h&&(d=c._colorAx&&n(d)?Math.max(d,g()):g()),h&&void 0!==m&&(d-m>m-f?f=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,p._sync("colorscale",o))}},{"../../lib":258,"./helpers":126,"fast-isnumeric":28}],124:[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 s=i(o),l=s.auto;(l||void 0===s.min)&&r(o,a.min),(l||void 0===s.max)&&r(o,a.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,a++){var i=t[n];r[a]=[1-i[0],i[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,u=new Array(l),c=0;c4/3-s?o:s}},{}],132:[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":258}],133:[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)}},{}],134:[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,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var u=t("./unhover");function c(){var t=document.createElement("div");t.className="dragcover";var e=t.style;return e.position="fixed",e.left=0,e.right=0,e.top=0,e.bottom=0,e.zIndex=999999999,e.background="none",document.body.appendChild(t),t}function p(t){return n(t.changedTouches?t.changedTouches[0]:t,document.body)}l.unhover=u.wrapped,l.unhoverRaw=u.raw,l.init=function(t){var e,r,n,u,h,f,d,m,y=t.gd,g=1,v=y._context.doubleClickDelay,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=b,i?(_._ontouchstart&&_.removeEventListener("touchstart",_._ontouchstart),_._ontouchstart=b,_.addEventListener("touchstart",b,{passive:!1})):_.ontouchstart=b;var x=t.clampFn||function(t,e,r){return Math.abs(t)v&&(g=Math.max(g-1,1)),y._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(g,f),!m){var r;try{r=new MouseEvent("click",e)}catch(t){var n=p(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)}d.dispatchEvent(r)}y._dragging=!1,y._dragged=!1}else y._dragged=!1}},l.coverSlip=c},{"../../lib":258,"../../plots/cartesian/constants":312,"./align":131,"./cursor":132,"./unhover":135,"has-hover":59,"has-passive-events":60,"mouse-event-offset":65}],135:[function(t,e,r){"use strict";var n=t("../../lib/events"),a=t("../../lib/throttle"),i=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=i(t))._fullLayout&&a.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,a=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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":248,"../../lib/events":249,"../../lib/throttle":282,"../fx/constants":149}],136:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],137:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=a.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),u=t("../color"),c=t("../colorscale"),p=a.strTranslate,h=t("../../lib/svg_text_utils"),f=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,y=t("../../traces/scatter/subtypes"),g=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,_=e.exports={};function x(t,e,r){var n=e.fillpattern,a=n&&_.getPatternAttr(n.shape,0,"");if(a){var i=_.getPatternAttr(n.bgcolor,0,null),o=_.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=_.getPatternAttr(n.size,0,8),c=_.getPatternAttr(n.solidity,0,.3),p=e.uid;_.pattern(t,"point",r,p,a,l,c,void 0,n.fillmode,i,o,s)}else e.fillcolor&&t.call(u.fill,e.fillcolor)}_.font=function(t,e,r,n){a.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(u.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,a){t.call(_.setPosition,e,r).call(_.setSize,n,a)},_.translatePoint=function(t,e,r,n){var a=r.c2p(t.x),i=n.c2p(t.y);return!!(o(a)&&o(i)&&e.node())&&("text"===e.node().nodeName?e.attr("x",a).attr("y",i):e.attr("transform",p(a,i)),!0)},_.translatePoints=function(t,e,r){t.each((function(t){var a=n.select(this);_.translatePoint(t,a,e,r)}))},_.hideOutsideRangePoint=function(t,e,r,n,a,i){e.attr("display",r.isPtWithinRange(t,a)&&n.isPtWithinRange(t,i)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,a=e.yaxis;t.each((function(e){var i=e[0].trace,o=i.xcalendar,s=i.ycalendar,u=l.traceIs(i,"bar-like")?".bartext":".point,.textpoint";t.selectAll(u).each((function(t){_.hideOutsideRangePoint(t,n.select(this),r,a,o,s)}))}))}},_.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.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||"";u.stroke(e,n||i.color),_.dashLine(e,s,o)},_.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(u.stroke,r||i.color).call(_.dashLine,s,o)}))},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.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},_.singleFillStyle=function(t,e){var r=n.select(t.node());x(t,((r.data()[0]||[])[0]||{}).trace||{},e)},_.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&x(r,t[0].trace,e)}))};var b=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolBackOffs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(b).forEach((function(t){var e=b[t],r=e.n;_.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),_.symbolNames[r]=t,_.symbolFuncs[r]=e.f,_.symbolBackOffs[r]=e.backoff||0,e.needLine&&(_.symbolNeedLines[r]=!0),e.noDot?_.symbolNoDot[r]=!0:_.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(_.symbolNoFill[r]=!0)}));var w=_.symbolNames.length;function T(t,e,r,n){var a=t%100;return _.symbolFuncs[a](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}_.symbolNumber=function(t){if(o(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=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var k={x1:1,x2:0,y1:0,y2:0},M={x1:0,x2:0,y1:1,y2:0},A=i("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:M},verticalreversed:{node:"linearGradient",attrs:M,reversed:!0}};_.gradient=function(t,e,r,i,o,l){for(var c=o.length,p=S[i],h=new Array(c),f=0;f=100;var p=rt(t,r),h=H(t,r);e.attr("d",T(c,l,p,h))}var f,d,m,y=!1;if(t.so)m=s.outlierwidth,d=s.outliercolor,f=o.outliercolor;else{var g=(s||{}).width;m=(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):a.isArrayOrTypedArray(s.color)?u.defaultLine:s.color,a.isArrayOrTypedArray(o.color)&&(f=u.defaultLine,y=!0),f="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(f=n.selectedColorFn(t))}if(t.om)e.call(u.stroke,f).style({"stroke-width":(m||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:m)+"px");var v=o.gradient,x=t.mgt;x?y=!0:x=v&&v.type,a.isArrayOrTypedArray(x)&&(x=x[0],S[x]||(x=0));var b=o.pattern,w=b&&_.getPatternAttr(b.shape,t.i,"");if(x&&"none"!==x){var k=t.mgc;k?y=!0:k=v.color;var M=r.uid;y&&(M+="-"+t.i),_.gradient(e,i,M,x,[[0,k],[1,f]],"fill")}else if(w){var A=_.getPatternAttr(b.bgcolor,t.i,null),C=_.getPatternAttr(b.fgcolor,t.i,null),L=b.fgopacity,I=_.getPatternAttr(b.size,t.i,8),P=_.getPatternAttr(b.solidity,t.i,.3),E=t.mcc||a.isArrayOrTypedArray(b.shape)||a.isArrayOrTypedArray(b.bgcolor)||a.isArrayOrTypedArray(b.size)||a.isArrayOrTypedArray(b.solidity),D=r.uid;E&&(D+="-"+t.i),_.pattern(e,"point",i,D,w,I,P,t.mcc,b.fillmode,A,C,L)}else u.fill(e,f);m&&u.stroke(e,d)}},_.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=_.tryColorscale(r,""),e.lineScale=_.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=y.isBubble(t)?g(t):function(){return(r.size||6)/2}),t.selectedpoints&&a.extendFlat(e,_.makeSelectedPointStyleFns(t)),e},_.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.marker||{},o=r.marker||{},s=n.marker||{},u=i.opacity,c=o.opacity,p=s.opacity,h=void 0!==c,f=void 0!==p;(a.isArrayOrTypedArray(u)||h||f)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?i.opacity:t.mo;return t.selected?h?c:e:f?p:m*e});var d=i.color,y=o.color,g=s.color;(y||g)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?y||e:g||e});var v=i.size,_=o.size,x=s.size,b=void 0!==_,w=void 0!==x;return l.traceIs(t,"symbols")&&(b||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?b?_/2:e:w?x/2:e}),e},_.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.textfont||{},i=r.textfont||{},o=n.textfont||{},s=a.color,l=i.color,c=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:c||(l?e:u.addOpacity(e,m))},e},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=_.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){u.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&i.push((function(t,n){var i=n.mx||a.symbol||0,o=r.selectedSizeFn(n);t.attr("d",T(_.symbolNumber(i),o,rt(n,e),H(n,e))),n.mrc2=o})),i.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}_.textPointStyle=function(t,e,r){if(t.size()){var i;if(e.selectedpoints){var o=_.makeSelectedTextStyleFns(e);i=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),u=s?a.extractOption(t,e,"txt","texttemplate"):a.extractOption(t,e,"tx","text");if(u||0===u){if(s){var c=e._module.formatLabels,p=c?c(t,e,l):{},f={};v(f,e,t.i);var d=e._meta||{};u=a.texttemplateString(u,p,l._d3locale,f,t,d)}var m=t.tp||e.textposition,y=I(t,e),g=i?i(t):t.tc||e.textfont.color;o.call(_.font,t.tf||e.textfont.family,y,g).text(u).call(h.convertToTspans,r).call(L,m,y,t.mrc)}else o.remove()}))}},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=_.makeSelectedTextStyleFns(e);t.each((function(t){var a=n.select(this),i=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=I(t,e);u.fill(a,i);var c=l.traceIs(e,"bar-like");L(a,o,s,t.mrc2||t.mrc,c)}))}};var P,E;function D(t,e,r){return r&&(t=N(t)),e?O(t[1]):z(t[0])}function z(t){var e=n.round(t,2);return P=e,e}function O(t){var e=n.round(t,2);return E=e,e}function R(t,e,r,n){var a=t[0]-e[0],i=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(a*a+i*i,.25),u=Math.pow(o*o+s*s,.25),c=(u*u*a-l*l*o)*n,p=(u*u*i-l*l*s)*n,h=3*u*(l+u),f=3*l*(l+u);return[[z(e[0]+(h&&c/h)),O(e[1]+(h&&p/h))],[z(e[0]-(f&&c/f)),O(e[1]-(f&&p/f))]]}_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=u||x>=p&&x<=u)&&(b<=h&&b>=c||b>=h&&b<=c)&&(t=[x,b])}return t}_.steps=function(t){var e=F[t]||B;return function(t){for(var r="M"+z(t[0][0])+","+O(t[0][1]),n=t.length,a=1;a=1e4&&(_.savedBBoxes={},j=0),r&&(_.savedBBoxes[r]=y),j++,a.extendFlat({},y)},_.setClipUrl=function(t,e,r){t.attr("clip-path",V(e,r))},_.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}},_.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+=p(e,r)).trim(),t[a]("transform",i),i},_.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}},_.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 q=/\s*sc.*/;_.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(q,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var Z=/translate\([^)]*\)\s*$/;function H(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}_.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,a=n.select(this),i=a.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(a.attr("transform")||"").match(Z);t=1===e&&1===r?[]:[p(o,s),"scale("+e+","+r+")",p(-o,-s)],l&&t.push(l),a.attr("transform",t.join(""))}}))},_.getMarkerStandoff=H;var G,Y,W,X,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,a=t.ma;void 0===a&&(a=e.marker.angle||0);var i=e.marker.angleref;if("previous"===i||"north"===i){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,u=e._yA;if(!l||!u)return 90;r=l.c2p(t.x),n=u.c2p(t.y)}if(e._geo){var c,p=t.lonlat[0],h=t.lonlat[1],f=e._geo.project([p,h+1e-5]),d=e._geo.project([p+1e-5,h]),m=Q(d[1]-n,d[0]-r),y=Q(f[1]-n,f[0]-r);if("north"===i)c=a/180*Math.PI;else if("previous"===i){var g=p/180*Math.PI,v=h/180*Math.PI,_=G/180*Math.PI,x=Y/180*Math.PI,b=_-g,w=$(x)*tt(b),T=tt(x)*$(v)-$(x)*tt(v)*$(b);c=-Q(w,T)-Math.PI,G=p,Y=h}var k=et(m,[$(c),0]),M=et(y,[tt(c),0]);a=Q(k[1]+M[1],k[0]+M[0])/Math.PI*180,"previous"!==i||K===e.uid&&t.i===J+1||(a=null)}if("previous"===i&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var A=r-W,S=n-X,C=e.line&&e.line.shape||"",L=C.slice(C.length-1);"h"===L&&(S=0),"v"===L&&(A=0),a+=Q(S,A)/Math.PI*180+90}else a=null}return W=r,X=n,J=t.i,K=e.uid,a}_.getMarkerAngle=rt},{"../../components/fx/helpers":151,"../../constants/alignment":231,"../../constants/interactions":235,"../../constants/xmlns_namespaces":237,"../../lib":258,"../../lib/svg_text_utils":281,"../../registry":349,"../../traces/scatter/make_bubble_size_func":397,"../../traces/scatter/subtypes":405,"../color":115,"../colorscale":127,"./symbol_defs":138,"@plotly/d3":12,"fast-isnumeric":28,tinycolor2:80}],138:[function(t,e,r){"use strict";var n,a,i,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,u=Math.sqrt(2),c=Math.sqrt(3),p=Math.PI,h=Math.cos,f=Math.sin;function d(t){return null===t}function m(t,e,r){if(!(t&&t%360!=0||e))return r;if(i===t&&o===e&&n===r)return a;function l(t,r){var n=h(t),a=f(t),i=r[0],o=r[1]+(e||0);return[i*n-o*a,i*a+o*n]}i=t,o=e,n=r;for(var u=t/180*p,c=0,d=0,m=s(r),y="",g=0;g0;e.each((function(e){var p,h=e[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(p=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(e=[]);var y=n.select(this).selectAll("g.errorbar").data(e,p);if(y.exit().remove(),e.length){f.visible||y.selectAll("path.xerror").remove(),d.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var g=y.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,r.layerClipId,t),y.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,l,u);if(!m||t.vis){var i,o=e.select("path.yerror");if(d.visible&&a(r.x)&&a(r.yh)&&a(r.ys)){var p=d.width;i="M"+(r.x-p)+","+r.yh+"h"+2*p+"m-"+p+",0V"+r.ys,r.noYS||(i+="m-"+p+",0h"+2*p),!o.size()?o=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(o=o.transition().duration(s.duration).ease(s.easing)),o.attr("d",i)}else o.remove();var h=e.select("path.xerror");if(f.visible&&a(r.y)&&a(r.xh)&&a(r.xs)){var y=(f.copy_ystyle?d:f).width;i="M"+r.xh+","+(r.y-y)+"v"+2*y+"m0,-"+y+"H"+r.xs,r.noXS||(i+="m0,-"+y+"v"+2*y),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",i)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":405,"../drawing":137,"@plotly/d3":12,"fast-isnumeric":28}],145:[function(t,e,r){"use strict";var n=t("@plotly/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":115,"@plotly/d3":12}],146:[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":250,"../../plots/font_attributes":333,"./layout_attributes":156}],147:[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 s=0;s=0&&r.indexb[0]._length||ot<0||ot>w[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=it+b[0]._offset,e.pointerY=ot+w[0]._offset,V="xval"in e?g.flat(l,e.xval):g.p2c(b,it),q="yval"in e?g.flat(l,e.yval):g.p2c(w,ot),!a(V[0])||!a(q[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ut=1/0;function ct(t,r){for(H=0;Htt&&(et.splice(0,tt),ut=et[0].distance),v&&0!==B&&0===et.length){$.distance=B,$.index=!1;var p=Y._module.hoverPoints($,K,Q,"closest",{hoverLayer:c._hoverlayer});if(p&&(p=p.filter((function(t){return t.spikeDistance<=B}))),p&&p.length){var h,d=p.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];a(m.x0)&&a(m.y0)&&(h=ht(m),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>h.spikeDistance)&&(nt.vLinePoint=h))}var y=p.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(y.length){var _=y[0];a(_.x0)&&a(_.y0)&&(h=ht(_),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>h.spikeDistance)&&(nt.hLinePoint=h))}}}}}function pt(t,e,r){for(var n,a=null,i=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;At--)It(et[At]);et=St,yt()}var Pt=t._hoverdata,Et=[],Dt=j(t),zt=U(t);for(Z=0;Z1||et.length>1)||"closest"===P&&at&&et.length>1,Yt=f.combine(c.plot_bgcolor||f.background,c.paper_bgcolor),Wt=E(et,{gd:t,hovermode:P,rotateLabels:Gt,bgColor:Yt,container:c._hoverlayer,outerContainer:c._paper.node(),commonLabelOpts:c.hoverlabel,hoverdistance:c.hoverdistance});g.isUnifiedHover(P)||(!function(t,e,r){var n,a,i,o,s,l,u,c=0,p=1,h=t.size(),f=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,i=r.pos+r.dp+r.size-e.pmax,a>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=a;n=!1}if(!(i<.01)){if(a<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=i;n=!1}if(n){var u=0;for(o=0;oe.pmax&&u++;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,u--);for(o=0;o=0;s--)t[s].dp-=i;for(o=t.length-1;o>=0&&!(u<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,u--)}}}t.each((function(t){var n=t[e],a="x"===n._id.charAt(0),i=n.range;0===d&&i&&i[0]>i[1]!==a&&(p=-1),f[d++]=[{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}]})),f.sort((function(t,e){return t[0].posref-e[0].posref||p*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&c<=h;){for(c++,n=!0,o=0;o.01&&v.pmin===_.pmin&&v.pmax===_.pmax){for(s=g.length-1;s>=0;s--)g[s].dp+=a;for(y.push.apply(y,g),f.splice(o+1,1),u=0,s=y.length-1;s>=0;s--)u+=y[s].dp;for(i=u/y.length,s=y.length-1;s>=0;s--)y[s].dp-=i;n=!1}else o++}f.forEach(m)}for(o=f.length-1;o>=0;o--){var x=f[o];for(s=x.length-1;s>=0;s--){var b=x[s],w=b.datum;w.offset=b.dp,w.del=b.del}}}(Wt,Gt?"xa":"ya",c),z(Wt,Gt,c._invScaleX,c._invScaleY));if(s&&s.tagName){var Xt=y.getComponentMethod("annotations","hasClickToShow")(t,Et);p(n.select(s),Xt?"pointer":"")}if(!s||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,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:b,yaxes:w,xvals:V,yvals:q})}(t,e,r,i,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var a=e.gd,i=j(a),o=U(a),s=E(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,u=t.eventData;if(u){var c=Math.min(r,n),p=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(y.traceIs(m,"gl3d")){var g=a._fullLayout[m.scene]._scene.container,v=g.offsetLeft,_=g.offsetTop;c+=v,p+=v,h+=_,d+=_}u.bbox={x0:c+o,x1:p+o,y0:h+i,y1:d+i},e.inOut_bbox&&e.inOut_bbox.push(u.bbox)}else u=!1;return{color:t.color||f.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:u}})),{gd:a,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||f.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,u=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function E(t,e){var r=e.gd,a=r._fullLayout,i=e.hovermode,u=e.rotateLabels,p=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var T=e.fontFamily||v.HOVERFONT,k=e.fontSize||v.HOVERFONTSIZE,M=t[0],C=M.xa,L=M.ya,P=i.charAt(0),E=P+"Label",z=M[E];if(void 0===z&&"multicategory"===C.type)for(var O=0;Oa.width-x?(y=a.width-x,e.attr("d","M"+(x-A)+",0L"+x+","+_+A+"v"+_+(2*S+v.height)+"H-"+x+"V"+_+A+"H"+(x-2*A)+"Z")):e.attr("d","M0,0L"+A+","+_+A+"H"+(S+v.width/2)+"v"+_+(2*S+v.height)+"H-"+(S+v.width/2)+"V"+_+A+"H-"+A+"Z")}else{var b,I,P;"right"===L.side?(b="start",I=1,P="",y=C._offset+C._length):(b="end",I=-1,P="-",y=C._offset),g=L._offset+(M.y0+M.y1)/2,l.attr("text-anchor",b),e.attr("d","M0,0L"+P+A+","+A+"V"+(S+v.height/2)+"h"+P+(2*S+v.width)+"V-"+(S+v.height/2)+"H"+P+A+"V-"+A+"Z");var E,D=v.height/2,O=F-v.top-D,R="clip"+a._uid+"commonlabel"+L._id;if(y=0?st:lt+pt=0?lt:_t+pt=0?it:ot+ht=0?ot:xt+ht=0,"top"!==t.idealAlign&&H||!G?H?(E+=R/2,t.anchor="start"):t.anchor="middle":(E-=R/2,t.anchor="end");else if(t.pos=E,H=P+O/2+Y<=B,G=P-O/2-Y>=0,"left"!==t.idealAlign&&H||!G)if(H)P+=O/2,t.anchor="start";else{t.anchor="middle";var W=Y/2,X=P+W-B,J=P-W;X>0&&(P-=X),J<0&&(P+=-J)}else P-=O/2,t.anchor="end";w.attr("text-anchor",t.anchor),C&&M.attr("text-anchor",t.anchor),e.attr("transform",s(P,E)+(u?l(b):""))})),bt}function D(t,e,r,n,a,i){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var u=r.charAt(0),c="x"===u?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[u+"Label"]===a?l=t[c+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),i&&""===l&&!t.hovertemplate&&(""===s&&i.remove(),l=s);var p=t.hovertemplate||!1;if(p){var h=t.hovertemplateLabels||t;t[u+"Label"]!==a&&(h[u+"other"]=h[u+"Val"],h[u+"otherLabel"]=h[u+"Label"]),l=(l=o.hovertemplateString(p,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}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"),s=t.anchor,l="end"===s?-1:1,u={start:1,end:-1,middle:0}[s],p=u*(A+S),f=p+u*(t.txwidth+S),d=0,m=t.offset,y="middle"===s;y&&(p-=t.tx2width/2,f+=t.txwidth/2+S),e&&(m*=-M,d=t.offset*k),r.select("path").attr("d",y?"M-"+i(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+i(t.bx)+"v"+o(t.by)+"h-"+i(t.bx)+"Z":"M0,0L"+i(l*A+d)+","+o(A+m)+"v"+o(t.by/2-A)+"h"+i(l*t.bx)+"v-"+o(t.by)+"H"+i(l*A+d)+"V"+o(m-A)+"Z");var g=d+p,v=m+t.ty0-t.by/2+S,_=t.textAlign||"auto";"auto"!==_&&("left"===_&&"start"!==s?(a.attr("text-anchor","start"),g=y?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===_&&"end"!==s&&(a.attr("text-anchor","end"),g=y?t.bx/2-t.tx2width/2-S:t.bx+S)),a.call(c.positionText,i(g),o(v)),t.tx2width&&(r.select("text.name").call(c.positionText,i(f+u*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,i(f+(u-1)*t.tx2width/2+d),o(m-t.by/2-1),i(t.tx2width),o(t.by+2)))}))}function O(t,e){var r=t.index,n=t.trace||{},i=t.cd[0],s=t.cd[r]||{};function l(t){return t||a(t)&&0===t}var u=Array.isArray(r)?function(t,e){var a=o.castOption(i,r,t);return l(a)?a:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function c(e,r,n){var a=u(r,n);l(a)&&(t[e]=a)}if(c("hoverinfo","hi","hoverinfo"),c("bgcolor","hbg","hoverlabel.bgcolor"),c("borderColor","hbc","hoverlabel.bordercolor"),c("fontFamily","htf","hoverlabel.font.family"),c("fontSize","hts","hoverlabel.font.size"),c("fontColor","htc","hoverlabel.font.color"),c("nameLength","hnl","hoverlabel.namelength"),c("textAlign","hta","hoverlabel.align"),t.posref="y"===e||"closest"===e&&"h"===n.orientation?t.xa._offset+(t.x0+t.x1)/2:t.ya._offset+(t.y0+t.y1)/2,t.x0=o.constrain(t.x0,0,t.xa._length),t.x1=o.constrain(t.x1,0,t.xa._length),t.y0=o.constrain(t.y0,0,t.ya._length),t.y1=o.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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 p=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+p+" / -"+m.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+p,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var h=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"y"===e&&(t.distance+=1)}var f=t.hoverinfo||t.trace.hoverinfo;return f&&"all"!==f&&(-1===(f=Array.isArray(f)?f:f.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===f.indexOf("y")&&(t.yLabel=void 0),-1===f.indexOf("z")&&(t.zLabel=void 0),-1===f.indexOf("text")&&(t.text=void 0),-1===f.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,a,o=r.container,s=r.fullLayout,l=s._size,u=r.event,c=!!e.hLinePoint,p=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),p||c){var d=f.combine(s.plot_bgcolor,s.paper_bgcolor);if(c){var y,g,v=e.hLinePoint;n=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(y=u.pointerX,g=u.pointerY):(y=n._offset+v.x,g=a._offset+v.y);var _,x,b=i.readability(v.color,d)<1.5?f.contrast(d):v.color,w=a.spikemode,T=a.spikethickness,k=a.spikecolor||b,M=m.getPxPosition(t,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(_=M,x=y),-1!==w.indexOf("across")){var A=a._counterDomainMin,S=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),S=Math.max(S,a.position)),_=l.l+A*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(a.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:_,x2:x,y1:g,y2:g,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:M+("right"!==a.side?T:-T),cy:g,r:T,fill:k}).classed("spikeline",!0)}if(p){var C,L,I=e.vLinePoint;n=I&&I.xa,a=I&&I.ya,"cursor"===n.spikesnap?(C=u.pointerX,L=u.pointerY):(C=n._offset+I.x,L=a._offset+I.y);var P,E,D=i.readability(I.color,d)<1.5?f.contrast(d):I.color,z=n.spikemode,O=n.spikethickness,R=n.spikecolor||D,F=m.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(P=F,E=L),-1!==z.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,E=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:E,"stroke-width":O,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,O)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:C,x2:C,y1:P,y2:E,"stroke-width":O+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:C,cy:F-("top"!==n.side?O:-O),r:O,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return c.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],a=e[t+"Val"],i=e.cd[0];if("category"===n.type||"multicategory"===n.type)a=n._categoriesMap[a];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var u=s[t+"End"];void 0===u&&(u=s[t]);var c=u-l;"end"===o?a+=c:"middle"===o&&(a+=c/2)}a=n.d2c(a)}return i&&i.t&&i.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(a+=i.t.dPos)),a}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function V(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),a=n.x,i=n.y,s=a+n.width,l=i+n.height,u=o.apply3DTransform(r._invTransform)(a,i),c=o.apply3DTransform(r._invTransform)(s,l),p=u[0],h=u[1],f=c[0],d=c[1];return{x:p,y:h,width:f-p,height:d-h,top:Math.min(h,d),left:Math.min(p,f),right:Math.max(p,f),bottom:Math.max(h,d)}}},{"../../lib":258,"../../lib/events":249,"../../lib/override_cursor":269,"../../lib/svg_text_utils":281,"../../plots/cartesian/axes":305,"../../registry":349,"../color":115,"../dragelement":134,"../drawing":137,"../legend/defaults":167,"../legend/draw":168,"./constants":149,"./helpers":151,"@plotly/d3":12,"fast-isnumeric":28,tinycolor2:80}],153:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../color"),i=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&i(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(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":258,"../color":115,"./helpers":151}],154:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes");e.exports=function(t,e){function r(r,i){return void 0!==e[r]?e[r]:n.coerce(t,e,a,r,i)}return r("clickmode"),r("hovermode")}},{"../../lib":258,"./layout_attributes":156}],155:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return a.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return a.castOption(t,r,"hoverinfo",(function(r){return a.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:i.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=a.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":258,"../dragelement":134,"./attributes":146,"./calc":147,"./click":148,"./constants":149,"./defaults":150,"./helpers":151,"./hover":152,"./layout_attributes":156,"./layout_defaults":157,"./layout_global_defaults":158,"@plotly/d3":12}],156:[function(t,e,r){"use strict";var n=t("./constants"),a=t("../../plots/font_attributes"),i=a({editType:"none"});i.family.dflt=n.HOVERFONT,i.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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,grouptitlefont:a({editType:"none"}),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":333,"./constants":149}],157:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./layout_attributes"),i=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,i){return n.coerce(t,e,a,r,i)}i(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),u=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===u||s&&l&&2===u)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":258,"./hoverlabel_defaults":153,"./hovermode_defaults":154,"./layout_attributes":156}],158:[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":258,"./hoverlabel_defaults":153,"./layout_attributes":156}],159:[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,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[a("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[o.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:i({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(t,e,r){var n=e[r+"axes"],a=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:a.length?a:void 0}function c(t,e,r,n,a,i){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(a),u=s[0],c=(s[1]-u)/(a-o),p=c*(1-o),h=0;h1){if(!h&&!f&&!d)"independent"===k("pattern")&&(h=!0);y._hasSubplotGrid=h;var _,x,b="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(_=e._splomGridDflt.xside,x=e._splomGridDflt.yside),y._domains={x:c("x",k,w,_,v),y:c("y",k,T,x,g,b)}}else delete e.grid}function k(t,e){return n.coerce(r,y,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,a,i,o,s,l,c,h=t.grid||{},f=e._subplots,d=r._hasSubplotGrid,m=r.rows,y=r.columns,g="independent"===r.pattern,v=r._axisMap={};if(d){var _=h.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n1);if(!1===b&&(e.legend=void 0),(!1!==b||p.uirevision)&&(f("uirevision",e.uirevision),!1!==b)){f("bgcolor",e.paper_bgcolor),f("bordercolor"),f("borderwidth");var w,T,k,M=a.coerceFont(f,"font",e.font),A="h"===f("orientation");if(A?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(T=1.1,k="bottom"):(T=-.1,k="top")):(w=1.02,T=1,k="auto"),f("traceorder",_),u.isGrouped(e.legend)&&f("tracegroupgap"),f("entrywidth"),f("entrywidthmode"),f("itemsizing"),f("itemwidth"),f("itemclick"),f("itemdoubleclick"),f("groupclick"),f("x",w),f("xanchor"),f("y",T),f("yanchor",k),f("valign"),a.noneOrAll(p,h,["x","y"]),f("title.text")){f("title.side",A?"left":"top");var S=a.extendFlat({},M,{size:a.bigFont(M.size)});a.coerceFont(f,"title.font",S)}}}},{"../../lib":258,"../../plot_api/plot_template":294,"../../plots/attributes":301,"../../plots/layout_attributes":337,"../../registry":349,"./attributes":165,"./helpers":171}],168:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../lib"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),u=t("../drawing"),c=t("../color"),p=t("../../lib/svg_text_utils"),h=t("./handle_click"),f=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,y=d.FROM_TL,g=d.FROM_BR,v=t("./get_legend_data"),_=t("./style"),x=t("./helpers");function b(t,e,r){var n=t[0],a=n.width,i=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===i?e._maxWidth*o:r+(o||a)}function w(t,e,r,n,a){var i=r.data()[0][0].trace,l={event:a,node:r.node(),curveNumber:i.index,expandedIndex:i._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(i._group&&(l.group=i._group),o.traceIs(i,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function T(t,e,r){var n,i,s=t.data()[0][0],l=s.trace,c=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!c,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,i=s.groupTitle.font):(i=r.font,r.entries?n=s.text:(n=c?s.label:l.name,l._meta&&(n=a.templateString(n,l._meta))));var m=a.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(u.font,i).text(h?k(n,d):n);var y=r.itemwidth+2*f.itemGap;p.positionText(m,y,0),h?m.call(p.makeEditable,{gd:e,text:n}).call(A,t,e,r).on("edit",(function(n){this.text(k(n,d)).call(A,t,e,r);var i=s.trace._fullInput||{},u={};if(o.hasTransform(i,"groupby")){var c=o.getTransformIndices(i,"groupby"),p=c[c.length-1],h=a.keyedContainer(i,"transforms["+p+"].styles","target","value.name");h.set(s.trace._group,n),u=h.constructUpdate()}else u.name=n;return o.call("_guiRestyle",e,u,l.index)})):A(m,t,e,r)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function M(t,e){var r,i=e._context.doubleClickDelay,o=1,s=a.ensureSingle(t,"rect","legendtoggle",(function(t){e._context.staticPlot||t.style("cursor","pointer").attr("pointer-events","all"),t.call(c.fill,"rgba(0,0,0,0)")}));e._context.staticPlot||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimei&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function A(t,e,r,n,a){n._inHover&&t.attr("data-notex",!0),p.convertToTspans(t,r,(function(){!function(t,e,r,n){var a=t.data()[0][0];if(!r._inHover&&a&&!a.trace.showlegend)return void t.remove();var i=t.select("g[class*=math-group]"),o=i.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:a.groupTitle?a.groupTitle.font:r.font;var c,h,d=s.size*m;if(o){var y=u.bBox(o);c=y.height,h=y.width,1===n?u.setTranslate(i,l,l+.75*c):u.setTranslate(i,0,.25*c)}else{var g=t.select(1===n?".legendtitletext":".legendtext"),v=p.lineCount(g),_=g.node();if(c=d*v,h=_?u.bBox(_).width:0,1===n)"left"===r.title.side&&(h+=2*f.itemGap),p.positionText(g,l+f.titlePad,l+d);else{var x=2*f.itemGap+r.itemwidth;a.groupTitle&&(x=f.itemGap,h-=r.itemwidth),p.positionText(g,x,-d*((v-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(a.lineHeight=d,a.height=Math.max(c,16)+3,a.width=h)}(e,r,n,a)}))}function S(t){return a.isRightAnchor(t)?"right":a.isCenterAnchor(t)?"center":"left"}function C(t){return a.isBottomAnchor(t)?"bottom":a.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,p=t._fullLayout,h="legend"+p._uid,d=e._inHover;d?(r=e.layer,h+="-hover"):r=p._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=v(e.entries,e)}else{if(!t.calcdata)return;s=p.showlegend&&v(t.calcdata,e)}var m=p.hiddenlabels||[];if(!(d||p.showlegend&&s.length))return r.selectAll(".legend").remove(),p._topdefs.select("#"+h).remove(),i.autoMargin(t,"legend");var k=a.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),L=a.ensureSingleById(p._topdefs,"clipPath",h,(function(t){t.append("rect")})),I=a.ensureSingle(k,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));I.call(c.stroke,e.bordercolor).call(c.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var P=a.ensureSingle(k,"g","scrollbox"),E=e.title;if(e._titleWidth=0,e._titleHeight=0,E.text){var D=a.ensureSingle(P,"text","legendtitletext");D.attr("text-anchor","start").call(u.font,E.font).text(E.text),A(D,P,t,e,1)}else P.selectAll(".legendtitletext").remove();var z=a.ensureSingle(k,"rect","scrollbar",(function(t){t.attr(f.scrollBarEnterAttrs).call(c.fill,f.scrollBarColor)})),O=P.selectAll("g.groups").data(s);O.enter().append("g").attr("class","groups"),O.exit().remove();var R=O.selectAll("g.traces").data(a.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(T,t,e)})).call(_,t,e).each((function(){d||n.select(this).call(M,t)})),a.syncOrAsync([i.previousPromises,function(){return function(t,e,r,a){var i=t._fullLayout;a||(a=i.legend);var o=i._size,s=x.isVertical(a),l=x.isGrouped(a),c="fraction"===a.entrywidthmode,p=a.borderwidth,h=2*p,d=f.itemGap,m=a.itemwidth+2*d,y=2*(p+d),g=C(a),v=a.y<0||0===a.y&&"top"===g,_=a.y>1||1===a.y&&"bottom"===g,w=a.tracegroupgap,T={};a._maxHeight=Math.max(v||_?i.height/2:o.h,30);var k=0;a._width=0,a._height=0;var M=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(s)r.each((function(t){var e=t[0].height;u.setTranslate(this,p+M[0],p+M[1]+a._height+e/2+d),a._height+=e,a._width=Math.max(a._width,t[0].width)})),k=m+a._width,a._width+=d+m+h,a._height+=y,l&&(e.each((function(t,e){u.setTranslate(this,0,e*a.tracegroupgap)})),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var A=S(a),L=a.x<0||0===a.x&&"right"===A,I=a.x>1||1===a.x&&"left"===A,P=_||v,E=i.width/2;a._maxWidth=Math.max(L?P&&"left"===A?o.l+o.w:E:I?P&&"right"===A?o.r+o.w:E:o.w,2*m);var D=0,z=0;r.each((function(t){var e=b(t,a,m);D=Math.max(D,e),z+=e})),k=null;var O=0;if(l){var R=0,F=0,B=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=b(r,a,m),i=r[0].height;u.setTranslate(this,M[0],M[1]+p+d+i/2+e),e+=i,t=Math.max(t,n),T[r[0].trace.legendgroup]=t}));var r=t+d;F>0&&r+p+F>a._maxWidth?(O=Math.max(O,F),F=0,B+=R+w,R=e):R=Math.max(R,e),u.setTranslate(this,F,B),F+=r})),a._width=Math.max(O,F)+p,a._height=B+R+y}else{var N=r.size(),j=z+h+(N-1)*d=a._maxWidth&&(O=Math.max(O,Z),V=0,q+=U,a._height+=U,U=0),u.setTranslate(this,M[0]+p+V,M[1]+p+q+e/2+d),Z=V+r+d,V+=n,U=Math.max(U,e)})),j?(a._width=V+h,a._height=U+y):(a._width=Math.max(O,Z)+h,a._height+=U+y)}}a._width=Math.ceil(Math.max(a._width+M[0],a._titleWidth+2*(p+f.titlePad))),a._height=Math.ceil(Math.max(a._height+M[1],a._titleHeight+2*(p+f.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var H=t._context.edits,G=H.legendText||H.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,i=t[0].trace.legendgroup,o=b(t,a,m);l&&""!==i&&(o=T[i]);var p=G?m:k||o;s||c||(p+=d/2),u.setRect(e,0,-r/2,p,r)}))}(t,O,R,e)},function(){var s,c,m,v,_=p._size,x=e.borderwidth;if(!d){if(function(t){var e=t._fullLayout.legend,r=S(e),n=C(e);return i.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*y[r],r:e._width*g[r],b:e._effHeight*g[n],t:e._effHeight*y[n]})}(t))return;var b=_.l+_.w*e.x-y[S(e)]*e._width,T=_.t+_.h*(1-e.y)-y[C(e)]*e._effHeight;if(p.margin.autoexpand){var M=b,A=T;b=a.constrain(b,0,p.width-e._width),T=a.constrain(T,0,p.height-e._effHeight),b!==M&&a.log("Constrain legend.x to make legend fit inside graph"),T!==A&&a.log("Constrain legend.y to make legend fit inside graph")}u.setTranslate(k,b,T)}if(z.on(".drag",null),k.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var E=e._effHeight;d&&(E=e._height),I.attr({width:e._width-x,height:E-x,x:x/2,y:x/2}),u.setTranslate(P,0,0),L.select("rect").attr({width:e._width-2*x,height:E-2*x,x:x,y:x}),u.setClipUrl(P,h,t),u.setRect(z,0,0,0,0),delete e._scrollY}else{var D,O,R,F=Math.max(f.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*f.scrollBarMargin,N=e._height-e._effHeight,j=B/N,U=Math.min(e._scrollY||0,N);I.attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),L.select("rect").attr({width:e._width-2*x+f.scrollBarWidth+f.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+U}),u.setClipUrl(P,h,t),Z(U,F,j),k.on("wheel",(function(){Z(U=a.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==U&&U!==N&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;D="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(O="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,Z(U=function(t,e,r){var n=(r-e)/j+t;return a.constrain(n,0,N)}(R,D,O),F,j))}));z.call(V);var q=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(D=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(O=t.changedTouches[0].clientY,Z(U=function(t,e,r){var n=(e-r)/j+t;return a.constrain(n,0,N)}(R,D,O),F,j))}));P.call(q)}function Z(r,n,a){e._scrollY=t._fullLayout.legend._scrollY=r,u.setTranslate(P,0,-r),u.setRect(z,e._width,f.scrollBarMargin+r*a,f.scrollBarWidth,n),L.select("rect").attr("y",x+r)}t._context.edits.legendPosition&&(k.classed("cursor-move",!0),l.init({element:k.node(),gd:t,prepFn:function(){var t=u.getTranslate(k);m=t.x,v=t.y},moveFn:function(t,r){var n=m+t,a=v+r;u.setTranslate(k,n,a),s=l.align(n,0,_.l,_.l+_.w,e.xanchor),c=l.align(a,0,_.t+_.h,_.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==c&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":c})},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&&w(t,k,a,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":231,"../../lib":258,"../../lib/events":249,"../../lib/svg_text_utils":281,"../../plots/plots":346,"../../registry":349,"../color":115,"../dragelement":134,"../drawing":137,"./constants":166,"./get_legend_data":169,"./handle_click":170,"./helpers":171,"./style":173,"@plotly/d3":12}],169:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("./helpers");e.exports=function(t,e){var r,i,o=e._inHover,s=a.isGrouped(e),l=a.isReversed(e),u={},c=[],p=!1,h={},f=0,d=0;function m(t,r){if(""!==t&&a.isGrouped(e))-1===c.indexOf(t)?(c.push(t),p=!0,u[t]=[r]):u[t].push(r);else{var n="~~i"+f;c.push(n),u[n]=[r],f++}}for(r=0;rM&&(k=M)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var A=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var g=e._fullLayout;r||(r=g.legend);var v="constant"===r.itemsizing,_=r.itemwidth,x=(_+2*f.itemGap)/2,b=o(x,0),w=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(t,i,o){var c=t[0].trace,p=c.marker||{},h=p.line||{},f=o?c.visible&&c.type===o:a.traceIs(c,"bar"),d=n.select(i).select("g.legendpoints").selectAll("path.legend"+o).data(f?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),d.exit().remove(),d.each((function(t){var a=n.select(this),i=t[0],o=w(i.mlw,p.line,5,2);a.style("stroke-width",o+"px");var f=i.mcc;if(!r._inHover&&"mc"in i){var d=u(p),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),f=s.tryColorscale(p,"")(m)}var g=f||i.mc||p.color,v=p.pattern,_=v&&s.getPatternAttr(v.shape,0,"");if(_){var x=s.getPatternAttr(v.bgcolor,0,null),b=s.getPatternAttr(v.fgcolor,0,null),T=v.fgopacity,k=y(v.size,8,10),M=y(v.solidity,.5,1),A="legend-"+c.uid;a.call(s.pattern,"legend",e,A,_,k,M,f,v.fillmode,x,b,T)}else a.call(l.fill,g);o&&l.stroke(a,i.mlc||h.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:a.traceIs(s,r),u=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(u.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",b),u.exit().remove(),u.size()){var c=(s.marker||{}).line,f=w(h(c.width,o.pts),c,5,2),d=i.minExtend(s,{marker:{line:{width:f}}});d.marker.line.color=c.color;var m=i.minExtend(o,{trace:d});p(u,m,d)}}t.each((function(t){var e=n.select(this),a=i.ensureSingle(e,"g","layers");a.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,u=t[0].height;if("middle"!==s&&l&&u){var c={top:1,bottom:-1}[s]*(.5*(l-u+3));a.attr("transform",o(0,c))}else a.attr("transform",null);a.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),a.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var p=a.selectAll("g.legendsymbols").data([t]);p.enter().append("g").classed("legendsymbols",!0),p.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 c=n.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(o);c.enter().append("path").classed("legend3dandfriends",!0).attr("transform",b).style("stroke-miterlimit",1),c.exit().remove(),c.each((function(t,o){var c,p=n.select(this),h=u(a),f=h.colorscale,m=h.reversescale;if(f){if(!r){var y=f.length;c=0===o?f[m?y-1:0][1]:1===o?f[m?0:y-1][1]:f[Math.floor((y-1)/2)][1]}}else{var g=a.vertexcolor||a.facecolor||a.color;c=i.isArrayOrTypedArray(g)?g[o]||g[0]:g}p.attr("d",t[0]),c?p.call(l.fill,c):p.call((function(t){if(t.size()){var n="legendfill-"+a.uid;s.gradient(t,e,n,d(m,"radial"===r),f,"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(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",b).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),a=e[t[0]].marker,i=w(void 0,a.line,5,2);r.attr("d",t[1]).style("stroke-width",i+"px").call(l.fill,a.color),i&&r.call(l.stroke,a.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){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",b),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var a=w(void 0,r.line,5,2);t.style("stroke-width",a+"px").call(l.fill,r.fillcolor),a&&l.stroke(t,r.line.color)}else{var u=i.minExtend(r,{marker:{size:v?12:i.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,u,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,a,o=m(t),l=o.showFill,p=o.showLine,h=o.showGradientLine,f=o.showGradientFill,y=o.anyFill,g=o.anyLine,v=t[0],x=v.trace,b=u(x),T=b.colorscale,k=b.reversescale,M=c.hasMarkers(x)||!y?"M5,0":g?"M5,-2":"M5,-3",A=n.select(this),S=A.select(".legendfill").selectAll("path").data(l||f?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",M+"h"+_+"v6h-"+_+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,d(k),T,"fill")}})),p||h){var C=w(void 0,x.line,10,5);a=i.minExtend(x,{line:{width:C}}),r=[i.minExtend(v,{trace:a})]}var L=A.select(".legendlines").selectAll("path").data(p||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",M+(h?"l"+_+",0.0001":"h"+_)).call(p?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,a,o=m(t),l=o.anyFill,u=o.anyLine,p=o.showLine,h=o.showMarker,f=t[0],d=f.trace,y=!h&&!u&&!l&&c.hasText(d);function g(t,e,r,n){var a=i.nestedProperty(d,t).get(),o=i.isArrayOrTypedArray(a)&&e?e(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function _(t){return f._distinct&&f.index&&t[f.index]?t[f.index]:t[0]}if(h||y||p){var x={},w={};if(h){x.mc=g("marker.color",_),x.mx=g("marker.symbol",_),x.mo=g("marker.opacity",i.mean,[.2,1]),x.mlc=g("marker.line.color",_),x.mlw=g("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=g("marker.size",i.mean,[2,16],12);x.ms=T,w.marker.size=T}p&&(w.line={width:g("line.width",_,[0,10],5)}),y&&(x.tx="Aa",x.tp=g("textposition",_),x.ts=10,x.tc=g("textfont.color",_),x.tf=g("textfont.family",_)),r=[i.minExtend(f,x)],(a=i.minExtend(d,w)).selectedpoints=null,a.texttemplate=null}var k=n.select(this).select("g.legendpoints"),M=k.selectAll("path.scatterpts").data(h?r:[]);M.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",b),M.exit().remove(),M.call(s.pointStyle,a,e),h&&(r[0].mrc=3);var A=k.selectAll("g.pointtext").data(y?r:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",b),A.exit().remove(),A.selectAll("text").call(s.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",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("stroke-width",o+"px").call(l.fill,i.fillcolor),o&&l.stroke(a,i.line.color)}))})).each((function(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",b).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var a=n.select(this),i=e[r?"increasing":"decreasing"],o=w(void 0,i.line,5,2);a.style("fill","none").call(s.dashLine,i.line.dash,o),o&&l.stroke(a,i.line.color)}))}))}},{"../../lib":258,"../../registry":349,"../../traces/pie/helpers":377,"../../traces/pie/style_one":378,"../../traces/scatter/subtypes":405,"../color":115,"../colorscale/helpers":126,"../drawing":137,"./constants":166,"@plotly/d3":12}],174:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":176}],175:[function(t,e,r){"use strict";var n=t("../../registry"),a=t("../../plots/plots"),i=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),u=l._,c=e.exports={};function p(t,e){var r,a,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,u=t._fullLayout,c={},p=i.list(t,null,!0),h=u._cartesianSpikesEnabled;if("zoom"===s){var f,d="in"===l?.5:2,m=(1+d)/2,y=(1-d)/2;for(a=0;a1?(E=["toggleHover"],D=["resetViews"]):g?(P=["zoomInGeo","zoomOutGeo"],E=["hoverClosestGeo"],D=["resetGeo"]):y?(E=["hoverClosest3d"],D=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(P=["zoomInMapbox","zoomOutMapbox"],E=["toggleHover"],D=["resetViewMapbox"]):x?E=["hoverClosestGl2d"]:v?E=["hoverClosestPie"]:M?(E=["hoverClosestCartesian","hoverCompareCartesian"],D=["resetViewSankey"]):E=["toggleHover"];m&&(E=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),a=0,i=0;i=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t=0;k--){var M=r.append("path").attr(y).style("opacity",k?.1:g).call(o.stroke,_).call(o.fill,v).call(s.dashLine,k?"solid":b,k?4+x:x);if(d(M,t,i),w){var A=l(t.layout,"selections",i);M.style({cursor:"move"});var S={element:M.node(),plotinfo:f,gd:t,editHelpers:A,isActiveSelection:!0},C=n(u,t);a(C,M,S)}else M.style("pointer-events",k?"all":"none");T[k]=M}var L=T[0];T[1].node().addEventListener("click",(function(){return function(t,e){if(!h(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void m(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=m,p(t)}}(t,L)}))}(t._fullLayout._selectionLayer)}function d(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function m(t){h(t)&&(t._fullLayout._activeSelectionIndex>=0&&(i(t),delete t._fullLayout._activeSelectionIndex,p(t)))}e.exports={draw:p,drawOne:f,activateLastSelection:function(t){if(!h(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=m,p(t)}}},{"../../plot_api/plot_template":294,"../color":115,"../drawing":137,"../shapes/display_outlines":209,"../shapes/draw_newshape/helpers":214,"../shapes/handle_outline":216,"../shapes/helpers":217}],199:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,a=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:a({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":250,"../../drawing/attributes":136}],200:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],201:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,a=t("../../shapes/handle_outline").clearOutline,i=t("../../shapes/draw_newshape/helpers"),o=i.readPaths,s=i.writePaths,l=i.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var i=r.getAttribute("d"),u=e.gd,c=u._fullLayout.newselection,p=e.plotinfo,h=p.xaxis,f=p.yaxis,d=e.isActiveSelection,m=e.dragmode,y=(u.layout||{}).selections||[];if(!n(m)&&void 0!==d){var g=u._fullLayout._activeSelectionIndex;if(g-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(g)){G(t,e,i);var b=function(t,e){var r,n,a=t[0],i=-1,o=[];for(n=0;n0?function(t,e){var r,n,a,i=[];for(a=0;a0&&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;a1)return!1;if((a+=r.selectedpoints.length)>1)return!1}return 1===a}(s)&&(h=K(b))){for(o&&o.remove(),y=0;y=0})(a)&&a._fullLayout._deactivateShape(a),function(t){return t._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=f(r),l=m(r);if(s||l){var u,c,p=o.selectAll(".select-outline-"+n.id);if(p&&a._fullLayout._outlining)s&&(u=T(p,t)),u&&i.call("_guiRelayout",a,{shapes:u}),l&&!U(t)&&(c=k(p,t)),c&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:c}).then((function(){e&&M(a)}))),a._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function W(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var a,i,o,s=[],l=e.map(W),u=r.map(W);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(a)>-1}function Q(t,e,r){var n,a;for(n=0;n-1&&e;if(!i&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,ft=et[0].yref;if(nt&&ft){var dt=ut(et);ct([I(t,nt,"x"),I(t,ft,"y")])($,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&pt(t,$),h._reselect=!1}if(!i&&h._deselect){var mt=h._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!_){var r=M.clickmode;L.done(Mt).then((function(){if(L.clear(Mt),2===t){for(xt.remove(),K=0;K-1&&V(e,k,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&pt(k,void 0);l.click(k,e)})).catch(A.error)}},n.doneFn=function(){kt.remove(),L.done(Mt).then((function(){L.clear(Mt),!S&&J&&n.selectionDefs&&(J.subtract=_t,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,W)),(S||_)&&Y(n,S),n.doneFnCompleted&&n.doneFnCompleted(At),x&&pt(k,it)})).catch(A.error)}},clearOutline:_,clearSelectionsCache:Y,selectOnClick:V}},{"../../lib":258,"../../lib/clear_gl_canvases":244,"../../lib/polygon":270,"../../lib/throttle":282,"../../plot_api/subroutines":295,"../../plots/cartesian/axis_ids":309,"../../registry":349,"../color":115,"../dragelement/helpers":133,"../drawing":137,"../fx":155,"../fx/helpers":151,"../shapes/constants":207,"../shapes/display_outlines":209,"../shapes/draw_newshape/helpers":214,"../shapes/draw_newshape/newshapes":215,"../shapes/handle_outline":216,"../shapes/helpers":217,"./constants":196,"./draw":198,"./draw_newselection/newselections":201,"./helpers":202,"point-in-polygon/nested":69,polybooljs:70}],205:[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,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},a.color,{editType:"arraydraw"}),width:o({},a.width,{editType:"calc+arraydraw"}),dash:o({},i,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},editType:"arraydraw"})},{"../../constants/axis_placeable_objects":232,"../../lib/extend":250,"../../plot_api/plot_template":294,"../../traces/scatter/attributes":380,"../annotations/attributes":98,"../drawing/attributes":136}],206:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/cartesian/axes"),i=t("./constants"),o=t("./helpers");function s(t){return u(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return u(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function u(t,e,r,a,s,l){var u=t/2,c=l;if("pixel"===e){var p=s?o.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[r,a],h=n.aggNums(Math.max,null,p),f=n.aggNums(Math.min,null,p),d=f<0?Math.abs(f)+u:u,m=h>0?h+u:u;return{ppad:u,ppadplus:c?d:m,ppadminus:c?m:d}}return{ppad:u}}function c(t,e,r,n,a){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,u,c,p,h=1/0,f=-1/0,d=n.match(i.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lf&&(f=p)));return f>=h?[h,f]:void 0}}e.exports=function(t){var e=t._fullLayout,r=n.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var o=0;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===C&&(t[0][0]="M"),e[S]=t,T(),k())}}()}}function B(t,r){!function(t,r){if(e.length)for(var n=0;n_?(k=p,C="y0",M=_,L="y1"):(k=_,C="y1",M=p,L="y0");X(n),Q(s,r),function(t,e,r){var n=e.xref,a=e.yref,o=i.getFromId(r,n),s=i.getFromId(r,a),l="";"paper"===n||o.autorange||(l+=n);"paper"===a||s.autorange||(l+=a);c.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),W.moveFn="move"===D?J:K,W.altKey=n.altKey},doneFn:function(){if(v(t))return;f(e),$(s),b(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;$(s)}};function X(r){if(v(t))D=null;else if(R)D="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=W.element.getBoundingClientRect(),a=n.right-n.left,i=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&a>10&&i>10&&!r.shiftKey?h.getCursor(o/a,1-s/i):"move";f(e,l),D=l.split("-")[0]}}function J(n,a){if("path"===r.type){var i=function(t){return t},o=i,l=i;z?B("xanchor",r.xanchor=H(x+n)):(o=function(t){return H(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+a)):(l=function(t){return G(Z(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(E,o,l))}else z?B("xanchor",r.xanchor=H(x+n)):(B("x0",r.x0=H(u+n)),B("x1",r.x1=H(g+n))),O?B("yanchor",r.yanchor=G(T+a)):(B("y0",r.y0=G(p+a)),B("y1",r.y1=G(_+a)));e.attr("d",y(t,r)),Q(s,r)}function K(n,a){if(F){var i=function(t){return t},o=i,l=i;z?B("xanchor",r.xanchor=H(x+n)):(o=function(t){return H(q(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),O?B("yanchor",r.yanchor=G(T+a)):(l=function(t){return G(Z(t)+a)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(E,o,l))}else if(R){if("resize-over-start-point"===D){var c=u+n,h=O?p-a:p+a;B("x0",r.x0=z?c:H(c)),B("y0",r.y0=O?h:G(h))}else if("resize-over-end-point"===D){var f=g+n,d=O?_-a:_+a;B("x1",r.x1=z?f:H(f)),B("y1",r.y1=O?d:G(d))}}else{var v=function(t){return-1!==D.indexOf(t)},b=v("n"),j=v("s"),V=v("w"),Y=v("e"),W=b?k+a:k,X=j?M+a:M,J=V?A+n:A,K=Y?S+n:S;O&&(b&&(W=k-a),j&&(X=M-a)),(!O&&X-W>10||O&&W-X>10)&&(B(C,r[C]=O?W:G(W)),B(L,r[L]=O?X:G(X))),K-J>10&&(B(I,r[I]=z?J:H(J)),B(P,r[P]=z?K:H(K)))}e.attr("d",y(t,r)),Q(s,r)}function Q(t,e){(z||O)&&function(){var r="path"!==e.type,n=t.selectAll(".visual-cue").data([0]);n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var i=q(z?e.xanchor:a.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=Z(O?e.yanchor:a.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(i=m.roundPositionForSharpStrokeRendering(i,1),o=m.roundPositionForSharpStrokeRendering(o,1),z&&O){var s="M"+(i-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(i-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var u="M"+(i-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",u)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(W),Y.node().onmousemove=X}(t,z,l,e,r,D):!0===l.editable&&z.style("pointer-events",P||u.opacity(S)*A<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!_(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,g(t)}}(t,z)}))}}function b(t,e,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");c.setClipUrl(t,n?"clip"+e._fullLayout._uid+n:null,e)}function w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,a=t.charAt(0),i=d.paramIsX[a],o=d.paramIsY[a],s=d.numParams[a];return a+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(i[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){_(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,g(t)))}e.exports={draw:g,drawOne:x,eraseActiveShape:function(t){if(!_(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&lf&&(t="X"),t}));return i>f&&(d=d.replace(/[\s,]*X.*/,""),a.log("Ignoring extra params in segment "+t)),c+d}))}(e,s,u);if("pixel"===e.xsizemode){var x=s(e.xanchor);c=x+e.x0,p=x+e.x1}else c=s(e.x0),p=s(e.x1);if("pixel"===e.ysizemode){var b=u(e.yanchor);h=b-e.y0,f=b-e.y1}else h=u(e.y0),f=u(e.y1);if("line"===d)return"M"+c+","+h+"L"+p+","+f;if("rect"===d)return"M"+c+","+h+"H"+p+"V"+f+"H"+c+"Z";var w=(c+p)/2,T=(h+f)/2,k=Math.abs(w-c),M=Math.abs(T-h),A="A"+k+","+M,S=w+k+","+T;return"M"+S+A+" 0 1,1 "+(w+","+(T-M))+A+" 0 0,1 "+S+"Z"}},{"../../lib":258,"../../plots/cartesian/axes":305,"./constants":207}],218:[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":316,"./attributes":205,"./calc_autorange":206,"./defaults":208,"./draw":210,"./draw_newshape/defaults":213}],219:[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,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=t("./constants"),c=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(a({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},{"../../lib/extend":250,"../../plot_api/edit_types":287,"../../plot_api/plot_template":294,"../../plots/animation_attributes":299,"../../plots/font_attributes":333,"../../plots/pad_attributes":345,"./constants":220}],220:[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}},{}],221:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.steps;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=a(t,e,{name:"steps",handleItemDefaults:u}),l=0,c=0;c0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*p.gripWidth,e._dims.currentValueTotalHeight))}}function C(t,e){var r=t._dims;return r.inputAreaStart+p.stepInset+(r.inputAreaLength-2*p.stepInset)*Math.min(1,Math.max(0,e))}function L(t,e){var r=t._dims;return Math.min(1,Math.max(0,(e-p.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*p.stepInset-2*r.inputAreaStart)))}function I(t,e,r){var n=r._dims,a=s.ensureSingle(t,"rect",p.railTouchRectClass,(function(n){n.call(M,e,t,r).style("pointer-events","all")}));a.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,p.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),o.setTranslate(a,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*p.railInset,a=s.ensureSingle(t,"rect",p.railRectClass);a.attr({width:n,height:p.railWidth,rx:p.railRadius,ry:p.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,e.bordercolor).call(i.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(a,p.railInset,.5*(r.inputAreaWidth-p.railWidth)+r.currentValueTotalHeight)}e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[p.name],n=[],a=0;a0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),a.autoMargin(t,y(e))}if(i.enter().append("g").classed(p.containerClassName,!0).style("cursor","ew-resize"),i.exit().each((function(){n.select(this).selectAll("g."+p.groupClassName).each(s)})).remove(),0!==r.length){var l=i.selectAll("g."+p.groupClassName).data(r,g);l.enter().append("g").classed(p.groupClassName,!0),l.exit().each(s).remove();for(var u=0;u0||h<0){var g={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[x.side];e.attr("transform",l(g[0],g[1]))}}}return R.call(F),D&&(C?R.on(".opacity",null):(M=0,A=!0,R.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(p.makeEditable,{gd:t}).on("edit",(function(e){void 0!==_?o.call("_guiRestyle",t,g,e,_):o.call("_guiRelayout",t,g,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(p.positionText,b.x,b.y)}))),R.classed("js-placeholder",A),T}}},{"../../constants/alignment":231,"../../constants/interactions":235,"../../lib":258,"../../lib/svg_text_utils":281,"../../plots/plots":346,"../../registry":349,"../color":115,"../drawing":137,"@plotly/d3":12,"fast-isnumeric":28}],225:[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,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,u=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:i(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:a.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":250,"../../plot_api/edit_types":287,"../../plot_api/plot_template":294,"../../plots/font_attributes":333,"../../plots/pad_attributes":345,"../color/attributes":114}],226:[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"}}},{}],227:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../plots/array_container_defaults"),i=t("./attributes"),o=t("./constants").name,s=i.buttons;function l(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}o("visible",a(t,e,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),n.noneOrAll(t,e,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),n.coerceFont(o,"font",r.font),o("bgcolor",r.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(t,e){function r(r,a){return n.coerce(t,e,s,r,a)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){a(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":258,"../../plots/array_container_defaults":300,"./attributes":225,"./constants":226}],228:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../plots/plots"),i=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),u=t("../../plot_api/plot_template").arrayEditor,c=t("../../constants/alignment").LINE_SPACING,p=t("./constants"),h=t("./scrollbox");function f(t){return t._index}function d(t,e){return+t.attr(p.menuIndexAttrName)===e._index}function m(t,e,r,n,a,i,o,s){e.active=o,u(t.layout,p.name,e).applyUpdate("active",o),"buttons"===e.type?g(t,n,null,null,e):"dropdown"===e.type&&(a.attr(p.menuIndexAttrName,"-1"),y(t,n,a,i,e),s||g(t,n,a,i,e))}function y(t,e,r,n,a){var i=s.ensureSingle(e,"g",p.headerClassName,(function(t){t.style("pointer-events","all")})),l=a._dims,u=a.active,c=a.buttons[u]||p.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};i.call(v,a,c,t).call(A,a,h,f),s.ensureSingle(e,"text",p.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,a.font).text(p.arrowSymbol[a.direction])})).attr({x:l.headerWidth-p.arrowOffsetX+a.pad.l,y:l.headerHeight/2+p.textOffsetY+a.pad.t}),i.on("click",(function(){r.call(S,String(d(r,a)?-1:a._index)),g(t,e,r,n,a)})),i.on("mouseover",(function(){i.call(w)})),i.on("mouseout",(function(){i.call(T,a)})),o.setTranslate(e,l.lx,l.ly)}function g(t,e,r,i,o){r||(r=e).attr("pointer-events","all");var l=function(t){return-1==+t.attr(p.menuIndexAttrName)}(r)&&"buttons"!==o.type?[]:o.buttons,u="dropdown"===o.type?p.dropdownButtonClassName:p.buttonClassName,c=r.selectAll("g."+u).data(s.filterVisible(l)),h=c.enter().append("g").classed(u,!0),f=c.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),f.transition().attr("opacity","0").remove()):f.remove();var d=0,y=0,g=o._dims,_=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(_?y=g.headerHeight+p.gapButtonHeader:d=g.headerWidth+p.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(y=-p.gapButtonHeader+p.gapButton-g.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-p.gapButtonHeader+p.gapButton-g.openWidth);var x={x:g.lx+d+o.pad.l,y:g.ly+y+o.pad.t,yPad:p.gapButton,xPad:p.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};c.each((function(s,l){var u=n.select(this);u.call(v,o,s,t).call(A,o,x),u.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,i,-1),a.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,i,l),a.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),u.on("mouseover",(function(){u.call(w)})),u.on("mouseout",(function(){u.call(T,o),c.call(b,o)}))})),c.call(b,o),_?(k.w=Math.max(g.openWidth,g.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(g.openHeight,g.headerHeight)),k.direction=o.direction,i&&(c.size()?function(t,e,r,n,a,i){var o,s,l,u=a.direction,c="up"===u||"down"===u,h=a._dims,f=a.active;if(c)for(s=0,l=0;l0?[0]:[]);if(o.enter().append("g").classed(p.containerClassName,!0).style("cursor","pointer"),o.exit().each((function(){n.select(this).selectAll("g."+p.headerGroupClassName).each(i)})).remove(),0!==r.length){var l=o.selectAll("g."+p.headerGroupClassName).data(r,f);l.enter().append("g").classed(p.headerGroupClassName,!0);for(var u=s.ensureSingle(o,"g",p.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),c=0;cw,M=s.barLength+2*s.barPad,A=s.barWidth+2*s.barPad,S=d,C=y+g;C+A>u&&(C=u-A);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:C,width:M,height:A}),this._hbarXMin=S+M/2,this._hbarTranslateMax=w-M):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=g>T,P=s.barWidth+2*s.barPad,E=s.barLength+2*s.barPad,D=d+m,z=y;D+P>l&&(D=l-P);var O=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,s.barColor),I?(this.vbar=O.attr({rx:s.barRadius,ry:s.barRadius,x:D,y:z,width:P,height:E}),this._vbarYMin=z+E/2,this._vbarTranslateMax=T-E):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=c-.5,B=I?p+P+.5:p+.5,N=h-.5,j=k?f+A+.5:f+.5,U=o._topdefs.selectAll("#"+R).data(k||I?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||I?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(i.setClipUrl,R,this.gd),this.bg.attr({x:d,y:y,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),k||I){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault(),n.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,a=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,a)-r)/(a-r)*(this.position.w-this._box.w)}if(this.vbar){var i=e+this._vbarYMin,s=i+this._vbarTranslateMax;e=(o.constrain(n.event.y,i,s)-i)/(s-i)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(i.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var a=t/r;this.hbar.call(i.setTranslate,t+a*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(i.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":258,"../color":115,"../drawing":137,"@plotly/d3":12}],231:[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"}}},{}],232:[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(" ")}}},{}],233:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],234:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],235:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],236:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],237:[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}},{}],238:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),a=r.register=n.register,i=t("./plot_api"),o=Object.keys(i),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],240:[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}},{}],241:[function(t,e,r){"use strict";var n=t("./mod"),a=n.mod,i=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function u(t,e){return i(e-t,s)}function c(t,e){if(l(e))return!0;var r,n;e[0](n=a(n,s))&&(n+=s);var i=a(t,s),o=i+s;return i>=r&&i<=n||o>=r&&o<=n}function p(t,e,r,n,a,i,u){a=a||0,i=i||0;var c,p,h,f,d,m=l([r,n]);function y(t,e){return[t*Math.cos(e)+a,i-t*Math.sin(e)]}m?(c=0,p=o,h=s):r=a&&t<=i);var a,i},pathArc:function(t,e,r,n,a){return p(null,t,e,r,n,a,0)},pathSector:function(t,e,r,n,a){return p(null,t,e,r,n,a,1)},pathAnnulus:function(t,e,r,n,a,i){return p(t,e,r,n,a,i,1)}}},{"./mod":265}],242:[function(t,e,r){"use strict";var n=Array.isArray,a=ArrayBuffer,i=DataView;function o(t){return a.isView(t)&&!(t instanceof i)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,a=0;aa.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,a){t%1||!n(t)||void 0!==a.min&&ta.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(p(+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(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var a=t.split("+"),i=0;i=n&&t<=a?t:c}if("string"!=typeof t&&"number"!=typeof t)return c;t=String(t);var u=b(e),g=t.charAt(0);!u||"G"!==g&&"g"!==g||(t=t.substr(1),e="");var w=u&&"chinese"===e.substr(0,7),T=t.match(w?_:v);if(!T)return c;var k=T[1],M=T[3]||"1",A=Number(T[5]||1),S=Number(T[7]||0),C=Number(T[9]||0),L=Number(T[11]||0);if(u){if(2===k.length)return c;var I;k=Number(k);try{var P=y.getComponentMethod("calendars","getCal")(e);if(w){var E="i"===M.charAt(M.length-1);M=parseInt(M,10),I=P.newDate(k,P.toMonthIndex(k,M,E),A)}else I=P.newDate(k,Number(M),A)}catch(t){return c}return I?(I.toJD()-m)*p+S*h+C*f+L*d:c}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),M-=1;var D=new Date(Date.UTC(2e3,M,A,S,C));return D.setUTCFullYear(k),D.getUTCMonth()!==M||D.getUTCDate()!==A?c:D.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),a=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==c};var T=90*p,k=3*h,M=5*f;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 c;e||(e=0);var i,o,s,u,v,_,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(b(r)){var S=Math.floor(w/p)+m,C=Math.floor(l(t,p));try{i=y.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){i=g("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=n+p&&t<=a-p))return c;var e=Math.floor(10*l(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===c)return e;if(r.isJSDate(t)||"number"==typeof t&&isFinite(t)){if(b(n))return s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,C=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function I(t,e,r,n){t=t.replace(S,(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(t=t.replace(C,(function(){return L[r("%q")(a)]})),b(n))try{t=y.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(a)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,a,i){if(a=b(a)&&a,!e)if("y"===r)e=i.year;else if("m"===r)e=i.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,p),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/f),60),2);if("M"!==e){o(e)||(e=0);var a=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(t,r)+"\n"+I(i.dayMonthYear,t,n,a);e=i.dayMonth+"\n"+i.year}return I(e,t,n,a)};var E=3*p;r.incrementMonth=function(t,e,r){r=b(r)&&r;var n=l(t,p);if(t=Math.round(t-n),r)try{var a=Math.round(t/p)+m,i=y.getComponentMethod("calendars","getCal")(r),o=i.fromJD(a);return e%12?i.add(o,e,"m"):i.add(o,e/12,"y"),(o.toJD()-m)*p+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var u=new Date(t+E);return u.setUTCMonth(u.getUTCMonth()+e)+n-E},r.findExactDates=function(t,e){for(var r,n,a=0,i=0,s=0,l=0,u=b(e)&&y.getComponentMethod("calendars","getCal")(e),c=0;c0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===u(t))e=t;else for(e=new Array(t.length),a=0;ae?r[n++]=[t[a][0]+360,t[a][1]]:a===e?(r[n++]=t[a],r[n++]=[t[a][0],-90]):r[n++]=t[a];var i=h.tester(r);i.pts.pop(),l.push(i)}:function(t){l.push(h.tester(t))},i.type){case"MultiPolygon":for(r=0;ra&&(a=u,e=l)}else e=r;return o.default(e).geometry.coordinates}(c),n.fIn=t,n.fOut=c,s.push(c)}else u.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete a[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(i),n("Unexpected error while fetching from "+t)):void a++}),50)}))}for(var o=0;o0&&(r.push(a),a=[])}return a.length>0&&r.push(a),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+p*m}}function l(t,e,r,n,a){var i=n*t+a*e;if(i<0)return n*n+a*a;if(i>r){var o=n-t,s=a-e;return o*o+s*s}var l=n*e-a*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,a,i,o,u){if(s(t,e,r,n,a,i,o,u))return 0;var c=r-t,p=n-e,h=o-a,f=u-i,d=c*c+p*p,m=h*h+f*f,y=Math.min(l(c,p,d,a-t,i-e),l(c,p,d,o-t,u-e),l(h,f,m,t-a,e-i),l(h,f,m,r-a,n-i));return Math.sqrt(y)},r.getTextLocation=function(t,e,r,s){if(t===a&&s===i||(n={},a=t,i=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),u=t.getPointAtLength(o(r+s/2,e)),c=Math.atan((u.y-l.y)/(u.x-l.x)),p=t.getPointAtLength(o(r,e)),h={x:(4*p.x+l.x+u.x)/6,y:(4*p.y+l.y+u.y)/6,theta:c};return n[r]=h,h},r.clearLocationCache=function(){a=null},r.getVisibleSegment=function(t,e,r){var n,a,i=e.left,o=e.right,s=e.top,l=e.bottom,u=0,c=t.getTotalLength(),p=c;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===c&&(a=r);var u=r.xo?r.x-o:0,p=r.yl?r.y-l:0;return Math.sqrt(u*u+p*p)}for(var f=h(u);f;){if((u+=f+r)>p)return;f=h(u)}for(f=h(p);f;){if(u>(p-=f+r))return;f=h(p)}return{min:u,max:p,len:p-u,total:c,isClosed:0===u&&p===c&&Math.abs(n.x-a.x)<.1&&Math.abs(n.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var a,i,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,u=n.iterationLimit||30,c=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,p=0,h=0,f=s;p0?f=a:h=a,p++}return i}},{"./mod":265}],256:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],257:[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}},{}],258:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,u=-l,c=s.BADNUM,p=e.exports={};p.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};p.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,p.warn('encountered bad format: "'+e+'"'))},p.noFormat=function(t){return String(t)},p.numberFormat=function(t){var e;try{e=i(p.adjustFormat(t))}catch(e){return p.warnBadFormat(t),p.noFormat}return e},p.nestedProperty=t("./nested_property"),p.keyedContainer=t("./keyed_container"),p.relativeAttr=t("./relative_attr"),p.isPlainObject=t("./is_plain_object"),p.toLogRange=t("./to_log_range"),p.relinkPrivateKeys=t("./relink_private");var f=t("./array");p.isTypedArray=f.isTypedArray,p.isArrayOrTypedArray=f.isArrayOrTypedArray,p.isArray1D=f.isArray1D,p.ensureArray=f.ensureArray,p.concat=f.concat,p.maxRowLength=f.maxRowLength,p.minRowLength=f.minRowLength;var d=t("./mod");p.mod=d.mod,p.modHalf=d.modHalf;var m=t("./coerce");p.valObjectMeta=m.valObjectMeta,p.coerce=m.coerce,p.coerce2=m.coerce2,p.coerceFont=m.coerceFont,p.coercePattern=m.coercePattern,p.coerceHoverinfo=m.coerceHoverinfo,p.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,p.validate=m.validate;var y=t("./dates");p.dateTime2ms=y.dateTime2ms,p.isDateTime=y.isDateTime,p.ms2DateTime=y.ms2DateTime,p.ms2DateTimeLocal=y.ms2DateTimeLocal,p.cleanDate=y.cleanDate,p.isJSDate=y.isJSDate,p.formatDate=y.formatDate,p.incrementMonth=y.incrementMonth,p.dateTick0=y.dateTick0,p.dfltRange=y.dfltRange,p.findExactDates=y.findExactDates,p.MIN_MS=y.MIN_MS,p.MAX_MS=y.MAX_MS;var g=t("./search");p.findBin=g.findBin,p.sorterAsc=g.sorterAsc,p.sorterDes=g.sorterDes,p.distinctVals=g.distinctVals,p.roundUp=g.roundUp,p.sort=g.sort,p.findIndexOfMin=g.findIndexOfMin,p.sortObjectKeys=t("./sort_object_keys");var v=t("./stats");p.aggNums=v.aggNums,p.len=v.len,p.mean=v.mean,p.median=v.median,p.midRange=v.midRange,p.variance=v.variance,p.stdev=v.stdev,p.interp=v.interp;var _=t("./matrix");p.init2dArray=_.init2dArray,p.transposeRagged=_.transposeRagged,p.dot=_.dot,p.translationMatrix=_.translationMatrix,p.rotationMatrix=_.rotationMatrix,p.rotationXYMatrix=_.rotationXYMatrix,p.apply3DTransform=_.apply3DTransform,p.apply2DTransform=_.apply2DTransform,p.apply2DTransform2=_.apply2DTransform2,p.convertCssMatrix=_.convertCssMatrix,p.inverseTransformMatrix=_.inverseTransformMatrix;var x=t("./angles");p.deg2rad=x.deg2rad,p.rad2deg=x.rad2deg,p.angleDelta=x.angleDelta,p.angleDist=x.angleDist,p.isFullCircle=x.isFullCircle,p.isAngleInsideSector=x.isAngleInsideSector,p.isPtInsideSector=x.isPtInsideSector,p.pathArc=x.pathArc,p.pathSector=x.pathSector,p.pathAnnulus=x.pathAnnulus;var b=t("./anchor_utils");p.isLeftAnchor=b.isLeftAnchor,p.isCenterAnchor=b.isCenterAnchor,p.isRightAnchor=b.isRightAnchor,p.isTopAnchor=b.isTopAnchor,p.isMiddleAnchor=b.isMiddleAnchor,p.isBottomAnchor=b.isBottomAnchor;var w=t("./geometry2d");p.segmentsIntersect=w.segmentsIntersect,p.segmentDistance=w.segmentDistance,p.getTextLocation=w.getTextLocation,p.clearLocationCache=w.clearLocationCache,p.getVisibleSegment=w.getVisibleSegment,p.findPointOnPath=w.findPointOnPath;var T=t("./extend");p.extendFlat=T.extendFlat,p.extendDeep=T.extendDeep,p.extendDeepAll=T.extendDeepAll,p.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");p.log=k.log,p.warn=k.warn,p.error=k.error;var M=t("./regex");p.counterRegex=M.counter;var A=t("./throttle");p.throttle=A.throttle,p.throttleDone=A.done,p.clearThrottle=A.clear;var S=t("./dom");function C(t){var e={};for(var r in t)for(var n=t[r],a=0;al||t=e)&&(o(t)&&t>=0&&t%1==0)},p.noop=t("./noop"),p.identity=t("./identity"),p.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},p.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},p.simpleMap=function(t,e,r,n,a){for(var i=t.length,o=new Array(i),s=0;s=Math.pow(2,r)?a>10?(p.warn("randstr failed uniqueness"),l):t(e,r,n,(a||0)+1):l},p.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},p.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,a,i,o=t.length,s=2*o,l=2*e-1,u=new Array(l),c=new Array(o);for(r=0;r=s&&(a-=s*Math.floor(a/s)),a<0?a=-1-a:a>=o&&(a=s-1-a),i+=t[a]*u[n];c[r]=i}return c},p.syncOrAsync=function(t,e,r){var n;function a(){return p.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(a);return r&&r(e)},p.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},p.noneOrAll=function(t,e,r){if(t){var n,a=!1,i=!0;for(n=0;n0?e:0}))},p.fillArray=function(t,e,r,n){if(n=n||p.identity,p.isArrayOrTypedArray(t))for(var a=0;a1?a+o[1]:"";if(i&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+i+"$2");return s+l},p.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;p.templateString=function(t,e){var r={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,n){var a;return z.test(n)?a=e[n]:(r[n]=r[n]||p.nestedProperty(e,n).get,a=r[n]()),p.isValidTextValue(a)?a:""}))};var O={max:10,count:0,name:"hovertemplate"};p.hovertemplateString=function(){return B.apply(O,arguments)};var R={max:10,count:0,name:"texttemplate"};p.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,i=arguments;e||(e={});var o={};return t.replace(p.TEMPLATE_STRING_REGEX,(function(t,s,l){var u,c,h,f="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,y="xother"===s||"yother"===s||f||m||d,g=s;if((f||d)&&(g=g.substring(1)),(m||d)&&(g=g.substring(0,g.length-1)),y){if(void 0===(u=e[g]))return""}else for(h=3;h=48&&o<=57,u=s>=48&&s<=57;if(l&&(n=10*n+o-48),u&&(a=10*a+s-48),!l||!u){if(n!==a)return n-a;if(o!==s)return o-s}}return a-n};var N=2e9;p.seedPseudoRandom=function(){N=2e9},p.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?p.pseudoRandom():N/4294967296},p.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},a=p.extractOption(t,e,"htx","hovertext");if(p.isValidTextValue(a))return n(a);var i=p.extractOption(t,e,"tx","text");return p.isValidTextValue(i)?n(i):void 0},p.isValidTextValue=function(t){return t||0===t},p.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;n1&&(u=1):u=0,p.strTranslate(a-u*(r+o),i-u*(n+s))+p.strScale(u)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},p.setTransormAndDisplay=function(t,e){t.attr("transform",p.getTextTransform(e)),t.style("display",e.scale?null:"none")},p.ensureUniformFontSize=function(t,e){var r=p.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},p.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)},p.bigFont=function(t){return Math.round(1.2*t)};var j=p.getFirefoxVersion(),U=null!==j&&j<86;p.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":236,"./anchor_utils":240,"./angles":241,"./array":242,"./clean_number":243,"./clear_responsive":245,"./coerce":246,"./dates":247,"./dom":248,"./extend":250,"./filter_unique":251,"./filter_visible":252,"./geometry2d":255,"./identity":256,"./increment":257,"./is_plain_object":259,"./keyed_container":260,"./localize":261,"./loggers":262,"./make_trace_groups":263,"./matrix":264,"./mod":265,"./nested_property":266,"./noop":267,"./notifier":268,"./preserve_drawing_buffer":271,"./push_unique":272,"./regex":274,"./relative_attr":275,"./relink_private":276,"./search":277,"./sort_object_keys":279,"./stats":280,"./throttle":282,"./to_log_range":283,"@plotly/d3":12,"d3-format":24,"d3-time-format":25,"fast-isnumeric":28}],259:[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).hasOwnProperty("hasOwnProperty")}},{}],260:[function(t,e,r){"use strict";var n=t("./nested_property"),a=/^\w*$/;e.exports=function(t,e,r,i){var o,s,l;r=r||"name",i=i||"value";var u={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var c={};if(s)for(o=0;o2)return u[e]=2|u[e],h.set(t,null);if(p){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},i.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},i.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":292,"./notifier":268}],263:[function(t,e,r){"use strict";var n=t("@plotly/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}},{"@plotly/d3":12}],264:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],266:[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,s,l,u=t;for(s=0;s/g),l=0;li||u===a||us)&&(!e||!l(t))}:function(t,e){var l=t[0],u=t[1];if(l===a||li||u===a||us)return!1;var c,p,h,f,d,m=r.length,y=r[0][0],g=r[0][1],v=0;for(c=1;cMath.max(p,y)||u>Math.max(h,g)))if(uc||Math.abs(n(o,h))>a)return!0;return!1},i.filter=function(t,e){var r=[t[0]],n=0,a=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(a+1);for(var u=l+1;u1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":236,"./matrix":264}],271:[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-1;s--){var l=i[s];if("Version/"===l.substr(0,8)){var u=l.substr(8).split(".")[0];if(n(u)&&(u=+u),u>=13)return!0}}}return r}},{"fast-isnumeric":28,"is-mobile":62}],272:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;na.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}function c(t,e){return t>=e}r.findBin=function(t,e,r){if(n(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var i,o,p=0,h=e.length,f=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?c:u,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);p90&&a.log("Long binary search..."),p-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var a,i=n[e]-n[0]||1,s=i/(e||1)/1e4,l=[],u=0;u<=e;u++){var c=n[u],p=c-a;void 0===a?(l.push(c),a=c):p>s&&(i=Math.min(i,p),l.push(c),a=c)}return{vals:l,minDiff:i}},r.roundUp=function(t,e,r){for(var n,a=0,i=e.length-1,o=0,s=r?0:1,l=r?1:0,u=r?Math.ceil:Math.floor;a0&&(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;ai.length)&&(o=i.length),n(e)||(e=!1),a(i[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":242,"fast-isnumeric":28}],281:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../lib"),i=a.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var A=t.text(),S=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&A.match(l),I=n.select(t.node().parentNode);if(!I.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",I.selectAll("svg."+P).remove(),I.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":A,"data-math":"N"}),S?(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,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2!==h&&3!==h)return void a.warn("No MathJax version:",MathJax.version);var f=function(){var r="math-output-"+a.randstr({},64),i=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(u,"\\lt ").replace(c,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(i):MathJax.typeset([i])},d=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),i=!e.empty()&&l.select("svg").node();if(i){var o,s=i.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else a.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=a.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:p},displayAlign:"left"})}),(function(){if("SVG"!==(i=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),f,d,(function(){if("SVG"!==i)return MathJax.Hub.setRenderer(i)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=a.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=p,"svg"!==(i=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){f(),d(),"svg"!==i&&(MathJax.config.startup.output=i),MathJax.config=o})))}(S[2],o,(function(n,a,o){I.selectAll("svg."+P).remove(),I.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return E(),void e();var l=I.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":A,"data-math":"Y"});l.node().appendChild(s.node()),a&&a.node()&&s.node().insertBefore(a.node().cloneNode(!0),s.node().firstChild);var u=o.width,c=o.height;s.attr({class:P,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black",h=s.select("g");h.attr({fill:p,stroke:p});var f=h.node().getBoundingClientRect(),d=f.width,y=f.height;(d>u||y>c)&&(s.style("overflow","hidden"),d=(f=s.node().getBoundingClientRect()).width,y=f.height);var g=+t.attr("x"),v=+t.attr("y"),_=-(r||t.node().getBoundingClientRect().height)/4;if("y"===P[0])l.attr({transform:"rotate("+[-90,g,v]+")"+i(-d/2,_-y/2)});else if("l"===P[0])v=_-y/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))g=0,v=_;else{var x=t.attr("text-anchor");g-=d*("middle"===x?.5:"end"===x?1:0),v=v+_-y/2}s.attr({x:g,y:v}),m&&m.call(t,l),e(l)}))}))):E(),t}function E(){I.empty()||(P=t.attr("class")+"-math",I.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(y," ");var r,i=!1,l=[],u=-1;function c(){u++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:u*s+"em"}),t.appendChild(e),r=e;var a=l;if(l=[{node:e}],a.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else a.log("Ignoring unexpected end tag .",e)}_.test(e)?c():(r=t,l=[{node:t}]);for(var S=e.split(g),I=0;I|>|>)/g;var p=[["$","$"],["\\(","\\)"]];var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},f={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],y=r.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,_=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,b=/(^|[\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&&C(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(g),o=[],s="",l=0,u=0;ua?o.push(c.substr(0,d-a)+"..."):o.push(c.substr(0,d));break}s=""}}return o.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function C(t){return t.replace(S,(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 L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var a=r.protocol,i=n.protocol;return-1!==m.indexOf(a)&&-1!==m.indexOf(i)?e:""}function I(t,e,r){var n,i,o,s=r.horizontalAlign,l=r.verticalAlign||"top",u=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===l?function(){return u.bottom-n.height}:"middle"===l?function(){return u.top+(u.height-n.height)/2}:function(){return u.top},o="right"===s?function(){return u.right-n.width}:"center"===s?function(){return u.left+(u.width-n.width)/2}:function(){return u.left},function(){n=this.node().getBoundingClientRect();var t=o()-c.left,e=i()-c.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=a.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=C,r.sanitizeHTML=function(t){t=t.replace(y," ");for(var e=document.createElement("p"),r=e,a=[],i=t.split(g),o=0;oi.ts+e?l():i.timer=setTimeout((function(){l(),i.timer=null}),e)},r.done=function(t){var e=n[t];return e&&e.timer?new Promise((function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}})):Promise.resolve()},r.clear=function(t){if(t)a(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],283:[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":28}],284:[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"}}},{}],285:[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"}}},{}],286:[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],s=0;s0&&o.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,n;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var i=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,p=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(D.x=1.02,D.xanchor="left"):D.x<-2&&(D.x=-.02,D.xanchor="right"),D.y>3?(D.y=1.02,D.yanchor="bottom"):D.y<-2&&(D.y=-.02,D.yanchor="top")),d(t),"rotate"===t.dragmode&&(t.dragmode="orbit"),u.clean(t),t.template&&t.template.layout&&r.cleanLayout(t.template.layout),t},r.cleanData=function(t){for(var e=0;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var b=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&i.warn("Full array edits are incompatible with other edits",p);var v=r[""][""];if(u(v))e.set(null);else{if(!Array.isArray(v))return i.warn("Unrecognized full array edit value",p,v),!0;e.set(v)}return!m&&(h(y,g),f(t),!0)}var _,x,b,w,T,k,M,A,S=Object.keys(r).map(Number).sort(o),C=e.get(),L=C||[],I=c(g,p).get(),P=[],E=-1,D=L.length;for(_=0;_L.length-(M?0:1))i.warn("index out of range",p,b);else if(void 0!==k)T.length>1&&i.warn("Insertion & removal are incompatible with edits to the same index.",p,b),u(k)?P.push(b):M?("add"===k&&(k={}),L.splice(b,0,k),I&&I.splice(b,0,{})):i.warn("Unrecognized full object edit value",p,b,k),-1===E&&(E=b);else for(x=0;x=0;_--)L.splice(P[_],1),I&&I.splice(P[_],1);if(L.length?C||e.set(L):e.set(null),m)return!1;if(h(y,g),d!==a){var z;if(-1===E)z=S;else{for(D=Math.max(L.length,D),z=[],_=0;_=E);_++)z.push(b);for(_=E;_=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(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function D(t,e,r,n,i){!function(t,e,r,n){var a=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var i in 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 l=function(t,e,r,n){var i,l,u,c,p,h=o.isPlainObject(n),f=[];for(var d in Array.isArray(r)||(r=[r]),r=I(r,t.data.length-1),e)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),b.clearPromiseQueue(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=Y(t,n),i=a.flags;i.calc&&(t.calcdata=void 0);var s=[h.previousPromises];i.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,i,a)||h.supplyDefaults(t),i.legend&&s.push(w.doLegend),i.layoutstyle&&s.push(w.layoutStyles),i.axrange&&q(s,a.rangesAltered),i.ticks&&s.push(w.doTicksRelayout),i.modebar&&s.push(w.doModeBar),i.camera&&s.push(w.doCamera),i.colorbars&&s.push(w.doColorBars),s.push(A)),s.push(h.rehover,h.redrag,h.reselect),u.add(t,U,[t,a.undoit],U,[t,a.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",a.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var a in e)if("axrange"!==a&&e[a])return!1;for(var i in r.rangesAltered){var o=f.id2name(i),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var u in l._matchGroup)if(u!==i){var c=n[f.id2name(u)];c.autorange=l.autorange,c.range=l.range.slice(),c._input.range=l.range.slice()}}return!0}function q(t,e){var r=e?function(t){var r=[];for(var n in e){var a=f.getFromId(t,n);if(r.push(n),-1!==(a.ticklabelposition||"").indexOf("inside")&&a._anchorAxis&&r.push(a._anchorAxis._id),a._matchGroup)for(var i in a._matchGroup)e[i]||r.push(i)}return f.draw(t,r,{skipTitle:!0})}:function(t){return f.draw(t,"redraw")};t.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var Z=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,H=/^[xyz]axis[0-9]*\.autorange$/,G=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,a,i=t.layout,l=t._fullLayout,u=l._guiEditing,h=F(l._preGUI,u),d=Object.keys(e),m=f.list(t),y=o.extendDeepAll({},e),g={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof D.parts[O];)O--;var B=D.parts[O],N=D.parts[O-1]+"."+B,U=D.parts.slice(0,O).join("."),V=s(t.layout,U).get(),q=s(l,U).get(),Y=D.get();if(void 0!==z){A[E]=z,S[E]="reverse"===B?z:R(Y);var X=p.getLayoutValObject(l,D.parts);if(X&&X.impliedEdits&&null!==z)for(var J in X.impliedEdits)C(o.relativeAttr(E,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(E))if(z){C("autosize",null);var K="height"===E?"width":"height";C(K,l[K])}else l[E]=t._initialAutoSize[E];else if("autosize"===E)C("width",z?null:l.width),C("height",z?null:l.height);else if(N.match(Z))P(N),s(l,U+"._inputRange").set(null);else if(N.match(H)){P(N),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(G)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var $="linear"===q.type&&"log"===z,tt="log"===q.type&&"linear"===z;if($||tt){if(L&&L.range)if(q.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&C(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),C(U+".range[0]",Math.log(et)/Math.LN10),C(U+".range[1]",Math.log(rt)/Math.LN10)):(C(U+".range[0]",Math.pow(10,et)),C(U+".range[1]",Math.pow(10,rt)))}else C(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[D.parts[0]]&&"radialaxis"===D.parts[1]&&delete l[D.parts[0]]._subplot.viewInitial["radialaxis.range"],c.getComponentMethod("annotations","convertCoords")(t,q,z,C),c.getComponentMethod("images","convertCoords")(t,q,z,C)}else C(U+".autorange",!0),C(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,E).get(),at=(z||{}).type;at&&"-"!==at||(at="linear"),c.getComponentMethod("annotations","convertCoords")(t,nt,at,C),c.getComponentMethod("images","convertCoords")(t,nt,at,C)}var it=x.containerArrayMatch(E);if(it){r=it.array,n=it.index;var ot=it.property,st=X||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(z)?S[E]=null:x.isRemoveVal(z)?S[E]=(s(i,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(M,st),g[r]||(g[r]={});var lt=g[r][n];lt||(lt=g[r][n]={}),lt[ot]=z,delete e[E]}else"reverse"===B?(V.range?V.range.reverse():(C(U+".autorange",!0),V.range=[1,0]),q.autorange?M.calc=!0:M.plot=!0):("dragmode"===E&&(!1===z&&!1!==Y||!1!==z&&!1===Y)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===E&&("lasso"===z||"select"===z)&&"lasso"!==Y&&"select"!==Y||l._has("gl2d")?M.plot=!0:X?T.update(M,X):M.calc=!0,D.set(z))}}for(r in g){x.applyContainerArrayChanges(t,h(i,r),g[r],M,h)||(M.plot=!0)}for(var ut in I){var ct=(L=f.getFromId(t,ut))&&L._constraintGroup;if(ct)for(var pt in M.calc=!0,ct)I[pt]||(f.getFromId(t,pt)._constraintShrinkable=!0)}return(W(t)||e.height||e.width)&&(M.plot=!0),(M.plot||M.calc)&&(M.layoutReplot=!0),{flags:M,rangesAltered:I,undoit:S,redoit:A,eventData:y}}function W(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function X(t,e,n,a){t=o.getGraphDiv(t),b.clearPromiseQueue(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=b.coerceTraceIndices(t,a),s=N(t,o.extendFlat({},e),i),l=s.flags,c=Y(t,o.extendFlat({},n)),p=c.flags;(l.calc||p.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&b.clearAxisTypes(t,i,n);var f=[];p.layoutReplot?f.push(w.layoutReplot):l.fullReplot?f.push(r._doPlot):(f.push(h.previousPromises),V(t,p,c)||h.supplyDefaults(t),l.style&&f.push(w.doTraceStyle),(l.colorbars||p.colorbars)&&f.push(w.doColorBars),p.legend&&f.push(w.doLegend),p.layoutstyle&&f.push(w.layoutStyles),p.axrange&&q(f,c.rangesAltered),p.ticks&&f.push(w.doTicksRelayout),p.modebar&&f.push(w.doModeBar),p.camera&&f.push(w.doCamera),f.push(A)),f.push(h.rehover,h.redrag,h.reselect),u.add(t,X,[t,s.undoit,c.undoit,s.traces],X,[t,s.redoit,c.redoit,s.traces]);var d=o.syncOrAsync(f,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:c.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=a.length?a[0]:a[t]:a}function l(t){return Array.isArray(i)?t>=i.length?i[0]:i[t]:i}function u(t,e){var r=0;return function(){if(t&&++r===e)return t()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(i,c){function p(){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,h.transition(t,e.frame.data,e.frame.layout,b.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 f(){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&&p()};e()}var d,m,y=0;function g(t){return Array.isArray(a)?y>=a.length?t.transitionOpts=a[y]:t.transitionOpts=a[0]:t.transitionOpts=a,y++,t}var v=[],_=null==e,x=Array.isArray(e);if(!_&&!x&&o.isPlainObject(e))v.push({type:"object",data:g(o.extendFlat({},e))});else if(_||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&M.push(m);v=M}}v.length>0?function(e){if(0!==e.length){for(var a=0;a=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,y=(c[m]||d[m]||{}).name,g=e[n].name,v=c[y]||d[y];y&&g&&"number"==typeof g&&v&&M<5&&(M++,o.warn('addFrames: overwriting frame "'+(c[y]||d[y]).name+'" with a frame whose name of type "number" also equates to "'+y+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&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.")),d[m]={name:m},f.push({frame:h.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}f.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(a=f[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(i=0;i=0;r--)n=e[r],i.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:a[n]});var l=h.modifyFrames,c=h.modifyFrames,p=[t,s],f=[t,i];return u&&u.add(t,l,p,c,f),h.modifyFrames(t,i)},r.addTraces=function t(e,n,a){e=o.getGraphDiv(e);var i,s,l=[],c=r.deleteTraces,p=t,h=[e,l],f=[e,n];for(function(t,e,r){var n,a;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=i.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!v(o))return!1;t=i[a][o]}else t=i[a]}else t=i}}return t}function v(t){return t===Math.round(t)&&t>=0}function _(){var t,e,r={};for(t in p(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var a=0;a=l.length)return!1;a=(r=(n.transformsRegistry[l[u].type]||{}).attributes)&&r[e[2]],s=3}else{var c=t._module;if(c||(c=(n.modules[t.type||i.type.dflt]||{})._module),!c)return!1;if(!(a=(r=c.attributes)&&r[o])){var p=c.basePlotModule;p&&p.attributes&&(a=p.attributes[o])}a||(a=i[o])}return g(a,e,s)},r.getLayoutValObject=function(t,e){return g(function(t,e){var r,a,i,s,l=t._basePlotModules;if(l){var u;for(r=0;r=a&&(r._input||{})._templateitemname;o&&(i=a);var s,l=e+"["+i+"]";function u(){s={},o&&(s[l]={},s[l].templateitemname=o)}function c(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function p(){var t=s;return u(),t}return u(),{modifyBase:function(t,e){s[t]=e},modifyItem:c,getUpdateObj:p,applyUpdate:function(e,r){e&&c(e,r);var a=p();for(var i in a)n.nestedProperty(t,i).set(a[i])}}}},{"../lib":258,"../plots/attributes":301}],295:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../registry"),i=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),u=t("../components/drawing"),c=t("../components/titles"),p=t("../components/modebar"),h=t("../plots/cartesian/axes"),f=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,y=d.clean,g=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||a[1]<=t[0])&&(i[0]e[0]))return!0}return!1}function _(t){var e,a,s,c,d,m,y=t._fullLayout,g=y._size,_=g.p,b=h.list(t,"",!0);if(y._paperdiv.style({width:t._context.responsive&&y.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":y.width+"px",height:t._context.responsive&&y.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":y.height+"px"}).selectAll(".main-svg").call(u.setSize,y.width,y.height),t._context.setBackground(t,y.paper_bgcolor),r.drawMainTitle(t),p.manage(t),!y._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-_-n:e._offset+e._length+_+n:g.t+g.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+_+n:e._offset-_-n:g.l+g.w*(t.position||0)+n%1}for(e=0;eT?c.push({code:"unused",traceType:v,templateCount:w,dataCount:T}):T>w&&c.push({code:"reused",traceType:v,templateCount:w,dataCount:T})}}else c.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var i=e[n],o=m(e,n,r);a(i)?(Array.isArray(e)&&!1===i._template&&i.templateitemname&&c.push({code:"missing",path:o,templateitemname:i.templateitemname}),t(i,o)):Array.isArray(i)&&y(i)&&t(i,o)}}({data:f,layout:h},""),c.length)return c.map(g)}},{"../lib":258,"../plots/attributes":301,"../plots/plots":346,"./plot_config":292,"./plot_schema":293,"./plot_template":294}],297:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("./plot_api"),i=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=t("../snapshot/tosvg"),u=t("../snapshot/svgtoimg"),c=t("../version").version,p={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,h,f,d;function m(t){return!(t in e)||o.validate(e[t],p[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},f=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),f=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(p.format.values,", "," or ")+".");var y={};function g(t,r){return o.coerce(e,y,p,t,r)}var v=g("format"),_=g("width"),x=g("height"),b=g("scale"),w=g("setBackground"),T=g("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var M=o.extendFlat({},h);_?M.width=_:null===e.width&&n(d.width)&&(M.width=d.width),x?M.height=x:null===e.height&&n(d.height)&&(M.height=d.height);var A=o.extendFlat({},f,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function C(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,v,b),n=k._fullLayout.width,p=k._fullLayout.height;function h(){a.purge(k),document.body.removeChild(k)}if("full-json"===v){var f=i.graphJson(k,!1,"keepdata","object",!0,!0);return f.version=c,f=JSON.stringify(f),h(),t(T?f:s.encodeJSON(f))}if(h(),"svg"===v)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),u({format:v,width:n,height:p,scale:b,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){a.newPlot(k,r,M,A).then(S).then(C).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":258,"../plots/plots":346,"../snapshot/helpers":353,"../snapshot/svgtoimg":355,"../snapshot/tosvg":357,"../version":424,"./plot_api":291,"fast-isnumeric":28}],298:[function(t,e,r){"use strict";var n=t("../lib"),a=t("../plots/plots"),i=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,u=n.isArrayOrTypedArray;function c(t,e,r,a,i,o){o=o||[];for(var p=Object.keys(t),h=0;h_.length&&a.push(d("unused",i,g.concat(_.length)));var M,A,S,C,L,I=_.length,P=Array.isArray(k);if(P&&(I=Math.min(I,k.length)),2===x.dimensions)for(A=0;A_[A].length&&a.push(d("unused",i,g.concat(A,_[A].length)));var E=_[A].length;for(M=0;M<(P?Math.min(E,k[A].length):E);M++)S=P?k[A][M]:k,C=v[A][M],L=_[A][M],n.validate(C,S)?L!==C&&L!==+C&&a.push(d("dynamic",i,g.concat(A,M),C,L)):a.push(d("value",i,g.concat(A,M),C))}else a.push(d("array",i,g.concat(A),v[A]));else for(A=0;A1&&f.push(d("object","layout"))),a.supplyDefaults(m);for(var y=m._fullData,g=r.length,v=0;v0&&Math.round(p)===p))return{vals:a};u=p}for(var h=e.calendar,f="start"===l,d="end"===l,m=t[r+"period0"],y=i(m,h)||0,g=[],v=[],_=[],x=a.length,b=0;bM;)k=o(k,-u,h);for(;k<=M;)k=o(k,u,h);T=o(k,-u,h)}else{for(k=y+(w=Math.round((M-y)/c))*c;k>M;)k-=c;for(;k<=M;)k+=c;T=k-c}g[b]=f?T:d?k:(T+k)/2,v[b]=T,_[b]=k}return{vals:g,starts:v,ends:_}}},{"../../constants/numerical":236,"../../lib":258,"fast-isnumeric":28}],303:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],304:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),u=t("./axis_ids"),c=u.getFromId,p=u.isLinked;function h(t,e){var r,n,a=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),u=m(t,e),c=u.min,p=u.max;if(0===c.length||0===p.length)return i.simpleMap(e.range,e.r2l);var h=c[0].val,y=p[0].val;for(r=1;r0&&((T=C-s(_)-l(x))>L?k/T>I&&(b=_,w=x,I=k/T):k/C>I&&(b={val:_.val,nopad:1},w={val:x.val,nopad:1},I=k/C));if(h===y){var P=h-1,E=h+1;if(A)if(0===h)a=[0,1];else{var D=(h>0?p:c).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,D/C));a=h>0?[0,z]:[z,0]}else a=S?[Math.max(0,P),Math.max(1,E)]:[P,E]}else A?(b.val>=0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(b.val-I*s(b)<0&&(b={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),I=(w.val-b.val-f(e,_.val,x.val))/(C-s(b)-l(w)),a=[b.val-I*s(b),w.val+I*l(w)];return g&&a.reverse(),i.simpleMap(a,e.l2r||Number)}function f(t,e,r){var n=0;if(t.rangebreaks)for(var a=t.locateBreaks(e,r),i=0;i0?r.ppadplus:r.ppadminus)||r.ppad||0),S=M((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),C=M(r.vpadplus||r.vpad),L=M(r.vpadminus||r.vpad);if(!T){if(h=1/0,f=-1/0,w)for(n=0;n0&&(h=i),i>f&&i-o&&(h=i),i>f&&i=E;n--)P(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,a,i,o=e._id,s=t._fullData,l=t._fullLayout,u=[],p=[];function h(t,e){for(n=0;n=r&&(u.extrapad||!o)){s=!1;break}a(e,u.val)&&u.pad<=r&&(o||!u.extrapad)&&(t.splice(l,1),l--)}if(s){var c=i&&0===e;t.push({val:e,pad:c?0:r,extrapad:!c&&o})}}function _(t){return a(t)&&Math.abs(t)=e}},{"../../components/drawing":137,"../../constants/numerical":236,"../../lib":258,"../../registry":349,"./axis_ids":309,"@plotly/d3":12,"fast-isnumeric":28}],305:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("fast-isnumeric"),i=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,u=t("../../lib/svg_text_utils"),c=t("../../components/titles"),p=t("../../components/color"),h=t("../../components/drawing"),f=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),y=m.ONEMAXYEAR,g=m.ONEAVGYEAR,v=m.ONEMINYEAR,_=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,b=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,M=m.ONEWEEK,A=m.ONEDAY,S=A/2,C=m.ONEHOUR,L=m.ONEMIN,I=m.ONESEC,P=m.MINUS_SIGN,E=m.BADNUM,D={K:"zeroline"},z={K:"gridline",L:"path"},O={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},B={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},N=t("../../constants/alignment"),j=N.MID_SHIFT,U=N.CAP_SHIFT,V=N.LINE_SPACING,q=N.OPPOSITE_SIDE,Z=e.exports={};Z.setConvert=t("./set_convert");var H=t("./axis_autotype"),G=t("./axis_ids"),Y=G.idSort,W=G.isLinked;Z.id2name=G.id2name,Z.name2id=G.name2id,Z.cleanId=G.cleanId,Z.list=G.list,Z.listIds=G.listIds,Z.getFromId=G.getFromId,Z.getFromTrace=G.getFromTrace;var X=t("./autorange");Z.getAutoRange=X.getAutoRange,Z.findExtremes=X.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}Z.coerceRef=function(t,e,r,n,a,i){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],u=n+"ref",c={};return a||(a=l[0]||("string"==typeof i?i:i[0])),i||(i=a),l=l.concat(l.map((function(t){return t+" domain"}))),c[u]={valType:"enumerated",values:l.concat(i?"string"==typeof i?[i]:i:[]),dflt:a},s.coerce(t,e,c,u)},Z.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},Z.coercePosition=function(t,e,r,n,a,i){var o,l;if("range"!==Z.getRefType(n))o=s.ensureNumber,l=r(a,i);else{var u=Z.getFromId(e,n);l=r(a,i=u.fraction2r(i)),o=u.cleanPos}t[a]=o(l)},Z.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:Z.getFromId(e,r).cleanPos)(t)},Z.redrawComponents=function(t,e){e=e||Z.listIds(t);var r=t._fullLayout;function n(n,a,i,s){for(var l=o.getComponentMethod(n,a),u={},c=0;cr&&p2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},Z.saveRangeInitial=function(t,e){for(var r=Z.list(t,"",!0),n=!1,a=0;a.3*h||c(n)||c(i))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));i.exactYears>.8&&o%12==0?t=Z.tickIncrement(t,"M6","reverse")+1.5*A:i.exactMonths>.8?t=Z.tickIncrement(t,"M1","reverse")+15.5*A:t-=S;var l=Z.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,g,u,i)),y=v,0;y<=c;)y=Z.tickIncrement(y,g,!1,i);return{start:e.c2r(v,0,i),end:e.c2r(y,0,i),size:g,_dataSpan:c-u}},Z.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,i=e.dtick&&a(e._tmin);if(i){var o=Z.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,Z.prepTicks(t,r),i){var u=a(e.dtick),c=a(t.dtick),p=u?e.dtick:+e.dtick.substring(1),h=c?t.dtick:+t.dtick.substring(1);u&&c?tt(p,h)?p===2*M&&h===2*A&&(t.dtick=M):p===2*M&&h===3*A?t.dtick=M:p!==M||(e._input.minor||{}).nticks?et(p/h,2.5)?t.dtick=p/2:t.dtick=p:t.dtick=A:"M"===String(e.dtick).charAt(0)?c?t.dtick="M1":tt(p,h)?p>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(p,h)||(t.dtick=et(p/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},Z.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,i=t.nticks;i||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,i=t._length/n):(n="y"===t._id.charAt(0)?40:80,i=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(i*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(i*=100),t._roughDTick=Math.abs(r[1]-r[0])/i,Z.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=Z.getTickFormat(t);if(i){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(i)||(/%[HI]/.test(i)?(e=C,o&&!n&&t.dtick=(D?0:1);z--){var O=!z;z?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var R=z?t:s.extendFlat({},t,t.minor);if(O?Z.prepMinorTicks(R,t,e):Z.prepTicks(R,e),"array"!==R.tickmode){var F=J(c),B=F[0],N=F[1],j=a(R.dtick),U="log"===i&&!(j||"L"===R.dtick.charAt(0)),V=Z.tickFirst(R,e);if(z){if(t._tmin=V,V=N:Y<=N;Y=Z.tickIncrement(Y,W,p,o)){if(z&&q++,R.rangebreaks&&!p){if(Y=f)break}if(I.length>d||Y===G)break;G=Y;var X={value:Y};z?(U&&Y!==(0|Y)&&(X.simpleLabel=!0),l>1&&q%l&&(X.skipLabel=!0),I.push(X)):(X.minor=!0,P.push(X))}}else z?(I=[],m=nt(t)):(P=[],L=nt(t))}if(D&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=I.map((function(t){return t.value})),Q=[],$=0;$0?(i=n-1,o=n):(i=n,o=n);var s,l=t[i].value,u=t[o].value,c=Math.abs(u-l),p=r||c,h=0;p>=v?h=c>=v&&c<=y?c:g:r===x&&p>=b?h=c>=b&&c<=_?c:x:p>=k?h=c>=k&&c<=w?c:T:r===M&&p>=M?h=M:p>=A?h=A:r===S&&p>=S?h=S:r===C&&p>=C&&(h=C),h>=c&&(h=c,s=!0);var f=a+h;if(e.rangebreaks&&h>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(a*(1-L)+L*f)!==E&&d++}(h*=d/84)||(t[n].drop=!0),s&&c>M&&(h=c)}(h>0||0===n)&&(t[n].periodX=a+h/2)}}(I,t,t._definedDelta),t.rangebreaks){var it="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=I.length-1;r>-1;r--)if(I[r].drop)I.splice(r,1);else{I[r].value=Et(I[r].value,t);var lt=t.c2p(I[r].value);(it?st>lt-ot:stf||ctf&&(ut.periodX=f),ct10||"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>=L&&i<=16||e>=C)t._tickround="M";else if(e>=I&&i<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,o)-20,t._tickround<0&&(t._tickround=4)}}else if(a(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);a(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),u=Math.floor(Math.log(l)/Math.LN10+.01),c=void 0===t.minexponent?3:t.minexponent;Math.abs(u)>c&&(mt(t.exponentformat)&&!yt(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function ft(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}}Z.autoTicks=function(t,e,r){var n;function i(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>g)e/=g,n=i(10),t.dtick="M"+12*pt(e,n,at);else if(o>T)e/=T,t.dtick="M"+pt(e,1,it);else if(o>A){if(t.dtick=pt(e,A,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=Z.getTickFormat(t),u="period"===t.ticklabelmode;u&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),u&&(t._dowTick0=t.tick0)}}else o>C?t.dtick=pt(e,C,it):o>L?t.dtick=pt(e,L,ot):o>I?t.dtick=pt(e,I,ot):(n=i(10),t.dtick=pt(e,n,at))}else if("log"===t.type){t.tick0=0;var c=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(c[1]-c[0])<1){var p=1.5*Math.abs((c[1]-c[0])/e);e=Math.abs(Math.pow(10,c[1])-Math.pow(10,c[0]))/p,n=i(10),t.dtick="L"+pt(e,n,at)}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))):Pt(t)?(t.tick0=0,n=1,t.dtick=pt(e,n,ct)):(t.tick0=0,n=i(10),t.dtick=pt(e,n,at));if(0===t.dtick&&(t.dtick=1),!a(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},Z.tickIncrement=function(t,e,r,i){var o=r?-1:1;if(a(e))return s.increment(t,o*e);var l=e.charAt(0),u=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,u,i);if("L"===l)return Math.log(Math.pow(10,t)+u)/Math.LN10;if("D"===l){var c="D2"===e?ut:lt,p=t+.01*o,h=s.roundUp(s.mod(p,1),c,r);return Math.floor(p)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},Z.tickFirst=function(t,e){var r=t.r2l||Number,i=s.simpleMap(t.range,r,void 0,void 0,e),o=i[1] ")}else t._prevDateHead=l,u+="
"+l;e.text=u}(t,o,r,u):"log"===c?function(t,e,r,n,i){var o=t.dtick,l=e.x,u=t.tickformat,c="string"==typeof o&&o.charAt(0);"never"===i&&(i="");n&&"L"!==c&&(o="L3",c="L");if(u||"L"===c)e.text=gt(Math.pow(10,l),t,i,n);else if(a(o)||"D"===c&&s.mod(l+.01,1)<.1){var p=Math.round(l),h=Math.abs(p),f=t.exponentformat;"power"===f||mt(f)&&yt(p)?(e.text=0===p?1:1===p?"10":"10"+(p>1?"":P)+h+"",e.fontSize*=1.25):("e"===f||"E"===f)&&h>2?e.text="1"+f+(p>0?"+":P)+h:(e.text=gt(Math.pow(10,l),t,"","fakehover"),"D1"===o&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==c)throw"unrecognized dtick "+String(o);e.text=String(Math.round(Math.pow(10,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,u,m):"category"===c?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r="");e.text=String(r)}(t,o):"multicategory"===c?function(t,e,r){var n=Math.round(e.x),a=t._categories[n]||[],i=void 0===a[1]?"":String(a[1]),o=void 0===a[0]?"":String(a[0]);r?e.text=o+" - "+i:(e.text=i,e.text2=o)}(t,o,r):Pt(t)?function(t,e,r,n,a){if("radians"!==t.thetaunit||r)e.text=gt(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=gt(s.deg2rad(e.x),t,a,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,u,m):function(t,e,r,n,a){"never"===a?a="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(a="hide");e.text=gt(e.x,t,a,n)}(t,o,0,u,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var y=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[y(o.x-.5),y(o.x+t.dtick-.5)]}return o},Z.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,a=Array.isArray(e)?e[1]:void 0;if(void 0!==a&&a!==n)return Z.hoverLabelText(t,n,r)+" - "+Z.hoverLabelText(t,a,r);var i="log"===t.type&&n<=0,o=Z.tickText(t,t.c2l(i?-n:n),"hover").text;return i?0===n?"0":P+o:o};var dt=["f","p","n","\u03bc","m","","k","M","G","T"];function mt(t){return"SI"===t||"B"===t}function yt(t){return t>14||t<-15}function gt(t,e,r,n){var i=t<0,o=e._tickround,l=r||e.exponentformat||"B",u=e._tickexponent,c=Z.getTickFormat(e),p=e.separatethousands;if(n){var h={exponentformat:l,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]};ht(h),o=(Number(h._tickround)||0)+4,u=h._tickexponent,e.hoverformat&&(c=e.hoverformat)}if(c)return e._numFormat(c)(t).replace(/-/g,P);var f,d=Math.pow(10,-o)/2;if("none"===l&&(u=0),(t=Math.abs(t))"+f+"":"B"===l&&9===u?t+="B":mt(l)&&(t+=dt[u/3+5]));return i?P+t:t}function vt(t,e){if(t){var r=Object.keys(B).reduce((function(t,r){return-1!==e.indexOf(r)&&B[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function _t(t,e){for(var r=[],n={},a=0;a1&&r=a.min&&t=0,i=c(t,e[1])<=0;return(r||a)&&(n||i)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(a)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-p:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?p-r.top:0,h),f.reverse()),r.width>0){var y=r.right-(e._offset+e._length);y>0&&(n.xr=1,n.r=y);var g=e._offset-r.left;g>0&&(n.xl=0,n.l=g)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?p-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-p:0,h),f.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var _=e._offset-r.top;_>0&&(n.yt=1,n.t=_)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[f[0]],e.title.text!==u._dfltTitle[d]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((a={x:0,y:0,r:0,l:0,t:0,b:0})[c]=e.linewidth,e.mirror&&!0!==e.mirror&&(a[c]+=h),!0===e.mirror||"ticks"===e.mirror?a[m]=e._anchorAxis.domain[f[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(a[m]=[e._counterDomainMin,e._counterDomainMax][f[1]]))}at&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(vt(n,e.automargin),vt(a,e.automargin)),i.autoMargin(t,Mt(e),n),i.autoMargin(t,At(e),a),i.autoMargin(t,St(e),s)})),r.skipTitle||at&&"bottom"===e.side||rt.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+wt(e);else{var s=Dt(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(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 u,p,f,d,m=Z.getPxPosition(t,e);"x"===i?(p=e._offset+e._length/2,f="top"===e.side?m-r:m+r):(f=e._offset+e._length/2,p="right"===e.side?m+r:m-r,u={rotate:"-90",offset:0});if("multicategory"!==e.type){var y=e._selections[e._id+"tick"];if(d={selection:y,side:e.side},y&&y.node()&&y.node().parentNode){var g=h.getTranslate(y.node().parentNode);d.offsetLeft=g.x,d.offsetTop=g.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return c.draw(t,a+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[i],avoid:d,transform:u,attributes:{x:p,y:f,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function it(t){var r=f+(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=kt(this),e=h.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]}},Z.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],a=t.side===n?1:-1,i=[-1,1,a,-a];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(i=i.map((function(t){return-t}))),t.side&&i.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),i},Z.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},Z.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"),s=r("inside"),l=o||a||n||i;if(!l&&!s)return[0,0];var u=t.side,c=l?(t.tickwidth||0)/2:0,p=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(c+=h*U,p+=(t.linewidth||0)/2);(a||i)&&(c+=(t.linewidth||0)/2,p+=3);s&&"top"===u&&(p-=h*(1-U));(a||n)&&(c=-c);"bottom"!==u&&"right"!==u||(p=-p);return[l?c:0,s?p:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(xt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(xt(e)))}},Z.makeTickPath=function(t,e,r,n){n||(n={});var a=n.minor;if(a&&!t.minor)return"";var i=void 0!==n.len?n.len:a?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+i*r:"M"+(e+s*r)+",0h"+i*r},Z.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",i=function(t){return-1!==n.indexOf(t)},o=i("top"),l=i("left"),u=i("right"),c=i("bottom")||l||o||u,p=i("inside"),h="inside"===n&&"inside"===t.ticks||!p&&"outside"===t.ticks&&"boundaries"!==t.tickson,f=0,d=0,m=h?t.ticklen:0;if(p?m*=-1:c&&(m=0),h&&(f+=m,r)){var y=s.deg2rad(r);f=m*Math.cos(y)+1,d=m*Math.sin(y)}t.showticklabels&&(h||t.showline)&&(f+=.2*t.tickfont.size);var g,v,_,x,b,w={labelStandoff:f+=(t.linewidth||1)/2*(p?-1:1),labelShift:d},T=0,k=t.side,M=t._id.charAt(0),A=t.tickangle;if("x"===M)x=(b=!p&&"bottom"===k||p&&"top"===k)?1:-1,p&&(x*=-1),g=d*x,v=e+f*x,_=b?1:-.2,90===Math.abs(A)&&(p?_+=j:_=-90===A&&"bottom"===k?U:90===A&&"top"===k?j:.5,T=j/2*(A/90)),w.xFn=function(t){return t.dx+g+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*_},w.anchorFn=function(t,e){if(c){if(l)return"end";if(u)return"start"}return a(e)&&0!==e&&180!==e?e*x<0!==p?"end":"start":"middle"},w.heightFn=function(e,r,n){return r<-60||r>60?-.5*n:"top"===t.side!==p?-n:0};else if("y"===M){if(x=(b=!p&&"left"===k||p&&"right"===k)?1:-1,p&&(x*=-1),g=f,v=d*x,_=0,p||90!==Math.abs(A)||(_=-90===A&&"left"===k||90===A&&"right"===k?U:.5),p){var S=a(A)?+A:0;if(0!==S){var C=s.deg2rad(S);T=Math.abs(Math.sin(C))*U*x,_=0}}w.xFn=function(t){return t.dx+e-(g+t.fontSize*_)*x+T*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*j},w.anchorFn=function(t,e){return a(e)&&90===Math.abs(e)?"middle":b?"end":"start"},w.heightFn=function(e,r,n){return"right"===t.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},Z.drawTicks=function(t,e,r){r=r||{};var a=e._id+"tick",i=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+a).data(i,bt);o.exit().remove(),o.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return p.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),zt(e,[R]),o.attr("transform",r.transFn)},Z.drawGrid=function(t,e,r){r=r||{};var a=e._id+"grid",i=e.minor&&e.minor.showgrid,o=i?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&Z.shouldShowZeroLine(t,e,l))for(var u="array"===e.tickmode,c=0;c=0;g--){var v=g?m:y;if(v){var _=v.selectAll("path."+a).data(g?s:o,bt);_.exit().remove(),_.enter().append("path").classed(a,1).classed("crisp",!1!==r.crisp),_.attr("transform",r.transFn).attr("d",r.path).each((function(t){return p.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&_.attr("d",r.path)}}zt(e,[z,O])},Z.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",a=Z.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 Y(t.id,e.id)}))})),i.attr("transform",r.transFn).attr("d",r.path).call(p.stroke,e.zerolinecolor||p.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),zt(e,[D])},Z.drawLabels=function(t,e,r){r=r||{};var i=t._fullLayout,o=e._id,c=o.charAt(0),p=r.cls||o+"tick",f=r.vals.filter((function(t){return t.text})),d=r.labelFns,m=r.secondary?0:e.tickangle,y=(e._prevTickAngles||{})[p],g=r.layer.selectAll("g."+p).data(e.showticklabels?f:[],bt),v=[];function _(t,i){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),c=d.anchorFn(t,i),p=r.transFn.call(o.node(),t)+(a(i)&&0!=+i?" rotate("+i+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),f=u.lineCount(o),m=V*t.fontSize,y=d.heightFn(t,a(i)?+i:0,(f-1)*m);if(y&&(p+=l(0,y)),s.empty()){var g=o.select("text");g.attr({transform:p,"text-anchor":c}),g.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=h.bBox(s.node()).width*{end:-.5,start:.5}[c];s.attr("transform",p+l(v,0))}}))}g.enter().append("g").classed(p,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),a=t._promises.length;r.call(u.positionText,d.xFn(e),d.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(u.convertToTspans,t),t._promises[a]?v.push(t._promises.pop().then((function(){_(r,m)}))):_(r,m)})),zt(e,[F]),g.exit().remove(),r.repositionOnUpdate&&g.each((function(t){n.select(this).select("text").call(u.positionText,d.xFn(t),d.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var a=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,u=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var c=s.simpleMap(e.range,e.r2l);l=e.l2p(c[0])+e._offset,u=e.l2p(c[1])+e._offset}var p=Math.min(l,u),f=Math.max(l,u),d=e.side,m=1/0,y=-1/0;for(var v in g.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var i=h.bBox(r.node()),s=0;o?(i.right>f||i.leftf||i.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||a||l.style("display",null)}))}))}))}))},_(g,y+1?y:m);var x=null;e._selections&&(e._selections[p]=g);var b=[function(){return v.length&&Promise.all(v)}];e.automargin&&i._redrawFromAutoMarginCount&&90===y?(x=90,b.push((function(){_(g,y)}))):b.push((function(){if(_(g,m),f.length&&"x"===c&&!a(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,i=[];if(g.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),a=kt(this),o=h.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=f.length,l=Math.abs((f[o-1].x-f[0].x)*e._m)/(o-1),u=e.ticklabelposition||"",p=function(t){return-1!==u.indexOf(t)},d=p("top"),y=p("left"),v=p("right"),b=p("bottom")||y||d||v?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(a,e))return"date";var y="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=p(r),a=0,o=0,s={},c=0;c2*a}(a,y)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,u,c="";if(2===o.length)for(s=0;s<2;s++)if(u=x(o[s])){c=y;break}var p=a("pattern",c);if(p===y)for(s=0;s<2;s++)(u=x(o[s]))&&(e.bounds[s]=o[s]=u-1);if(p)for(s=0;s<2;s++)switch(u=o[s],p){case y:if(!n(u))return void(e.enabled=!1);if((u=+u)!==Math.floor(u)||u<0||u>=7)return void(e.enabled=!1);e.bounds[s]=o[s]=u;break;case g:if(!n(u))return void(e.enabled=!1);if((u=+u)<0||u>24)return void(e.enabled=!1);e.bounds[s]=o[s]=u}if(!1===r.autorange){var h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]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":349,"./constants":312}],310:[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 s,l=r("categoryorder",a);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,a,i=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?a.substr(n):i.substr(r))+o:a+i+t*e:o}function y(t,e){for(var r=e._size,n=r.h/r.w,a={},i=Object.keys(t),o=0;ou*_)||T)for(r=0;rD&&FP&&(P=F);h/=(P-I)/(2*E),I=l.l2r(I),P=l.l2r(P),l.range=l._input.range=S=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",u(r,n)).attr("d",a+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:p.background,stroke:p.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(e,r)).attr("d","M0,0Z")}function U(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"),V(t,e,a,i)}function V(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 q(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function Z(t){E&&t.data&&t._context.showTips&&(a.notifier(a._(t,"Double-click to zoom back out"),"long"),E=!1)}function H(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/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,i){for(var o,s,l,u,c=!1,p={},h={},f=(i||{}).xaHash,d=(i||{}).yaHash,m=0;m=0)a._fullLayout._deactivateShape(a);else{var o=a._fullLayout.clickmode;if(q(a),2!==t||gt||Zt(),yt)o.indexOf("select")>-1&&S(r,a,J,K,e.id,Pt),o.indexOf("event")>-1&&f.click(a,r,e.id);else if(1===t&>){var s=m?D:E,u="s"===m||"w"===g?0:1,p=s._name+".range["+u+"]",h=function(t,e){var r,n=t.range[e],a=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(s,u),d="left",y="middle";if(s.fixedrange)return;m?(y="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===g&&(d="right"),a._context.showAxisRangeEntryBoxes&&n.select(xt).call(c.makeEditable,{gd:a,immediate:!0,background:a._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:y}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",a,p,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ft*e+bt)),a=Math.max(0,Math.min(et,dt*r+wt)),i=Math.abs(n-bt),o=Math.abs(a-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(bt,n),Tt.r=Math.max(bt,n),Tt.t=Math.min(wt,a),Tt.b=Math.max(wt,a),rt.isSubplotConstrained)i>P||o>P?(St="xy",i/tt>o/et?(o=i*et/tt,wt>a?Tt.t=wt-o:Tt.b=wt+o):(i=o*tt/et,bt>n?Tt.l=bt-i:Tt.r=bt+i),Lt.attr("d",H(Tt))):s();else if(nt.isSubplotConstrained)if(i>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),u=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=u*tt,Tt.b=(1-l)*et,Tt.t=(1-u)*et,Lt.attr("d",H(Tt))}else s();else!it||o0){var c;if(nt.isSubplotConstrained||!at&&1===it.length){for(c=0;cm[1]-1/4096&&(e.domain=s),a.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":258,"fast-isnumeric":28}],322:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,a,i){i||(i={});var o=i.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":325}],323:[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":231}],324:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("d3-time-format").utcFormat,i=t("../../lib"),o=i.numberFormat,s=t("fast-isnumeric"),l=i.cleanNumber,u=i.ms2DateTime,c=i.dateTime2ms,p=i.ensureNumber,h=i.isArrayOrTypedArray,f=t("../../constants/numerical"),d=f.FP_SAFE,m=f.BADNUM,y=f.LOG_CLIP,g=f.ONEWEEK,v=f.ONEDAY,_=f.ONEHOUR,x=f.ONEMIN,b=f.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,M=T.WEEKDAY_PATTERN;function A(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",f=r.charAt(0);function C(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*y*Math.abs(n-a))}return m}function L(e,r,n,a){if((a||{}).msUTC&&s(e))return+e;var o=c(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*i.mod(e+.05,1)),u=Math.round(e-l/10);o=c(new Date(u))+l/10}return o}function I(e,r,n){return u(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function E(e){if(S(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 m}function D(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=D(t);return void 0!==e?e:s(t)?+t:void 0}function O(t){return s(t)?+t:D(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===f;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var a=n?-1:1,i=a*e,o=0,l=0;lc)){o=i<(u+c)/2?l:l+1;break}o=l+1}var p=t._B[o]||0;return isFinite(p)?R(e,t._m2,p):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,a=0;at._rangebreaks[a].pmax&&(n=a+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?C:p,t.l2c="log"===t.type?A:p,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(C(t,e))}:B,t.p2c="log"===t.type?function(t){return A(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=p,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=p):"log"===t.type?(t.d2r=t.d2l=function(t,e){return C(l(t),e)},t.r2d=t.r2c=function(t){return A(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=p,t.c2r=C,t.l2d=A,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return A(N(t))},t.r2p=function(e){return t.l2p(l(e))},t.p2r=N,t.cleanPos=p):"date"===t.type?(t.d2r=t.r2d=i.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=I,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return I(N(t),e,r)},t.cleanPos=function(e){return i.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=E,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=O(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=p,t.r2l=O,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:p(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=D,t.l2r=t.c2r=p,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:p(t)},t.setupMultiCategory=function(n){var a,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var u in l)if(u!==r){var c=e[w.id2name(u)];s=s.concat(c._traceIndices)}var p=[[0,{}],[0,{}]],d=[];for(a=0;ad&&(o[n]=d),o[0]===o[1]){var u=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=u,o[1]+=u}}else i.nestedProperty(t,e).set(a)},t.setScale=function(r){var n=e._size;if(t.overlaying){var a=w.getFromId({_fullLayout:e},t.overlaying);t.domain=a.domain}var i=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(i);var s,l,u=t.r2l(t[i][0],o),c=t.r2l(t[i][1],o),p="y"===f;if((p?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(u-c),t._b=-t._m*c):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(c-u),t._b=-t._m*u),t._rangebreaks=[],t._lBreaks=0,t._m2=0,t._B=[],t.rangebreaks)&&(t._rangebreaks=t.locateBreaks(Math.min(u,c),Math.max(u,c)),t._rangebreaks.length)){for(s=0;sc&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(c-u)-t._lBreaks),t._B.push(-t._m2*(p?c:u)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),a=!1)}a&&u.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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 y(e,r){var n=e.plotinfo,a=n.xaxis,l=n.yaxis,u=a._length,c=l._length,p=!!e.xr1,h=!!e.yr1,f=[];if(p){var d=i.simpleMap(e.xr0,a.r2l),m=i.simpleMap(e.xr1,a.r2l),y=d[1]-d[0],g=m[1]-m[0];f[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*u,f[2]=u*(1-r+r*g/y),a.range[0]=a.l2r(d[0]*(1-r)+r*m[0]),a.range[1]=a.l2r(d[1]*(1-r)+r*m[1])}else f[0]=0,f[2]=u;if(h){var v=i.simpleMap(e.yr0,l.r2l),_=i.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],b=_[1]-_[0];f[1]=(v[1]*(1-r)+r*_[1]-v[1])/(v[0]-v[1])*c,f[3]=c*(1-r+r*b/x),l.range[0]=a.l2r(v[0]*(1-r)+r*_[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*_[1])}else f[1]=0,f[3]=c;s.drawOne(t,a,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[a._id,l._id]);var w=p?u/f[2]:1,T=h?c/f[3]:1,k=p?f[0]:0,M=h?f[1]:0,A=p?f[0]/f[2]*u:0,S=h?f[1]/f[3]*c:0,C=a._offset-A,L=l._offset-S;n.clipRect.call(o.setTranslate,k,M).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,C,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":137,"../../lib":258,"../../registry":349,"./axes":305,"@plotly/d3":12}],330:[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,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var u=function(t,e,r){for(var n=0;n0&&(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,s,l);if(!u)return;if("histogram"===u.type&&l==={v:"y",h:"x"}[u.orientation||"v"])return void(t.type="linear");var c=l+"calendar",p=u[c],h={noMultiCategory:!n(u,"cartesian")||n(u,"noMultiCategory")};"box"===u.type&&u._hasPreCompStats&&l==={h:"x",v:"y"}[u.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(u,l)){var f=i(u),d=[];for(r=0;r0?".":"")+i;a.isPlainObject(o)?l(o,e,s,n+1):e(s,i,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var u=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(u)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(u){i(t,u,s.cache),s.check=function(){if(l){var e=i(t,u,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:u.type,prop:u.prop,traces:u.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var c=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],p=0;pOpenStreetMap contributors',i=['\xa9 Carto',a].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:a,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:i,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":279}],339:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),a=r[0],i=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,u=["",""],c=[0,0];switch(a){case"top":u[0]="top",c[1]=-l;break;case"bottom":u[0]="bottom",c[1]=l}switch(i){case"left":u[1]="right",c[0]=-s;break;case"right":u[1]="left",c[0]=s}return{anchor:u[0]&&u[1]?u.join("-"):u[0]?u[0]:u[1]?u[1]:"center",offset:c}}},{"../../lib":258}],340:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),a=t("../../lib"),i=a.strTranslate,o=a.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),u=t("@plotly/d3"),c=t("../../components/drawing"),p=t("../../lib/svg_text_utils"),h=t("./mapbox"),f=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==f.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=a.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,i=e._subplots.mapbox;if(n.version!==f.requiredVersion)throw new Error(f.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],i=[],o=!1,s=!1,l=0;l1&&a.warn(f.multipleTokensErrorMsg),n[0]):(i.length&&a.log(["Listed mapbox access token(s)",i.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,i);n.accessToken=o;for(var l=0;lb/2){var w=g.split("|").join("
");_.text(w).attr("data-unformatted",w).call(p.convertToTspans,t),x=c.bBox(_.node())}_.attr("transform",i(-3,8-x.height)),v.insert("rect",".static-attribution").attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;x.width+6>b&&(T=b/(x.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];v.attr("transform",i(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function c(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var a=t.symbol,o=i(a.textposition,a.iconsize);n.extendFlat(e,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":a.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=u(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,u(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",i.tileSize=256):"image"===r&&(e="url",i.coordinates=t.coordinates);i[e]=n,t.sourceattribution&&(i.attribution=a(t.sourceattribution));return i}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&y(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),a.indexOf("event")>-1&&u.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var i,o=t.dragmode;i=function(t,r){r.isRect?(t.range={})[e.id]=[u([r.xmin,r.ymin]),u([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(u)};var s=e.dragOptions;e.dragOptions=a.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:i},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||p(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){f(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function u(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(i["text-anchor"]="start",i.x=5):(i["text-anchor"]="end",i.x=e._paper.attr("width")-7),r.attr(i);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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),s.text(o.text()&&l.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 T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function M(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,a={};function i(t){for(var r=!0,i=0;i1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(u,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(h,l,p,n),x.cleanPlot(h,l,p,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var a=0;a0){var p=1-2*s;n=Math.round(p*n),a=Math.round(p*a)}}var h=x.layoutAttributes.width.min,f=x.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-a)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=a)),t._initialAutoSize||(t._initialAutoSize={width:n,height:a}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var a,i,o,l=s.componentsRegistry,u=e._basePlotModules,p=s.subplotsRegistry.cartesian;for(a in l)(o=l[a]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in u.length||u.push(p),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),p.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(c.subplotSort);for(i=0;i1&&(r.l/=g,r.r/=g)}if(f){var v=(r.t+r.b)/f;v>1&&(r.t/=v,r.b/=v)}var _=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:_,size:r.l+y},r:{val:b,size:r.r+y},b:{val:T,size:r.b+y},t:{val:w,size:r.t+y}},m[e]=1}else delete d[e],delete m[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={}),I(e);var a=e._size,i=e.margin,l=c.extendFlat({},a),u=i.l,p=i.r,h=i.t,d=i.b,m=e._pushmargin,y=e._pushmarginIds,g=e.minreducedwidth,v=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var _ in m)y[_]||delete m[_];for(var b in m.base={l:{val:0,size:u},r:{val:1,size:p},t:{val:1,size:h},b:{val:0,size:d}},m){var w=m[b].l||{},T=m[b].b||{},k=w.val,M=w.size,A=T.val,S=T.size;for(var C in m){if(o(M)&&m[C].r){var L=m[C].r.val,P=m[C].r.size;if(L>k){var E=(M*L+(P-r)*k)/(L-k),D=(P*(1-k)+(M-r)*(1-L))/(L-k);E+D>u+p&&(u=E,p=D)}}if(o(S)&&m[C].t){var z=m[C].t.val,O=m[C].t.size;if(z>A){var R=(S*z+(O-n)*A)/(z-A),F=(O*(1-A)+(S-n)*(1-z))/(z-A);R+F>d+h&&(d=R,h=F)}}}}}var B=c.constrain(r-i.l-i.r,2,g),N=c.constrain(n-i.t-i.b,2,v),j=Math.max(0,r-B),U=Math.max(0,n-N);if(j){var V=(u+p)/j;V>1&&(u/=V,p/=V)}if(U){var q=(d+h)/U;q>1&&(d/=q,h/=q)}if(a.l=Math.round(u),a.r=Math.round(p),a.t=Math.round(h),a.b=Math.round(d),a.p=Math.round(i.pad),a.w=Math.round(r)-a.l-a.r,a.h=Math.round(n)-a.t-a.b,!e._replotting&&x.didMarginChange(l,a)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var Z=3*(1+Object.keys(y).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var i=0,o=0;function l(){return i++,function(){o++,n||o!==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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(a)}}r.runFn(l),setTimeout(l())}))}],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;r1)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,s=a?t._fullLayout:t.layout,l=(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 p={data:(o||[]).map((function(t){var r=u(t);return e&&delete r.fit,r}))};if(!e&&(p.layout=u(s),a)){var h=s._size;p.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(p.frames=u(l)),i&&(p.config=u(t._context,!0)),"object"===n?p:JSON.stringify(p)},x.modifyFrames=function(t,e){var r,n,a,i=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;i--)if(s[i].enabled){r._indexToPoints=s[i]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,u,p),a=0;a0){for(var n=[],a=0;a-1&&(p[f[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(b),b=(b=b.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(u,"'"),a.isIE()&&(b=(b=(b=b.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),b}},{"../components/color":115,"../components/drawing":137,"../constants/xmlns_namespaces":237,"../lib":258,"@plotly/d3":12}],358:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,u=a.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:a.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},a.geojson,{}),featureidkey:a.featureidkey,text:l({},a.text,{}),hovertext:l({},a.hovertext,{}),marker:{line:{color:l({},u.color,{dflt:s}),width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:a.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:a.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":114,"../../components/colorscale/attributes":122,"../../lib/extend":250,"../../plots/attributes":301,"../../plots/template_attributes":348,"../scattergeo/attributes":408}],359:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../constants/numerical").BADNUM,i=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,u=e._length,c=new Array(u);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var p=0;p")}(t,p,o),[t]}},{"../../lib":258,"../../plots/cartesian/axes":305,"./attributes":358}],362:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[];if(!1===e)for(r=0;r=0;n--){var a=r[n].id;if("string"==typeof a&&0===a.indexOf("water"))for(var i=n+1;i=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new o(t,r.uid),i=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(i,{type:"geojson",data:s.geojson}),a._addLayers(s,l),e[0].trace._glTrace=a,a}},{"../../plots/mapbox/constants":338,"./convert":364}],368:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/attributes"),o=t("../scattermapbox/attributes"),s=t("../../lib/extend").extendFlat;e.exports=s({lon:o.lon,lat:o.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:o.text,hovertext:o.hovertext,hoverinfo:s({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:a(),showlegend:s({},i.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/colorscale/attributes":122,"../../lib/extend":250,"../../plots/attributes":301,"../../plots/template_attributes":348,"../scattermapbox/attributes":410}],369:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),a=t("../../lib").isArrayOrTypedArray,i=t("../../constants/numerical").BADNUM,o=t("../../components/colorscale/calc"),s=t("../../lib")._;e.exports=function(t,e){for(var r=e._length,l=new Array(r),u=e.z,c=a(u)&&u.length,p=0;p0?+f[c]:0),p.push({type:"Feature",geometry:{type:"Point",coordinates:g},properties:v})}}var x=o.extractOpts(e),b=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=b[0][1],T=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(c=1;c=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,a=new i(t,r.uid),o=a.sourceId,s=n(e),l=a.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}},{"../../plots/mapbox/constants":338,"./convert":370}],376:[function(t,e,r){"use strict";e.exports={min:"zmin",max:"zmax"}},{}],377:[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;rl&&I[g].gap;)g--;for(_=I[g].s,m=I.length-1;m>g;m--)I[m].s=_;for(;lA[c]&&c=0;a--){var i=t[a];if("scatter"===i.type&&i.xaxis===r.xaxis&&i.yaxis===r.yaxis){i.opacity=void 0;break}}}}}},{}],387:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("../../registry"),i=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),u=t("./period_defaults"),c=t("./stack_defaults"),p=t("./marker_defaults"),h=t("./line_defaults"),f=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults"),y=t("../../lib").coercePattern;e.exports=function(t,e,r,g){function v(r,a){return n.coerce(t,e,i,r,a)}var _=l(t,e,g,v);if(_||(e.visible=!1),e.visible){u(t,e,g,v),v("xhoverformat"),v("yhoverformat");var x=c(t,e,g,v),b=!x&&_=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(h.c2p(t.x)-d);return i=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),a=1-1/n,i=Math.abs(f.c2p(t.y)-m);return iY!=(N=z[E][1])>=Y&&(R=z[E-1][0],F=z[E][0],N-B&&(O=R+(F-R)*(Y-B)/(N-B),q=Math.min(q,O),Z=Math.max(Z,O)));q=Math.max(q,0),Z=Math.min(Z,h._length);var W=s.defaultLine;return s.opacity(p.fillcolor)?W=p.fillcolor:s.opacity((p.line||{}).color)&&(W=p.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:q,x1:Z,y0:Y,y1:Y,color:W,hovertemplate:!1}),delete t.index,p.text&&!Array.isArray(p.text)?t.text=String(p.text):t.text=p.name,[t]}}}},{"../../components/color":115,"../../components/fx":155,"../../lib":258,"../../registry":349,"./get_trace_color":390}],392:[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":317,"./arrays_to_calcdata":379,"./attributes":380,"./calc":381,"./cross_trace_calc":385,"./cross_trace_defaults":386,"./defaults":387,"./format_labels":389,"./hover":391,"./marker_colorbar":398,"./plot":401,"./select":402,"./style":404,"./subtypes":405}],393:[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,s,l){l||(l={});var u=(t.marker||{}).color;(s("line.color",r),a(t,"line"))?i(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(u)&&u||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":125,"../../components/colorscale/helpers":126,"../../lib":258}],394:[function(t,e,r){"use strict";var n=t("../../components/drawing"),a=t("../../constants/numerical"),i=a.BADNUM,o=a.LOG_CLIP,s=o+.5,l=o-.5,u=t("../../lib"),c=u.segmentsIntersect,p=u.constrain,h=t("./constants");e.exports=function(t,e){var r,a,o,f,d,m,y,g,v,_,x,b,w,T,k,M,A,S,C=e.trace||{},L=e.xaxis,I=e.yaxis,P="log"===L.type,E="log"===I.type,D=L._length,z=I._length,O=e.backoff,R=C.marker,F=e.connectGaps,B=e.baseTolerance,N=e.shape,j="linear"===N,U=C.fill&&"none"!==C.fill,V=[],q=h.minTolerance,Z=t.length,H=new Array(Z),G=0;function Y(r){var n=t[r];if(!n)return!1;var a=e.linearized?L.l2p(n.x):L.c2p(n.x),o=e.linearized?I.l2p(n.y):I.c2p(n.y);if(a===i){if(P&&(a=L.c2p(n.x,!0)),a===i)return!1;E&&o===i&&(a*=Math.abs(L._m*z*(L._m>0?s:l)/(I._m*D*(I._m>0?s:l)))),a*=1e3}if(o===i){if(E&&(o=I.c2p(n.y,!0)),o===i)return!1;o*=1e3}return[a,o]}function W(t,e,r,n){var a=r-t,i=n-e,o=.5-t,s=.5-e,l=a*a+i*i,u=a*o+i*s;if(u>0&&uot||t[1]lt)return[p(t[0],it,ot),p(t[1],st,lt)]}function pt(t,e){return t[0]===e[0]&&(t[0]===it||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function ht(t,e,r){return function(n,a){var i=ct(n),o=ct(a),s=[];if(i&&o&&pt(i,o))return s;i&&s.push(i),o&&s.push(o);var l=2*u.constrain((n[t]+a[t])/2,e,r)-((i||n)[t]+(o||a)[t]);l&&((i&&o?l>0==i[t]>o[t]?i:o:i||o)[t]+=l);return s}}function ft(t){var e=t[0],r=t[1],n=e===H[G-1][0],a=r===H[G-1][1];if(!n||!a)if(G>1){var i=e===H[G-2][0],o=r===H[G-2][1];n&&(e===it||e===ot)&&i?o?G--:H[G-1]=t:a&&(r===st||r===lt)&&o?i?G--:H[G-1]=t:H[G++]=t}else H[G++]=t}function dt(t){H[G-1][0]!==t[0]&&H[G-1][1]!==t[1]&&ft([$,tt]),ft(t),et=null,$=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,a=0;a<4;a++){var i=ut[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(G)if(et){var n=nt(et,e);n.length>1&&(dt(n[0]),H[G++]=n[1])}else rt=nt(H[G-1],e)[0],H[G++]=rt;else H[G++]=[K||e[0],Q||e[1]];var a=H[G-1];K&&Q&&(a[0]!==K||a[1]!==Q)?(et&&($!==K&&tt!==Q?ft($&&tt?(i=et,s=(o=e)[0]-i[0],l=(o[1]-i[1])/s,(i[1]*o[0]-o[1]*i[0])/s>0?[l>0?it:ot,lt]:[l>0?ot:it,st]):[$||K,tt||Q]):$&&tt&&ft([$,tt])),ft([K,Q])):$-K&&tt-Q&&ft([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&dt(nt(et,e)[0]),H[G++]=e;var i,o,s,l}for(r=0;rX(m,gt))break;o=m,(w=v[0]*g[0]+v[1]*g[1])>x?(x=w,f=m,y=!1):w=t.length||!m)break;yt(m),a=m}}else yt(f)}et&&ft([$||et[0],tt||et[1]]),V.push(H.slice(0,G))}var vt=N.slice(N.length-1);if(O&&"h"!==vt&&"v"!==vt){for(var _t=!1,xt=-1,bt=[],wt=0;wt=0?l=f:(l=f=h,h++),l0?Math.max(r,i):0}}},{"fast-isnumeric":28}],398:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],399:[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,s,l,u){var c=o.isBubble(t),p=(t.line||{}).color;(u=u||{},p&&(r=p),l("marker.symbol"),l("marker.opacity",c?.7:1),l("marker.size"),u.noAngle||(l("marker.angle"),u.noAngleRef||l("marker.angleref"),u.noStandOff||l("marker.standoff")),l("marker.color",r),a(t,"marker")&&i(t,e,s,l,{prefix:"marker.",cLetter:"c"}),u.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),u.noLine||(l("marker.line.color",p&&!Array.isArray(p)&&e.marker.color!==p?p:c?n.background:n.defaultLine),a(t,"marker.line")&&i(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",c?1:0)),c&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),u.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":115,"../../components/colorscale/defaults":125,"../../components/colorscale/helpers":126,"./subtypes":405}],400:[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 s=n("yperiod");s&&(n("yperiod0",i(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":236,"../../lib":258}],401:[function(t,e,r){"use strict";var n=t("@plotly/d3"),a=t("../../registry"),i=t("../../lib"),o=i.ensureSingle,s=i.identity,l=t("../../components/drawing"),u=t("./subtypes"),c=t("./line_points"),p=t("./link_traces"),h=t("../../lib/polygon").tester;function f(t,e,r,p,f,d,m){var y;!function(t,e,r,a,o){var s=r.xaxis,l=r.yaxis,c=n.extent(i.simpleMap(s.range,s.r2c)),p=n.extent(i.simpleMap(l.range,l.r2c)),h=a[0].trace;if(!u.hasMarkers(h))return;var f=h.marker.maxdisplayed;if(0===f)return;var d=a.filter((function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=p[0]&&t.y<=p[1]})),m=Math.ceil(d.length/f),y=0;o.forEach((function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return g?t.transition():t}var _=r.xaxis,x=r.yaxis,b=p[0].trace,w=b.line,T=n.select(d),k=o(T,"g","errorbars"),M=o(T,"g","lines"),A=o(T,"g","points"),S=o(T,"g","text");if(a.getComponentMethod("errorbars","plot")(t,k,r,m),!0===b.visible){var C,L;v(T).style("opacity",b.opacity);var I=b.fill.charAt(b.fill.length-1);"x"!==I&&"y"!==I&&(I=""),p[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,E,D="",z=[],O=b._prevtrace;O&&(D=O._prevRevpath||"",L=O._nextFill,z=O._polygons);var R,F,B,N,j,U,V,q="",Z="",H=[],G=i.noop;if(C=b._ownFill,u.hasLines(b)||"none"!==b.fill){for(L&&L.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},H=c(p,{xaxis:_,yaxis:x,trace:b,connectGaps:b.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:b.fill}),V=b._polygons=new Array(H.length),y=0;y1){var r=n.select(this);if(r.datum(p),t)v(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var a=v(r);a.attr("d",P),l.singleLineStyle(p,a)}}}}}var Y=M.selectAll(".js-line").data(H);v(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(G(!0)),l.setClipUrl(Y,r.layerClipId,t),H.length?(C?(C.datum(p),N&&U&&(I?("y"===I?N[1]=U[1]=x.c2p(0,!0):"x"===I&&(N[0]=U[0]=_.c2p(0,!0)),v(C).attr("d","M"+U+"L"+N+"L"+q.substr(1)).call(l.singleFillStyle,t)):v(C).attr("d",q+"Z").call(l.singleFillStyle,t))):L&&("tonext"===b.fill.substr(0,6)&&q&&D?("tonext"===b.fill?v(L).attr("d",q+"Z"+D+"Z").call(l.singleFillStyle,t):v(L).attr("d",q+"L"+D.substr(1)+"Z").call(l.singleFillStyle,t),b._polygons=b._polygons.concat(z)):(X(L),b._polygons=null)),b._prevRevpath=Z,b._prevPolygons=V):(C?X(C):L&&X(L),b._polygons=b._prevRevpath=b._prevPolygons=null),A.datum(p),S.datum(p),function(e,a,i){var o,c=i[0].trace,p=u.hasMarkers(c),h=u.hasText(c),f=tt(c),d=et,m=et;if(p||h){var y=s,b=c.stackgroup,w=b&&"infer zero"===t._fullLayout._scatterStackOpts[_._id+x._id][b].stackgaps;c.marker.maxdisplayed||c._needsCull?y=w?K:J:b&&!w&&(y=Q),p&&(d=y),h&&(m=y)}var T,k=(o=e.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);g&&k.call(l.pointStyle,c,t).call(l.translatePoints,_,x).style("opacity",0).transition().style("opacity",1),o.order(),p&&(T=l.makePointStyleFns(c)),o.each((function(e){var a=n.select(this),i=v(a);l.translatePoint(e,i,_,x)?(l.singlePointStyle(e,i,c,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,_,x,c.xcalendar,c.ycalendar),c.customdata&&a.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()})),g?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=a.selectAll("g").data(m,f)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),a=v(e.select("text"));l.translatePoint(t,a,_,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,_,x,c.xcalendar,c.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,c,t).each((function(t){var e=_.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(A,S,p);var W=!1===b.cliponaxis?null:r.layerClipId;l.setClipUrl(A,W,t),l.setClipUrl(S,W,t)}function X(t){v(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,a,i,u){var c,h,d=!i,m=!!i&&i.duration>0,y=p(t,e,r);((c=a.selectAll("g.trace").data(y,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),c.order(),function(t,e,r){e.each((function(e){var a=o(n.select(this),"g","fills");l.setClipUrl(a,r.layerClipId,t);var i=e[0].trace,u=[];i._ownfill&&u.push("_ownFill"),i._nexttrace&&u.push("_nextFill");var c=a.selectAll("g").data(u,s);c.enter().append("g"),c.exit().each((function(t){i[t]=null})).remove(),c.order().each((function(t){i[t]=o(n.select(this),"path","js-fill")}))}))}(t,c,e),m)?(u&&(h=u()),n.transition().duration(i.duration).ease(i.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){a.selectAll("g.trace").each((function(r,n){f(t,n,e,r,y,this,i)}))}))):c.each((function(r,n){f(t,n,e,r,y,this,i)}));d&&c.exit().remove(),a.selectAll("path:not([d])").remove()}},{"../../components/drawing":137,"../../lib":258,"../../lib/polygon":270,"../../registry":349,"./line_points":394,"./link_traces":396,"./subtypes":405,"@plotly/d3":12}],402:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,a,i,o,s=t.cd,l=t.xaxis,u=t.yaxis,c=[],p=s[0].trace;if(!n.hasMarkers(p)&&!n.hasText(p))return[];if(!1===e)for(r=0;r")}function c(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,c=o[0].trace,p=t.xa,h=t.ya,f=t.subplot,d=[],m=l+c.uid+"-circle",y=c.cluster&&c.cluster.enabled;if(y){var g=f.map.queryRenderedFeatures(null,{layers:[m]});d=g.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),_=e-v;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;if(y&&-1===d.indexOf(t.i+1))return 1/0;var n=a.modHalf(e[0],360),i=e[1],o=f.project([n,i]),l=o.x-p.c2p([_,i]),u=o.y-h.c2p([n,r]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+u*u)-c,1-3/c)}),t),!1!==t.index){var x=o[t.index],b=x.lonlat,w=[a.modHalf(b[0],360)+v,b[1]],T=p.c2p(w),k=h.c2p(w),M=x.mrc||1;t.x0=T-M,t.x1=T+M,t.y0=k-M,t.y1=k+M;var A={};A[c.subplot]={_subplot:f};var S=c._module.formatLabels(x,c,A);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=i(c,x),t.extraText=u(c,x,o[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}},getExtraText:u}},{"../../components/fx":155,"../../constants/numerical":236,"../../lib":258,"../../plots/mapbox/constants":338,"../scatter/get_trace_color":390}],416:[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("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":340,"../scatter/marker_colorbar":398,"../scattergeo/calc":409,"./attributes":410,"./defaults":412,"./event_data":413,"./format_labels":414,"./hover":415,"./plot":417,"./select":418}],417:[function(t,e,r){"use strict";var n=t("../../lib"),a=t("./convert"),i=t("../../plots/mapbox/constants").traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(t,e,r,n){this.type="scattermapbox",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:i+e+"-fill",line:i+e+"-line",circle:i+e+"-circle",symbol:i+e+"-symbol",cluster:i+e+"-cluster",clusterCount:i+e+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(t,e,r){var a={type:"geojson",data:e.geojson};r&&r.enabled&&n.extendFlat(a,{cluster:!0,clusterMaxZoom:r.maxzoom}),this.subplot.map.addSource(this.sourceIds[t],a)},l.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},l.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter),this.subplot.addLayer(n,r)},l.update=function(t){var e=t[0].trace,r=this.subplot,n=r.map,i=a(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),u=!!this.clusterEnabled,c=this;function p(t){u?function(t){for(var e=o.cluster,r=e.length-1;r>=0;r--){var a=e[r];n.removeLayer(c.layerIds[a])}t||n.removeSource(c.sourceIds.circle)}(t):function(t){for(var e=o.nonCluster,r=e.length-1;r>=0;r--){var a=e[r];n.removeLayer(c.layerIds[a]),t||n.removeSource(c.sourceIds[a])}}(t)}function h(t){l?function(t){t||c.addSource("circle",i.circle,e.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,n,i,l=e[0].trace,u=l.cluster&&l.cluster.enabled,c=!0!==l.visible,p=new s(t,l.uid,u,c),h=a(t.gd,e),f=p.below=t.belowLookup["trace-"+l.uid];if(u)for(p.addSource("circle",h.circle,l.cluster),r=0;ra&&(a=c,o=u)}}return a?i(o):s};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,i.getDataToCoordFunc(t,e,s,a),h),_={},x={},b=0;d?(y=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set(new Array(p))},g=function(t,e){var r=_[t.astr][e];t.get()[e]=r}):(y=function(t){_[t.astr]=n.extendDeep([],t.get()),t.set([])},g=function(t,e){var r=_[t.astr][e];t.get().push(r)}),k(y);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,u=o.styles=[];if(l)for(i=0;i=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],254:[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]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var p=e.pointsSame(o,c),h=e.pointsSame(s,u);if(p&&h)return n;var d=!p&&e.pointBetween(o,c,u),m=!h&&e.pointBetween(s,c,u);if(p)return m?l(n,s):l(t,u),n;d&&(h||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var p=a.getHead();if(r&&r.vert(p.pt[0]),p.isStart){r&&r.segmentNew(p.seg,p.primary);var h=c(p),d=h.before?h.before.ev:null,m=h.after?h.after.ev:null;function g(){if(d){var t=u(p,d);if(t)return t}return!!m&&u(p,m)}r&&r.tempStatus(p.seg,!!d&&d.seg,!!m&&m.seg);var y,v=g();if(v){var b;if(t)(b=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=p.seg.myFill;r&&r.segmentUpdate(v.seg),p.other.remove(),p.remove()}if(a.getHead()!==p){r&&r.rewind(p.seg);continue}if(t)b=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:i,p.seg.myFill.above=b?!p.seg.myFill.below:p.seg.myFill.below;else if(null===p.seg.otherFill)y=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?o:i,p.seg.otherFill={above:y,below:y};r&&r.status(p.seg,!!d&&d.seg,!!m&&m.seg),p.other.status=h.insert(n.node({ev:p}))}else{var x=p.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!p.primary){var _=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=_}f.push(p.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},a.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));case 5:case 10:case 11:case 12:case 7:default:return null}},a.prototype.scan_ifd=function(t,e,r){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],m=p,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),h=!0),!1===r({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:f,data_offset:p+this.start,value:d,is_subifd_link:h}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=a,e.exports.get_orientation=function(t){var e=0;try{return new a(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}},{}],261:[function(t,e,r){"use strict";var n=t("./common").readUInt16BE,i=t("./common").readUInt32BE;function a(t,e){if(t.length<4+e)return null;var r=i(t,e);return t.length>4&15,i=15&t[4],a=t[5]>>4&15,o=n(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),i=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>i.height||n.width===i.height&&n.height>i.width?n:i),s=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n1&&(p.variants=f.variants),f.orientation&&(p.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=t.length){var h=a(t,f.exif_location.offset),d=t.slice(f.exif_location.offset+h+4,f.exif_location.offset+f.exif_location.length),m=s.get_orientation(d);m>0&&(p.orientation=m)}return p}}}}}}},{"../common":259,"../exif_utils":260,"../miaf_utils":261}],263:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("BM");e.exports=function(t){if(!(t.length<26)&&i(t,0,o))return{width:a(t,18),height:a(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":259}],264:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");e.exports=function(t){if(!(t.length<10)&&(i(t,0,o)||i(t,0,s)))return{width:a(t,6),height:a(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":259}],265:[function(t,e,r){"use strict";var n=t("../common").readUInt16LE;e.exports=function(t){var e=n(t,0),r=n(t,2),i=n(t,4);if(0===e&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":259}],266:[function(t,e,r){"use strict";var n=t("../common").readUInt16BE,i=t("../common").str2arr,a=t("../common").sliceEq,o=t("../exif_utils"),s=i("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var r,i,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;r=n(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(t,e,s)&&(i=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=i),c}e+=r}}},{"../common":259,"../exif_utils":260}],267:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(t){if(!(t.length<24)&&i(t,0,o)&&i(t,12,s))return{width:a(t,16),height:a(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":259}],268:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&i(t,0,o))return{width:a(t,18),height:a(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":259}],269:[function(t,e,r){"use strict";function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function p(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||u(t,e+8):"VP8L"===h&&d>=9?r=r||f(t,e+8):"VP8X"===h&&d>=10?r=r||p(t,e+8):"EXIF"===h&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":259,"../exif_utils":260}],272:[function(t,e,r){"use strict";e.exports={avif:t("./parse_sync/avif"),bmp:t("./parse_sync/bmp"),gif:t("./parse_sync/gif"),ico:t("./parse_sync/ico"),jpeg:t("./parse_sync/jpeg"),png:t("./parse_sync/png"),psd:t("./parse_sync/psd"),svg:t("./parse_sync/svg"),tiff:t("./parse_sync/tiff"),webp:t("./parse_sync/webp")}},{"./parse_sync/avif":262,"./parse_sync/bmp":263,"./parse_sync/gif":264,"./parse_sync/ico":265,"./parse_sync/jpeg":266,"./parse_sync/png":267,"./parse_sync/psd":268,"./parse_sync/svg":269,"./parse_sync/tiff":270,"./parse_sync/webp":271}],273:[function(t,e,r){"use strict";var n=t("./lib/parsers_sync");e.exports=function(t){return function(t){for(var e=Object.keys(n),r=0;r1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function A(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=b=t.map((function(t,c){var u=b[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(b[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},v,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},y.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},y.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},y.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>y.precisionThreshold||e.scale[1]*e.viewport.height>y.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=y.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},y.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var d=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),d||(e.passes[f]=d={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},y.defaults,t)),null!=t.thickness&&(d.thickness=parseFloat(t.thickness)),null!=t.opacity&&(d.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(d.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(d.overlay=!!t.overlay,f=D}));(P=P.slice(0,R)).push(D)}for(var F=function(t){var e=k.slice(2*I,2*P[t]).concat(D?k.slice(2*D):[]),r=(d.hole||[]).map((function(e){return e-D+(P[t]-I)})),n=c(e,r);n=n.map((function(e){return e+I+(e+It.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=p(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),g&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=u(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var p={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(p):e.elements=o.elements(p)}var h=y.float32(t);return i({data:h,usage:"dynamic"}),a({data:y.fract32(t,h),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function h(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},u.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nk))&&(s.lower||!(A>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||J(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,p=0;Array.isArray(t)||J(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=et[t.usage]),"primitive"in t&&(n=at[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(p=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===p||5122===p?o*=2:5125!==p&&5124!==p||(o*=4))),a(f,e,r,n,i,o,p)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){K(s).forEach(o)}}}function m(t){for(var e=Z.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,h(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(vt).forEach((function(e){t+=vt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;C.call(r);var a=E();return"number"==typeof t?M(a,0|t,"number"==typeof e?0|e:0|t):t?(P(r,t),S(a,t)):M(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),z(a,3553),O(r,3553),R(),L(a),o.profile&&(i.stats.size=A(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new I(3553);return vt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=y();return c(o,i),o.width=0,o.height=0,h(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,D(i),d(o,3553,e,r,a),R(),k(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l=0;i.mipmask>>l;++l){var c=a>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return R(),o.profile&&(i.stats.size=A(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=p.texInfo;for(C.call(l),s=0;6>s;++s)m[s]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(m[0],t),S(m[1],e),S(m[2],r),S(m[3],n),S(m[4],i),S(m[5],a);else if(P(l,t),u(p,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(m[s],p),S(m[s],t[s]);else for(s=0;6>s;++s)S(m[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(m[s],t,t);for(c(p,m[0]),p.mipmask=l.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,p.internalformat=m[0].internalformat,f.width=m[0].width,f.height=m[0].height,D(p),s=0;6>s;++s)z(m[s],34069+s);for(O(l,34067),R(),o.profile&&(p.stats.size=A(p.internalformat,p.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[p.internalformat],f.type=et[p.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)L(m[s]);return f}var p=new I(34067);vt[p.id]=p,a.cubeCount++;var m=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=y();return c(a,p),a.width=0,a.height=0,h(a,e),a.width=a.width||(p.width>>i)-r,a.height=a.height||(p.height>>i)-n,D(p),d(a,34069+t,r,n,i),R(),k(a),f},f.resize=function(e){if((e|=0)!==p.width){f.width=p.width=e,f.height=p.height=e,D(p);for(var r=0;6>r;++r)for(var n=0;p.mipmask>>n;++n)t.texImage2D(34069+r,n,p.format,e>>n,e>>n,0,p.format,p.type,null);return R(),o.profile&&(p.stats.size=A(p.internalformat,p.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=p,o.profile&&(f.stats=p.stats),f.destroy=function(){p.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);O(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){K(k).forEach(g)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,K(k).forEach((function(e){e.framebuffer=t.createFramebuffer(),y(e)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,p[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r=p.byteLength?c.subdata(p):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=i.create(u,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else i.getBuffer(u)?(f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(u.buffer)?(f.buffer=i.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?tt[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;ct&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return p.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);K(c).forEach(e),c={},K(u).forEach(e),u={},p.forEach((function(e){t.deleteProgram(e.program)})),p.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var h=o[e];if(h&&(h.refCount++,!a))return h;var d=new s(n,e);return r.shaderCount++,l(d,i,a),h||(o[e]=d),p.push(d),H(d,{destroy:function(){if(d.refCount--,0>=d.refCount){t.deleteProgram(d.program);var e=p.indexOf(d);p.splice(e,1),r.shaderCount--}0>=o[d.vertId].refCount&&(t.deleteShader(u[d.vertId]),delete u[d.vertId],delete f[d.fragId][d.vertId]),Object.keys(f[d.fragId]).length||(t.deleteShader(c[d.fragId]),delete c[d.fragId],delete f[d.fragId])}})},restore:function(){c={},u={};for(var t=0;t>>e|t<<32-e}function C(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function P(t){return Array.prototype.slice.call(t)}function O(t){return P(t).join("")}function I(t){function e(){var t=[],e=[];return H((function(){t.push.apply(t,P(arguments))}),{def:function(){var r="v"+i++;return e.push(r),0>>4&15)+"0123456789abcdef".charAt(15&e);return r}(function(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,c,u,f,p,h,d=8*t.length;for(t=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),e[d>>5]|=128<<24-d%32,e[15+(d+64>>9<<4)]=d,u=0;uf;f++){var m;if(16>f)r[f]=e[f+u];else p=f,h=C(h=L(h=r[f-2],17)^L(h,19)^h>>>10,r[f-7]),m=L(m=r[f-15],7)^L(m,18)^m>>>3,r[p]=C(C(h,m),r[f-16]);p=C(C(C(C(c,p=L(p=o,6)^L(p,11)^L(p,25)),o&s^~o&l),kt[f]),r[f]),h=C(c=L(c=d,2)^L(c,13)^L(c,22),d&n^d&i^n&i),c=l,l=s,s=o,o=C(a,p),a=i,i=n,n=d,d=C(p,h)}t[0]=C(d,t[0]),t[1]=C(n,t[1]),t[2]=C(i,t[2]),t[3]=C(a,t[3]),t[4]=C(o,t[4]),t[5]=C(s,t[5]),t[6]=C(l,t[6]),t[7]=C(c,t[7])}for(e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t){for(var e,r,n="",i=-1;++i=e&&56320<=r&&57343>=r&&(e=65536+((1023&e)<<10)+(1023&r),i++),127>=e?n+=String.fromCharCode(e):2047>=e?n+=String.fromCharCode(192|e>>>6&31,128|63&e):65535>=e?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):2097151>=e&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(r))),n[e])?n[e].apply(null,o):(r=Function.apply(null,a.concat(r)),n&&(n[e]=r),r.apply(null,o))}}}function D(t){return Array.isArray(t)||J(t)||l(t)}function R(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",a,".createStream(",34962,",",i,".buffer);","}else{",u,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",u,");","}"),l}))})),o}function M(t,e,n,i,o){function s(t){var e=c[t];e&&(p[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,m,g,s],");")}h&&"null"!==h?v?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[d,g,y,m+"<<(("+y+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[d,m,g]+");")}h&&"null"!==h?v?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,p=n.draw,h=function(){var i=p.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),p.elementsActive&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",rt?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),d=i("primitive"),m=i("offset"),g=function(){var i=p.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");$&&(s=i("instances"),l=t.instancing);var y=h+".type",v=p.elements&&B(p.elements)&&!p.vaoActive;$&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function q(t,e,r,n,i){return i=(e=_()).proc("body",i),$&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function W(t,e,r,n){C(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),O(t,e,r,n.attributes,(function(){return!0}))),V(t,e,r,n.uniforms,(function(){return!0}),!1),U(t,e,e,r)}function Y(t,e,r,n){function i(){return!0}t.batchId="a1",C(t,e),O(t,e,r,n.attributes,i),V(t,e,r,n.uniforms,i,!1),U(t,e,e,r)}function Z(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}C(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&S(t,u,r.context),r.needsFramebuffer&&z(t,u,r.framebuffer),L(t,u,r.state,i),r.profile&&i(r.profile)&&P(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),O(t,c,r,n.attributes,a),O(t,u,r,n.attributes,i)),V(t,c,r,n.uniforms,a,!1),V(t,u,r,n.uniforms,i,!0),U(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return q(Y,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function X(t,r){function n(e){var n=r.shader[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.shader,"."+e,n):i.set(a.shader,"."+e,t.link(n,{stable:!0})))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;if(S(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),R(Object.keys(r.state)).forEach((function(e){var n=r.state[e],o=n.append(t,i);g(o)?o.forEach((function(r,n){isNaN(r)?i.set(t.next[e],"["+n+"]",r):i.set(t.next[e],"["+n+"]",t.link(r,{stable:!0}))})):B(n)?i.set(a.next,"."+e,t.link(o,{stable:!0})):i.set(a.next,"."+e,o)})),P(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.draw,"."+e,n):i.set(a.draw,"."+e,t.link(n),{stable:!0}))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.map((function(e){return isNaN(e)?e:t.link(e,{stable:!0})}))+"]"),i.set(a.uniforms,"["+t.link(e.id(n),{stable:!0})+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new K).forEach((function(t){i.set(a,"."+t,n[t])}))})),r.scopeVAO){var s=r.scopeVAO.append(t,i);isNaN(s)?i.set(a.vao,".targetVAO",s):i.set(a.vao,".targetVAO",t.link(s,{stable:!0}))}n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=xt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height||(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=xt[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){K(u).forEach(o)},restore:function(){K(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},wt=[];wt[6408]=4,wt[6407]=3;var At=[];At[5121]=1,At[5126]=4,At[36193]=2;var kt=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Tt=["x","y","z","w"],Mt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),St={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},zt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Et={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Lt={cw:2304,ccw:2305},Ct=new F(!1,!1,!1,(function(){}));return function(t){function e(){if(0===K.length)A&&A.update(),et=null;else{et=W.next(e),f();for(var t=K.length-1;0<=t;--t){var r=K[t];r&&r(P,null,0)}g.flush(),A&&A.update()}}function r(){!et&&0=K.length&&n()}}}}function u(){var t=Z.viewport,e=Z.scissor_box;t[0]=t[1]=e[0]=e[1]=0,P.viewportWidth=P.framebufferWidth=P.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,P.viewportHeight=P.framebufferHeight=P.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){P.tick+=1,P.time=m(),u(),q.procs.poll()}function p(){B.refresh(),u(),q.procs.refresh(),A&&A.update()}function m(){return(Y()-M)/1e3}if(!(t=i(t)))return null;var g=t.gl,y=g.getContextAttributes();g.isContextLost();var v=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)rt(H({framebuffer:t.framebuffer.faces[e]},t),l);else rt(t,l);else l(0,t)},prop:G.define.bind(null,1),context:G.define.bind(null,2),this:G.define.bind(null,3),draw:s({}),buffer:function(t){return I.create(t,34962,!1,!1)},elements:function(t){return D.create(t,!1)},texture:B.create2D,cube:B.createCube,renderbuffer:N.create,framebuffer:j.create,framebufferCube:j.createCube,vao:R.createVAO,attributes:y,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=Q;break;case"restore":r=$;break;case"destroy":r=tt}return r.push(e),{cancel:function(){for(var t=0;t2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(a(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(a(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],284:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),a=t("./_stream_writable");t("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)o.endEmitted?w(t,new _):S(t,o,e,!0);else if(o.ended)w(t,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?S(t,o,e,!1):C(t,o)):S(t,o,e,!1)}else n||(o.reading=!1,C(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(L,t))}function L(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function C(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(N,e,t))}function N(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):E(this),null;if(0===(t=z(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(t){w(this,new x("_read()"))},T.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",g),n.removeListener("data",p),f=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function l(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",u);var f=!1;function p(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==j(i.pipes,t))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(e){c("onerror",e),g(),t.removeListener("error",h),0===a(t,"error")&&w(t,e)}function d(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",h),t.once("close",d),t.once("finish",m),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?E(this):i.reading||r.nextTick(I,this))),n},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(O,this),n},T.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(O,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new m("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,C(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":283,"./_stream_duplex":284,"./internal/streams/destroy":291,"./internal/streams/state":295,"./internal/streams/stream":296,_process:274,buffer:81,inherits:227,"util-deprecate":327}],289:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=t("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function h(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[p].read();null!==r&&(t[u]=null,t[o]=null,t[s]=null,e(h(r,!1)))}}function m(t){r.nextTick(d,t)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[p]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(h(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(h(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var a=this[p].read();if(null!==a)return Promise.resolve(h(a,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(h(void 0,!0))}))}))})),n),g);e.exports=function(t){var e,r=Object.create(y,(i(e={},p,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[p].read();n?(r[u]=null,r[o]=null,r[s]=null,t(h(n,!1))):(r[o]=t,r[s]=e)},writable:!0}),e));return r[u]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[o]=null,r[s]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":292,_process:274}],290:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0==(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&o.forEach(c),a||(o.forEach(c),i(n))}))}));return e.reduce(u)}},{"../../../errors":283,"./end-of-stream":292}],295:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},{"../../../errors":283}],296:[function(t,e,r){e.exports=t("events").EventEmitter},{events:80}],297:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=f,e=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":281}],298:[function(t,e,r){(function(r,n){(function(){var r=t("assert"),i=t("debug")("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),t._bytes=o,t._skipBytes=s,e&&(t._passthrough=l);e?t._transform=u:t._write=c};function a(t){i("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||a(this),i("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function s(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function l(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function c(t,e,r){this._parserInit||a(this),i("write(%o bytes)",t.length),"function"==typeof e&&(r=e),p(this,t,null,r)}function u(t,e,r){this._parserInit||a(this),i("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),p(this,t,e,r)}function f(t,e,r,a){if(t._parserBytesLeft-=e.length,i("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return a;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(e=n.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];e&&s.push(e),r&&s.push(r);var l=o.length>s.length;l&&s.push(h(a));var c=o.apply(t,s);if(!l||a===c)return a}}var p=h((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return f(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return f(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function h(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:274,assert:71,buffer:81,debug:299}],299:[function(t,e,r){(function(n){(function(){function i(){var t;try{t=r.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(r=e.exports=t("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))})),t.splice(a,0,n)},r.save=function(t){try{null==t?r.storage.removeItem("debug"):r.storage.debug=t}catch(t){}},r.load=i,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(i())}).call(this)}).call(this,t("_process"))},{"./debug":300,_process:274}],300:[function(t,e,r){var n;function i(t){function e(){if(e.enabled){var t=e,i=+new Date,a=i-(n||i);t.diff=a,t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===l&&!1===isNaN(t))return e.long?s(r=t,o,"day")||s(r,a,"hour")||s(r,i,"minute")||s(r,n,"second")||r+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=a)return Math.round(t/a)+"h";if(t>=i)return Math.round(t/i)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],302:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var h=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var b=l[d];if(i[b]=!1,g.push(b),y.push(s[b]),v+=s[b].length,o[b]=f.length,b===e){l.length=d;break}}f.push(g);var x=new Array(v);for(d=0;d1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,p=t.xAxisRotation,h=void 0===p?0:p,d=t.largeArcFlag,m=void 0===d?0:d,g=t.sweepFlag,y=void 0===g?0:g,v=[];if(0===u||0===f)return[];var b=Math.sin(h*i/360),x=Math.cos(h*i/360),_=x*(e-l)/2+b*(r-c)/2,w=-b*(e-l)/2+x*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(u*=Math.sqrt(A),f*=Math.sqrt(A));var k=function(t,e,r,n,a,o,l,c,u,f,p,h){var d=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(p,2),y=Math.pow(h,2),v=d*m-d*y-m*g;v<0&&(v=0),v/=d*y+m*g;var b=(v=Math.sqrt(v)*(l===c?-1:1))*a/o*h,x=v*-o/a*p,_=f*b-u*x+(t+r)/2,w=u*b+f*x+(e+n)/2,A=(p-b)/a,k=(h-x)/o,T=(-p-b)/a,M=(-h-x)/o,S=s(1,0,A,k),z=s(A,k,T,M);return 0===c&&z>0&&(z-=i),1===c&&z<0&&(z+=i),[_,w,S,z]}(e,r,l,c,u,f,m,y,b,x,_,w),T=n(k,4),M=T[0],S=T[1],z=T[2],E=T[3],L=Math.abs(E)/(i/4);Math.abs(1-L)<1e-7&&(L=1);var C=Math.max(Math.ceil(L),1);E/=C;for(var P=0;Pe[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":66,assert:71,"is-svg-path":234,"normalize-svg-path":306,"parse-svg-path":246}],306:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,p=0,h=0,d=0,m=t.length;d4?(o=g[g.length-4],s=g[g.length-3]):(o=p,s=h),r.push(g)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":304}],307:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=c.width=e.w||e.width||200,f=c.height=e.h||e.height||200);var p=Math.min(r,f),h=e.stroke||0,d=e.viewbox||e.viewBox||i(t),m=[r/(d[2]-d[0]),f/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",h&&("number"!=typeof h&&(h=1),u.strokeStyle=h>0?"white":"black",u.lineWidth=Math.abs(h));if(u.translate(.5*r,.5*f),u.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var y=new Path2D(t);u.fill(y),h&&u.stroke(y)}else{var v=a(t);o(u,v),u.fill(),h&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*p})}},{"bitmap-sdf":78,"draw-svg-path":122,"is-svg-path":234,"parse-svg-path":246,"svg-path-bounds":305}],308:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},l=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":274,timers:308}],309:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,p=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:P(e[1]),g:P(e[2]),b:P(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:P(e[1]),g:P(e[2]),b:P(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(V(e.r)&&V(e.g)&&V(e.b)?(h=e.r,d=e.g,m=e.b,i={r:255*L(h,255),g:255*L(d,255),b:255*L(m,255)},f=!0,p="%"===String(e.r).substr(-1)?"prgb":"rgb"):V(e.h)&&V(e.s)&&V(e.v)?(l=I(e.s),c=I(e.v),i=function(e,r,n){e=6*L(e,360),r=L(r,100),n=L(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,p="hsv"):V(e.h)&&V(e.s)&&V(e.l)&&(l=I(e.s),u=I(e.l),i=function(t,e,r){var n,i,a;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=L(t,360),e=L(e,100),r=L(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,p="hsl"),e.hasOwnProperty("a")&&(a=e.a));var h,d,m;return a=E(a),{ok:f,format:e.format||p,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%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,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=a(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=a(360*t.h),r=a(100*t.s),n=a(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=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return p(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[O(a(t).toString(16)),O(a(e).toString(16)),O(a(r).toString(16)),O(D(n))];if(i&&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:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*L(this._r,255))+"%",g:a(100*L(this._g,255))+"%",b:a(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%)":"rgba("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(z[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+h(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+h(i._r,i._g,i._b,i._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(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,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]:I(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:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!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":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=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"},z=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function C(t){return o(1,s(0,t))}function P(t){return parseInt(t,16)}function O(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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 V(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],310:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=i(t));for(var r=0,n=e.length;ro&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=l(t,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,u=f(e),p=t.objects,h={};function d(t){return u(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in p)h[c]=m(p[c]);return{type:"Topology",bbox:l,transform:e,objects:h,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=u(t[0],0);++r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":315}],317:[function(t,e,r){"use strict";var n=t("../value/is"),i={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},{"../value/is":323}],318:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":314,"./is":319}],319:[function(t,e,r){"use strict";var n=t("../function/is"),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!i.test(a.call(t))}},{"../function/is":313}],320:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":317}],321:[function(t,e,r){"use strict";var n=t("../value/is"),i=t("../object/is"),a=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},{"../object/is":317,"../value/is":323}],322:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":314,"./is":323}],323:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],324:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),i=t("dup"),a=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,f=c.BUFFER;function p(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function h(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(h(t),0,t)}function m(t){return new Uint16Array(h(2*t),0,t)}function g(t){return new Uint32Array(h(4*t),0,t)}function y(t){return new Int8Array(h(t),0,t)}function v(t){return new Int16Array(h(2*t),0,t)}function b(t){return new Int32Array(h(4*t),0,t)}function x(t){return new Float32Array(h(4*t),0,t)}function _(t){return new Float64Array(h(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(h(t),0,t):d(t)}function A(t){return s?new BigUint64Array(h(8*t),0,t):null}function k(t){return l?new BigInt64Array(h(8*t),0,t):null}function T(t){return new DataView(h(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){p(t.buffer)},r.freeArrayBuffer=p,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return v(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return A(t);case"buffer":return M(t);case"data":case"dataview":return T(t);default:return null}return null},r.mallocArrayBuffer=h,r.mallocUint8=d,r.mallocUint16=m,r.mallocUint32=g,r.mallocInt8=y,r.mallocInt16=v,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=k,r.mallocDataView=T,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":77,buffer:81,dup:124}],325:[function(t,e,r){var n=/[\'\"]/;e.exports=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},{}],326:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=p[o-p[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],h=u>>13;c=h&&(o.month>h||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=p[i.year-p[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=p[a.year-p[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var h,d=f[a.year-f[0]];for(h=0;h<13;h++){var m=d&1<<12-h?30:29;if(l>13;!g||h=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":343,"object-assign":243}],332:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":343,"object-assign":243}],333:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":343,"object-assign":243}],334:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":343,"object-assign":243}],335:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":343,"object-assign":243}],336:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":343,"object-assign":243}],337:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":343,"object-assign":243}],338:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":343,"object-assign":243}],340:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":343,"object-assign":243}],341:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":343,"object-assign":243}],342:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":343,"object-assign":243}],343:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":243}],344:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,p=r.monthNames||this.local.monthNames,h=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(h(t,n))for(;i.length1},b=function(t,r){var n=v(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(T).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){v("m");var t=l.call(x,e.substring(T));return T+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=v(t,a)?n:r,s=0;s-1){h=1,d=m;for(var z=this.daysInMonth(p,h);d>z;z=this.daysInMonth(p,h))h++,d-=z}return f>-1?this.fromJD(f):this.newDate(p,h,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":343,"object-assign":243}],345:[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}]},{}],346:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=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:i({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",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.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",a.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:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":480,"../../plot_api/plot_template":565,"../../plots/cartesian/constants":583,"../../plots/font_attributes":604,"./arrow_paths":345}],347:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],p={x:1,y:-1}[a]*t[a+"shift"],h=3*t.arrowsize*t.arrowwidth||0,d=h+p,m=h-p,g=3*t.startarrowsize*t.arrowwidth||0,y=g+p,v=g-p;if(c===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,y),ppadminus:Math.max(f,v)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,y),ppadminus:Math.max(f,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":525,"../../plots/cartesian/axes":576,"./draw":352}],348:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],p=[],h=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},p=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,Z=["x","y"],X=0;X1)&&(nt===rt?((ht=it.r2fraction(e["a"+et]))<0||ht>1)&&(Y=!0):Y=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var dt="domain"===pt;"x"===et?(Q=e[et],J=dt?it._offset+it._length*Q:J=A.l+A.w*Q):(Q=1-e[et],J=dt?it._offset+it._length*Q:J=A.t+A.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var mt=e["a"+et];if(tt=ot*q(.5,e.xanchor)-st*q(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ft.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ft.tail=A.t+A.h*mt):ft.tail=A.l+A.w*mt:ft.tail=it._offset+it.r2p(mt),K=tt}else ft.tail=J+mt,K=tt+mt;ft.text=ft.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,yt-1)),"pixel"===nt){var vt=-Math.max(ft.tail-3,ft.text),bt=Math.min(ft.tail+3,ft.text)-yt;vt>0?(ft.tail+=vt,ft.text+=vt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*q($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(T-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(D-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:N+xt-1,y:N+_t}).call(u.setClipUrl,V?E:null,t);else{var wt=N+_t-m.top,At=N+xt-m.left;G.call(p.positionText,At,wt).call(u.setClipUrl,V?E:null,t)}U.select("rect").call(u.setRect,N,N,T,D),j.call(u.setRect,F/2,F/2,B-F,H-F),R.call(u.setTranslate,Math.round(L.x.text-B/2),Math.round(L.y.text-H/2)),O.attr({transform:"rotate("+C+","+L.x.text+","+L.y.text+")"});var kt,Tt=function(r,n){P.selectAll(".annotation-arrow-g").remove();var l=L.x.head,f=L.y.head,p=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,x=L.y.text+n,_=o.rotationXYMatrix(C,m,x),w=o.apply2DTransform(_),T=o.apply2DTransform2(_),E=+j.attr("width"),I=+j.attr("height"),D=m-.5*E,F=D+E,B=x-.5*I,N=B+I,V=[[D,B,D,N],[D,N,F,N],[F,N,F,B],[F,B,D,B]].map(T);if(!V.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){V.forEach((function(t){var e=o.segmentsIntersect(p,h,l,f,t[0],t[1],t[2],t[3]);e&&(p=e.x,h=e.y)}));var U=e.arrowwidth,H=e.arrowcolor,q=e.arrowside,G=P.append("g").style({opacity:c.opacity(H)}).classed("annotation-arrow-g",!0),W=G.append("path").attr("d","M"+p+","+h+"L"+l+","+f).style("stroke-width",U+"px").call(c.stroke,c.rgb(H));if(g(W,q,e),k.annotationPosition&&W.node().parentNode&&!a){var Y=l,Z=f;if(e.standoff){var X=Math.sqrt(Math.pow(l-p,2)+Math.pow(f-h,2));Y+=e.standoff*(p-l)/X,Z+=e.standoff*(h-f)/X}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(p-Y)+","+(h-Z),transform:s(Y,Z)}).style("stroke-width",U+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);J=t.x,K=t.y,y&&y.autorange&&M(y._name+".autorange",!0),b&&b.autorange&&M(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S("x",v(y,t,"x",A,e)),S("y",v(b,r,"y",A,e)),e.axref===e.xref&&S("ax",v(y,t,"ax",A,e)),e.ayref===e.yref&&S("ay",v(b,r,"ay",A,e)),G.attr("transform",s(t,r)),O.attr({transform:"rotate("+C+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,z());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Tt(0,0),I)d.init({element:R.node(),gd:t,prepFn:function(){kt=O.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",v(y,t,"ax",A,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",v(b,r,"ay",A.w,e)):S("ay",e.ay+r),Tt(t,r);else{if(a)return;var i,o;if(y)i=v(y,t,"x",A,e);else{var l=e._xsize/A.w,c=e.x+(e._xshift-e.xshift)/A.w-l/2;i=d.align(c+t/A.w,l,0,1,e.xanchor)}if(b)o=v(b,r,"y",A,e);else{var u=e._ysize/A.h,f=e.y-(e._yshift+e.yshift)/A.h-u/2;o=d.align(f-r/A.h,u,0,1,e.yanchor)}S("x",i),S("y",o),y&&b||(n=d.getCursor(y?.5:i,b?.5:o,e.xanchor,e.yanchor))}O.attr({transform:s(t,r)+kt}),h(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",W(n))},doneFn:function(){h(R),i.call("_guiRelayout",t,z());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=0,b=e.indexOf("end")>=0,x=d.backoff*g+r.standoff,_=m.backoff*y+r.startstandoff;if("line"===h.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,A=o.y-u.y;if(p=(f=Math.atan2(A,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+A*A))return void I();if(x){if(x*x>w*w+A*A)return void I();var k=x*Math.cos(f),T=x*Math.sin(f);u.x+=k,u.y+=T,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+A*A)return void I();var M=_*Math.cos(f),S=_*Math.sin(f);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===h.nodeName){var z=h.getTotalLength(),E="";if(z1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":626,"../annotations/draw":352}],359:[function(t,e,r){"use strict";var n=t("../../registry"),i=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 a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ct=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ct*c.roundUp(lt/ct,[2,5,10]),(Math.abs(q.start)/q.size+1e-6)%1<2e-6&&(it.tick0=0)}it.dtick=ot}it.domain=o?[rt+P/R.h,rt+K-P/R.h]:[rt+C/R.w,rt+K-C/R.w],it.setScale(),t.attr("transform",u(Math.round(R.l),Math.round(R.t)));var ut,ft=t.select("."+T.cbtitleunshift).attr("transform",u(-Math.round(R.l),-Math.round(R.t))),pt=it.ticklabelposition,ht=it.title.font.size,dt=t.select("."+T.cbaxis),mt=0,gt=0;function yt(n,i){var a={propContainer:it,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:D._dfltTitle.colorbar,containerGroup:t.select("."+T.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&at||!o&&!at)&&("top"===j&&(t=C+R.l+R.w*O,e=P+R.t+R.h*(1-rt-K)+3+.75*ht),"bottom"===j&&(t=C+R.l+R.w*O,e=P+R.t+R.h*(1-rt)-3-.25*ht),"right"===j&&(e=P+R.t+R.h*I+3+.75*ht,t=C+R.l+R.w*rt),yt(it._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!at||o&&at){var a,l=t.select("."+T.cbtitle),f=l.select("text"),p=[-M/2,M/2],d=l.select(".h"+it._id+"title-math-group").node(),m=15.6;if(f.node()&&(m=parseInt(f.node().style.fontSize,10)*w),d?(a=h.bBox(d),gt=a.width,(mt=a.height)>m&&(p[1]-=(mt-m)/2)):f.node()&&!f.classed(T.jsPlaceholder)&&(a=h.bBox(f.node()),gt=a.width,mt=a.height),o){if(mt){if(mt+=5,"top"===j)it.domain[1]-=mt/R.h,p[1]*=-1;else{it.domain[0]+=mt/R.h;var y=g.lineCount(f);p[1]+=(1-y)*m}l.attr("transform",u(p[0],p[1])),it.setScale()}}else gt&&("right"===j&&(it.domain[0]+=(gt+ht/2)/R.w),l.attr("transform",u(p[0],p[1])),it.setScale())}t.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",o?u(0,Math.round(R.h*(1-it.domain[1]))):u(Math.round(R.w*it.domain[0]),0)),dt.attr("transform",o?u(0,Math.round(-R.t)):u(Math.round(-R.l),0));var v=t.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(W);v.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),v.exit().remove();var b=V.map(it.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,a){var s=[0===a?V[0]:(W[a]+W[a-1])/2,a===W.length-1?V[1]:(W[a]+W[a+1])/2].map(it.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,b[0],b[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(Z,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)h.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=H(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var x=t.select("."+T.cblines).selectAll("path."+T.cbline).data(B.color&&B.width?Y:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(t){var e=Q,r=Math.round(it.c2p(t))+B.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+Z).call(h.lineGroupStyle,B.width,U(t),B.dash)})),dt.selectAll("g."+it._id+"tick,path").remove();var _=Q+Z+(M||0)/2-("outside"===e.ticks?1:0),A=s.calcTicks(it),k=s.getTickSigns(it)[2];return s.drawTicks(r,it,{vals:"inside"===it.ticks?s.clipEnds(it,A):A,layer:dt,path:s.makeTickPath(it,_,k),transFn:s.makeTransTickFn(it)}),s.drawLabels(r,it,{vals:A,layer:dt,transFn:s.makeTransTickLabelFn(it),labelFns:s.makeLabelFns(it,_)})},function(){if(o&&!at||!o&&at){var t,i,a=it.position||0,s=it._offset+it._length/2;if("right"===j)i=s,t=R.l+R.w*a+10+ht*(it.showticklabels?1:.5);else if(t=s,"bottom"===j&&(i=R.t+R.h*a+10+(-1===pt.indexOf("inside")?it.tickfont.size:0)+("intside"!==it.ticks&&e.ticklen||0)),"top"===j){var l=N.text.split("
").length;i=R.t+R.h*a+10-Z-w*ht*l}yt((o?"h":"v")+it._id+"title",{avoid:{selection:n.select(r).selectAll("g."+it._id+"tick"),side:j,offsetTop:o?0:R.t,offsetLeft:o?R.l:0,maxShift:o?D.width:D.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=Z+M/2;-1===pt.indexOf("inside")&&(n=h.bBox(dt.node()),s+=o?n.width:n.height),ut=ft.select("text");var c=0,f=o&&"top"===j,m=!o&&"right"===j,g=0;if(ut.node()&&!ut.classed(T.jsPlaceholder)){var v,b=ft.select(".h"+it._id+"title-math-group").node();b&&(o&&at||!o&&!at)?(c=(n=h.bBox(b)).width,v=n.height):(c=(n=h.bBox(ft.node())).right-R.l-(o?Q:nt),v=n.bottom-R.t-(o?nt:Q),o||"top"!==j||(s+=n.height,g=n.height)),m&&(ut.attr("transform",u(c/2+ht/2,0)),c*=2),s=Math.max(s,o?c:v)}var x=2*(o?C:P)+s+S+M/2,w=0;!o&&N.text&&"bottom"===L&&I<=0&&(x+=w=x/2,g+=w),D._hColorbarMoveTitle=w,D._hColorbarMoveCBTitle=g;var F=S+M;t.select("."+T.cbbg).attr("x",(o?Q:nt)-F/2-(o?C:0)).attr("y",(o?nt:Q)-(o?J:P+g-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(J+F,2)).call(d.fill,z).call(d.stroke,e.bordercolor).style("stroke-width",S);var B=m?Math.max(c-10,0):0;if(t.selectAll("."+T.cboutline).attr("x",(o?Q:nt+C)+B).attr("y",(o?nt+P-J:Q)+(f?mt:0)).attr(o?"width":"height",Math.max(Z,2)).attr(o?"height":"width",Math.max(J-(o?2*P+mt:2*C+B),2)).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":M}),t.attr("transform",u(R.l-(o?$*x:0),R.t-(o?0:(1-tt)*x-g))),!o&&(S||i(z).getAlpha()&&!i.equals(D.paper_bgcolor,z))){var V=dt.selectAll("text"),U=V[0].length,H=t.select("."+T.cbbg).node(),q=h.bBox(H),G=h.getTranslate(t);V.each((function(t,e){var r=U-1;if(0===e||e===r){var n,i=h.bBox(this),a=h.getTranslate(this);if(e===r){var o=i.right+a.x;(n=q.right+G.x+nt-S-2+O-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=q.left+G.x+nt+S+2-s)<0&&(n=0)}n&&(U<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var W={},Y=A[E],X=k[E],K=A[L],et=k[L],rt=x-Z;o?("pixels"===p?(W.y=I,W.t=J*K,W.b=J*et):(W.t=W.b=0,W.yt=I+l*K,W.yb=I-l*et),"pixels"===_?(W.x=O,W.l=x*Y,W.r=x*X):(W.l=rt*Y,W.r=rt*X,W.xl=O-y*Y,W.xr=O+y*X)):("pixels"===p?(W.x=O,W.l=J*Y,W.r=J*X):(W.l=W.r=0,W.xl=O+l*Y,W.xr=O-l*X),"pixels"===_?(W.y=1-I,W.t=x*K,W.b=x*et):(W.t=rt*K,W.b=rt*et,W.yt=I-y*K,W.yb=I+y*et)),a.autoMargin(r,e._id,W)}],r)}(r,e,t);y&&y.then&&(t._promises||[]).push(y),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),p(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);p(t,f)},doneFn:function(){if(p(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":479,"../../lib":525,"../../lib/extend":515,"../../lib/setcursor":546,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"../../plots/cartesian/axis_defaults":578,"../../plots/cartesian/layout_attributes":589,"../../plots/cartesian/position_defaults":592,"../../plots/plots":638,"../../registry":657,"../color":363,"../colorscale/helpers":374,"../dragelement":382,"../drawing":385,"../titles":472,"./constants":365,"@plotly/d3":54,tinycolor2:309}],368:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":525}],369:[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":364,"./defaults":366,"./draw":367,"./has_colorbar":368}],370:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",p=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(p+(r={z:"z",c:"color"}[a]));var h=a+"auto",d=a+"min",m=a+"max",g=a+"mid",y=(s(p+h),s(p+d),s(p+m),{});y[d]=y[m]=void 0;var v={};v[h]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[h]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},b[d]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},b[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},b[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":542,"../../lib/sort_object_keys":548,"../colorbar/attributes":364,"./scales.js":378}],371:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),p=!1!==f.auto,h=f.min,d=f.max,m=f.mid,g=function(){return i.aggNums(Math.min,null,l)},y=function(){return i.aggNums(Math.max,null,l)};(void 0===h?h=g():p&&(h=u._colorAx&&n(h)?Math.min(h,g()):g()),void 0===d?d=y():p&&(d=u._colorAx&&n(d)?Math.max(d,y()):y()),p&&void 0!==m&&(d-m>m-h?h=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":525,"./helpers":374,"fast-isnumeric":186}],372:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=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,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],380:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":525}],381:[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)}},{}],382:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var 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)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,p,h,d,m,g=t.gd,y=1,v=g._context.doubleClickDelay,b=t.element;g._mouseDownTime||(g._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)v&&(y=Math.max(y-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,h),!m){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)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":525,"../../plots/cartesian/constants":583,"./align":379,"./cursor":380,"./unhover":383,"has-hover":224,"has-passive-events":225,"mouse-event-offset":238}],383:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":513,"../../lib/events":514,"../../lib/throttle":552,"../fx/constants":397}],384:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],385:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,p=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),y=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};function x(t,e,r){var n=e.fillpattern,i=n&&b.getPatternAttr(n.shape,0,"");if(i){var a=b.getPatternAttr(n.bgcolor,0,null),o=b.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=b.getPatternAttr(n.size,0,8),u=b.getPatternAttr(n.solidity,0,.3),f=e.uid;b.pattern(t,"point",r,f,i,l,u,void 0,n.fillmode,a,o,s)}else e.fillcolor&&t.call(c.fill,e.fillcolor)}b.font=function(t,e,r,n){i.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(c.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,i){t.call(b.setPosition,e,r).call(b.setSize,n,i)},b.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);b.translatePoint(t,i,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.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},b.singleFillStyle=function(t,e){var r=n.select(t.node());x(t,((r.data()[0]||[])[0]||{}).trace||{},e)},b.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&x(r,t[0].trace,e)}))};var _=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolBackOffs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,b.symbolBackOffs[r]=e.backoff||0,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var w=b.symbolNames.length;function A(t,e,r,n){var i=t%100;return b.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var k={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},M=a("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=S[a],p=new Array(u),h=0;h=100;var f=rt(t,r),p=G(t,r);e.attr("d",A(u,l,f,p))}var h,d,m,g=!1;if(t.so)m=s.outlierwidth,d=s.outliercolor,h=o.outliercolor;else{var y=(s||{}).width;m=(t.mlw+1||y+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(h=c.defaultLine,g=!0),h="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,h).style({"stroke-width":(m||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:m)+"px");var v=o.gradient,x=t.mgt;x?g=!0:x=v&&v.type,i.isArrayOrTypedArray(x)&&(x=x[0],S[x]||(x=0));var _=o.pattern,w=_&&b.getPatternAttr(_.shape,t.i,"");if(x&&"none"!==x){var k=t.mgc;k?g=!0:k=v.color;var T=r.uid;g&&(T+="-"+t.i),b.gradient(e,a,T,x,[[0,k],[1,h]],"fill")}else if(w){var M=b.getPatternAttr(_.bgcolor,t.i,null),z=b.getPatternAttr(_.fgcolor,t.i,null),E=_.fgopacity,L=b.getPatternAttr(_.size,t.i,8),C=b.getPatternAttr(_.solidity,t.i,.3),P=t.mcc||i.isArrayOrTypedArray(_.shape)||i.isArrayOrTypedArray(_.bgcolor)||i.isArrayOrTypedArray(_.size)||i.isArrayOrTypedArray(_.solidity),O=r.uid;P&&(O+="-"+t.i),b.pattern(e,"point",a,O,w,L,C,t.mcc,_.fillmode,M,z,E)}else c.fill(e,h);m&&c.stroke(e,d)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?y(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,p=void 0!==u,h=void 0!==f;(i.isArrayOrTypedArray(c)||p||h)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?p?u:e:h?f:m*e});var d=a.color,g=o.color,y=s.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?g||e:y||e});var v=a.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",A(b.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},h={};v(h,e,t.i);var d=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,h,t,d)}var m=t.tp||e.textposition,g=L(t,e),y=a?a(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,g,y).text(c).call(p.convertToTspans,r).call(E,m,g,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=L(t,e);c.fill(i,a);var u=l.traceIs(e,"bar-like");E(i,o,s,t.mrc2||t.mrc,u)}))}};var C,P;function O(t,e,r){return r&&(t=N(t)),e?D(t[1]):I(t[0])}function I(t){var e=n.round(t,2);return C=e,e}function D(t){var e=n.round(t,2);return P=e,e}function R(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,p=3*c*(l+c),h=3*l*(l+c);return[[I(e[0]+(p&&u/p)),D(e[1]+(p&&f/p))],[I(e[0]-(h&&u/h)),D(e[1]-(h&&f/h))]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||x>=f&&x<=c)&&(_<=p&&_>=u||_>=p&&_<=u)&&(t=[x,_])}return t}b.steps=function(t){var e=F[t]||B;return function(t){for(var r="M"+I(t[0][0])+","+D(t[0][1]),n=t.length,i=1;i=1e4&&(b.savedBBoxes={},j=0),r&&(b.savedBBoxes[r]=g),j++,i.extendFlat({},g)},b.setClipUrl=function(t,e,r){t.attr("clip-path",U(e,r))},b.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}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},b.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}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var H=/\s*sc.*/;b.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(H,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var q=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(q);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},b.getMarkerStandoff=G;var W,Y,Z,X,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,c=e._yA;if(!l||!c)return 90;r=l.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var u,f=t.lonlat[0],p=t.lonlat[1],h=e._geo.project([f,p+1e-5]),d=e._geo.project([f+1e-5,p]),m=Q(d[1]-n,d[0]-r),g=Q(h[1]-n,h[0]-r);if("north"===a)u=i/180*Math.PI;else if("previous"===a){var y=f/180*Math.PI,v=p/180*Math.PI,b=W/180*Math.PI,x=Y/180*Math.PI,_=b-y,w=$(x)*tt(_),A=tt(x)*$(v)-$(x)*tt(v)*$(_);u=-Q(w,A)-Math.PI,W=f,Y=p}var k=et(m,[$(u),0]),T=et(g,[tt(u),0]);i=Q(k[1]+T[1],k[0]+T[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var M=r-Z,S=n-X,z=e.line&&e.line.shape||"",E=z.slice(z.length-1);"h"===E&&(S=0),"v"===E&&(M=0),i+=Q(S,M)/Math.PI*180+90}else i=null}return Z=r,X=n,J=t.i,K=e.uid,i}b.getMarkerAngle=rt},{"../../components/fx/helpers":399,"../../constants/alignment":479,"../../constants/interactions":486,"../../constants/xmlns_namespaces":488,"../../lib":525,"../../lib/svg_text_utils":551,"../../registry":657,"../../traces/scatter/make_bubble_size_func":965,"../../traces/scatter/subtypes":973,"../color":363,"../colorscale":375,"./symbol_defs":386,"@plotly/d3":54,"fast-isnumeric":186,tinycolor2:309}],386:[function(t,e,r){"use strict";var n,i,a,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,p=Math.cos,h=Math.sin;function d(t){return null===t}function m(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=p(t),i=h(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,d=0,m=s(r),g="",y=0;y0;e.each((function(e){var f,p=e[0].trace,h=p.error_x||{},d=p.error_y||{};p.ids&&(f=function(t){return t.id});var m=o.hasMarkers(p)&&p.marker.maxdisplayed>0;d.visible||h.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,f);if(g.exit().remove(),e.length){h.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);u&&y.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=d.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="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(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var p=e.select("path.xerror");if(h.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(h.copy_ystyle?d:h).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!p.size()?p=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(p=p.transition().duration(s.duration).ease(s.easing)),p.attr("d",a)}else p.remove()}}))}}))}},{"../../traces/scatter/subtypes":973,"../drawing":385,"@plotly/d3":54,"fast-isnumeric":186}],393:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":363,"@plotly/d3":54}],394:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":515,"../../plots/font_attributes":604,"./layout_attributes":404}],395:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||ot<0||ot>w[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=ot+w[0]._offset,U="xval"in e?y.flat(l,e.xval):y.p2c(_,at),H="yval"in e?y.flat(l,e.yval):y.p2c(w,ot),!i(U[0])||!i(H[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(G=0;Gtt&&(et.splice(0,tt),ct=et[0].distance),v&&0!==B&&0===et.length){$.distance=B,$.index=!1;var f=Y._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=B}))),f&&f.length){var p,d=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];i(m.x0)&&i(m.y0)&&(p=pt(m),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>p.spikeDistance)&&(nt.vLinePoint=p))}var g=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(g.length){var b=g[0];i(b.x0)&&i(b.y0)&&(p=pt(b),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>p.spikeDistance)&&(nt.hLinePoint=p))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)At-1;Mt--)Lt(et[Mt]);et=St,gt()}var Ct=t._hoverdata,Pt=[],Ot=j(t),It=V(t);for(q=0;q1||et.length>1)||"closest"===C&&it&&et.length>1,Yt=h.combine(u.plot_bgcolor||h.background,u.paper_bgcolor),Zt=P(et,{gd:t,hovermode:C,rotateLabels:Wt,bgColor:Yt,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});y.isUnifiedHover(C)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,p=t.size(),h=new Array(p),d=0;function m(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(f=-1),h[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?A:1)/2,pmin:0,pmax:i?r.width:r.height}]})),h.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=p;){for(u++,n=!0,o=0;o.01&&v.pmin===b.pmin&&v.pmax===b.pmax){for(s=y.length-1;s>=0;s--)y[s].dp+=i;for(g.push.apply(g,y),h.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(a=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}h.forEach(m)}for(o=h.length-1;o>=0;o--){var x=h[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Zt,Wt?"xa":"ya",u),I(Zt,Wt,u._invScaleX,u._invScaleY));if(s&&s.tagName){var Xt=g.getComponentMethod("annotations","hasClickToShow")(t,Pt);f(n.select(s),Xt?"pointer":"")}if(!s||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Ct))return;Ct&&t.emit("plotly_unhover",{event:e,points:Ct});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:U,yvals:H})}(t,e,r,a,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=V(i),s=P(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),p=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,b=y.offsetTop;u+=v,f+=v,p+=b,d+=b}c.bbox={x0:u+o,x1:f+o,y0:p+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||h.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||h.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function P(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var A=e.fontFamily||v.HOVERFONT,k=e.fontSize||v.HOVERFONTSIZE,T=t[0],z=T.xa,E=T.ya,C=a.charAt(0),P=C+"Label",I=T[P];if(void 0===I&&"multicategory"===z.type)for(var D=0;Di.width-x?(g=i.width-x,e.attr("d","M"+(x-M)+",0L"+x+","+b+M+"v"+b+(2*S+v.height)+"H-"+x+"V"+b+M+"H"+(x-2*M)+"Z")):e.attr("d","M0,0L"+M+","+b+M+"H"+(S+v.width/2)+"v"+b+(2*S+v.height)+"H-"+(S+v.width/2)+"V"+b+M+"H-"+M+"Z")}else{var _,L,C;"right"===E.side?(_="start",L=1,C="",g=z._offset+z._length):(_="end",L=-1,C="-",g=z._offset),y=E._offset+(T.y0+T.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+C+M+","+M+"V"+(S+v.height/2)+"h"+C+(2*S+v.width)+"V-"+(S+v.height/2)+"H"+C+M+"V-"+M+"Z");var P,O=v.height/2,D=F-v.top-O,R="clip"+i._uid+"commonlabel"+E._id;if(g=0?st:lt+ft=0?lt:bt+ft=0?at:ot+pt=0?ot:xt+pt=0,"top"!==t.idealAlign&&G||!W?G?(P+=R/2,t.anchor="start"):t.anchor="middle":(P-=R/2,t.anchor="end");else if(t.pos=P,G=C+D/2+Y<=B,W=C-D/2-Y>=0,"left"!==t.idealAlign&&G||!W)if(G)C+=D/2,t.anchor="start";else{t.anchor="middle";var Z=Y/2,X=C+Z-B,J=C-Z;X>0&&(C-=X),J<0&&(C+=-J)}else C-=D/2,t.anchor="end";w.attr("text-anchor",t.anchor),z&&T.attr("text-anchor",t.anchor),e.attr("transform",s(C,P)+(c?l(_):""))})),_t}function O(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var p=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(p[c+"other"]=p[c+"Val"],p[c+"otherLabel"]=p[c+"Label"]),l=(l=o.hovertemplateString(f,p,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(C,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}function I(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(M+S),h=f+c*(t.txwidth+S),d=0,m=t.offset,g="middle"===s;g&&(f-=t.tx2width/2,h+=t.txwidth/2+S),e&&(m*=-T,d=t.offset*k),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*M+d)+","+o(M+m)+"v"+o(t.by/2-M)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*M+d)+"V"+o(m-M)+"Z");var y=d+f,v=m+t.ty0-t.by/2+S,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(i.attr("text-anchor","start"),y=g?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===b&&"end"!==s&&(i.attr("text-anchor","end"),y=g?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(y),o(v)),t.tx2width&&(r.select("text.name").call(u.positionText,a(h+c*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(p.setRect,a(h+(c-1)*t.tx2width/2+d),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function D(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}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:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+m.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 p=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+p+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+p,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var d=h.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=e.hLinePoint;n=v&&v.xa,"cursor"===(i=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=n._offset+v.x,y=i._offset+v.y);var b,x,_=a.readability(v.color,d)<1.5?h.contrast(d):v.color,w=i.spikemode,A=i.spikethickness,k=i.spikecolor||_,T=m.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=g),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),b=l.l+M*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:y,y2:y,"stroke-width":A,stroke:k,"stroke-dasharray":p.dashStyle(i.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:y,y2:y,"stroke-width":A+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==i.side?A:-A),cy:y,r:A,fill:k}).classed("spikeline",!0)}if(f){var z,E,L=e.vLinePoint;n=L&&L.xa,i=L&&L.ya,"cursor"===n.spikesnap?(z=c.pointerX,E=c.pointerY):(z=n._offset+L.x,E=i._offset+L.y);var C,P,O=a.readability(L.color,d)<1.5?h.contrast(d):L.color,I=n.spikemode,D=n.spikethickness,R=n.spikecolor||O,F=m.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(C=F,P=E),-1!==I.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),C=l.t+(1-N)*l.h,P=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:z,x2:z,y1:C,y2:P,"stroke-width":D,stroke:R,"stroke-dasharray":p.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:z,x2:z,y1:C,y2:P,"stroke-width":D+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:z,cy:F-("top"!==n.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function V(t){return t.offsetLeft+t.clientLeft}function U(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],p=c[1],h=u[0],d=u[1];return{x:f,y:p,width:h-f,height:d-p,top:Math.min(p,d),left:Math.min(f,h),right:Math.max(f,h),bottom:Math.max(p,d)}}},{"../../lib":525,"../../lib/events":514,"../../lib/override_cursor":536,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"../../registry":657,"../color":363,"../dragelement":382,"../drawing":385,"../legend/defaults":415,"../legend/draw":416,"./constants":397,"./helpers":399,"@plotly/d3":54,"fast-isnumeric":186,tinycolor2:309}],401:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.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":525,"../color":363,"./helpers":399}],402:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":525,"./layout_attributes":404}],403:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":525,"../dragelement":382,"./attributes":394,"./calc":395,"./click":396,"./constants":397,"./defaults":398,"./helpers":399,"./hover":400,"./layout_attributes":404,"./layout_defaults":405,"./layout_global_defaults":406,"@plotly/d3":54}],404:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes"),a=i({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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),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":604,"./constants":397}],405:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":525,"./hoverlabel_defaults":401,"./hovermode_defaults":402,"./layout_attributes":404}],406:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":525,"./hoverlabel_defaults":401,"./layout_attributes":404}],407:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("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:a({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"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),p=0;p1){if(!p&&!h&&!d)"independent"===k("pattern")&&(p=!0);g._hasSubplotGrid=p;var b,x,_="top to bottom"===k("roworder"),w=p?.2:.1,A=p?.3:.1;m&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),g._domains={x:u("x",k,w,b,v),y:u("y",k,A,x,y,_)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,p=t.grid||{},h=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var b=p.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n1);if(!1===_&&(e.legend=void 0),(!1!==_||f.uirevision)&&(h("uirevision",e.uirevision),!1!==_)){h("bgcolor",e.paper_bgcolor),h("bordercolor"),h("borderwidth");var w,A,k,T=i.coerceFont(h,"font",e.font),M="h"===h("orientation");if(M?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(A=1.1,k="bottom"):(A=-.1,k="top")):(w=1.02,A=1,k="auto"),h("traceorder",b),c.isGrouped(e.legend)&&h("tracegroupgap"),h("entrywidth"),h("entrywidthmode"),h("itemsizing"),h("itemwidth"),h("itemclick"),h("itemdoubleclick"),h("groupclick"),h("x",w),h("xanchor"),h("y",A),h("yanchor",k),h("valign"),i.noneOrAll(f,p,["x","y"]),h("title.text")){h("title.side",M?"left":"top");var S=i.extendFlat({},T,{size:i.bigFont(T.size)});i.coerceFont(h,"title.font",S)}}}},{"../../lib":525,"../../plot_api/plot_template":565,"../../plots/attributes":572,"../../plots/layout_attributes":629,"../../registry":657,"./attributes":413,"./helpers":419}],416:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),p=t("./handle_click"),h=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,g=d.FROM_TL,y=d.FROM_BR,v=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function w(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&p(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&p(r,t,n)}}function A(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),p=!r._inHover&&e._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(c.font,a).text(p?k(n,d):n);var g=r.itemwidth+2*h.itemGap;f.positionText(m,g,0),p?m.call(f.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(k(n,d)).call(M,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],p=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");p.set(s.trace._group,n),c=p.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):M(m,t,e,r)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.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||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function M(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,p,d=s.size*m;if(o){var g=c.bBox(o);u=g.height,p=g.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var y=t.select(1===n?".legendtitletext":".legendtext"),v=f.lineCount(y),b=y.node();if(u=d*v,p=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(p+=2*h.itemGap),f.positionText(y,l+h.titlePad,l+d);else{var x=2*h.itemGap+r.itemwidth;i.groupTitle&&(x=h.itemGap,p-=r.itemwidth),f.positionText(y,x,-d*((v-1)/2-.3))}}1===n?(r._titleWidth=p,r._titleHeight=u):(i.lineHeight=d,i.height=Math.max(u,16)+3,i.width=p)}(e,r,n,i)}))}function S(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function z(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,p="legend"+f._uid,d=e._inHover;d?(r=e.layer,p+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=v(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&v(t.calcdata,e)}var m=f.hiddenlabels||[];if(!(d||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+p).remove(),a.autoMargin(t,"legend");var k=i.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),E=i.ensureSingleById(f._topdefs,"clipPath",p,(function(t){t.append("rect")})),L=i.ensureSingle(k,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=i.ensureSingle(k,"g","scrollbox"),P=e.title;if(e._titleWidth=0,e._titleHeight=0,P.text){var O=i.ensureSingle(C,"text","legendtitletext");O.attr("text-anchor","start").call(c.font,P.font).text(P.text),M(O,C,t,e,1)}else C.selectAll(".legendtitletext").remove();var I=i.ensureSingle(k,"rect","scrollbar",(function(t){t.attr(h.scrollBarEnterAttrs).call(u.fill,h.scrollBarColor)})),D=C.selectAll("g.groups").data(s);D.enter().append("g").attr("class","groups"),D.exit().remove();var R=D.selectAll("g.traces").data(i.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(A,t,e)})).call(b,t,e).each((function(){d||n.select(this).call(T,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),u="fraction"===i.entrywidthmode,f=i.borderwidth,p=2*f,d=h.itemGap,m=i.itemwidth+2*d,g=2*(f+d),y=z(i),v=i.y<0||0===i.y&&"top"===y,b=i.y>1||1===i.y&&"bottom"===y,w=i.tracegroupgap,A={};i._maxHeight=Math.max(v||b?a.height/2:o.h,30);var k=0;i._width=0,i._height=0;var T=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+T[0],f+T[1]+i._height+e/2+d),i._height+=e,i._width=Math.max(i._width,t[0].width)})),k=m+i._width,i._width+=d+m+p,i._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var M=S(i),E=i.x<0||0===i.x&&"right"===M,L=i.x>1||1===i.x&&"left"===M,C=b||v,P=a.width/2;i._maxWidth=Math.max(E?C&&"left"===M?o.l+o.w:P:L?C&&"right"===M?o.r+o.w:P:o.w,2*m);var O=0,I=0;r.each((function(t){var e=_(t,i,m);O=Math.max(O,e),I+=e})),k=null;var D=0;if(l){var R=0,F=0,B=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,i,m),a=r[0].height;c.setTranslate(this,T[0],T[1]+f+d+a/2+e),e+=a,t=Math.max(t,n),A[r[0].trace.legendgroup]=t}));var r=t+d;F>0&&r+f+F>i._maxWidth?(D=Math.max(D,F),F=0,B+=R+w,R=e):R=Math.max(R,e),c.setTranslate(this,F,B),F+=r})),i._width=Math.max(D,F)+f,i._height=B+R+g}else{var N=r.size(),j=I+p+(N-1)*d=i._maxWidth&&(D=Math.max(D,q),U=0,H+=V,i._height+=V,V=0),c.setTranslate(this,T[0]+f+U,T[1]+f+H+e/2+d),q=U+r+d,U+=n,V=Math.max(V,e)})),j?(i._width=U+p,i._height=V+g):(i._width=Math.max(D,q)+p,i._height+=V+g)}}i._width=Math.ceil(Math.max(i._width+T[0],i._titleWidth+2*(f+h.titlePad))),i._height=Math.ceil(Math.max(i._height+T[1],i._titleHeight+2*(f+h.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,W=G.legendText||G.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=t[0].trace.legendgroup,o=_(t,i,m);l&&""!==a&&(o=A[a]);var f=W?m:k||o;s||u||(f+=d/2),c.setRect(e,0,-r/2,f,r)}))}(t,D,R,e)},function(){var s,u,m,v,b=f._size,x=e.borderwidth;if(!d){if(function(t){var e=t._fullLayout.legend,r=S(e),n=z(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*y[r],b:e._effHeight*y[n],t:e._effHeight*g[n]})}(t))return;var _=b.l+b.w*e.x-g[S(e)]*e._width,A=b.t+b.h*(1-e.y)-g[z(e)]*e._effHeight;if(f.margin.autoexpand){var T=_,M=A;_=i.constrain(_,0,f.width-e._width),A=i.constrain(A,0,f.height-e._effHeight),_!==T&&i.log("Constrain legend.x to make legend fit inside graph"),A!==M&&i.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(k,_,A)}if(I.on(".drag",null),k.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var P=e._effHeight;d&&(P=e._height),L.attr({width:e._width-x,height:P-x,x:x/2,y:x/2}),c.setTranslate(C,0,0),E.select("rect").attr({width:e._width-2*x,height:P-2*x,x:x,y:x}),c.setClipUrl(C,p,t),c.setRect(I,0,0,0,0),delete e._scrollY}else{var O,D,R,F=Math.max(h.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*h.scrollBarMargin,N=e._height-e._effHeight,j=B/N,V=Math.min(e._scrollY||0,N);L.attr({width:e._width-2*x+h.scrollBarWidth+h.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),E.select("rect").attr({width:e._width-2*x+h.scrollBarWidth+h.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+V}),c.setClipUrl(C,p,t),q(V,F,j),k.on("wheel",(function(){q(V=i.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==V&&V!==N&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;O="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=V})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(V=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,N)}(R,O,D),F,j))}));I.call(U);var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(O=t.changedTouches[0].clientY,R=V)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,q(V=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,N)}(R,O,D),F,j))}));C.call(H)}function q(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(I,e._width,h.scrollBarMargin+r*i,h.scrollBarWidth,n),E.select("rect").attr("y",x+r)}t._context.edits.legendPosition&&(k.classed("cursor-move",!0),l.init({element:k.node(),gd:t,prepFn:function(){var t=c.getTranslate(k);m=t.x,v=t.y},moveFn:function(t,r){var n=m+t,i=v+r;c.setTranslate(k,n,i),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),u=l.align(i,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=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}));i.size()>0&&w(t,k,i,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":479,"../../lib":525,"../../lib/events":514,"../../lib/svg_text_utils":551,"../../plots/plots":638,"../../registry":657,"../color":363,"../dragelement":382,"../drawing":385,"./constants":414,"./get_legend_data":417,"./handle_click":418,"./helpers":419,"./style":421,"@plotly/d3":54}],417:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,p={},h=0,d=0;function m(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+h;u.push(n),c[n]=[r],h++}}for(r=0;rT&&(k=T)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var M=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var y=e._fullLayout;r||(r=y.legend);var v="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*h.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function A(t,a,o){var u=t[0].trace,f=u.marker||{},p=f.line||{},h=o?u.visible&&u.type===o:i.traceIs(u,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(h?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var h=a.mcc;if(!r._inHover&&"mc"in a){var d=c(f),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),h=s.tryColorscale(f,"")(m)}var y=h||a.mc||f.color,v=f.pattern,b=v&&s.getPatternAttr(v.shape,0,"");if(b){var x=s.getPatternAttr(v.bgcolor,0,null),_=s.getPatternAttr(v.fgcolor,0,null),A=v.fgopacity,k=g(v.size,8,10),T=g(v.solidity,.5,1),M="legend-"+u.uid;i.call(s.pattern,"legend",e,M,b,k,T,h,v.fillmode,x,_,A)}else i.call(l.fill,y);o&&l.stroke(i,a.mlc||p.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,h=w(p(u.width,o.pts),u,5,2),d=a.minExtend(s,{marker:{line:{width:h}}});d.marker.line.color=u.color;var m=a.minExtend(o,{trace:d});f(c,m,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.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,i=t[0].trace,o=[];if(i.visible)switch(i.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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),p=c(i),h=p.colorscale,m=p.reversescale;if(h){if(!r){var g=h.length;u=0===o?h[m?g-1:0][1]:1===o?h[m?0:g-1][1]:h[Math.floor((g-1)/2)][1]}}else{var y=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(y)?y[o]||y[0]:y}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(m,"radial"===r),h,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,A(t,this,"waterfall")}var a=[];e.visible&&r&&(a=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(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){A(t,this,"funnel")})).each((function(t){A(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:v?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,i,o=m(t),l=o.showFill,f=o.showLine,p=o.showGradientLine,h=o.showGradientFill,g=o.anyFill,y=o.anyLine,v=t[0],x=v.trace,_=c(x),A=_.colorscale,k=_.reversescale,T=u.hasMarkers(x)||!g?"M5,0":y?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(l||h?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",T+"h"+b+"v6h-"+b+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,d(k),A,"fill")}})),f||p){var z=w(void 0,x.line,10,5);i=a.minExtend(x,{line:{width:z}}),r=[a.minExtend(v,{trace:i})]}var E=M.select(".legendlines").selectAll("path").data(f||p?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",T+(p?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),A,"stroke")}})})).each((function(t){var r,i,o=m(t),l=o.anyFill,c=o.anyLine,f=o.showLine,p=o.showMarker,h=t[0],d=h.trace,g=!p&&!c&&!l&&u.hasText(d);function y(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return h._distinct&&h.index&&t[h.index]?t[h.index]:t[0]}if(p||g||f){var x={},w={};if(p){x.mc=y("marker.color",b),x.mx=y("marker.symbol",b),x.mo=y("marker.opacity",a.mean,[.2,1]),x.mlc=y("marker.line.color",b),x.mlw=y("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var A=y("marker.size",a.mean,[2,16],12);x.ms=A,w.marker.size=A}f&&(w.line={width:y("line.width",b,[0,10],5)}),g&&(x.tx="Aa",x.tp=y("textposition",b),x.ts=10,x.tc=y("textfont.color",b),x.tf=y("textfont.family",b)),r=[a.minExtend(h,x)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var k=n.select(this).select("g.legendpoints"),T=k.selectAll("path.scatterpts").data(p?r:[]);T.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),T.exit().remove(),T.call(s.pointStyle,i,e),p&&(r[0].mrc=3);var M=k.selectAll("g.pointtext").data(g?r:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),M.exit().remove(),M.selectAll("text").call(s.textPointStyle,i,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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":525,"../../registry":657,"../../traces/pie/helpers":927,"../../traces/pie/style_one":933,"../../traces/scatter/subtypes":973,"../color":363,"../colorscale/helpers":374,"../drawing":385,"./constants":414,"@plotly/d3":54}],422:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":424}],423:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),p=c._cartesianSpikesEnabled;if("zoom"===s){var h,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(i=0;i1?(P=["toggleHover"],O=["resetViews"]):y?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],O=["resetGeo"]):g?(P=["hoverClosest3d"],O=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],O=["resetViewMapbox"]):x?P=["hoverClosestGl2d"]:v?P=["hoverClosestPie"]:T?(P=["hoverClosestCartesian","hoverCompareCartesian"],O=["resetViewSankey"]):P=["toggleHover"];m&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t=0;k--){var T=r.append("path").attr(g).style("opacity",k?.1:y).call(o.stroke,b).call(o.fill,v).call(s.dashLine,k?"solid":_,k?4+x:x);if(d(T,t,a),w){var M=l(t.layout,"selections",a);T.style({cursor:"move"});var S={element:T.node(),plotinfo:h,gd:t,editHelpers:M,isActiveSelection:!0},z=n(c,t);i(z,T,S)}else T.style("pointer-events",k?"all":"none");A[k]=T}var E=A[0];A[1].node().addEventListener("click",(function(){return function(t,e){if(!p(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void m(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=m,f(t)}}(t,E)}))}(t._fullLayout._selectionLayer)}function d(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function m(t){p(t)&&(t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t)))}e.exports={draw:f,drawOne:h,activateLastSelection:function(t){if(!p(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=m,f(t)}}},{"../../plot_api/plot_template":565,"../color":363,"../drawing":385,"../shapes/display_outlines":457,"../shapes/draw_newshape/helpers":462,"../shapes/handle_outline":464,"../shapes/helpers":465}],447:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":515,"../../drawing/attributes":384}],448:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],449:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,i=t("../../shapes/handle_outline").clearOutline,a=t("../../shapes/draw_newshape/helpers"),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,f=e.plotinfo,p=f.xaxis,h=f.yaxis,d=e.isActiveSelection,m=e.dragmode,g=(c.layout||{}).selections||[];if(!n(m)&&void 0!==d){var y=c._fullLayout._activeSelectionIndex;if(y-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){W(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(p=K(_))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=h(r),l=m(r);if(s||l){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&i._fullLayout._outlining)s&&(c=A(f,t)),c&&a.call("_guiRelayout",i,{shapes:c}),l&&!V(t)&&(u=k(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:u}).then((function(){e&&T(i)}))),i._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Z(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Z),c=r.map(Z);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,ht=et[0].yref;if(nt&&ht){var dt=ct(et);ut([L(t,nt,"x"),L(t,ht,"y")])($,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),p._reselect=!1}if(!a&&p._deselect){var mt=p._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!b){var r=T.clickmode;E.done(Tt).then((function(){if(E.clear(Tt),2===t){for(xt.remove(),K=0;K-1&&U(e,k,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&ft(k,void 0);l.click(k,e)})).catch(M.error)}},n.doneFn=function(){kt.remove(),E.done(Tt).then((function(){E.clear(Tt),!S&&J&&n.selectionDefs&&(J.subtract=bt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Z)),(S||b)&&Y(n,S),n.doneFnCompleted&&n.doneFnCompleted(Mt),x&&ft(k,at)})).catch(M.error)}},clearOutline:b,clearSelectionsCache:Y,selectOnClick:U}},{"../../lib":525,"../../lib/clear_gl_canvases":509,"../../lib/polygon":537,"../../lib/throttle":552,"../../plot_api/subroutines":566,"../../plots/cartesian/axis_ids":580,"../../registry":657,"../color":363,"../dragelement/helpers":381,"../drawing":385,"../fx":403,"../fx/helpers":399,"../shapes/constants":455,"../shapes/display_outlines":457,"../shapes/draw_newshape/helpers":462,"../shapes/draw_newshape/newshapes":463,"../shapes/handle_outline":464,"../shapes/helpers":465,"./constants":444,"./draw":446,"./draw_newselection/newselections":449,"./helpers":450,"point-in-polygon/nested":250,polybooljs:251}],453:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{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":480,"../../lib/extend":515,"../../plot_api/plot_template":565,"../../traces/scatter/attributes":948,"../annotations/attributes":346,"../drawing/attributes":384}],454:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],p=n.aggNums(Math.max,null,f),h=n.aggNums(Math.min,null,f),d=h<0?Math.abs(h)+c:c,m=p>0?p+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,p=1/0,h=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lh&&(h=f)));return h>=p?[p,h]: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;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===z&&(t[0][0]="M"),e[S]=t,A(),k())}}()}}function B(t,r){!function(t,r){if(e.length)for(var n=0;nb?(k=f,z="y0",T=b,E="y1"):(k=b,z="y1",T=f,E="y0");X(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),Z.moveFn="move"===O?J:K,Z.altKey=n.altKey},doneFn:function(){if(v(t))return;h(e),$(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;$(s)}};function X(r){if(v(t))O=null;else if(R)O="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";h(e,l),O=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;I?B("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=W(A+i)):(l=function(t){return W(q(t)+i)},V&&"date"===V.type&&(l=m.encodeDate(l))),B("path",r.path=w(P,o,l))}else I?B("xanchor",r.xanchor=G(x+n)):(B("x0",r.x0=G(c+n)),B("x1",r.x1=G(y+n))),D?B("yanchor",r.yanchor=W(A+i)):(B("y0",r.y0=W(f+i)),B("y1",r.y1=W(b+i)));e.attr("d",g(t,r)),Q(s,r)}function K(n,i){if(F){var a=function(t){return t},o=a,l=a;I?B("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=W(A+i)):(l=function(t){return W(q(t)+i)},V&&"date"===V.type&&(l=m.encodeDate(l))),B("path",r.path=w(P,o,l))}else if(R){if("resize-over-start-point"===O){var u=c+n,p=D?f-i:f+i;B("x0",r.x0=I?u:G(u)),B("y0",r.y0=D?p:W(p))}else if("resize-over-end-point"===O){var h=y+n,d=D?b-i:b+i;B("x1",r.x1=I?h:G(h)),B("y1",r.y1=D?d:W(d))}}else{var v=function(t){return-1!==O.indexOf(t)},_=v("n"),j=v("s"),U=v("w"),Y=v("e"),Z=_?k+i:k,X=j?T+i:T,J=U?M+n:M,K=Y?S+n:S;D&&(_&&(Z=k-i),j&&(X=T-i)),(!D&&X-Z>10||D&&Z-X>10)&&(B(z,r[z]=D?Z:W(Z)),B(E,r[E]=D?X:W(X))),K-J>10&&(B(L,r[L]=I?J:G(J)),B(C,r[C]=I?K:G(K)))}e.attr("d",g(t,r)),Q(s,r)}function Q(t,e){(I||D)&&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 a=H(I?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=q(D?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),I&&D){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}p.init(Z),Y.node().onmousemove=X}(t,I,l,e,r,O):!0===l.editable&&I.style("pointer-events",C||c.opacity(S)*M<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!b(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,y(t)}}(t,I)}))}}function _(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 w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){b(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,y(t)))}e.exports={draw:y,drawOne:x,eraseActiveShape:function(t){if(!b(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&lh&&(t="X"),t}));return a>h&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d}))}(e,s,c);if("pixel"===e.xsizemode){var x=s(e.xanchor);u=x+e.x0,f=x+e.x1}else u=s(e.x0),f=s(e.x1);if("pixel"===e.ysizemode){var _=c(e.yanchor);p=_-e.y0,h=_-e.y1}else p=c(e.y0),h=c(e.y1);if("line"===d)return"M"+u+","+p+"L"+f+","+h;if("rect"===d)return"M"+u+","+p+"H"+f+"V"+h+"H"+u+"Z";var w=(u+f)/2,A=(p+h)/2,k=Math.abs(w-u),T=Math.abs(A-p),M="A"+k+","+T,S=w+k+","+A;return"M"+S+M+" 0 1,1 "+(w+","+(A-T))+M+" 0 0,1 "+S+"Z"}},{"../../lib":525,"../../plots/cartesian/axes":576,"./constants":455}],466:[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":587,"./attributes":453,"./calc_autorange":454,"./defaults":456,"./draw":458,"./draw_newshape/defaults":461}],467:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps: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:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt: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":515,"../../plot_api/edit_types":558,"../../plot_api/plot_template":565,"../../plots/animation_attributes":570,"../../plots/font_attributes":604,"../../plots/pad_attributes":637,"./constants":468}],468:[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}},{}],469:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function z(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function E(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 L(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(T,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,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=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,y);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||p<0){var y={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[x.side];e.attr("transform",l(y[0],y[1]))}}}return R.call(F),O&&(z?R.on(".opacity",null):(T=0,M=!0,R.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(p.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(p.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,y,e,b):o.call("_guiRelayout",t,y,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),R.classed("js-placeholder",M),A}}},{"../../constants/alignment":479,"../../constants/interactions":486,"../../lib":525,"../../lib/svg_text_utils":551,"../../plots/plots":638,"../../registry":657,"../color":363,"../drawing":385,"@plotly/d3":54,"fast-isnumeric":186}],473:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":515,"../../plot_api/edit_types":558,"../../plot_api/plot_template":565,"../../plots/font_attributes":604,"../../plots/pad_attributes":637,"../color/attributes":362}],474:[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"}}},{}],475:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(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,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":525,"../../plots/array_container_defaults":571,"./attributes":473,"./constants":474}],476:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),p=t("./scrollbox");function h(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?y(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||y(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,p={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},h={width:l.headerWidth,height:l.headerHeight};a.call(v,i,u,t).call(M,i,p,h),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),y(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(A,i)})),o.setTranslate(e,l.lx,l.ly)}function y(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=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(s.filterVisible(l)),p=u.enter().append("g").classed(c,!0),h=u.exit();"dropdown"===o.type?(p.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var d=0,g=0,y=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?g=y.headerHeight+f.gapButtonHeader:d=y.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-y.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-y.openWidth);var x={x:y.lx+d+o.pad.l,y:y.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(v,o,s,t).call(M,o,x),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(A,o),u.call(_,o)}))})),u.call(_,o),b?(k.w=Math.max(y.openWidth,y.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(y.openHeight,y.headerHeight)),k.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,p=i._dims,h=i.active;if(u)for(s=0,l=0;l0?[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(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,h);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,T=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,z=g+y;z+M>c&&(z=c-M);var E=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:z,width:T,height:M}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=y>A,C=s.barWidth+2*s.barPad,P=s.barLength+2*s.barPad,O=d+m,I=g;O+C>l&&(O=l-C);var D=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),L?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:O,y:I,width:C,height:P}),this._vbarYMin=I+P/2,this._vbarTranslateMax=A-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=L?f+C+.5:f+.5,N=p-.5,j=k?h+M+.5:h+.5,V=o._topdefs.selectAll("#"+R).data(k||L?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",R).append("rect"),k||L?(this._clipRect=V.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||L){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 H=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(H),L&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":525,"../color":363,"../drawing":385,"@plotly/d3":54}],479:[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"}}},{}],480:[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(" ")}}},{}],481:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],482:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],483:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],484:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],485:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],486:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],487:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],488:[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}},{}],489:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],491:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s){"use strict";var l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j;return l=t.gl,c=t.context,t.strings,u=t.next,f=t.current,t.draw,t.elements,t.buffer,p=t.shader,t.attributes,h=t.vao,t.uniforms,d=t.framebuffer,t.extensions,t.timer,t.isBufferArgs,m=u.blend_color,g=f.blend_color,y=u.blend_equation,v=f.blend_equation,b=u.blend_func,x=f.blend_func,_=u.depth_range,w=f.depth_range,A=u.colorMask,k=f.colorMask,T=u.polygonOffset_offset,M=f.polygonOffset_offset,S=u.sample_coverage,z=f.sample_coverage,E=u.stencil_func,L=f.stencil_func,C=u.stencil_opFront,P=f.stencil_opFront,O=u.stencil_opBack,I=f.stencil_opBack,D=u.scissor_box,R=f.scissor_box,F=u.viewport,B=f.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},N={},j={},{draw:function(t){var n,i,a,o,s,D,F,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut;(n=t.framebuffer,i=d.getFramebuffer(n),a=d.next,d.next=i,o=c.framebufferWidth,c.framebufferWidth=i?i.width:c.drawingBufferWidth,s=c.framebufferHeight,c.framebufferHeight=i?i.height:c.drawingBufferHeight,i!==d.cur&&(i?l.bindFramebuffer(36160,i.framebuffer):l.bindFramebuffer(36160,null),d.cur=i),f.dirty)&&((K=u.dither)!==f.dither&&(K?l.enable(3024):l.disable(3024),f.dither=K),(Q=u.blend_enable)!==f.blend_enable&&(Q?l.enable(3042):l.disable(3042),f.blend_enable=Q),$=m[0],tt=m[1],et=m[2],rt=m[3],$===g[0]&&tt===g[1]&&et===g[2]&&rt===g[3]||(l.blendColor($,tt,et,rt),g[0]=$,g[1]=tt,g[2]=et,g[3]=rt),nt=y[0],it=y[1],nt===v[0]&&it===v[1]||(l.blendEquationSeparate(nt,it),v[0]=nt,v[1]=it),at=b[0],ot=b[1],st=b[2],lt=b[3],at===x[0]&&ot===x[1]&&st===x[2]&<===x[3]||(l.blendFuncSeparate(at,ot,st,lt),x[0]=at,x[1]=ot,x[2]=st,x[3]=lt),(ct=u.depth_enable)!==f.depth_enable&&(ct?l.enable(2929):l.disable(2929),f.depth_enable=ct),(ut=u.depth_func)!==f.depth_func&&(l.depthFunc(ut),f.depth_func=ut),ft=_[0],pt=_[1],ft===w[0]&&pt===w[1]||(l.depthRange(ft,pt),w[0]=ft,w[1]=pt),(ht=u.depth_mask)!==f.depth_mask&&(l.depthMask(ht),f.depth_mask=ht),dt=A[0],mt=A[1],gt=A[2],yt=A[3],dt===k[0]&&mt===k[1]&>===k[2]&&yt===k[3]||(l.colorMask(dt,mt,gt,yt),k[0]=dt,k[1]=mt,k[2]=gt,k[3]=yt),(vt=u.cull_enable)!==f.cull_enable&&(vt?l.enable(2884):l.disable(2884),f.cull_enable=vt),(bt=u.cull_face)!==f.cull_face&&(l.cullFace(bt),f.cull_face=bt),(xt=u.frontFace)!==f.frontFace&&(l.frontFace(xt),f.frontFace=xt),(_t=u.lineWidth)!==f.lineWidth&&(l.lineWidth(_t),f.lineWidth=_t),(wt=u.polygonOffset_enable)!==f.polygonOffset_enable&&(wt?l.enable(32823):l.disable(32823),f.polygonOffset_enable=wt),At=T[0],kt=T[1],At===M[0]&&kt===M[1]||(l.polygonOffset(At,kt),M[0]=At,M[1]=kt),(Tt=u.sample_alpha)!==f.sample_alpha&&(Tt?l.enable(32926):l.disable(32926),f.sample_alpha=Tt),(Mt=u.sample_enable)!==f.sample_enable&&(Mt?l.enable(32928):l.disable(32928),f.sample_enable=Mt),St=S[0],zt=S[1],St===z[0]&&zt===z[1]||(l.sampleCoverage(St,zt),z[0]=St,z[1]=zt),(Et=u.stencil_enable)!==f.stencil_enable&&(Et?l.enable(2960):l.disable(2960),f.stencil_enable=Et),(Lt=u.stencil_mask)!==f.stencil_mask&&(l.stencilMask(Lt),f.stencil_mask=Lt),Ct=E[0],Pt=E[1],Ot=E[2],Ct===L[0]&&Pt===L[1]&&Ot===L[2]||(l.stencilFunc(Ct,Pt,Ot),L[0]=Ct,L[1]=Pt,L[2]=Ot),It=C[0],Dt=C[1],Rt=C[2],Ft=C[3],It===P[0]&&Dt===P[1]&&Rt===P[2]&&Ft===P[3]||(l.stencilOpSeparate(It,Dt,Rt,Ft),P[0]=It,P[1]=Dt,P[2]=Rt,P[3]=Ft),Bt=O[0],Nt=O[1],jt=O[2],Vt=O[3],Bt===I[0]&&Nt===I[1]&&jt===I[2]&&Vt===I[3]||(l.stencilOpSeparate(Bt,Nt,jt,Vt),I[0]=Bt,I[1]=Nt,I[2]=jt,I[3]=Vt),(Ut=u.scissor_enable)!==f.scissor_enable&&(Ut?l.enable(3089):l.disable(3089),f.scissor_enable=Ut));D=c.framebufferWidth,F=c.framebufferHeight,j=c.viewportWidth,c.viewportWidth=D,V=c.viewportHeight,c.viewportHeight=F,l.viewport(0,0,D,F),B[0]=0,B[1]=0,B[2]=D,B[3]=F,U=c.framebufferWidth,H=c.framebufferHeight,l.scissor(0,0,U,H),R[0]=0,R[1]=0,R[2]=U,R[3]=H,(q=f.profile)&&(G=performance.now(),e.count++),W=p.frag,Y=p.vert,Z=p.program(Y,W),l.useProgram(Z.program),h.setVAO(null),X=Z.id,(J=N[X])?J.call(this,t):(J=N[X]=r(Z)).call(this,t),f.dirty=!0,h.setVAO(null),d.next=a,c.framebufferWidth=o,c.framebufferHeight=s,c.viewportWidth=j,c.viewportHeight=V,q&&(e.cpuTime+=performance.now()-G)},scope:function(t,r,s){var l,u,p,h,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C;l=t.framebuffer,u=d.getFramebuffer(l),p=d.next,d.next=u,h=c.framebufferWidth,c.framebufferWidth=u?u.width:c.drawingBufferWidth,m=c.framebufferHeight,c.framebufferHeight=u?u.height:c.drawingBufferHeight,g=c.framebufferWidth,y=c.framebufferHeight,v=c.viewportWidth,c.viewportWidth=g,b=c.viewportHeight,c.viewportHeight=y,x=F[0],F[0]=n,_=F[1],F[1]=i,w=F[2],F[2]=g,A=F[3],F[3]=y,k=c.framebufferWidth,T=c.framebufferHeight,M=D[0],D[0]=a,S=D[1],D[1]=o,z=D[2],D[2]=k,E=D[3],D[3]=T,(L=f.profile)&&(C=performance.now(),e.count++),f.dirty=!0,r(c,t,s),d.next=p,c.framebufferWidth=h,c.framebufferHeight=m,c.viewportWidth=v,c.viewportHeight=b,F[0]=x,F[1]=_,F[2]=w,F[3]=A,D[0]=M,D[1]=S,D[2]=z,D[3]=E,L&&(e.cpuTime+=performance.now()-C),f.dirty=!0},batch:function(t,r){var n,i,a,o,c,d,D,R,F,B,N,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt;f.dirty&&((R=u.dither)!==f.dither&&(R?l.enable(3024):l.disable(3024),f.dither=R),(F=u.blend_enable)!==f.blend_enable&&(F?l.enable(3042):l.disable(3042),f.blend_enable=F),B=m[0],N=m[1],V=m[2],U=m[3],B===g[0]&&N===g[1]&&V===g[2]&&U===g[3]||(l.blendColor(B,N,V,U),g[0]=B,g[1]=N,g[2]=V,g[3]=U),H=y[0],q=y[1],H===v[0]&&q===v[1]||(l.blendEquationSeparate(H,q),v[0]=H,v[1]=q),G=b[0],W=b[1],Y=b[2],Z=b[3],G===x[0]&&W===x[1]&&Y===x[2]&&Z===x[3]||(l.blendFuncSeparate(G,W,Y,Z),x[0]=G,x[1]=W,x[2]=Y,x[3]=Z),(X=u.depth_enable)!==f.depth_enable&&(X?l.enable(2929):l.disable(2929),f.depth_enable=X),(J=u.depth_func)!==f.depth_func&&(l.depthFunc(J),f.depth_func=J),K=_[0],Q=_[1],K===w[0]&&Q===w[1]||(l.depthRange(K,Q),w[0]=K,w[1]=Q),($=u.depth_mask)!==f.depth_mask&&(l.depthMask($),f.depth_mask=$),tt=A[0],et=A[1],rt=A[2],nt=A[3],tt===k[0]&&et===k[1]&&rt===k[2]&&nt===k[3]||(l.colorMask(tt,et,rt,nt),k[0]=tt,k[1]=et,k[2]=rt,k[3]=nt),(it=u.cull_enable)!==f.cull_enable&&(it?l.enable(2884):l.disable(2884),f.cull_enable=it),(at=u.cull_face)!==f.cull_face&&(l.cullFace(at),f.cull_face=at),(ot=u.frontFace)!==f.frontFace&&(l.frontFace(ot),f.frontFace=ot),(st=u.lineWidth)!==f.lineWidth&&(l.lineWidth(st),f.lineWidth=st),(lt=u.polygonOffset_enable)!==f.polygonOffset_enable&&(lt?l.enable(32823):l.disable(32823),f.polygonOffset_enable=lt),ct=T[0],ut=T[1],ct===M[0]&&ut===M[1]||(l.polygonOffset(ct,ut),M[0]=ct,M[1]=ut),(ft=u.sample_alpha)!==f.sample_alpha&&(ft?l.enable(32926):l.disable(32926),f.sample_alpha=ft),(pt=u.sample_enable)!==f.sample_enable&&(pt?l.enable(32928):l.disable(32928),f.sample_enable=pt),ht=S[0],dt=S[1],ht===z[0]&&dt===z[1]||(l.sampleCoverage(ht,dt),z[0]=ht,z[1]=dt),(mt=u.stencil_enable)!==f.stencil_enable&&(mt?l.enable(2960):l.disable(2960),f.stencil_enable=mt),(gt=u.stencil_mask)!==f.stencil_mask&&(l.stencilMask(gt),f.stencil_mask=gt),yt=E[0],vt=E[1],bt=E[2],yt===L[0]&&vt===L[1]&&bt===L[2]||(l.stencilFunc(yt,vt,bt),L[0]=yt,L[1]=vt,L[2]=bt),xt=C[0],_t=C[1],wt=C[2],At=C[3],xt===P[0]&&_t===P[1]&&wt===P[2]&&At===P[3]||(l.stencilOpSeparate(xt,_t,wt,At),P[0]=xt,P[1]=_t,P[2]=wt,P[3]=At),kt=O[0],Tt=O[1],Mt=O[2],St=O[3],kt===I[0]&&Tt===I[1]&&Mt===I[2]&&St===I[3]||(l.stencilOpSeparate(kt,Tt,Mt,St),I[0]=kt,I[1]=Tt,I[2]=Mt,I[3]=St),(zt=u.scissor_enable)!==f.scissor_enable&&(zt?l.enable(3089):l.disable(3089),f.scissor_enable=zt));(n=f.profile)&&(i=performance.now(),e.count+=r),a=p.frag,o=p.vert,c=p.program(o,a),l.useProgram(c.program),h.setVAO(null),d=c.id,(D=j[d])?D.call(this,t,r):(D=j[d]=s(c)).call(this,t,r),f.dirty=!0,h.setVAO(null),n&&(e.cpuTime+=performance.now()-i)}}}},{}],492:[function(t,e,r){e.exports=function(t,e,r){"use strict";var n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P;return n=t.gl,t.context,t.strings,i=t.next,a=t.current,t.draw,t.elements,t.buffer,t.shader,o=t.attributes,s=t.vao,t.uniforms,l=t.framebuffer,t.extensions,t.timer,t.isBufferArgs,i.blend_color,a.blend_color,i.blend_equation,a.blend_equation,i.blend_func,a.blend_func,i.depth_range,a.depth_range,i.colorMask,a.colorMask,i.polygonOffset_offset,a.polygonOffset_offset,i.sample_coverage,a.sample_coverage,i.stencil_func,a.stencil_func,i.stencil_opFront,a.stencil_opFront,i.stencil_opBack,a.stencil_opBack,i.scissor_box,a.scissor_box,i.viewport,a.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},c=i.blend_color,u=a.blend_color,f=i.blend_equation,p=a.blend_equation,h=i.blend_func,d=a.blend_func,m=i.depth_range,g=a.depth_range,y=i.colorMask,v=a.colorMask,b=i.polygonOffset_offset,x=a.polygonOffset_offset,_=i.sample_coverage,w=a.sample_coverage,A=i.stencil_func,k=a.stencil_func,T=i.stencil_opFront,M=a.stencil_opFront,S=i.stencil_opBack,z=a.stencil_opBack,E=i.scissor_box,L=a.scissor_box,C=i.viewport,P=a.viewport,{poll:function(){var t,e,r,o,s,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X;a.dirty=!1,e=i.dither,r=i.blend_enable,o=i.depth_enable,s=i.cull_enable,O=i.polygonOffset_enable,I=i.sample_alpha,D=i.sample_enable,R=i.stencil_enable,F=i.scissor_enable,B=i.depth_func,N=a.depth_func,j=i.depth_mask,V=a.depth_mask,U=i.cull_face,H=a.cull_face,q=i.frontFace,G=a.frontFace,W=i.lineWidth,Y=a.lineWidth,Z=i.stencil_mask,X=a.stencil_mask,(t=l.next)!==l.cur&&(t?n.bindFramebuffer(36160,t.framebuffer):n.bindFramebuffer(36160,null),l.cur=t),e!==a.dither&&(e?n.enable(3024):n.disable(3024),a.dither=e),r!==a.blend_enable&&(r?n.enable(3042):n.disable(3042),a.blend_enable=r),o!==a.depth_enable&&(o?n.enable(2929):n.disable(2929),a.depth_enable=o),s!==a.cull_enable&&(s?n.enable(2884):n.disable(2884),a.cull_enable=s),O!==a.polygonOffset_enable&&(O?n.enable(32823):n.disable(32823),a.polygonOffset_enable=O),I!==a.sample_alpha&&(I?n.enable(32926):n.disable(32926),a.sample_alpha=I),D!==a.sample_enable&&(D?n.enable(32928):n.disable(32928),a.sample_enable=D),R!==a.stencil_enable&&(R?n.enable(2960):n.disable(2960),a.stencil_enable=R),F!==a.scissor_enable&&(F?n.enable(3089):n.disable(3089),a.scissor_enable=F),c[0]===u[0]&&c[1]===u[1]&&c[2]===u[2]&&c[3]===u[3]||(n.blendColor(c[0],c[1],c[2],c[3]),u[0]=c[0],u[1]=c[1],u[2]=c[2],u[3]=c[3]),f[0]===p[0]&&f[1]===p[1]||(n.blendEquationSeparate(f[0],f[1]),p[0]=f[0],p[1]=f[1]),h[0]===d[0]&&h[1]===d[1]&&h[2]===d[2]&&h[3]===d[3]||(n.blendFuncSeparate(h[0],h[1],h[2],h[3]),d[0]=h[0],d[1]=h[1],d[2]=h[2],d[3]=h[3]),B!==N&&(n.depthFunc(B),a.depth_func=B),m[0]===g[0]&&m[1]===g[1]||(n.depthRange(m[0],m[1]),g[0]=m[0],g[1]=m[1]),j!==V&&(n.depthMask(j),a.depth_mask=j),y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&y[3]===v[3]||(n.colorMask(y[0],y[1],y[2],y[3]),v[0]=y[0],v[1]=y[1],v[2]=y[2],v[3]=y[3]),U!==H&&(n.cullFace(U),a.cull_face=U),q!==G&&(n.frontFace(q),a.frontFace=q),W!==Y&&(n.lineWidth(W),a.lineWidth=W),b[0]===x[0]&&b[1]===x[1]||(n.polygonOffset(b[0],b[1]),x[0]=b[0],x[1]=b[1]),_[0]===w[0]&&_[1]===w[1]||(n.sampleCoverage(_[0],_[1]),w[0]=_[0],w[1]=_[1]),Z!==X&&(n.stencilMask(Z),a.stencil_mask=Z),A[0]===k[0]&&A[1]===k[1]&&A[2]===k[2]||(n.stencilFunc(A[0],A[1],A[2]),k[0]=A[0],k[1]=A[1],k[2]=A[2]),T[0]===M[0]&&T[1]===M[1]&&T[2]===M[2]&&T[3]===M[3]||(n.stencilOpSeparate(T[0],T[1],T[2],T[3]),M[0]=T[0],M[1]=T[1],M[2]=T[2],M[3]=T[3]),S[0]===z[0]&&S[1]===z[1]&&S[2]===z[2]&&S[3]===z[3]||(n.stencilOpSeparate(S[0],S[1],S[2],S[3]),z[0]=S[0],z[1]=S[1],z[2]=S[2],z[3]=S[3]),E[0]===L[0]&&E[1]===L[1]&&E[2]===L[2]&&E[3]===L[3]||(n.scissor(E[0],E[1],E[2],E[3]),L[0]=E[0],L[1]=E[1],L[2]=E[2],L[3]=E[3]),C[0]===P[0]&&C[1]===P[1]&&C[2]===P[2]&&C[3]===P[3]||(n.viewport(C[0],C[1],C[2],C[3]),P[0]=C[0],P[1]=C[1],P[2]=C[2],P[3]=C[3])},refresh:function(){var t,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X;a.dirty=!1,D=i.dither,R=i.blend_enable,F=i.depth_enable,B=i.cull_enable,N=i.polygonOffset_enable,j=i.sample_alpha,V=i.sample_enable,U=i.stencil_enable,H=i.scissor_enable,q=i.depth_func,a.depth_func,G=i.depth_mask,a.depth_mask,W=i.cull_face,a.cull_face,Y=i.frontFace,a.frontFace,Z=i.lineWidth,a.lineWidth,X=i.stencil_mask,a.stencil_mask,(t=l.next)?n.bindFramebuffer(36160,t.framebuffer):n.bindFramebuffer(36160,null),l.cur=t,O=o,I=0;for(var J=0;J":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},gr={},yr={},vr=new Float32Array(16),br=new Float32Array(16),xr=new Float32Array(16),_r=new Float32Array(16),wr=new Float32Array(16),Ar=new Float32Array(16),kr=new Float32Array(16),Tr=new Float32Array(16),Mr=new Float32Array(16),Sr=new Float32Array(16),zr=new Float32Array(16),Er=new Float32Array(16),Lr=new Float32Array(16),Cr=new Float32Array(16),Pr=new Float32Array(16),Or=new Float32Array(16),Ir=new Float32Array(16),Dr=new Float32Array(16),Rr=new Float32Array(16),Fr=new Float32Array(16),Br=new Float32Array(16),Nr=new Float32Array(16),jr=new Float32Array(16),Vr=new Float32Array(16),Ur=new Float32Array(16),Hr=new Float32Array(16),qr=new Float32Array(16),Gr=new Float32Array(16),Wr=new Float32Array(16),Yr=new Float32Array(16),Zr=new Float32Array(16),Xr=new Float32Array(16),{draw:function(t){var e,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,Ve,qe,We,Ze,Je,Qe,pr,dr,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn;((e=Ge.next)!==Ge.cur&&(e?De.bindFramebuffer(36160,e.framebuffer):De.bindFramebuffer(36160,null),Ge.cur=e),Be.dirty)&&(jr=tr[0],Vr=tr[1],Ur=tr[2],Hr=tr[3],jr===er[0]&&Vr===er[1]&&Ur===er[2]&&Hr===er[3]||(De.colorMask(jr,Vr,Ur,Hr),er[0]=jr,er[1]=Vr,er[2]=Ur,er[3]=Hr),(qr=Fe.frontFace)!==Be.frontFace&&(De.frontFace(qr),Be.frontFace=qr),(Gr=Fe.polygonOffset_enable)!==Be.polygonOffset_enable&&(Gr?De.enable(32823):De.disable(32823),Be.polygonOffset_enable=Gr),Wr=rr[0],Yr=rr[1],Wr===nr[0]&&Yr===nr[1]||(De.polygonOffset(Wr,Yr),nr[0]=Wr,nr[1]=Yr),(Zr=Fe.sample_alpha)!==Be.sample_alpha&&(Zr?De.enable(32926):De.disable(32926),Be.sample_alpha=Zr),(Xr=Fe.sample_enable)!==Be.sample_enable&&(Xr?De.enable(32928):De.disable(32928),Be.sample_enable=Xr),Jr=ir[0],Kr=ir[1],Jr===ar[0]&&Kr===ar[1]||(De.sampleCoverage(Jr,Kr),ar[0]=Jr,ar[1]=Kr),(Qr=Fe.stencil_enable)!==Be.stencil_enable&&(Qr?De.enable(2960):De.disable(2960),Be.stencil_enable=Qr),($r=Fe.stencil_mask)!==Be.stencil_mask&&(De.stencilMask($r),Be.stencil_mask=$r),tn=or[0],en=or[1],rn=or[2],tn===sr[0]&&en===sr[1]&&rn===sr[2]||(De.stencilFunc(tn,en,rn),sr[0]=tn,sr[1]=en,sr[2]=rn),nn=lr[0],an=lr[1],on=lr[2],sn=lr[3],nn===cr[0]&&an===cr[1]&&on===cr[2]&&sn===cr[3]||(De.stencilOpSeparate(nn,an,on,sn),cr[0]=nn,cr[1]=an,cr[2]=on,cr[3]=sn),ln=ur[0],cn=ur[1],un=ur[2],fn=ur[3],ln===fr[0]&&cn===fr[1]&&un===fr[2]&&fn===fr[3]||(De.stencilOpSeparate(ln,cn,un,fn),fr[0]=ln,fr[1]=cn,fr[2]=un,fr[3]=fn));mt=t.viewportX,gr.x=mt,gt=t.viewportY,gr.y=gt,yt=t.viewportWidth,gr.width=yt,vt=t.viewportHeight,gr.height=vt,bt=0|gr.x,xt=0|gr.y,_t="width"in gr?0|gr.width:Re.framebufferWidth-bt,wt="height"in gr?0|gr.height:Re.framebufferHeight-xt,At=Re.viewportWidth,Re.viewportWidth=_t,kt=Re.viewportHeight,Re.viewportHeight=wt,De.viewport(bt,xt,_t,wt),mr[0]=bt,mr[1]=xt,mr[2]=_t,mr[3]=wt,De.blendColor(0,0,0,0),Ye[0]=0,Ye[1]=0,Ye[2]=0,Ye[3]=0,r?De.enable(3042):De.disable(3042),Be.blend_enable=r,De.blendEquationSeparate(32774,32774),Xe[0]=32774,Xe[1]=32774,De.blendFuncSeparate(770,771,1,1),Ke[0]=770,Ke[1]=771,Ke[2]=1,Ke[3]=1,n?De.enable(2884):De.disable(2884),Be.cull_enable=n,De.cullFace(i),Be.cull_face=i,a?De.enable(2929):De.disable(2929),Be.depth_enable=a,De.depthFunc(o),Be.depth_func=o,De.depthMask(s),Be.depth_mask=s,De.depthRange(0,1),$e[0]=0,$e[1]=1,l?De.enable(3024):De.disable(3024),Be.dither=l,De.lineWidth(c),Be.lineWidth=c,Tt=t.scissorX,yr.x=Tt,Mt=t.scissorY,yr.y=Mt,St=t.scissorWidth,yr.width=St,zt=t.scissorHeight,yr.height=zt,Et=0|yr.x,Lt=0|yr.y,Ct="width"in yr?0|yr.width:Re.framebufferWidth-Et,Pt="height"in yr?0|yr.height:Re.framebufferHeight-Lt,De.scissor(Et,Lt,Ct,Pt),hr[0]=Et,hr[1]=Lt,hr[2]=Ct,hr[3]=Pt,u?De.enable(3089):De.disable(3089),Be.scissor_enable=u,Ot=Be.profile,Be.profile=!1,De.useProgram(f.program),He.setVAO(null),It=h.location,(Dt=Ue[It]).buffer||De.enableVertexAttribArray(It),Dt.type===p.dtype&&4===Dt.size&&Dt.buffer===p&&!1===Dt.normalized&&0===Dt.offset&&0===Dt.stride||(De.bindBuffer(34962,p.buffer),De.vertexAttribPointer(It,4,p.dtype,!1,0,0),Dt.type=p.dtype,Dt.size=4,Dt.buffer=p,Dt.normalized=!1,Dt.offset=0,Dt.stride=0),Rt=m.location,(Ft=Ue[Rt]).buffer||De.enableVertexAttribArray(Rt),Ft.type===d.dtype&&4===Ft.size&&Ft.buffer===d&&!1===Ft.normalized&&0===Ft.offset&&0===Ft.stride||(De.bindBuffer(34962,d.buffer),De.vertexAttribPointer(Rt,4,d.dtype,!1,0,0),Ft.type=d.dtype,Ft.size=4,Ft.buffer=d,Ft.normalized=!1,Ft.offset=0,Ft.stride=0),Bt=y.location,(Nt=Ue[Bt]).buffer||De.enableVertexAttribArray(Bt),Nt.type===g.dtype&&4===Nt.size&&Nt.buffer===g&&!1===Nt.normalized&&0===Nt.offset&&0===Nt.stride||(De.bindBuffer(34962,g.buffer),De.vertexAttribPointer(Bt,4,g.dtype,!1,0,0),Nt.type=g.dtype,Nt.size=4,Nt.buffer=g,Nt.normalized=!1,Nt.offset=0,Nt.stride=0),jt=b.location,(Vt=Ue[jt]).buffer||De.enableVertexAttribArray(jt),Vt.type===v.dtype&&4===Vt.size&&Vt.buffer===v&&!1===Vt.normalized&&0===Vt.offset&&0===Vt.stride||(De.bindBuffer(34962,v.buffer),De.vertexAttribPointer(jt,4,v.dtype,!1,0,0),Vt.type=v.dtype,Vt.size=4,Vt.buffer=v,Vt.normalized=!1,Vt.offset=0,Vt.stride=0),Ut=_.location,(Ht=Ue[Ut]).buffer||De.enableVertexAttribArray(Ut),Ht.type===x.dtype&&4===Ht.size&&Ht.buffer===x&&!1===Ht.normalized&&0===Ht.offset&&0===Ht.stride||(De.bindBuffer(34962,x.buffer),De.vertexAttribPointer(Ut,4,x.dtype,!1,0,0),Ht.type=x.dtype,Ht.size=4,Ht.buffer=x,Ht.normalized=!1,Ht.offset=0,Ht.stride=0),qt=A.location,(Gt=Ue[qt]).buffer||De.enableVertexAttribArray(qt),Gt.type===w.dtype&&4===Gt.size&&Gt.buffer===w&&!1===Gt.normalized&&0===Gt.offset&&0===Gt.stride||(De.bindBuffer(34962,w.buffer),De.vertexAttribPointer(qt,4,w.dtype,!1,0,0),Gt.type=w.dtype,Gt.size=4,Gt.buffer=w,Gt.normalized=!1,Gt.offset=0,Gt.stride=0),Wt=T.location,(Yt=Ue[Wt]).buffer||De.enableVertexAttribArray(Wt),Yt.type===k.dtype&&4===Yt.size&&Yt.buffer===k&&!1===Yt.normalized&&0===Yt.offset&&0===Yt.stride||(De.bindBuffer(34962,k.buffer),De.vertexAttribPointer(Wt,4,k.dtype,!1,0,0),Yt.type=k.dtype,Yt.size=4,Yt.buffer=k,Yt.normalized=!1,Yt.offset=0,Yt.stride=0),Zt=S.location,(Xt=Ue[Zt]).buffer||De.enableVertexAttribArray(Zt),Xt.type===M.dtype&&4===Xt.size&&Xt.buffer===M&&!1===Xt.normalized&&0===Xt.offset&&0===Xt.stride||(De.bindBuffer(34962,M.buffer),De.vertexAttribPointer(Zt,4,M.dtype,!1,0,0),Xt.type=M.dtype,Xt.size=4,Xt.buffer=M,Xt.normalized=!1,Xt.offset=0,Xt.stride=0),Jt=E.location,(Kt=Ue[Jt]).buffer||De.enableVertexAttribArray(Jt),Kt.type===z.dtype&&4===Kt.size&&Kt.buffer===z&&!1===Kt.normalized&&0===Kt.offset&&0===Kt.stride||(De.bindBuffer(34962,z.buffer),De.vertexAttribPointer(Jt,4,z.dtype,!1,0,0),Kt.type=z.dtype,Kt.size=4,Kt.buffer=z,Kt.normalized=!1,Kt.offset=0,Kt.stride=0),Qt=C.location,($t=Ue[Qt]).buffer||De.enableVertexAttribArray(Qt),$t.type===L.dtype&&4===$t.size&&$t.buffer===L&&!1===$t.normalized&&0===$t.offset&&0===$t.stride||(De.bindBuffer(34962,L.buffer),De.vertexAttribPointer(Qt,4,L.dtype,!1,0,0),$t.type=L.dtype,$t.size=4,$t.buffer=L,$t.normalized=!1,$t.offset=0,$t.stride=0),te=O.location,(ee=Ue[te]).buffer||De.enableVertexAttribArray(te),ee.type===P.dtype&&4===ee.size&&ee.buffer===P&&!1===ee.normalized&&0===ee.offset&&0===ee.stride||(De.bindBuffer(34962,P.buffer),De.vertexAttribPointer(te,4,P.dtype,!1,0,0),ee.type=P.dtype,ee.size=4,ee.buffer=P,ee.normalized=!1,ee.offset=0,ee.stride=0),re=D.location,(ne=Ue[re]).buffer||De.enableVertexAttribArray(re),ne.type===I.dtype&&4===ne.size&&ne.buffer===I&&!1===ne.normalized&&0===ne.offset&&0===ne.stride||(De.bindBuffer(34962,I.buffer),De.vertexAttribPointer(re,4,I.dtype,!1,0,0),ne.type=I.dtype,ne.size=4,ne.buffer=I,ne.normalized=!1,ne.offset=0,ne.stride=0),ie=F.location,(ae=Ue[ie]).buffer||De.enableVertexAttribArray(ie),ae.type===R.dtype&&4===ae.size&&ae.buffer===R&&!1===ae.normalized&&0===ae.offset&&0===ae.stride||(De.bindBuffer(34962,R.buffer),De.vertexAttribPointer(ie,4,R.dtype,!1,0,0),ae.type=R.dtype,ae.size=4,ae.buffer=R,ae.normalized=!1,ae.offset=0,ae.stride=0),oe=N.location,(se=Ue[oe]).buffer||De.enableVertexAttribArray(oe),se.type===B.dtype&&4===se.size&&se.buffer===B&&!1===se.normalized&&0===se.offset&&0===se.stride||(De.bindBuffer(34962,B.buffer),De.vertexAttribPointer(oe,4,B.dtype,!1,0,0),se.type=B.dtype,se.size=4,se.buffer=B,se.normalized=!1,se.offset=0,se.stride=0),le=V.location,(ce=Ue[le]).buffer||De.enableVertexAttribArray(le),ce.type===j.dtype&&4===ce.size&&ce.buffer===j&&!1===ce.normalized&&0===ce.offset&&0===ce.stride||(De.bindBuffer(34962,j.buffer),De.vertexAttribPointer(le,4,j.dtype,!1,0,0),ce.type=j.dtype,ce.size=4,ce.buffer=j,ce.normalized=!1,ce.offset=0,ce.stride=0),ue=H.location,(fe=Ue[ue]).buffer||De.enableVertexAttribArray(ue),fe.type===U.dtype&&4===fe.size&&fe.buffer===U&&!1===fe.normalized&&0===fe.offset&&0===fe.stride||(De.bindBuffer(34962,U.buffer),De.vertexAttribPointer(ue,4,U.dtype,!1,0,0),fe.type=U.dtype,fe.size=4,fe.buffer=U,fe.normalized=!1,fe.offset=0,fe.stride=0),he=(pe=t.contextColor)[0],de=pe[1],me=pe[2],ge=pe[3],De.uniform4f(q.location,he,de,me,ge),ye=t.dim0A,De.uniformMatrix4fv(G.location,!1,Array.isArray(ye)||ye instanceof Float32Array?ye:(vr[0]=ye[0],vr[1]=ye[1],vr[2]=ye[2],vr[3]=ye[3],vr[4]=ye[4],vr[5]=ye[5],vr[6]=ye[6],vr[7]=ye[7],vr[8]=ye[8],vr[9]=ye[9],vr[10]=ye[10],vr[11]=ye[11],vr[12]=ye[12],vr[13]=ye[13],vr[14]=ye[14],vr[15]=ye[15],vr)),ve=t.dim0B,De.uniformMatrix4fv(W.location,!1,Array.isArray(ve)||ve instanceof Float32Array?ve:(br[0]=ve[0],br[1]=ve[1],br[2]=ve[2],br[3]=ve[3],br[4]=ve[4],br[5]=ve[5],br[6]=ve[6],br[7]=ve[7],br[8]=ve[8],br[9]=ve[9],br[10]=ve[10],br[11]=ve[11],br[12]=ve[12],br[13]=ve[13],br[14]=ve[14],br[15]=ve[15],br)),be=t.dim0C,De.uniformMatrix4fv(Y.location,!1,Array.isArray(be)||be instanceof Float32Array?be:(xr[0]=be[0],xr[1]=be[1],xr[2]=be[2],xr[3]=be[3],xr[4]=be[4],xr[5]=be[5],xr[6]=be[6],xr[7]=be[7],xr[8]=be[8],xr[9]=be[9],xr[10]=be[10],xr[11]=be[11],xr[12]=be[12],xr[13]=be[13],xr[14]=be[14],xr[15]=be[15],xr)),xe=t.dim0D,De.uniformMatrix4fv(Z.location,!1,Array.isArray(xe)||xe instanceof Float32Array?xe:(_r[0]=xe[0],_r[1]=xe[1],_r[2]=xe[2],_r[3]=xe[3],_r[4]=xe[4],_r[5]=xe[5],_r[6]=xe[6],_r[7]=xe[7],_r[8]=xe[8],_r[9]=xe[9],_r[10]=xe[10],_r[11]=xe[11],_r[12]=xe[12],_r[13]=xe[13],_r[14]=xe[14],_r[15]=xe[15],_r)),_e=t.dim1A,De.uniformMatrix4fv(X.location,!1,Array.isArray(_e)||_e instanceof Float32Array?_e:(wr[0]=_e[0],wr[1]=_e[1],wr[2]=_e[2],wr[3]=_e[3],wr[4]=_e[4],wr[5]=_e[5],wr[6]=_e[6],wr[7]=_e[7],wr[8]=_e[8],wr[9]=_e[9],wr[10]=_e[10],wr[11]=_e[11],wr[12]=_e[12],wr[13]=_e[13],wr[14]=_e[14],wr[15]=_e[15],wr)),we=t.dim1B,De.uniformMatrix4fv(J.location,!1,Array.isArray(we)||we instanceof Float32Array?we:(Ar[0]=we[0],Ar[1]=we[1],Ar[2]=we[2],Ar[3]=we[3],Ar[4]=we[4],Ar[5]=we[5],Ar[6]=we[6],Ar[7]=we[7],Ar[8]=we[8],Ar[9]=we[9],Ar[10]=we[10],Ar[11]=we[11],Ar[12]=we[12],Ar[13]=we[13],Ar[14]=we[14],Ar[15]=we[15],Ar)),Ae=t.dim1C,De.uniformMatrix4fv(K.location,!1,Array.isArray(Ae)||Ae instanceof Float32Array?Ae:(kr[0]=Ae[0],kr[1]=Ae[1],kr[2]=Ae[2],kr[3]=Ae[3],kr[4]=Ae[4],kr[5]=Ae[5],kr[6]=Ae[6],kr[7]=Ae[7],kr[8]=Ae[8],kr[9]=Ae[9],kr[10]=Ae[10],kr[11]=Ae[11],kr[12]=Ae[12],kr[13]=Ae[13],kr[14]=Ae[14],kr[15]=Ae[15],kr)),ke=t.dim1D,De.uniformMatrix4fv(Q.location,!1,Array.isArray(ke)||ke instanceof Float32Array?ke:(Tr[0]=ke[0],Tr[1]=ke[1],Tr[2]=ke[2],Tr[3]=ke[3],Tr[4]=ke[4],Tr[5]=ke[5],Tr[6]=ke[6],Tr[7]=ke[7],Tr[8]=ke[8],Tr[9]=ke[9],Tr[10]=ke[10],Tr[11]=ke[11],Tr[12]=ke[12],Tr[13]=ke[13],Tr[14]=ke[14],Tr[15]=ke[15],Tr)),Te=t.drwLayer,De.uniform1f($.location,Te),Me=t.hiA,De.uniformMatrix4fv(tt.location,!1,Array.isArray(Me)||Me instanceof Float32Array?Me:(Mr[0]=Me[0],Mr[1]=Me[1],Mr[2]=Me[2],Mr[3]=Me[3],Mr[4]=Me[4],Mr[5]=Me[5],Mr[6]=Me[6],Mr[7]=Me[7],Mr[8]=Me[8],Mr[9]=Me[9],Mr[10]=Me[10],Mr[11]=Me[11],Mr[12]=Me[12],Mr[13]=Me[13],Mr[14]=Me[14],Mr[15]=Me[15],Mr)),Se=t.hiB,De.uniformMatrix4fv(et.location,!1,Array.isArray(Se)||Se instanceof Float32Array?Se:(Sr[0]=Se[0],Sr[1]=Se[1],Sr[2]=Se[2],Sr[3]=Se[3],Sr[4]=Se[4],Sr[5]=Se[5],Sr[6]=Se[6],Sr[7]=Se[7],Sr[8]=Se[8],Sr[9]=Se[9],Sr[10]=Se[10],Sr[11]=Se[11],Sr[12]=Se[12],Sr[13]=Se[13],Sr[14]=Se[14],Sr[15]=Se[15],Sr)),ze=t.hiC,De.uniformMatrix4fv(rt.location,!1,Array.isArray(ze)||ze instanceof Float32Array?ze:(zr[0]=ze[0],zr[1]=ze[1],zr[2]=ze[2],zr[3]=ze[3],zr[4]=ze[4],zr[5]=ze[5],zr[6]=ze[6],zr[7]=ze[7],zr[8]=ze[8],zr[9]=ze[9],zr[10]=ze[10],zr[11]=ze[11],zr[12]=ze[12],zr[13]=ze[13],zr[14]=ze[14],zr[15]=ze[15],zr)),Ee=t.hiD,De.uniformMatrix4fv(nt.location,!1,Array.isArray(Ee)||Ee instanceof Float32Array?Ee:(Er[0]=Ee[0],Er[1]=Ee[1],Er[2]=Ee[2],Er[3]=Ee[3],Er[4]=Ee[4],Er[5]=Ee[5],Er[6]=Ee[6],Er[7]=Ee[7],Er[8]=Ee[8],Er[9]=Ee[9],Er[10]=Ee[10],Er[11]=Ee[11],Er[12]=Ee[12],Er[13]=Ee[13],Er[14]=Ee[14],Er[15]=Ee[15],Er)),Le=t.loA,De.uniformMatrix4fv(it.location,!1,Array.isArray(Le)||Le instanceof Float32Array?Le:(Lr[0]=Le[0],Lr[1]=Le[1],Lr[2]=Le[2],Lr[3]=Le[3],Lr[4]=Le[4],Lr[5]=Le[5],Lr[6]=Le[6],Lr[7]=Le[7],Lr[8]=Le[8],Lr[9]=Le[9],Lr[10]=Le[10],Lr[11]=Le[11],Lr[12]=Le[12],Lr[13]=Le[13],Lr[14]=Le[14],Lr[15]=Le[15],Lr)),Ce=t.loB,De.uniformMatrix4fv(at.location,!1,Array.isArray(Ce)||Ce instanceof Float32Array?Ce:(Cr[0]=Ce[0],Cr[1]=Ce[1],Cr[2]=Ce[2],Cr[3]=Ce[3],Cr[4]=Ce[4],Cr[5]=Ce[5],Cr[6]=Ce[6],Cr[7]=Ce[7],Cr[8]=Ce[8],Cr[9]=Ce[9],Cr[10]=Ce[10],Cr[11]=Ce[11],Cr[12]=Ce[12],Cr[13]=Ce[13],Cr[14]=Ce[14],Cr[15]=Ce[15],Cr)),Pe=t.loC,De.uniformMatrix4fv(ot.location,!1,Array.isArray(Pe)||Pe instanceof Float32Array?Pe:(Pr[0]=Pe[0],Pr[1]=Pe[1],Pr[2]=Pe[2],Pr[3]=Pe[3],Pr[4]=Pe[4],Pr[5]=Pe[5],Pr[6]=Pe[6],Pr[7]=Pe[7],Pr[8]=Pe[8],Pr[9]=Pe[9],Pr[10]=Pe[10],Pr[11]=Pe[11],Pr[12]=Pe[12],Pr[13]=Pe[13],Pr[14]=Pe[14],Pr[15]=Pe[15],Pr)),Oe=t.loD,De.uniformMatrix4fv(st.location,!1,Array.isArray(Oe)||Oe instanceof Float32Array?Oe:(Or[0]=Oe[0],Or[1]=Oe[1],Or[2]=Oe[2],Or[3]=Oe[3],Or[4]=Oe[4],Or[5]=Oe[5],Or[6]=Oe[6],Or[7]=Oe[7],Or[8]=Oe[8],Or[9]=Oe[9],Or[10]=Oe[10],Or[11]=Oe[11],Or[12]=Oe[12],Or[13]=Oe[13],Or[14]=Oe[14],Or[15]=Oe[15],Or)),Ie=t.maskHeight,De.uniform1f(lt.location,Ie),(Ve=t.maskTexture)&&"framebuffer"===Ve._reglType&&(Ve=Ve.color[0]),qe=Ve._texture,De.uniform1i(ct.location,qe.bind()),De.uniform1i(ut.location,ft.bind()),Ze=(We=t.resolution)[0],Je=We[1],De.uniform2f(pt.location,Ze,Je),pr=(Qe=t.viewBoxPos)[0],dr=Qe[1],De.uniform2f(ht.location,pr,dr),Dr=(Ir=t.viewBoxSize)[0],Rr=Ir[1],De.uniform2f(dt.location,Dr,Rr),((Fr=Ne.elements)||He.currentVAO&&(Fr=je.getElements(He.currentVAO.elements)))&&De.bindBuffer(34963,Fr.buffer.buffer),Br=t.offset,(Nr=t.count)&&(Fr?De.drawElements(1,Nr,Fr.type,Br<<(Fr.type-5121>>1)):De.drawArrays(1,Br,Nr),Be.dirty=!0,He.setVAO(null),Re.viewportWidth=At,Re.viewportHeight=kt,Be.profile=Ot,qe.unbind(),ft.unbind())},scope:function(t,e,r){var n,i,a,o,s,l,c,u,f,h,m,y,b,_,A,T,S,E,C,O,D,F,N,V,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,je,Ue,He,Ge,Ye,Xe,Ke,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,hr,mr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi,Ei,Li,Ci,Pi,Oi,Ii,Di,Ri,Fi,Bi,Ni,ji,Vi,Ui,Hi,qi,Gi,Wi,Yi,Zi,Xi,Ji,Ki,Qi,$i,ta,ea,ra,na,ia,aa,oa,sa,la,ca,ua,fa,pa,ha,da,ma,ga,ya,va,ba,xa,_a,wa,Aa,ka,Ta,Ma,Sa,za,Ea,La,Ca,Pa,Oa,Ia,Da,Ra,Fa,Ba,Na,ja,Va,Ua,Ha,qa,Ga,Wa,Ya,Za,Xa,Ja,Ka,Qa,$a,to,eo,ro,no,io,ao,oo,so,lo,co,uo,fo,po,ho,mo;n=t.viewportX,gr.x=n,i=t.viewportY,gr.y=i,a=t.viewportWidth,gr.width=a,o=t.viewportHeight,gr.height=o,s=0|gr.x,l=0|gr.y,c="width"in gr?0|gr.width:Re.framebufferWidth-s,u="height"in gr?0|gr.height:Re.framebufferHeight-l,f=Re.viewportWidth,Re.viewportWidth=c,h=Re.viewportHeight,Re.viewportHeight=u,m=dr[0],dr[0]=s,y=dr[1],dr[1]=l,b=dr[2],dr[2]=c,_=dr[3],dr[3]=u,A=We[0],We[0]=mt,T=We[1],We[1]=gt,S=We[2],We[2]=yt,E=We[3],We[3]=vt,C=Fe.blend_enable,Fe.blend_enable=bt,O=Ze[0],Ze[0]=xt,D=Ze[1],Ze[1]=_t,F=Je[0],Je[0]=wt,N=Je[1],Je[1]=At,V=Je[2],Je[2]=kt,H=Je[3],Je[3]=Tt,q=Fe.cull_enable,Fe.cull_enable=Mt,G=Fe.cull_face,Fe.cull_face=St,W=Fe.depth_enable,Fe.depth_enable=zt,Y=Fe.depth_func,Fe.depth_func=Et,Z=Fe.depth_mask,Fe.depth_mask=Lt,X=Qe[0],Qe[0]=Ct,J=Qe[1],Qe[1]=Pt,K=Fe.dither,Fe.dither=Ot,Q=Fe.lineWidth,Fe.lineWidth=It,$=t.scissorX,yr.x=$,tt=t.scissorY,yr.y=tt,et=t.scissorWidth,yr.width=et,rt=t.scissorHeight,yr.height=rt,nt=0|yr.x,it=0|yr.y,at="width"in yr?0|yr.width:Re.framebufferWidth-nt,ot="height"in yr?0|yr.height:Re.framebufferHeight-it,st=pr[0],pr[0]=nt,lt=pr[1],pr[1]=it,ct=pr[2],pr[2]=at,ut=pr[3],pr[3]=ot,ft=Fe.scissor_enable,Fe.scissor_enable=Dt,pt=Be.profile,Be.profile=!1,ht=t.offset,dt=Ne.offset,Ne.offset=ht,Me=t.count,Se=Ne.count,Ne.count=Me,ze=Ne.primitive,Ne.primitive=Rt,Ee=qe[Bt],qe[Bt]=Ft,Le=t.resolution,Ce=qe[Nt],qe[Nt]=Le,Pe=t.viewBoxPos,Oe=qe[jt],qe[jt]=Pe,Ie=t.viewBoxSize,De=qe[Vt],qe[Vt]=Ie,je=t.dim0A,Ue=qe[Ut],qe[Ut]=je,He=t.dim1A,Ge=qe[Ht],qe[Ht]=He,Ye=t.dim0B,Xe=qe[qt],qe[qt]=Ye,Ke=t.dim1B,$e=qe[Gt],qe[Gt]=Ke,tr=t.dim0C,er=qe[Wt],qe[Wt]=tr,rr=t.dim1C,nr=qe[Yt],qe[Yt]=rr,ir=t.dim0D,ar=qe[Zt],qe[Zt]=ir,or=t.dim1D,sr=qe[Xt],qe[Xt]=or,lr=t.loA,cr=qe[Jt],qe[Jt]=lr,ur=t.hiA,fr=qe[Kt],qe[Kt]=ur,hr=t.loB,mr=qe[Qt],qe[Qt]=hr,vr=t.hiB,br=qe[$t],qe[$t]=vr,xr=t.loC,_r=qe[te],qe[te]=xr,wr=t.hiC,Ar=qe[ee],qe[ee]=wr,kr=t.loD,Tr=qe[re],qe[re]=kr,Mr=t.hiD,Sr=qe[ne],qe[ne]=Mr,zr=t.contextColor,Er=qe[ie],qe[ie]=zr,Lr=t.maskTexture,Cr=qe[ae],qe[ae]=Lr,Pr=t.drwLayer,Or=qe[oe],qe[oe]=Pr,Ir=t.maskHeight,Dr=qe[se],qe[se]=Ir,Rr=le.state,le.state=1,Fr=le.x,le.x=0,Br=le.y,le.y=0,Nr=le.z,le.z=0,jr=le.w,le.w=0,Vr=le.buffer,le.buffer=d,Ur=le.size,le.size=0,Hr=le.normalized,le.normalized=!1,qr=le.type,le.type=d.dtype,Gr=le.offset,le.offset=0,Wr=le.stride,le.stride=0,Yr=le.divisor,le.divisor=0,Zr=ce.state,ce.state=1,Xr=ce.x,ce.x=0,Jr=ce.y,ce.y=0,Kr=ce.z,ce.z=0,Qr=ce.w,ce.w=0,$r=ce.buffer,ce.buffer=g,tn=ce.size,ce.size=0,en=ce.normalized,ce.normalized=!1,rn=ce.type,ce.type=g.dtype,nn=ce.offset,ce.offset=0,an=ce.stride,ce.stride=0,on=ce.divisor,ce.divisor=0,sn=ue.state,ue.state=1,ln=ue.x,ue.x=0,cn=ue.y,ue.y=0,un=ue.z,ue.z=0,fn=ue.w,ue.w=0,pn=ue.buffer,ue.buffer=v,hn=ue.size,ue.size=0,dn=ue.normalized,ue.normalized=!1,mn=ue.type,ue.type=v.dtype,gn=ue.offset,ue.offset=0,yn=ue.stride,ue.stride=0,vn=ue.divisor,ue.divisor=0,bn=fe.state,fe.state=1,xn=fe.x,fe.x=0,_n=fe.y,fe.y=0,wn=fe.z,fe.z=0,An=fe.w,fe.w=0,kn=fe.buffer,fe.buffer=x,Tn=fe.size,fe.size=0,Mn=fe.normalized,fe.normalized=!1,Sn=fe.type,fe.type=x.dtype,zn=fe.offset,fe.offset=0,En=fe.stride,fe.stride=0,Ln=fe.divisor,fe.divisor=0,Cn=pe.state,pe.state=1,Pn=pe.x,pe.x=0,On=pe.y,pe.y=0,In=pe.z,pe.z=0,Dn=pe.w,pe.w=0,Rn=pe.buffer,pe.buffer=w,Fn=pe.size,pe.size=0,Bn=pe.normalized,pe.normalized=!1,Nn=pe.type,pe.type=w.dtype,jn=pe.offset,pe.offset=0,Vn=pe.stride,pe.stride=0,Un=pe.divisor,pe.divisor=0,Hn=he.state,he.state=1,qn=he.x,he.x=0,Gn=he.y,he.y=0,Wn=he.z,he.z=0,Yn=he.w,he.w=0,Zn=he.buffer,he.buffer=k,Xn=he.size,he.size=0,Jn=he.normalized,he.normalized=!1,Kn=he.type,he.type=k.dtype,Qn=he.offset,he.offset=0,$n=he.stride,he.stride=0,ti=he.divisor,he.divisor=0,ei=de.state,de.state=1,ri=de.x,de.x=0,ni=de.y,de.y=0,ii=de.z,de.z=0,ai=de.w,de.w=0,oi=de.buffer,de.buffer=M,si=de.size,de.size=0,li=de.normalized,de.normalized=!1,ci=de.type,de.type=M.dtype,ui=de.offset,de.offset=0,fi=de.stride,de.stride=0,pi=de.divisor,de.divisor=0,hi=me.state,me.state=1,di=me.x,me.x=0,mi=me.y,me.y=0,gi=me.z,me.z=0,yi=me.w,me.w=0,vi=me.buffer,me.buffer=z,bi=me.size,me.size=0,xi=me.normalized,me.normalized=!1,_i=me.type,me.type=z.dtype,wi=me.offset,me.offset=0,Ai=me.stride,me.stride=0,ki=me.divisor,me.divisor=0,Ti=ge.state,ge.state=1,Mi=ge.x,ge.x=0,Si=ge.y,ge.y=0,zi=ge.z,ge.z=0,Ei=ge.w,ge.w=0,Li=ge.buffer,ge.buffer=L,Ci=ge.size,ge.size=0,Pi=ge.normalized,ge.normalized=!1,Oi=ge.type,ge.type=L.dtype,Ii=ge.offset,ge.offset=0,Di=ge.stride,ge.stride=0,Ri=ge.divisor,ge.divisor=0,Fi=ye.state,ye.state=1,Bi=ye.x,ye.x=0,Ni=ye.y,ye.y=0,ji=ye.z,ye.z=0,Vi=ye.w,ye.w=0,Ui=ye.buffer,ye.buffer=P,Hi=ye.size,ye.size=0,qi=ye.normalized,ye.normalized=!1,Gi=ye.type,ye.type=P.dtype,Wi=ye.offset,ye.offset=0,Yi=ye.stride,ye.stride=0,Zi=ye.divisor,ye.divisor=0,Xi=ve.state,ve.state=1,Ji=ve.x,ve.x=0,Ki=ve.y,ve.y=0,Qi=ve.z,ve.z=0,$i=ve.w,ve.w=0,ta=ve.buffer,ve.buffer=I,ea=ve.size,ve.size=0,ra=ve.normalized,ve.normalized=!1,na=ve.type,ve.type=I.dtype,ia=ve.offset,ve.offset=0,aa=ve.stride,ve.stride=0,oa=ve.divisor,ve.divisor=0,sa=be.state,be.state=1,la=be.x,be.x=0,ca=be.y,be.y=0,ua=be.z,be.z=0,fa=be.w,be.w=0,pa=be.buffer,be.buffer=R,ha=be.size,be.size=0,da=be.normalized,be.normalized=!1,ma=be.type,be.type=R.dtype,ga=be.offset,be.offset=0,ya=be.stride,be.stride=0,va=be.divisor,be.divisor=0,ba=xe.state,xe.state=1,xa=xe.x,xe.x=0,_a=xe.y,xe.y=0,wa=xe.z,xe.z=0,Aa=xe.w,xe.w=0,ka=xe.buffer,xe.buffer=B,Ta=xe.size,xe.size=0,Ma=xe.normalized,xe.normalized=!1,Sa=xe.type,xe.type=B.dtype,za=xe.offset,xe.offset=0,Ea=xe.stride,xe.stride=0,La=xe.divisor,xe.divisor=0,Ca=_e.state,_e.state=1,Pa=_e.x,_e.x=0,Oa=_e.y,_e.y=0,Ia=_e.z,_e.z=0,Da=_e.w,_e.w=0,Ra=_e.buffer,_e.buffer=j,Fa=_e.size,_e.size=0,Ba=_e.normalized,_e.normalized=!1,Na=_e.type,_e.type=j.dtype,ja=_e.offset,_e.offset=0,Va=_e.stride,_e.stride=0,Ua=_e.divisor,_e.divisor=0,Ha=we.state,we.state=1,qa=we.x,we.x=0,Ga=we.y,we.y=0,Wa=we.z,we.z=0,Ya=we.w,we.w=0,Za=we.buffer,we.buffer=U,Xa=we.size,we.size=0,Ja=we.normalized,we.normalized=!1,Ka=we.type,we.type=U.dtype,Qa=we.offset,we.offset=0,$a=we.stride,we.stride=0,to=we.divisor,we.divisor=0,eo=Ae.state,Ae.state=1,ro=Ae.x,Ae.x=0,no=Ae.y,Ae.y=0,io=Ae.z,Ae.z=0,ao=Ae.w,Ae.w=0,oo=Ae.buffer,Ae.buffer=p,so=Ae.size,Ae.size=0,lo=Ae.normalized,Ae.normalized=!1,co=Ae.type,Ae.type=p.dtype,uo=Ae.offset,Ae.offset=0,fo=Ae.stride,Ae.stride=0,po=Ae.divisor,Ae.divisor=0,ho=Ve.vert,Ve.vert=ke,mo=Ve.frag,Ve.frag=Te,Be.dirty=!0,e(Re,t,r),Re.viewportWidth=f,Re.viewportHeight=h,dr[0]=m,dr[1]=y,dr[2]=b,dr[3]=_,We[0]=A,We[1]=T,We[2]=S,We[3]=E,Fe.blend_enable=C,Ze[0]=O,Ze[1]=D,Je[0]=F,Je[1]=N,Je[2]=V,Je[3]=H,Fe.cull_enable=q,Fe.cull_face=G,Fe.depth_enable=W,Fe.depth_func=Y,Fe.depth_mask=Z,Qe[0]=X,Qe[1]=J,Fe.dither=K,Fe.lineWidth=Q,pr[0]=st,pr[1]=lt,pr[2]=ct,pr[3]=ut,Fe.scissor_enable=ft,Be.profile=pt,Ne.offset=dt,Ne.count=Se,Ne.primitive=ze,qe[Bt]=Ee,qe[Nt]=Ce,qe[jt]=Oe,qe[Vt]=De,qe[Ut]=Ue,qe[Ht]=Ge,qe[qt]=Xe,qe[Gt]=$e,qe[Wt]=er,qe[Yt]=nr,qe[Zt]=ar,qe[Xt]=sr,qe[Jt]=cr,qe[Kt]=fr,qe[Qt]=mr,qe[$t]=br,qe[te]=_r,qe[ee]=Ar,qe[re]=Tr,qe[ne]=Sr,qe[ie]=Er,qe[ae]=Cr,qe[oe]=Or,qe[se]=Dr,le.state=Rr,le.x=Fr,le.y=Br,le.z=Nr,le.w=jr,le.buffer=Vr,le.size=Ur,le.normalized=Hr,le.type=qr,le.offset=Gr,le.stride=Wr,le.divisor=Yr,ce.state=Zr,ce.x=Xr,ce.y=Jr,ce.z=Kr,ce.w=Qr,ce.buffer=$r,ce.size=tn,ce.normalized=en,ce.type=rn,ce.offset=nn,ce.stride=an,ce.divisor=on,ue.state=sn,ue.x=ln,ue.y=cn,ue.z=un,ue.w=fn,ue.buffer=pn,ue.size=hn,ue.normalized=dn,ue.type=mn,ue.offset=gn,ue.stride=yn,ue.divisor=vn,fe.state=bn,fe.x=xn,fe.y=_n,fe.z=wn,fe.w=An,fe.buffer=kn,fe.size=Tn,fe.normalized=Mn,fe.type=Sn,fe.offset=zn,fe.stride=En,fe.divisor=Ln,pe.state=Cn,pe.x=Pn,pe.y=On,pe.z=In,pe.w=Dn,pe.buffer=Rn,pe.size=Fn,pe.normalized=Bn,pe.type=Nn,pe.offset=jn,pe.stride=Vn,pe.divisor=Un,he.state=Hn,he.x=qn,he.y=Gn,he.z=Wn,he.w=Yn,he.buffer=Zn,he.size=Xn,he.normalized=Jn,he.type=Kn,he.offset=Qn,he.stride=$n,he.divisor=ti,de.state=ei,de.x=ri,de.y=ni,de.z=ii,de.w=ai,de.buffer=oi,de.size=si,de.normalized=li,de.type=ci,de.offset=ui,de.stride=fi,de.divisor=pi,me.state=hi,me.x=di,me.y=mi,me.z=gi,me.w=yi,me.buffer=vi,me.size=bi,me.normalized=xi,me.type=_i,me.offset=wi,me.stride=Ai,me.divisor=ki,ge.state=Ti,ge.x=Mi,ge.y=Si,ge.z=zi,ge.w=Ei,ge.buffer=Li,ge.size=Ci,ge.normalized=Pi,ge.type=Oi,ge.offset=Ii,ge.stride=Di,ge.divisor=Ri,ye.state=Fi,ye.x=Bi,ye.y=Ni,ye.z=ji,ye.w=Vi,ye.buffer=Ui,ye.size=Hi,ye.normalized=qi,ye.type=Gi,ye.offset=Wi,ye.stride=Yi,ye.divisor=Zi,ve.state=Xi,ve.x=Ji,ve.y=Ki,ve.z=Qi,ve.w=$i,ve.buffer=ta,ve.size=ea,ve.normalized=ra,ve.type=na,ve.offset=ia,ve.stride=aa,ve.divisor=oa,be.state=sa,be.x=la,be.y=ca,be.z=ua,be.w=fa,be.buffer=pa,be.size=ha,be.normalized=da,be.type=ma,be.offset=ga,be.stride=ya,be.divisor=va,xe.state=ba,xe.x=xa,xe.y=_a,xe.z=wa,xe.w=Aa,xe.buffer=ka,xe.size=Ta,xe.normalized=Ma,xe.type=Sa,xe.offset=za,xe.stride=Ea,xe.divisor=La,_e.state=Ca,_e.x=Pa,_e.y=Oa,_e.z=Ia,_e.w=Da,_e.buffer=Ra,_e.size=Fa,_e.normalized=Ba,_e.type=Na,_e.offset=ja,_e.stride=Va,_e.divisor=Ua,we.state=Ha,we.x=qa,we.y=Ga,we.z=Wa,we.w=Ya,we.buffer=Za,we.size=Xa,we.normalized=Ja,we.type=Ka,we.offset=Qa,we.stride=$a,we.divisor=to,Ae.state=eo,Ae.x=ro,Ae.y=no,Ae.z=io;Ae.w=ao,Ae.buffer=oo,Ae.size=so,Ae.normalized=lo,Ae.type=co,Ae.offset=uo,Ae.stride=fo,Ae.divisor=po,Ve.vert=ho,Ve.frag=mo,Be.dirty=!0},batch:function(t,e){var r,n,i,a,o,s,l,c,u,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he;((r=Ge.next)!==Ge.cur&&(r?De.bindFramebuffer(36160,r.framebuffer):De.bindFramebuffer(36160,null),Ge.cur=r),Be.dirty)&&(o=tr[0],s=tr[1],l=tr[2],c=tr[3],o===er[0]&&s===er[1]&&l===er[2]&&c===er[3]||(De.colorMask(o,s,l,c),er[0]=o,er[1]=s,er[2]=l,er[3]=c),(u=Fe.frontFace)!==Be.frontFace&&(De.frontFace(u),Be.frontFace=u),(mt=Fe.polygonOffset_enable)!==Be.polygonOffset_enable&&(mt?De.enable(32823):De.disable(32823),Be.polygonOffset_enable=mt),gt=rr[0],yt=rr[1],gt===nr[0]&&yt===nr[1]||(De.polygonOffset(gt,yt),nr[0]=gt,nr[1]=yt),(vt=Fe.sample_alpha)!==Be.sample_alpha&&(vt?De.enable(32926):De.disable(32926),Be.sample_alpha=vt),(bt=Fe.sample_enable)!==Be.sample_enable&&(bt?De.enable(32928):De.disable(32928),Be.sample_enable=bt),xt=ir[0],_t=ir[1],xt===ar[0]&&_t===ar[1]||(De.sampleCoverage(xt,_t),ar[0]=xt,ar[1]=_t),(wt=Fe.stencil_enable)!==Be.stencil_enable&&(wt?De.enable(2960):De.disable(2960),Be.stencil_enable=wt),(At=Fe.stencil_mask)!==Be.stencil_mask&&(De.stencilMask(At),Be.stencil_mask=At),kt=or[0],Tt=or[1],Mt=or[2],kt===sr[0]&&Tt===sr[1]&&Mt===sr[2]||(De.stencilFunc(kt,Tt,Mt),sr[0]=kt,sr[1]=Tt,sr[2]=Mt),St=lr[0],zt=lr[1],Et=lr[2],Lt=lr[3],St===cr[0]&&zt===cr[1]&&Et===cr[2]&&Lt===cr[3]||(De.stencilOpSeparate(St,zt,Et,Lt),cr[0]=St,cr[1]=zt,cr[2]=Et,cr[3]=Lt),Ct=ur[0],Pt=ur[1],Ot=ur[2],It=ur[3],Ct===fr[0]&&Pt===fr[1]&&Ot===fr[2]&&It===fr[3]||(De.stencilOpSeparate(Ct,Pt,Ot,It),fr[0]=Ct,fr[1]=Pt,fr[2]=Ot,fr[3]=It));for(De.blendColor(0,0,0,0),Ye[0]=0,Ye[1]=0,Ye[2]=0,Ye[3]=0,Me?De.enable(3042):De.disable(3042),Be.blend_enable=Me,De.blendEquationSeparate(32774,32774),Xe[0]=32774,Xe[1]=32774,De.blendFuncSeparate(770,771,1,1),Ke[0]=770,Ke[1]=771,Ke[2]=1,Ke[3]=1,Se?De.enable(2884):De.disable(2884),Be.cull_enable=Se,De.cullFace(ze),Be.cull_face=ze,Ee?De.enable(2929):De.disable(2929),Be.depth_enable=Ee,De.depthFunc(Le),Be.depth_func=Le,De.depthMask(Ce),Be.depth_mask=Ce,De.depthRange(0,1),$e[0]=0,$e[1]=1,Pe?De.enable(3024):De.disable(3024),Be.dither=Pe,De.lineWidth(Oe),Be.lineWidth=Oe,Ie?De.enable(3089):De.disable(3089),Be.scissor_enable=Ie,n=Be.profile,Be.profile=!1,De.useProgram(f.program),He.setVAO(null),Dt=h.location,(Rt=Ue[Dt]).buffer||De.enableVertexAttribArray(Dt),Rt.type===p.dtype&&4===Rt.size&&Rt.buffer===p&&!1===Rt.normalized&&0===Rt.offset&&0===Rt.stride||(De.bindBuffer(34962,p.buffer),De.vertexAttribPointer(Dt,4,p.dtype,!1,0,0),Rt.type=p.dtype,Rt.size=4,Rt.buffer=p,Rt.normalized=!1,Rt.offset=0,Rt.stride=0),Ft=m.location,(Bt=Ue[Ft]).buffer||De.enableVertexAttribArray(Ft),Bt.type===d.dtype&&4===Bt.size&&Bt.buffer===d&&!1===Bt.normalized&&0===Bt.offset&&0===Bt.stride||(De.bindBuffer(34962,d.buffer),De.vertexAttribPointer(Ft,4,d.dtype,!1,0,0),Bt.type=d.dtype,Bt.size=4,Bt.buffer=d,Bt.normalized=!1,Bt.offset=0,Bt.stride=0),Nt=y.location,(jt=Ue[Nt]).buffer||De.enableVertexAttribArray(Nt),jt.type===g.dtype&&4===jt.size&&jt.buffer===g&&!1===jt.normalized&&0===jt.offset&&0===jt.stride||(De.bindBuffer(34962,g.buffer),De.vertexAttribPointer(Nt,4,g.dtype,!1,0,0),jt.type=g.dtype,jt.size=4,jt.buffer=g,jt.normalized=!1,jt.offset=0,jt.stride=0),Vt=b.location,(Ut=Ue[Vt]).buffer||De.enableVertexAttribArray(Vt),Ut.type===v.dtype&&4===Ut.size&&Ut.buffer===v&&!1===Ut.normalized&&0===Ut.offset&&0===Ut.stride||(De.bindBuffer(34962,v.buffer),De.vertexAttribPointer(Vt,4,v.dtype,!1,0,0),Ut.type=v.dtype,Ut.size=4,Ut.buffer=v,Ut.normalized=!1,Ut.offset=0,Ut.stride=0),Ht=_.location,(qt=Ue[Ht]).buffer||De.enableVertexAttribArray(Ht),qt.type===x.dtype&&4===qt.size&&qt.buffer===x&&!1===qt.normalized&&0===qt.offset&&0===qt.stride||(De.bindBuffer(34962,x.buffer),De.vertexAttribPointer(Ht,4,x.dtype,!1,0,0),qt.type=x.dtype,qt.size=4,qt.buffer=x,qt.normalized=!1,qt.offset=0,qt.stride=0),Gt=A.location,(Wt=Ue[Gt]).buffer||De.enableVertexAttribArray(Gt),Wt.type===w.dtype&&4===Wt.size&&Wt.buffer===w&&!1===Wt.normalized&&0===Wt.offset&&0===Wt.stride||(De.bindBuffer(34962,w.buffer),De.vertexAttribPointer(Gt,4,w.dtype,!1,0,0),Wt.type=w.dtype,Wt.size=4,Wt.buffer=w,Wt.normalized=!1,Wt.offset=0,Wt.stride=0),Yt=T.location,(Zt=Ue[Yt]).buffer||De.enableVertexAttribArray(Yt),Zt.type===k.dtype&&4===Zt.size&&Zt.buffer===k&&!1===Zt.normalized&&0===Zt.offset&&0===Zt.stride||(De.bindBuffer(34962,k.buffer),De.vertexAttribPointer(Yt,4,k.dtype,!1,0,0),Zt.type=k.dtype,Zt.size=4,Zt.buffer=k,Zt.normalized=!1,Zt.offset=0,Zt.stride=0),Xt=S.location,(Jt=Ue[Xt]).buffer||De.enableVertexAttribArray(Xt),Jt.type===M.dtype&&4===Jt.size&&Jt.buffer===M&&!1===Jt.normalized&&0===Jt.offset&&0===Jt.stride||(De.bindBuffer(34962,M.buffer),De.vertexAttribPointer(Xt,4,M.dtype,!1,0,0),Jt.type=M.dtype,Jt.size=4,Jt.buffer=M,Jt.normalized=!1,Jt.offset=0,Jt.stride=0),Kt=E.location,(Qt=Ue[Kt]).buffer||De.enableVertexAttribArray(Kt),Qt.type===z.dtype&&4===Qt.size&&Qt.buffer===z&&!1===Qt.normalized&&0===Qt.offset&&0===Qt.stride||(De.bindBuffer(34962,z.buffer),De.vertexAttribPointer(Kt,4,z.dtype,!1,0,0),Qt.type=z.dtype,Qt.size=4,Qt.buffer=z,Qt.normalized=!1,Qt.offset=0,Qt.stride=0),$t=C.location,(te=Ue[$t]).buffer||De.enableVertexAttribArray($t),te.type===L.dtype&&4===te.size&&te.buffer===L&&!1===te.normalized&&0===te.offset&&0===te.stride||(De.bindBuffer(34962,L.buffer),De.vertexAttribPointer($t,4,L.dtype,!1,0,0),te.type=L.dtype,te.size=4,te.buffer=L,te.normalized=!1,te.offset=0,te.stride=0),ee=O.location,(re=Ue[ee]).buffer||De.enableVertexAttribArray(ee),re.type===P.dtype&&4===re.size&&re.buffer===P&&!1===re.normalized&&0===re.offset&&0===re.stride||(De.bindBuffer(34962,P.buffer),De.vertexAttribPointer(ee,4,P.dtype,!1,0,0),re.type=P.dtype,re.size=4,re.buffer=P,re.normalized=!1,re.offset=0,re.stride=0),ne=D.location,(ie=Ue[ne]).buffer||De.enableVertexAttribArray(ne),ie.type===I.dtype&&4===ie.size&&ie.buffer===I&&!1===ie.normalized&&0===ie.offset&&0===ie.stride||(De.bindBuffer(34962,I.buffer),De.vertexAttribPointer(ne,4,I.dtype,!1,0,0),ie.type=I.dtype,ie.size=4,ie.buffer=I,ie.normalized=!1,ie.offset=0,ie.stride=0),ae=F.location,(oe=Ue[ae]).buffer||De.enableVertexAttribArray(ae),oe.type===R.dtype&&4===oe.size&&oe.buffer===R&&!1===oe.normalized&&0===oe.offset&&0===oe.stride||(De.bindBuffer(34962,R.buffer),De.vertexAttribPointer(ae,4,R.dtype,!1,0,0),oe.type=R.dtype,oe.size=4,oe.buffer=R,oe.normalized=!1,oe.offset=0,oe.stride=0),se=N.location,(le=Ue[se]).buffer||De.enableVertexAttribArray(se),le.type===B.dtype&&4===le.size&&le.buffer===B&&!1===le.normalized&&0===le.offset&&0===le.stride||(De.bindBuffer(34962,B.buffer),De.vertexAttribPointer(se,4,B.dtype,!1,0,0),le.type=B.dtype,le.size=4,le.buffer=B,le.normalized=!1,le.offset=0,le.stride=0),ce=V.location,(ue=Ue[ce]).buffer||De.enableVertexAttribArray(ce),ue.type===j.dtype&&4===ue.size&&ue.buffer===j&&!1===ue.normalized&&0===ue.offset&&0===ue.stride||(De.bindBuffer(34962,j.buffer),De.vertexAttribPointer(ce,4,j.dtype,!1,0,0),ue.type=j.dtype,ue.size=4,ue.buffer=j,ue.normalized=!1,ue.offset=0,ue.stride=0),fe=H.location,(pe=Ue[fe]).buffer||De.enableVertexAttribArray(fe),pe.type===U.dtype&&4===pe.size&&pe.buffer===U&&!1===pe.normalized&&0===pe.offset&&0===pe.stride||(De.bindBuffer(34962,U.buffer),De.vertexAttribPointer(fe,4,U.dtype,!1,0,0),pe.type=U.dtype,pe.size=4,pe.buffer=U,pe.normalized=!1,pe.offset=0,pe.stride=0),De.uniform1i(ut.location,ft.bind()),((he=Ne.elements)||He.currentVAO&&(he=je.getElements(He.currentVAO.elements)))&&De.bindBuffer(34963,he.buffer.buffer),i=0;i>1)):De.drawArrays(1,Tn,Mn),Re.viewportWidth=we,Re.viewportHeight=Ae,cn.unbind())}ft.unbind(),Be.dirty=!0,He.setVAO(null),Be.profile=n}}}},{}],494:[function(t,e,r){e.exports=function(t,e){"use strict";var r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C;return r=t.gl,t.context,t.strings,n=t.next,i=t.current,t.draw,t.elements,t.buffer,t.shader,a=t.attributes,o=t.vao,t.uniforms,s=t.framebuffer,t.extensions,t.timer,t.isBufferArgs,n.blend_color,i.blend_color,n.blend_equation,i.blend_equation,n.blend_func,i.blend_func,n.depth_range,i.depth_range,n.colorMask,i.colorMask,n.polygonOffset_offset,i.polygonOffset_offset,n.sample_coverage,i.sample_coverage,n.stencil_func,i.stencil_func,n.stencil_opFront,i.stencil_opFront,n.stencil_opBack,i.stencil_opBack,n.scissor_box,i.scissor_box,n.viewport,i.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},l=n.blend_color,c=i.blend_color,u=n.blend_equation,f=i.blend_equation,p=n.blend_func,h=i.blend_func,d=n.depth_range,m=i.depth_range,g=n.colorMask,y=i.colorMask,v=n.polygonOffset_offset,b=i.polygonOffset_offset,x=n.sample_coverage,_=i.sample_coverage,w=n.stencil_func,A=i.stencil_func,k=n.stencil_opFront,T=i.stencil_opFront,M=n.stencil_opBack,S=i.stencil_opBack,z=n.scissor_box,E=i.scissor_box,L=n.viewport,C=i.viewport,{poll:function(){var t,e,a,o,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X;i.dirty=!1,e=n.dither,a=n.blend_enable,o=n.depth_enable,P=n.cull_enable,O=n.polygonOffset_enable,I=n.sample_alpha,D=n.sample_enable,R=n.stencil_enable,F=n.scissor_enable,B=n.depth_func,N=i.depth_func,j=n.depth_mask,V=i.depth_mask,U=n.cull_face,H=i.cull_face,q=n.frontFace,G=i.frontFace,W=n.lineWidth,Y=i.lineWidth,Z=n.stencil_mask,X=i.stencil_mask,(t=s.next)!==s.cur&&(t?r.bindFramebuffer(36160,t.framebuffer):r.bindFramebuffer(36160,null),s.cur=t),e!==i.dither&&(e?r.enable(3024):r.disable(3024),i.dither=e),a!==i.blend_enable&&(a?r.enable(3042):r.disable(3042),i.blend_enable=a),o!==i.depth_enable&&(o?r.enable(2929):r.disable(2929),i.depth_enable=o),P!==i.cull_enable&&(P?r.enable(2884):r.disable(2884),i.cull_enable=P),O!==i.polygonOffset_enable&&(O?r.enable(32823):r.disable(32823),i.polygonOffset_enable=O),I!==i.sample_alpha&&(I?r.enable(32926):r.disable(32926),i.sample_alpha=I),D!==i.sample_enable&&(D?r.enable(32928):r.disable(32928),i.sample_enable=D),R!==i.stencil_enable&&(R?r.enable(2960):r.disable(2960),i.stencil_enable=R),F!==i.scissor_enable&&(F?r.enable(3089):r.disable(3089),i.scissor_enable=F),l[0]===c[0]&&l[1]===c[1]&&l[2]===c[2]&&l[3]===c[3]||(r.blendColor(l[0],l[1],l[2],l[3]),c[0]=l[0],c[1]=l[1],c[2]=l[2],c[3]=l[3]),u[0]===f[0]&&u[1]===f[1]||(r.blendEquationSeparate(u[0],u[1]),f[0]=u[0],f[1]=u[1]),p[0]===h[0]&&p[1]===h[1]&&p[2]===h[2]&&p[3]===h[3]||(r.blendFuncSeparate(p[0],p[1],p[2],p[3]),h[0]=p[0],h[1]=p[1],h[2]=p[2],h[3]=p[3]),B!==N&&(r.depthFunc(B),i.depth_func=B),d[0]===m[0]&&d[1]===m[1]||(r.depthRange(d[0],d[1]),m[0]=d[0],m[1]=d[1]),j!==V&&(r.depthMask(j),i.depth_mask=j),g[0]===y[0]&&g[1]===y[1]&&g[2]===y[2]&&g[3]===y[3]||(r.colorMask(g[0],g[1],g[2],g[3]),y[0]=g[0],y[1]=g[1],y[2]=g[2],y[3]=g[3]),U!==H&&(r.cullFace(U),i.cull_face=U),q!==G&&(r.frontFace(q),i.frontFace=q),W!==Y&&(r.lineWidth(W),i.lineWidth=W),v[0]===b[0]&&v[1]===b[1]||(r.polygonOffset(v[0],v[1]),b[0]=v[0],b[1]=v[1]),x[0]===_[0]&&x[1]===_[1]||(r.sampleCoverage(x[0],x[1]),_[0]=x[0],_[1]=x[1]),Z!==X&&(r.stencilMask(Z),i.stencil_mask=Z),w[0]===A[0]&&w[1]===A[1]&&w[2]===A[2]||(r.stencilFunc(w[0],w[1],w[2]),A[0]=w[0],A[1]=w[1],A[2]=w[2]),k[0]===T[0]&&k[1]===T[1]&&k[2]===T[2]&&k[3]===T[3]||(r.stencilOpSeparate(k[0],k[1],k[2],k[3]),T[0]=k[0],T[1]=k[1],T[2]=k[2],T[3]=k[3]),M[0]===S[0]&&M[1]===S[1]&&M[2]===S[2]&&M[3]===S[3]||(r.stencilOpSeparate(M[0],M[1],M[2],M[3]),S[0]=M[0],S[1]=M[1],S[2]=M[2],S[3]=M[3]),z[0]===E[0]&&z[1]===E[1]&&z[2]===E[2]&&z[3]===E[3]||(r.scissor(z[0],z[1],z[2],z[3]),E[0]=z[0],E[1]=z[1],E[2]=z[2],E[3]=z[3]),L[0]===C[0]&&L[1]===C[1]&&L[2]===C[2]&&L[3]===C[3]||(r.viewport(L[0],L[1],L[2],L[3]),C[0]=L[0],C[1]=L[1],C[2]=L[2],C[3]=L[3])},refresh:function(){var t,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z;i.dirty=!1,I=n.dither,D=n.blend_enable,R=n.depth_enable,F=n.cull_enable,B=n.polygonOffset_enable,N=n.sample_alpha,j=n.sample_enable,V=n.stencil_enable,U=n.scissor_enable,H=n.depth_func,i.depth_func,q=n.depth_mask,i.depth_mask,G=n.cull_face,i.cull_face,W=n.frontFace,i.frontFace,Y=n.lineWidth,i.lineWidth,Z=n.stencil_mask,i.stencil_mask,(t=s.next)?r.bindFramebuffer(36160,t.framebuffer):r.bindFramebuffer(36160,null),s.cur=t,P=a,O=0;for(var X=0;X":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Dt={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(Rt={}).stride=8,Rt.offset=8,(Ft={}).stride=8,Ft.offset=8,{draw:function(t){var y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,it,st,ft,ht,mt,Ct,Ot,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze;(ct.angle_instanced_arrays,(y=lt.next)!==lt.cur&&(y?K.bindFramebuffer(36160,y.framebuffer):K.bindFramebuffer(36160,null),lt.cur=y),tt.dirty)&&((ye=$.dither)!==tt.dither&&(ye?K.enable(3024):K.disable(3024),tt.dither=ye),(ve=$.depth_func)!==tt.depth_func&&(K.depthFunc(ve),tt.depth_func=ve),be=yt[0],xe=yt[1],be===vt[0]&&xe===vt[1]||(K.depthRange(be,xe),vt[0]=be,vt[1]=xe),(_e=$.depth_mask)!==tt.depth_mask&&(K.depthMask(_e),tt.depth_mask=_e),we=bt[0],Ae=bt[1],ke=bt[2],Te=bt[3],we===xt[0]&&Ae===xt[1]&&ke===xt[2]&&Te===xt[3]||(K.colorMask(we,Ae,ke,Te),xt[0]=we,xt[1]=Ae,xt[2]=ke,xt[3]=Te),(Me=$.cull_enable)!==tt.cull_enable&&(Me?K.enable(2884):K.disable(2884),tt.cull_enable=Me),(Se=$.cull_face)!==tt.cull_face&&(K.cullFace(Se),tt.cull_face=Se),(ze=$.frontFace)!==tt.frontFace&&(K.frontFace(ze),tt.frontFace=ze),(Ee=$.lineWidth)!==tt.lineWidth&&(K.lineWidth(Ee),tt.lineWidth=Ee),(Le=$.polygonOffset_enable)!==tt.polygonOffset_enable&&(Le?K.enable(32823):K.disable(32823),tt.polygonOffset_enable=Le),Ce=_t[0],Pe=_t[1],Ce===wt[0]&&Pe===wt[1]||(K.polygonOffset(Ce,Pe),wt[0]=Ce,wt[1]=Pe),(Oe=$.sample_alpha)!==tt.sample_alpha&&(Oe?K.enable(32926):K.disable(32926),tt.sample_alpha=Oe),(Ie=$.sample_enable)!==tt.sample_enable&&(Ie?K.enable(32928):K.disable(32928),tt.sample_enable=Ie),De=At[0],Re=At[1],De===kt[0]&&Re===kt[1]||(K.sampleCoverage(De,Re),kt[0]=De,kt[1]=Re),(Fe=$.stencil_mask)!==tt.stencil_mask&&(K.stencilMask(Fe),tt.stencil_mask=Fe),Be=Tt[0],Ne=Tt[1],je=Tt[2],Be===Mt[0]&&Ne===Mt[1]&&je===Mt[2]||(K.stencilFunc(Be,Ne,je),Mt[0]=Be,Mt[1]=Ne,Mt[2]=je),Ve=St[0],Ue=St[1],He=St[2],qe=St[3],Ve===zt[0]&&Ue===zt[1]&&He===zt[2]&&qe===zt[3]||(K.stencilOpSeparate(Ve,Ue,He,qe),zt[0]=Ve,zt[1]=Ue,zt[2]=He,zt[3]=qe),Ge=Et[0],We=Et[1],Ye=Et[2],Ze=Et[3],Ge===Lt[0]&&We===Lt[1]&&Ye===Lt[2]&&Ze===Lt[3]||(K.stencilOpSeparate(Ge,We,Ye,Ze),Lt[0]=Ge,Lt[1]=We,Lt[2]=Ye,Lt[3]=Ze));b=0|(v=t.viewport).x,x=0|v.y,_="width"in v?0|v.width:Q.framebufferWidth-b,w="height"in v?0|v.height:Q.framebufferHeight-x,A=Q.viewportWidth,Q.viewportWidth=_,k=Q.viewportHeight,Q.viewportHeight=w,K.viewport(b,x,_,w),It[0]=b,It[1]=x,It[2]=_,It[3]=w,K.blendColor(0,0,0,0),pt[0]=0,pt[1]=0,pt[2]=0,pt[3]=0,r?K.enable(3042):K.disable(3042),tt.blend_enable=r,K.blendEquationSeparate(32774,32774),dt[0]=32774,dt[1]=32774,K.blendFuncSeparate(770,771,773,1),gt[0]=770,gt[1]=771,gt[2]=773,gt[3]=1,n?K.enable(2929):K.disable(2929),tt.depth_enable=n,M=0|(T=t.viewport).x,S=0|T.y,z="width"in T?0|T.width:Q.framebufferWidth-M,E="height"in T?0|T.height:Q.framebufferHeight-S,K.scissor(M,S,z,E),Pt[0]=M,Pt[1]=S,Pt[2]=z,Pt[3]=E,i?K.enable(3089):K.disable(3089),tt.scissor_enable=i,a?K.enable(2960):K.disable(2960),tt.stencil_enable=a,(L=tt.profile)&&(C=performance.now(),e.count++),K.useProgram(o.program),P=ct.angle_instanced_arrays,ot.setVAO(null),O=t.positionBuffer,Rt.buffer=O,I=!1,D=1,R=0,F=0,B=0,N=0,j=null,V=0,U=!1,H=5126,q=0,G=0,W=0,ut(Rt)?(I=!0,H=(j=nt.createStream(34962,Rt)).dtype):(j=nt.getBuffer(Rt))?H=j.dtype:"constant"in Rt?(D=2,"number"==typeof Rt.constant?(R=Rt.constant,F=B=N=0):(R=Rt.constant.length>0?Rt.constant[0]:0,F=Rt.constant.length>1?Rt.constant[1]:0,B=Rt.constant.length>2?Rt.constant[2]:0,N=Rt.constant.length>3?Rt.constant[3]:0)):(j=ut(Rt.buffer)?nt.createStream(34962,Rt.buffer):nt.getBuffer(Rt.buffer),H="type"in Rt?Dt[Rt.type]:j.dtype,U=!!Rt.normalized,V=0|Rt.size,q=0|Rt.offset,G=0|Rt.stride,W=0|Rt.divisor),Y=s.location,Z=at[Y],1===D?(Z.buffer||K.enableVertexAttribArray(Y),X=V||2,Z.type===H&&Z.size===X&&Z.buffer===j&&Z.normalized===U&&Z.offset===q&&Z.stride===G||(K.bindBuffer(34962,j.buffer),K.vertexAttribPointer(Y,X,H,U,G,q),Z.type=H,Z.size=X,Z.buffer=j,Z.normalized=U,Z.offset=q,Z.stride=G),Z.divisor!==W&&(P.vertexAttribDivisorANGLE(Y,W),Z.divisor=W)):(Z.buffer&&(K.disableVertexAttribArray(Y),Z.buffer=null),Z.x===R&&Z.y===F&&Z.z===B&&Z.w===N||(K.vertexAttrib4f(Y,R,F,B,N),Z.x=R,Z.y=F,Z.z=B,Z.w=N)),J=t.positionFractBuffer,Ft.buffer=J,it=!1,st=1,ft=0,ht=0,mt=0,Ct=0,Ot=null,Bt=0,Nt=!1,jt=5126,Vt=0,Ut=0,Ht=0,ut(Ft)?(it=!0,jt=(Ot=nt.createStream(34962,Ft)).dtype):(Ot=nt.getBuffer(Ft))?jt=Ot.dtype:"constant"in Ft?(st=2,"number"==typeof Ft.constant?(ft=Ft.constant,ht=mt=Ct=0):(ft=Ft.constant.length>0?Ft.constant[0]:0,ht=Ft.constant.length>1?Ft.constant[1]:0,mt=Ft.constant.length>2?Ft.constant[2]:0,Ct=Ft.constant.length>3?Ft.constant[3]:0)):(Ot=ut(Ft.buffer)?nt.createStream(34962,Ft.buffer):nt.getBuffer(Ft.buffer),jt="type"in Ft?Dt[Ft.type]:Ot.dtype,Nt=!!Ft.normalized,Bt=0|Ft.size,Vt=0|Ft.offset,Ut=0|Ft.stride,Ht=0|Ft.divisor),qt=l.location,Gt=at[qt],1===st?(Gt.buffer||K.enableVertexAttribArray(qt),Wt=Bt||2,Gt.type===jt&&Gt.size===Wt&&Gt.buffer===Ot&&Gt.normalized===Nt&&Gt.offset===Vt&&Gt.stride===Ut||(K.bindBuffer(34962,Ot.buffer),K.vertexAttribPointer(qt,Wt,jt,Nt,Ut,Vt),Gt.type=jt,Gt.size=Wt,Gt.buffer=Ot,Gt.normalized=Nt,Gt.offset=Vt,Gt.stride=Ut),Gt.divisor!==Ht&&(P.vertexAttribDivisorANGLE(qt,Ht),Gt.divisor=Ht)):(Gt.buffer&&(K.disableVertexAttribArray(qt),Gt.buffer=null),Gt.x===ft&&Gt.y===ht&&Gt.z===mt&&Gt.w===Ct||(K.vertexAttrib4f(qt,ft,ht,mt,Ct),Gt.x=ft,Gt.y=ht,Gt.z=mt,Gt.w=Ct)),Zt=(Yt=t.fill)[0],Xt=Yt[1],Jt=Yt[2],Kt=Yt[3],K.uniform4f(c.location,Zt,Xt,Jt,Kt),Qt=t.id,K.uniform1f(u.location,Qt),$t=t.opacity,K.uniform1f(f.location,$t),ee=(te=t.scale)[0],re=te[1],K.uniform2f(p.location,ee,re),ie=(ne=t.scaleFract)[0],ae=ne[1],K.uniform2f(h.location,ie,ae),se=(oe=t.translate)[0],le=oe[1],K.uniform2f(d.location,se,le),ue=(ce=t.translateFract)[0],fe=ce[1],K.uniform2f(m.location,ue,fe),pe=g.call(this,Q,t,0),he=null,(he=(de=ut(pe))?rt.createStream(pe):rt.getElements(pe))&&K.bindBuffer(34963,he.buffer.buffer),(me=he?he.vertCount:-1)&&((ge=et.instances)>0?he?P.drawElementsInstancedANGLE(4,me,he.type,0<<(he.type-5121>>1),ge):P.drawArraysInstancedANGLE(4,0,me,ge):ge<0&&(he?K.drawElements(4,me,he.type,0<<(he.type-5121>>1)):K.drawArrays(4,0,me)),tt.dirty=!0,ot.setVAO(null),Q.viewportWidth=A,Q.viewportHeight=k,L&&(e.cpuTime+=performance.now()-C),I&&nt.destroyStream(j),it&&nt.destroyStream(Ot),de&&rt.destroyStream(he))},scope:function(t,r,n){var i,a,o,s,l,c,u,f,p,h,d,m,Y,Z,X,J,K,at,ot,lt,ct,pt,dt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Pt,It,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar;a=0|(i=t.viewport).x,o=0|i.y,s="width"in i?0|i.width:Q.framebufferWidth-a,l="height"in i?0|i.height:Q.framebufferHeight-o,c=Q.viewportWidth,Q.viewportWidth=s,u=Q.viewportHeight,Q.viewportHeight=l,f=Ot[0],Ot[0]=a,p=Ot[1],Ot[1]=o,h=Ot[2],Ot[2]=s,d=Ot[3],Ot[3]=l,m=ft[0],ft[0]=y,Y=ft[1],ft[1]=v,Z=ft[2],ft[2]=b,X=ft[3],ft[3]=x,J=$.blend_enable,$.blend_enable=_,K=ht[0],ht[0]=w,at=ht[1],ht[1]=A,ot=mt[0],mt[0]=k,lt=mt[1],mt[1]=T,ct=mt[2],mt[2]=M,pt=mt[3],mt[3]=S,dt=$.depth_enable,$.depth_enable=z,yt=0|(gt=t.viewport).x,vt=0|gt.y,bt="width"in gt?0|gt.width:Q.framebufferWidth-yt,xt="height"in gt?0|gt.height:Q.framebufferHeight-vt,_t=Ct[0],Ct[0]=yt,wt=Ct[1],Ct[1]=vt,At=Ct[2],Ct[2]=bt,kt=Ct[3],Ct[3]=xt,Tt=$.scissor_enable,$.scissor_enable=E,Mt=$.stencil_enable,$.stencil_enable=L,(St=tt.profile)&&(zt=performance.now(),e.count++),Et=g.call(this,Q,t,n),Lt=null,Lt=(Pt=ut(Et))?rt.createStream(Et):rt.getElements(Et),It=et.elements,et.elements=Lt,Bt=et.offset,et.offset=C,Nt=Lt?Lt.vertCount:-1,jt=et.count,et.count=Nt,Vt=et.primitive,et.primitive=P,Ut=t.scale,Ht=st[O],st[O]=Ut,qt=t.fill,Gt=st[I],st[I]=qt,Wt=t.scaleFract,Yt=st[D],st[D]=Wt,Zt=t.translateFract,Xt=st[R],st[R]=Zt,Jt=t.translate,Kt=st[F],st[F]=Jt,Qt=t.opacity,$t=st[B],st[B]=Qt,te=Q.pixelRatio,ee=st[N],st[N]=te,re=t.id,ne=st[j],st[j]=re,ie=V.call(this,Q,t,n),ae=st[U],st[U]=ie,oe=t.positionBuffer,Rt.buffer=oe,se=!1,le=1,ce=0,ue=0,fe=0,pe=0,he=null,de=0,me=!1,ge=5126,ye=0,ve=0,be=0,ut(Rt)?(se=!0,ge=(he=nt.createStream(34962,Rt)).dtype):(he=nt.getBuffer(Rt))?ge=he.dtype:"constant"in Rt?(le=2,"number"==typeof Rt.constant?(ce=Rt.constant,ue=fe=pe=0):(ce=Rt.constant.length>0?Rt.constant[0]:0,ue=Rt.constant.length>1?Rt.constant[1]:0,fe=Rt.constant.length>2?Rt.constant[2]:0,pe=Rt.constant.length>3?Rt.constant[3]:0)):(he=ut(Rt.buffer)?nt.createStream(34962,Rt.buffer):nt.getBuffer(Rt.buffer),ge="type"in Rt?Dt[Rt.type]:he.dtype,me=!!Rt.normalized,de=0|Rt.size,ye=0|Rt.offset,ve=0|Rt.stride,be=0|Rt.divisor),xe=H.state,H.state=le,_e=H.x,H.x=ce,we=H.y,H.y=ue,Ae=H.z,H.z=fe,ke=H.w,H.w=pe,Te=H.buffer,H.buffer=he,Me=H.size,H.size=de,Se=H.normalized,H.normalized=me,ze=H.type,H.type=ge,Ee=H.offset,H.offset=ye,Le=H.stride,H.stride=ve,Ce=H.divisor,H.divisor=be,Pe=t.positionFractBuffer,Ft.buffer=Pe,Oe=!1,Ie=1,De=0,Re=0,Fe=0,Be=0,Ne=null,je=0,Ve=!1,Ue=5126,He=0,qe=0,Ge=0,ut(Ft)?(Oe=!0,Ue=(Ne=nt.createStream(34962,Ft)).dtype):(Ne=nt.getBuffer(Ft))?Ue=Ne.dtype:"constant"in Ft?(Ie=2,"number"==typeof Ft.constant?(De=Ft.constant,Re=Fe=Be=0):(De=Ft.constant.length>0?Ft.constant[0]:0,Re=Ft.constant.length>1?Ft.constant[1]:0,Fe=Ft.constant.length>2?Ft.constant[2]:0,Be=Ft.constant.length>3?Ft.constant[3]:0)):(Ne=ut(Ft.buffer)?nt.createStream(34962,Ft.buffer):nt.getBuffer(Ft.buffer),Ue="type"in Ft?Dt[Ft.type]:Ne.dtype,Ve=!!Ft.normalized,je=0|Ft.size,He=0|Ft.offset,qe=0|Ft.stride,Ge=0|Ft.divisor),We=q.state,q.state=Ie,Ye=q.x,q.x=De,Ze=q.y,q.y=Re,Xe=q.z,q.z=Fe,Je=q.w,q.w=Be,Ke=q.buffer,q.buffer=Ne,Qe=q.size,q.size=je,$e=q.normalized,q.normalized=Ve,tr=q.type,q.type=Ue,er=q.offset,q.offset=He,rr=q.stride,q.stride=qe,nr=q.divisor,q.divisor=Ge,ir=it.vert,it.vert=G,ar=it.frag,it.frag=W,tt.dirty=!0,r(Q,t,n),Q.viewportWidth=c,Q.viewportHeight=u,Ot[0]=f,Ot[1]=p,Ot[2]=h,Ot[3]=d,ft[0]=m,ft[1]=Y,ft[2]=Z,ft[3]=X,$.blend_enable=J,ht[0]=K,ht[1]=at,mt[0]=ot,mt[1]=lt,mt[2]=ct,mt[3]=pt,$.depth_enable=dt,Ct[0]=_t,Ct[1]=wt,Ct[2]=At,Ct[3]=kt,$.scissor_enable=Tt,$.stencil_enable=Mt,St&&(e.cpuTime+=performance.now()-zt),Pt&&rt.destroyStream(Lt),et.elements=It,et.offset=Bt,et.count=jt,et.primitive=Vt,st[O]=Ht,st[I]=Gt,st[D]=Yt,st[R]=Xt,st[F]=Kt,st[B]=$t,st[N]=ee,st[j]=ne,st[U]=ae,se&&nt.destroyStream(he),H.state=xe,H.x=_e,H.y=we,H.z=Ae,H.w=ke,H.buffer=Te,H.size=Me,H.normalized=Se,H.type=ze,H.offset=Ee,H.stride=Le,H.divisor=Ce,Oe&&nt.destroyStream(Ne),q.state=We,q.x=Ye,q.y=Ze,q.z=Xe,q.w=Je,q.buffer=Ke,q.size=Qe,q.normalized=$e,q.type=tr,q.offset=er,q.stride=rr,q.divisor=nr,it.vert=ir,it.frag=ar,tt.dirty=!0},batch:function(t,r){var n,i,a,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,it,st,ft,ht,mt,Ct;(ct.angle_instanced_arrays,(n=lt.next)!==lt.cur&&(n?K.bindFramebuffer(36160,n.framebuffer):K.bindFramebuffer(36160,null),lt.cur=n),tt.dirty)&&((x=$.dither)!==tt.dither&&(x?K.enable(3024):K.disable(3024),tt.dither=x),(_=$.depth_func)!==tt.depth_func&&(K.depthFunc(_),tt.depth_func=_),w=yt[0],A=yt[1],w===vt[0]&&A===vt[1]||(K.depthRange(w,A),vt[0]=w,vt[1]=A),(k=$.depth_mask)!==tt.depth_mask&&(K.depthMask(k),tt.depth_mask=k),T=bt[0],M=bt[1],S=bt[2],z=bt[3],T===xt[0]&&M===xt[1]&&S===xt[2]&&z===xt[3]||(K.colorMask(T,M,S,z),xt[0]=T,xt[1]=M,xt[2]=S,xt[3]=z),(E=$.cull_enable)!==tt.cull_enable&&(E?K.enable(2884):K.disable(2884),tt.cull_enable=E),(L=$.cull_face)!==tt.cull_face&&(K.cullFace(L),tt.cull_face=L),(C=$.frontFace)!==tt.frontFace&&(K.frontFace(C),tt.frontFace=C),(P=$.lineWidth)!==tt.lineWidth&&(K.lineWidth(P),tt.lineWidth=P),(O=$.polygonOffset_enable)!==tt.polygonOffset_enable&&(O?K.enable(32823):K.disable(32823),tt.polygonOffset_enable=O),I=_t[0],D=_t[1],I===wt[0]&&D===wt[1]||(K.polygonOffset(I,D),wt[0]=I,wt[1]=D),(R=$.sample_alpha)!==tt.sample_alpha&&(R?K.enable(32926):K.disable(32926),tt.sample_alpha=R),(F=$.sample_enable)!==tt.sample_enable&&(F?K.enable(32928):K.disable(32928),tt.sample_enable=F),B=At[0],N=At[1],B===kt[0]&&N===kt[1]||(K.sampleCoverage(B,N),kt[0]=B,kt[1]=N),(j=$.stencil_mask)!==tt.stencil_mask&&(K.stencilMask(j),tt.stencil_mask=j),V=Tt[0],U=Tt[1],H=Tt[2],V===Mt[0]&&U===Mt[1]&&H===Mt[2]||(K.stencilFunc(V,U,H),Mt[0]=V,Mt[1]=U,Mt[2]=H),q=St[0],G=St[1],W=St[2],it=St[3],q===zt[0]&&G===zt[1]&&W===zt[2]&&it===zt[3]||(K.stencilOpSeparate(q,G,W,it),zt[0]=q,zt[1]=G,zt[2]=W,zt[3]=it),st=Et[0],ft=Et[1],ht=Et[2],mt=Et[3],st===Lt[0]&&ft===Lt[1]&&ht===Lt[2]&&mt===Lt[3]||(K.stencilOpSeparate(st,ft,ht,mt),Lt[0]=st,Lt[1]=ft,Lt[2]=ht,Lt[3]=mt));for(K.blendColor(0,0,0,0),pt[0]=0,pt[1]=0,pt[2]=0,pt[3]=0,Y?K.enable(3042):K.disable(3042),tt.blend_enable=Y,K.blendEquationSeparate(32774,32774),dt[0]=32774,dt[1]=32774,K.blendFuncSeparate(770,771,773,1),gt[0]=770,gt[1]=771,gt[2]=773,gt[3]=1,Z?K.enable(2929):K.disable(2929),tt.depth_enable=Z,X?K.enable(3089):K.disable(3089),tt.scissor_enable=X,J?K.enable(2960):K.disable(2960),tt.stencil_enable=J,(i=tt.profile)&&(a=performance.now(),e.count+=r),K.useProgram(o.program),y=ct.angle_instanced_arrays,ot.setVAO(null),Ct=et.instances,v=0;v0?Rt.constant[0]:0,$t=Rt.constant.length>1?Rt.constant[1]:0,te=Rt.constant.length>2?Rt.constant[2]:0,ee=Rt.constant.length>3?Rt.constant[3]:0)):(re=ut(Rt.buffer)?nt.createStream(34962,Rt.buffer):nt.getBuffer(Rt.buffer),ae="type"in Rt?Dt[Rt.type]:re.dtype,ie=!!Rt.normalized,ne=0|Rt.size,oe=0|Rt.offset,se=0|Rt.stride,le=0|Rt.divisor),ce=s.location,ue=at[ce],1===Kt?(ue.buffer||K.enableVertexAttribArray(ce),fe=ne||2,ue.type===ae&&ue.size===fe&&ue.buffer===re&&ue.normalized===ie&&ue.offset===oe&&ue.stride===se||(K.bindBuffer(34962,re.buffer),K.vertexAttribPointer(ce,fe,ae,ie,se,oe),ue.type=ae,ue.size=fe,ue.buffer=re,ue.normalized=ie,ue.offset=oe,ue.stride=se),ue.divisor!==le&&(y.vertexAttribDivisorANGLE(ce,le),ue.divisor=le)):(ue.buffer&&(K.disableVertexAttribArray(ce),ue.buffer=null),ue.x===Qt&&ue.y===$t&&ue.z===te&&ue.w===ee||(K.vertexAttrib4f(ce,Qt,$t,te,ee),ue.x=Qt,ue.y=$t,ue.z=te,ue.w=ee)),pe=b.positionFractBuffer,Ft.buffer=pe,he=!1,de=1,me=0,ge=0,ye=0,ve=0,be=null,xe=0,_e=!1,we=5126,Ae=0,ke=0,Te=0,ut(Ft)?(he=!0,we=(be=nt.createStream(34962,Ft)).dtype):(be=nt.getBuffer(Ft))?we=be.dtype:"constant"in Ft?(de=2,"number"==typeof Ft.constant?(me=Ft.constant,ge=ye=ve=0):(me=Ft.constant.length>0?Ft.constant[0]:0,ge=Ft.constant.length>1?Ft.constant[1]:0,ye=Ft.constant.length>2?Ft.constant[2]:0,ve=Ft.constant.length>3?Ft.constant[3]:0)):(be=ut(Ft.buffer)?nt.createStream(34962,Ft.buffer):nt.getBuffer(Ft.buffer),we="type"in Ft?Dt[Ft.type]:be.dtype,_e=!!Ft.normalized,xe=0|Ft.size,Ae=0|Ft.offset,ke=0|Ft.stride,Te=0|Ft.divisor),Me=l.location,Se=at[Me],1===de?(Se.buffer||K.enableVertexAttribArray(Me),ze=xe||2,Se.type===we&&Se.size===ze&&Se.buffer===be&&Se.normalized===_e&&Se.offset===Ae&&Se.stride===ke||(K.bindBuffer(34962,be.buffer),K.vertexAttribPointer(Me,ze,we,_e,ke,Ae),Se.type=we,Se.size=ze,Se.buffer=be,Se.normalized=_e,Se.offset=Ae,Se.stride=ke),Se.divisor!==Te&&(y.vertexAttribDivisorANGLE(Me,Te),Se.divisor=Te)):(Se.buffer&&(K.disableVertexAttribArray(Me),Se.buffer=null),Se.x===me&&Se.y===ge&&Se.z===ye&&Se.w===ve||(K.vertexAttrib4f(Me,me,ge,ye,ve),Se.x=me,Se.y=ge,Se.z=ye,Se.w=ve)),Le=(Ee=b.fill)[0],Pe=Ee[1],Ie=Ee[2],Re=Ee[3],v&&Ce===Le&&Oe===Pe&&De===Ie&&Fe===Re||(Ce=Le,Oe=Pe,De=Ie,Fe=Re,K.uniform4f(c.location,Le,Pe,Ie,Re)),Be=b.id,v&&Ne===Be||(Ne=Be,K.uniform1f(u.location,Be)),je=b.opacity,v&&Ve===je||(Ve=je,K.uniform1f(f.location,je)),He=(Ue=b.scale)[0],Ge=Ue[1],v&&qe===He&&We===Ge||(qe=He,We=Ge,K.uniform2f(p.location,He,Ge)),Ze=(Ye=b.scaleFract)[0],Je=Ye[1],v&&Xe===Ze&&Ke===Je||(Xe=Ze,Ke=Je,K.uniform2f(h.location,Ze,Je)),$e=(Qe=b.translate)[0],er=Qe[1],v&&tr===$e&&rr===er||(tr=$e,rr=er,K.uniform2f(d.location,$e,er)),ir=(nr=b.translateFract)[0],or=nr[1],v&&ar===ir&&sr===or||(ar=ir,sr=or,K.uniform2f(m.location,ir,or)),lr=g.call(this,Q,b,v),cr=null,(cr=(ur=ut(lr))?rt.createStream(lr):rt.getElements(lr))&&K.bindBuffer(34963,cr.buffer.buffer),(fr=cr?cr.vertCount:-1)&&(Ct>0?cr?y.drawElementsInstancedANGLE(4,fr,cr.type,0<<(cr.type-5121>>1),Ct):y.drawArraysInstancedANGLE(4,0,fr,Ct):Ct<0&&(cr?K.drawElements(4,fr,cr.type,0<<(cr.type-5121>>1)):K.drawArrays(4,0,fr)),Q.viewportWidth=Ut,Q.viewportHeight=Ht,Jt&&nt.destroyStream(re),he&&nt.destroyStream(be),ur&&rt.destroyStream(cr))}tt.dirty=!0,ot.setVAO(null),i&&(e.cpuTime+=performance.now()-a)}}}},{}],496:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt){"use strict";var ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee;return ht=t.gl,dt=t.context,t.strings,mt=t.next,gt=t.current,yt=t.draw,vt=t.elements,bt=t.buffer,xt=t.shader,_t=t.attributes,wt=t.vao,At=t.uniforms,kt=t.framebuffer,Tt=t.extensions,t.timer,Mt=t.isBufferArgs,St=mt.blend_color,zt=gt.blend_color,Et=mt.blend_equation,Lt=gt.blend_equation,Ct=mt.blend_func,Pt=gt.blend_func,Ot=mt.depth_range,It=gt.depth_range,Dt=mt.colorMask,Rt=gt.colorMask,Ft=mt.polygonOffset_offset,Bt=gt.polygonOffset_offset,Nt=mt.sample_coverage,jt=gt.sample_coverage,Vt=mt.stencil_func,Ut=gt.stencil_func,Ht=mt.stencil_opFront,qt=gt.stencil_opFront,Gt=mt.stencil_opBack,Wt=gt.stencil_opBack,Yt=mt.scissor_box,Zt=gt.scissor_box,Xt=mt.viewport,Jt=gt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Kt={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(Qt={}).buffer=r,Qt.divisor=1,($t={}).buffer=n,$t.divisor=1,(te={}).buffer=i,te.divisor=1,(ee={}).buffer=a,ee.divisor=1,{draw:function(t){var r,n,i,a,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,xt,At,St,Et,Ct,Yt,Xt,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr;(Tt.angle_instanced_arrays,(r=kt.next)!==kt.cur&&(r?ht.bindFramebuffer(36160,r.framebuffer):ht.bindFramebuffer(36160,null),kt.cur=r),gt.dirty)&&((dr=mt.dither)!==gt.dither&&(dr?ht.enable(3024):ht.disable(3024),gt.dither=dr),(mr=mt.depth_func)!==gt.depth_func&&(ht.depthFunc(mr),gt.depth_func=mr),gr=Ot[0],yr=Ot[1],gr===It[0]&&yr===It[1]||(ht.depthRange(gr,yr),It[0]=gr,It[1]=yr),(vr=mt.depth_mask)!==gt.depth_mask&&(ht.depthMask(vr),gt.depth_mask=vr),br=Dt[0],xr=Dt[1],_r=Dt[2],wr=Dt[3],br===Rt[0]&&xr===Rt[1]&&_r===Rt[2]&&wr===Rt[3]||(ht.colorMask(br,xr,_r,wr),Rt[0]=br,Rt[1]=xr,Rt[2]=_r,Rt[3]=wr),(Ar=mt.cull_enable)!==gt.cull_enable&&(Ar?ht.enable(2884):ht.disable(2884),gt.cull_enable=Ar),(kr=mt.cull_face)!==gt.cull_face&&(ht.cullFace(kr),gt.cull_face=kr),(Tr=mt.frontFace)!==gt.frontFace&&(ht.frontFace(Tr),gt.frontFace=Tr),(Mr=mt.lineWidth)!==gt.lineWidth&&(ht.lineWidth(Mr),gt.lineWidth=Mr),(Sr=mt.polygonOffset_enable)!==gt.polygonOffset_enable&&(Sr?ht.enable(32823):ht.disable(32823),gt.polygonOffset_enable=Sr),zr=Ft[0],Er=Ft[1],zr===Bt[0]&&Er===Bt[1]||(ht.polygonOffset(zr,Er),Bt[0]=zr,Bt[1]=Er),(Lr=mt.sample_alpha)!==gt.sample_alpha&&(Lr?ht.enable(32926):ht.disable(32926),gt.sample_alpha=Lr),(Cr=mt.sample_enable)!==gt.sample_enable&&(Cr?ht.enable(32928):ht.disable(32928),gt.sample_enable=Cr),Pr=Nt[0],Or=Nt[1],Pr===jt[0]&&Or===jt[1]||(ht.sampleCoverage(Pr,Or),jt[0]=Pr,jt[1]=Or),(Ir=mt.stencil_enable)!==gt.stencil_enable&&(Ir?ht.enable(2960):ht.disable(2960),gt.stencil_enable=Ir),(Dr=mt.stencil_mask)!==gt.stencil_mask&&(ht.stencilMask(Dr),gt.stencil_mask=Dr),Rr=Vt[0],Fr=Vt[1],Br=Vt[2],Rr===Ut[0]&&Fr===Ut[1]&&Br===Ut[2]||(ht.stencilFunc(Rr,Fr,Br),Ut[0]=Rr,Ut[1]=Fr,Ut[2]=Br),Nr=Ht[0],jr=Ht[1],Vr=Ht[2],Ur=Ht[3],Nr===qt[0]&&jr===qt[1]&&Vr===qt[2]&&Ur===qt[3]||(ht.stencilOpSeparate(Nr,jr,Vr,Ur),qt[0]=Nr,qt[1]=jr,qt[2]=Vr,qt[3]=Ur),Hr=Gt[0],qr=Gt[1],Gr=Gt[2],Wr=Gt[3],Hr===Wt[0]&&qr===Wt[1]&&Gr===Wt[2]&&Wr===Wt[3]||(ht.stencilOpSeparate(Hr,qr,Gr,Wr),Wt[0]=Hr,Wt[1]=qr,Wt[2]=Gr,Wt[3]=Wr));i=0|(n=t.viewport).x,a=0|n.y,C="width"in n?0|n.width:dt.framebufferWidth-i,P="height"in n?0|n.height:dt.framebufferHeight-a,O=dt.viewportWidth,dt.viewportWidth=C,I=dt.viewportHeight,dt.viewportHeight=P,ht.viewport(i,a,C,P),Jt[0]=i,Jt[1]=a,Jt[2]=C,Jt[3]=P,ht.blendColor(0,0,0,0),zt[0]=0,zt[1]=0,zt[2]=0,zt[3]=0,o?ht.enable(3042):ht.disable(3042),gt.blend_enable=o,ht.blendEquationSeparate(32774,32774),Lt[0]=32774,Lt[1]=32774,ht.blendFuncSeparate(770,771,773,1),Pt[0]=770,Pt[1]=771,Pt[2]=773,Pt[3]=1,s?ht.enable(2929):ht.disable(2929),gt.depth_enable=s,R=0|(D=t.viewport).x,F=0|D.y,B="width"in D?0|D.width:dt.framebufferWidth-R,N="height"in D?0|D.height:dt.framebufferHeight-F,ht.scissor(R,F,B,N),Zt[0]=R,Zt[1]=F,Zt[2]=B,Zt[3]=N,l?ht.enable(3089):ht.disable(3089),gt.scissor_enable=l,(j=gt.profile)&&(V=performance.now(),e.count++),ht.useProgram(c.program),U=Tt.angle_instanced_arrays,wt.setVAO(null),H=f.location,(q=_t[H]).buffer||ht.enableVertexAttribArray(H),5126===q.type&&2===q.size&&q.buffer===u&&!1===q.normalized&&16===q.offset&&24===q.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(H,2,5126,!1,24,16),q.type=5126,q.size=2,q.buffer=u,q.normalized=!1,q.offset=16,q.stride=24),0!==q.divisor&&(U.vertexAttribDivisorANGLE(H,0),q.divisor=0),G=p.call(this,dt,t,0),Qt.offset=G,W=!1,Y=1,Z=0,X=0,J=0,K=0,Q=null,$=0,tt=!1,et=5126,rt=0,nt=0,it=0,Mt(Qt)?(W=!0,et=(Q=bt.createStream(34962,Qt)).dtype):(Q=bt.getBuffer(Qt))?et=Q.dtype:"constant"in Qt?(Y=2,"number"==typeof Qt.constant?(Z=Qt.constant,X=J=K=0):(Z=Qt.constant.length>0?Qt.constant[0]:0,X=Qt.constant.length>1?Qt.constant[1]:0,J=Qt.constant.length>2?Qt.constant[2]:0,K=Qt.constant.length>3?Qt.constant[3]:0)):(Q=Mt(Qt.buffer)?bt.createStream(34962,Qt.buffer):bt.getBuffer(Qt.buffer),et="type"in Qt?Kt[Qt.type]:Q.dtype,tt=!!Qt.normalized,$=0|Qt.size,rt=0|Qt.offset,nt=0|Qt.stride,it=0|Qt.divisor),at=h.location,ot=_t[at],1===Y?(ot.buffer||ht.enableVertexAttribArray(at),st=$||4,ot.type===et&&ot.size===st&&ot.buffer===Q&&ot.normalized===tt&&ot.offset===rt&&ot.stride===nt||(ht.bindBuffer(34962,Q.buffer),ht.vertexAttribPointer(at,st,et,tt,nt,rt),ot.type=et,ot.size=st,ot.buffer=Q,ot.normalized=tt,ot.offset=rt,ot.stride=nt),ot.divisor!==it&&(U.vertexAttribDivisorANGLE(at,it),ot.divisor=it)):(ot.buffer&&(ht.disableVertexAttribArray(at),ot.buffer=null),ot.x===Z&&ot.y===X&&ot.z===J&&ot.w===K||(ht.vertexAttrib4f(at,Z,X,J,K),ot.x=Z,ot.y=X,ot.z=J,ot.w=K)),lt=d.location,(ct=_t[lt]).buffer||ht.enableVertexAttribArray(lt),5126===ct.type&&2===ct.size&&ct.buffer===u&&!1===ct.normalized&&0===ct.offset&&24===ct.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(lt,2,5126,!1,24,0),ct.type=5126,ct.size=2,ct.buffer=u,ct.normalized=!1,ct.offset=0,ct.stride=24),0!==ct.divisor&&(U.vertexAttribDivisorANGLE(lt,0),ct.divisor=0),ut=m.call(this,dt,t,0),ee.offset=ut,ft=!1,pt=1,xt=0,At=0,St=0,Et=0,Ct=null,Yt=0,Xt=!1,re=5126,ne=0,ie=0,ae=0,Mt(ee)?(ft=!0,re=(Ct=bt.createStream(34962,ee)).dtype):(Ct=bt.getBuffer(ee))?re=Ct.dtype:"constant"in ee?(pt=2,"number"==typeof ee.constant?(xt=ee.constant,At=St=Et=0):(xt=ee.constant.length>0?ee.constant[0]:0,At=ee.constant.length>1?ee.constant[1]:0,St=ee.constant.length>2?ee.constant[2]:0,Et=ee.constant.length>3?ee.constant[3]:0)):(Ct=Mt(ee.buffer)?bt.createStream(34962,ee.buffer):bt.getBuffer(ee.buffer),re="type"in ee?Kt[ee.type]:Ct.dtype,Xt=!!ee.normalized,Yt=0|ee.size,ne=0|ee.offset,ie=0|ee.stride,ae=0|ee.divisor),oe=g.location,se=_t[oe],1===pt?(se.buffer||ht.enableVertexAttribArray(oe),le=Yt||4,se.type===re&&se.size===le&&se.buffer===Ct&&se.normalized===Xt&&se.offset===ne&&se.stride===ie||(ht.bindBuffer(34962,Ct.buffer),ht.vertexAttribPointer(oe,le,re,Xt,ie,ne),se.type=re,se.size=le,se.buffer=Ct,se.normalized=Xt,se.offset=ne,se.stride=ie),se.divisor!==ae&&(U.vertexAttribDivisorANGLE(oe,ae),se.divisor=ae)):(se.buffer&&(ht.disableVertexAttribArray(oe),se.buffer=null),se.x===xt&&se.y===At&&se.z===St&&se.w===Et||(ht.vertexAttrib4f(oe,xt,At,St,Et),se.x=xt,se.y=At,se.z=St,se.w=Et)),ce=y.location,(ue=_t[ce]).buffer||ht.enableVertexAttribArray(ce),5126===ue.type&&2===ue.size&&ue.buffer===u&&!1===ue.normalized&&8===ue.offset&&24===ue.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(ce,2,5126,!1,24,8),ue.type=5126,ue.size=2,ue.buffer=u,ue.normalized=!1,ue.offset=8,ue.stride=24),0!==ue.divisor&&(U.vertexAttribDivisorANGLE(ce,0),ue.divisor=0),fe=v.call(this,dt,t,0),$t.offset=fe,pe=!1,he=1,de=0,me=0,ge=0,ye=0,ve=null,be=0,xe=!1,_e=5126,we=0,Ae=0,ke=0,Mt($t)?(pe=!0,_e=(ve=bt.createStream(34962,$t)).dtype):(ve=bt.getBuffer($t))?_e=ve.dtype:"constant"in $t?(he=2,"number"==typeof $t.constant?(de=$t.constant,me=ge=ye=0):(de=$t.constant.length>0?$t.constant[0]:0,me=$t.constant.length>1?$t.constant[1]:0,ge=$t.constant.length>2?$t.constant[2]:0,ye=$t.constant.length>3?$t.constant[3]:0)):(ve=Mt($t.buffer)?bt.createStream(34962,$t.buffer):bt.getBuffer($t.buffer),_e="type"in $t?Kt[$t.type]:ve.dtype,xe=!!$t.normalized,be=0|$t.size,we=0|$t.offset,Ae=0|$t.stride,ke=0|$t.divisor),Te=b.location,Me=_t[Te],1===he?(Me.buffer||ht.enableVertexAttribArray(Te),Se=be||2,Me.type===_e&&Me.size===Se&&Me.buffer===ve&&Me.normalized===xe&&Me.offset===we&&Me.stride===Ae||(ht.bindBuffer(34962,ve.buffer),ht.vertexAttribPointer(Te,Se,_e,xe,Ae,we),Me.type=_e,Me.size=Se,Me.buffer=ve,Me.normalized=xe,Me.offset=we,Me.stride=Ae),Me.divisor!==ke&&(U.vertexAttribDivisorANGLE(Te,ke),Me.divisor=ke)):(Me.buffer&&(ht.disableVertexAttribArray(Te),Me.buffer=null),Me.x===de&&Me.y===me&&Me.z===ge&&Me.w===ye||(ht.vertexAttrib4f(Te,de,me,ge,ye),Me.x=de,Me.y=me,Me.z=ge,Me.w=ye)),ze=x.call(this,dt,t,0),te.offset=ze,Ee=!1,Le=1,Ce=0,Pe=0,Oe=0,Ie=0,De=null,Re=0,Fe=!1,Be=5126,Ne=0,je=0,Ve=0,Mt(te)?(Ee=!0,Be=(De=bt.createStream(34962,te)).dtype):(De=bt.getBuffer(te))?Be=De.dtype:"constant"in te?(Le=2,"number"==typeof te.constant?(Ce=te.constant,Pe=Oe=Ie=0):(Ce=te.constant.length>0?te.constant[0]:0,Pe=te.constant.length>1?te.constant[1]:0,Oe=te.constant.length>2?te.constant[2]:0,Ie=te.constant.length>3?te.constant[3]:0)):(De=Mt(te.buffer)?bt.createStream(34962,te.buffer):bt.getBuffer(te.buffer),Be="type"in te?Kt[te.type]:De.dtype,Fe=!!te.normalized,Re=0|te.size,Ne=0|te.offset,je=0|te.stride,Ve=0|te.divisor),Ue=_.location,He=_t[Ue],1===Le?(He.buffer||ht.enableVertexAttribArray(Ue),qe=Re||2,He.type===Be&&He.size===qe&&He.buffer===De&&He.normalized===Fe&&He.offset===Ne&&He.stride===je||(ht.bindBuffer(34962,De.buffer),ht.vertexAttribPointer(Ue,qe,Be,Fe,je,Ne),He.type=Be,He.size=qe,He.buffer=De,He.normalized=Fe,He.offset=Ne,He.stride=je),He.divisor!==Ve&&(U.vertexAttribDivisorANGLE(Ue,Ve),He.divisor=Ve)):(He.buffer&&(ht.disableVertexAttribArray(Ue),He.buffer=null),He.x===Ce&&He.y===Pe&&He.z===Oe&&He.w===Ie||(ht.vertexAttrib4f(Ue,Ce,Pe,Oe,Ie),He.x=Ce,He.y=Pe,He.z=Oe,He.w=Ie)),Ge=t.capSize,ht.uniform1f(w.location,Ge),We=t.lineWidth,ht.uniform1f(A.location,We),Ye=t.opacity,ht.uniform1f(k.location,Ye),Xe=(Ze=t.scale)[0],Je=Ze[1],ht.uniform2f(T.location,Xe,Je),Qe=(Ke=t.scaleFract)[0],$e=Ke[1],ht.uniform2f(M.location,Qe,$e),er=(tr=t.translate)[0],rr=tr[1],ht.uniform2f(S.location,er,rr),ir=(nr=t.translateFract)[0],ar=nr[1],ht.uniform2f(z.location,ir,ar),sr=(or=L.call(this,dt,t,0))[0],lr=or[1],cr=or[2],ur=or[3],ht.uniform4f(E.location,sr,lr,cr,ur),((fr=yt.elements)||wt.currentVAO&&(fr=vt.getElements(wt.currentVAO.elements)))&&ht.bindBuffer(34963,fr.buffer.buffer),pr=yt.offset,(hr=t.count)>0?fr?U.drawElementsInstancedANGLE(4,36,fr.type,pr<<(fr.type-5121>>1),hr):U.drawArraysInstancedANGLE(4,pr,36,hr):hr<0&&(fr?ht.drawElements(4,36,fr.type,pr<<(fr.type-5121>>1)):ht.drawArrays(4,pr,36)),gt.dirty=!0,wt.setVAO(null),dt.viewportWidth=O,dt.viewportHeight=I,j&&(e.cpuTime+=performance.now()-V),W&&bt.destroyStream(Q),ft&&bt.destroyStream(Ct),pe&&bt.destroyStream(ve),Ee&&bt.destroyStream(De)},scope:function(t,r,n){var i,a,o,s,l,c,f,h,d,g,y,b,_,w,A,k,T,M,S,z,E,ut,ft,pt,ht,vt,_t,wt,kt,Tt,zt,Lt,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Zt,Jt,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn;a=0|(i=t.viewport).x,o=0|i.y,s="width"in i?0|i.width:dt.framebufferWidth-a,l="height"in i?0|i.height:dt.framebufferHeight-o,c=dt.viewportWidth,dt.viewportWidth=s,f=dt.viewportHeight,dt.viewportHeight=l,h=Xt[0],Xt[0]=a,d=Xt[1],Xt[1]=o,g=Xt[2],Xt[2]=s,y=Xt[3],Xt[3]=l,b=St[0],St[0]=C,_=St[1],St[1]=P,w=St[2],St[2]=O,A=St[3],St[3]=I,k=mt.blend_enable,mt.blend_enable=D,T=Et[0],Et[0]=R,M=Et[1],Et[1]=F,S=Ct[0],Ct[0]=B,z=Ct[1],Ct[1]=N,E=Ct[2],Ct[2]=j,ut=Ct[3],Ct[3]=V,ft=mt.depth_enable,mt.depth_enable=U,ht=0|(pt=t.viewport).x,vt=0|pt.y,_t="width"in pt?0|pt.width:dt.framebufferWidth-ht,wt="height"in pt?0|pt.height:dt.framebufferHeight-vt,kt=Yt[0],Yt[0]=ht,Tt=Yt[1],Yt[1]=vt,zt=Yt[2],Yt[2]=_t,Lt=Yt[3],Yt[3]=wt,Pt=mt.scissor_enable,mt.scissor_enable=H,(Ot=gt.profile)&&(It=performance.now(),e.count++),Dt=yt.count,yt.count=q,Rt=t.count,Ft=yt.instances,yt.instances=Rt,Bt=yt.primitive,yt.primitive=G,Nt=t.range,jt=At[W],At[W]=Nt,Vt=t.lineWidth,Ut=At[Y],At[Y]=Vt,Ht=t.capSize,qt=At[Z],At[Z]=Ht,Gt=t.opacity,Wt=At[X],At[X]=Gt,Zt=t.scale,Jt=At[J],At[J]=Zt,re=t.translate,ne=At[K],At[K]=re,ie=t.scaleFract,ae=At[Q],At[Q]=ie,oe=t.translateFract,se=At[$],At[$]=oe,le=L.call(this,dt,t,n),ce=At[tt],At[tt]=le,ue=et.state,et.state=1,fe=et.x,et.x=0,pe=et.y,et.y=0,he=et.z,et.z=0,de=et.w,et.w=0,me=et.buffer,et.buffer=u,ge=et.size,et.size=0,ye=et.normalized,et.normalized=!1,ve=et.type,et.type=5126,be=et.offset,et.offset=0,xe=et.stride,et.stride=24,_e=et.divisor,et.divisor=0,we=rt.state,rt.state=1,Ae=rt.x,rt.x=0,ke=rt.y,rt.y=0,Te=rt.z,rt.z=0,Me=rt.w,rt.w=0,Se=rt.buffer,rt.buffer=u,ze=rt.size,rt.size=0,Ee=rt.normalized,rt.normalized=!1,Le=rt.type,rt.type=5126,Ce=rt.offset,rt.offset=8,Pe=rt.stride,rt.stride=24,Oe=rt.divisor,rt.divisor=0,Ie=nt.state,nt.state=1,De=nt.x,nt.x=0,Re=nt.y,nt.y=0,Fe=nt.z,nt.z=0,Be=nt.w,nt.w=0,Ne=nt.buffer,nt.buffer=u,je=nt.size,nt.size=0,Ve=nt.normalized,nt.normalized=!1,Ue=nt.type,nt.type=5126,He=nt.offset,nt.offset=16,qe=nt.stride,nt.stride=24,Ge=nt.divisor,nt.divisor=0,We=p.call(this,dt,t,n),Qt.offset=We,Ye=!1,Ze=1,Xe=0,Je=0,Ke=0,Qe=0,$e=null,tr=0,er=!1,rr=5126,nr=0,ir=0,ar=0,Mt(Qt)?(Ye=!0,rr=($e=bt.createStream(34962,Qt)).dtype):($e=bt.getBuffer(Qt))?rr=$e.dtype:"constant"in Qt?(Ze=2,"number"==typeof Qt.constant?(Xe=Qt.constant,Je=Ke=Qe=0):(Xe=Qt.constant.length>0?Qt.constant[0]:0,Je=Qt.constant.length>1?Qt.constant[1]:0,Ke=Qt.constant.length>2?Qt.constant[2]:0,Qe=Qt.constant.length>3?Qt.constant[3]:0)):($e=Mt(Qt.buffer)?bt.createStream(34962,Qt.buffer):bt.getBuffer(Qt.buffer),rr="type"in Qt?Kt[Qt.type]:$e.dtype,er=!!Qt.normalized,tr=0|Qt.size,nr=0|Qt.offset,ir=0|Qt.stride,ar=0|Qt.divisor),or=it.state,it.state=Ze,sr=it.x,it.x=Xe,lr=it.y,it.y=Je,cr=it.z,it.z=Ke,ur=it.w,it.w=Qe,fr=it.buffer,it.buffer=$e,pr=it.size,it.size=tr,hr=it.normalized,it.normalized=er,dr=it.type,it.type=rr,mr=it.offset,it.offset=nr,gr=it.stride,it.stride=ir,yr=it.divisor,it.divisor=ar,vr=v.call(this,dt,t,n),$t.offset=vr,br=!1,xr=1,_r=0,wr=0,Ar=0,kr=0,Tr=null,Mr=0,Sr=!1,zr=5126,Er=0,Lr=0,Cr=0,Mt($t)?(br=!0,zr=(Tr=bt.createStream(34962,$t)).dtype):(Tr=bt.getBuffer($t))?zr=Tr.dtype:"constant"in $t?(xr=2,"number"==typeof $t.constant?(_r=$t.constant,wr=Ar=kr=0):(_r=$t.constant.length>0?$t.constant[0]:0,wr=$t.constant.length>1?$t.constant[1]:0,Ar=$t.constant.length>2?$t.constant[2]:0,kr=$t.constant.length>3?$t.constant[3]:0)):(Tr=Mt($t.buffer)?bt.createStream(34962,$t.buffer):bt.getBuffer($t.buffer),zr="type"in $t?Kt[$t.type]:Tr.dtype,Sr=!!$t.normalized,Mr=0|$t.size,Er=0|$t.offset,Lr=0|$t.stride,Cr=0|$t.divisor),Pr=at.state,at.state=xr,Or=at.x,at.x=_r,Ir=at.y,at.y=wr,Dr=at.z,at.z=Ar,Rr=at.w,at.w=kr,Fr=at.buffer,at.buffer=Tr,Br=at.size,at.size=Mr,Nr=at.normalized,at.normalized=Sr,jr=at.type,at.type=zr,Vr=at.offset,at.offset=Er,Ur=at.stride,at.stride=Lr,Hr=at.divisor,at.divisor=Cr,qr=x.call(this,dt,t,n),te.offset=qr,Gr=!1,Wr=1,Yr=0,Zr=0,Xr=0,Jr=0,Kr=null,Qr=0,$r=!1,tn=5126,en=0,rn=0,nn=0,Mt(te)?(Gr=!0,tn=(Kr=bt.createStream(34962,te)).dtype):(Kr=bt.getBuffer(te))?tn=Kr.dtype:"constant"in te?(Wr=2,"number"==typeof te.constant?(Yr=te.constant,Zr=Xr=Jr=0):(Yr=te.constant.length>0?te.constant[0]:0,Zr=te.constant.length>1?te.constant[1]:0,Xr=te.constant.length>2?te.constant[2]:0,Jr=te.constant.length>3?te.constant[3]:0)):(Kr=Mt(te.buffer)?bt.createStream(34962,te.buffer):bt.getBuffer(te.buffer),tn="type"in te?Kt[te.type]:Kr.dtype,$r=!!te.normalized,Qr=0|te.size,en=0|te.offset,rn=0|te.stride,nn=0|te.divisor),an=ot.state,ot.state=Wr,on=ot.x,ot.x=Yr,sn=ot.y,ot.y=Zr,ln=ot.z,ot.z=Xr,cn=ot.w,ot.w=Jr,un=ot.buffer,ot.buffer=Kr,fn=ot.size,ot.size=Qr,pn=ot.normalized,ot.normalized=$r,hn=ot.type,ot.type=tn,dn=ot.offset,ot.offset=en,mn=ot.stride,ot.stride=rn,gn=ot.divisor,ot.divisor=nn,yn=m.call(this,dt,t,n),ee.offset=yn,vn=!1,bn=1,xn=0,_n=0,wn=0,An=0,kn=null,Tn=0,Mn=!1,Sn=5126,zn=0,En=0,Ln=0,Mt(ee)?(vn=!0,Sn=(kn=bt.createStream(34962,ee)).dtype):(kn=bt.getBuffer(ee))?Sn=kn.dtype:"constant"in ee?(bn=2,"number"==typeof ee.constant?(xn=ee.constant,_n=wn=An=0):(xn=ee.constant.length>0?ee.constant[0]:0,_n=ee.constant.length>1?ee.constant[1]:0,wn=ee.constant.length>2?ee.constant[2]:0,An=ee.constant.length>3?ee.constant[3]:0)):(kn=Mt(ee.buffer)?bt.createStream(34962,ee.buffer):bt.getBuffer(ee.buffer),Sn="type"in ee?Kt[ee.type]:kn.dtype,Mn=!!ee.normalized,Tn=0|ee.size,zn=0|ee.offset,En=0|ee.stride,Ln=0|ee.divisor),Cn=st.state,st.state=bn,Pn=st.x,st.x=xn,On=st.y,st.y=_n,In=st.z,st.z=wn,Dn=st.w,st.w=An,Rn=st.buffer,st.buffer=kn,Fn=st.size,st.size=Tn,Bn=st.normalized,st.normalized=Mn,Nn=st.type,st.type=Sn,jn=st.offset,st.offset=zn,Vn=st.stride,st.stride=En,Un=st.divisor,st.divisor=Ln,Hn=xt.vert,xt.vert=lt,qn=xt.frag,xt.frag=ct,gt.dirty=!0,r(dt,t,n),dt.viewportWidth=c,dt.viewportHeight=f,Xt[0]=h,Xt[1]=d,Xt[2]=g,Xt[3]=y,St[0]=b,St[1]=_,St[2]=w,St[3]=A,mt.blend_enable=k,Et[0]=T,Et[1]=M,Ct[0]=S,Ct[1]=z,Ct[2]=E,Ct[3]=ut,mt.depth_enable=ft,Yt[0]=kt,Yt[1]=Tt,Yt[2]=zt,Yt[3]=Lt,mt.scissor_enable=Pt,Ot&&(e.cpuTime+=performance.now()-It),yt.count=Dt,yt.instances=Ft,yt.primitive=Bt,At[W]=jt,At[Y]=Ut,At[Z]=qt,At[X]=Wt,At[J]=Jt,At[K]=ne,At[Q]=ae,At[$]=se,At[tt]=ce,et.state=ue,et.x=fe,et.y=pe,et.z=he,et.w=de,et.buffer=me,et.size=ge,et.normalized=ye,et.type=ve,et.offset=be,et.stride=xe,et.divisor=_e,rt.state=we,rt.x=Ae,rt.y=ke,rt.z=Te,rt.w=Me,rt.buffer=Se,rt.size=ze,rt.normalized=Ee,rt.type=Le,rt.offset=Ce,rt.stride=Pe,rt.divisor=Oe,nt.state=Ie,nt.x=De,nt.y=Re,nt.z=Fe,nt.w=Be,nt.buffer=Ne,nt.size=je,nt.normalized=Ve,nt.type=Ue,nt.offset=He,nt.stride=qe,nt.divisor=Ge,Ye&&bt.destroyStream($e),it.state=or,it.x=sr,it.y=lr,it.z=cr,it.w=ur,it.buffer=fr,it.size=pr,it.normalized=hr,it.type=dr,it.offset=mr,it.stride=gr,it.divisor=yr,br&&bt.destroyStream(Tr),at.state=Pr,at.x=Or,at.y=Ir,at.z=Dr,at.w=Rr,at.buffer=Fr,at.size=Br,at.normalized=Nr,at.type=jr,at.offset=Vr,at.stride=Ur,at.divisor=Hr,Gr&&bt.destroyStream(Kr),ot.state=an,ot.x=on,ot.y=sn,ot.z=ln,ot.w=cn,ot.buffer=un,ot.size=fn,ot.normalized=pn,ot.type=hn,ot.offset=dn,ot.stride=mn,ot.divisor=gn,vn&&bt.destroyStream(kn),st.state=Cn,st.x=Pn,st.y=On,st.z=In,st.w=Dn,st.buffer=Rn,st.size=Fn,st.normalized=Bn,st.type=Nn,st.offset=jn,st.stride=Vn,st.divisor=Un,xt.vert=Hn,xt.frag=qn,gt.dirty=!0},batch:function(t,r){var n,i,a,o,s,l,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,xt,At,St,Et,Ct,Yt,Xt,re;(Tt.angle_instanced_arrays,(n=kt.next)!==kt.cur&&(n?ht.bindFramebuffer(36160,n.framebuffer):ht.bindFramebuffer(36160,null),kt.cur=n),gt.dirty)&&((C=mt.dither)!==gt.dither&&(C?ht.enable(3024):ht.disable(3024),gt.dither=C),(P=mt.depth_func)!==gt.depth_func&&(ht.depthFunc(P),gt.depth_func=P),O=Ot[0],I=Ot[1],O===It[0]&&I===It[1]||(ht.depthRange(O,I),It[0]=O,It[1]=I),(D=mt.depth_mask)!==gt.depth_mask&&(ht.depthMask(D),gt.depth_mask=D),R=Dt[0],F=Dt[1],B=Dt[2],N=Dt[3],R===Rt[0]&&F===Rt[1]&&B===Rt[2]&&N===Rt[3]||(ht.colorMask(R,F,B,N),Rt[0]=R,Rt[1]=F,Rt[2]=B,Rt[3]=N),(j=mt.cull_enable)!==gt.cull_enable&&(j?ht.enable(2884):ht.disable(2884),gt.cull_enable=j),(V=mt.cull_face)!==gt.cull_face&&(ht.cullFace(V),gt.cull_face=V),(U=mt.frontFace)!==gt.frontFace&&(ht.frontFace(U),gt.frontFace=U),(H=mt.lineWidth)!==gt.lineWidth&&(ht.lineWidth(H),gt.lineWidth=H),(q=mt.polygonOffset_enable)!==gt.polygonOffset_enable&&(q?ht.enable(32823):ht.disable(32823),gt.polygonOffset_enable=q),G=Ft[0],W=Ft[1],G===Bt[0]&&W===Bt[1]||(ht.polygonOffset(G,W),Bt[0]=G,Bt[1]=W),(Y=mt.sample_alpha)!==gt.sample_alpha&&(Y?ht.enable(32926):ht.disable(32926),gt.sample_alpha=Y),(Z=mt.sample_enable)!==gt.sample_enable&&(Z?ht.enable(32928):ht.disable(32928),gt.sample_enable=Z),X=Nt[0],J=Nt[1],X===jt[0]&&J===jt[1]||(ht.sampleCoverage(X,J),jt[0]=X,jt[1]=J),(K=mt.stencil_enable)!==gt.stencil_enable&&(K?ht.enable(2960):ht.disable(2960),gt.stencil_enable=K),(Q=mt.stencil_mask)!==gt.stencil_mask&&(ht.stencilMask(Q),gt.stencil_mask=Q),$=Vt[0],tt=Vt[1],et=Vt[2],$===Ut[0]&&tt===Ut[1]&&et===Ut[2]||(ht.stencilFunc($,tt,et),Ut[0]=$,Ut[1]=tt,Ut[2]=et),rt=Ht[0],nt=Ht[1],it=Ht[2],at=Ht[3],rt===qt[0]&&nt===qt[1]&&it===qt[2]&&at===qt[3]||(ht.stencilOpSeparate(rt,nt,it,at),qt[0]=rt,qt[1]=nt,qt[2]=it,qt[3]=at),ot=Gt[0],st=Gt[1],lt=Gt[2],ct=Gt[3],ot===Wt[0]&&st===Wt[1]&<===Wt[2]&&ct===Wt[3]||(ht.stencilOpSeparate(ot,st,lt,ct),Wt[0]=ot,Wt[1]=st,Wt[2]=lt,Wt[3]=ct));for(ht.blendColor(0,0,0,0),zt[0]=0,zt[1]=0,zt[2]=0,zt[3]=0,ut?ht.enable(3042):ht.disable(3042),gt.blend_enable=ut,ht.blendEquationSeparate(32774,32774),Lt[0]=32774,Lt[1]=32774,ht.blendFuncSeparate(770,771,773,1),Pt[0]=770,Pt[1]=771,Pt[2]=773,Pt[3]=1,ft?ht.enable(2929):ht.disable(2929),gt.depth_enable=ft,pt?ht.enable(3089):ht.disable(3089),gt.scissor_enable=pt,(i=gt.profile)&&(a=performance.now(),e.count+=r),ht.useProgram(c.program),o=Tt.angle_instanced_arrays,wt.setVAO(null),xt=f.location,(At=_t[xt]).buffer||ht.enableVertexAttribArray(xt),5126===At.type&&2===At.size&&At.buffer===u&&!1===At.normalized&&16===At.offset&&24===At.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(xt,2,5126,!1,24,16),At.type=5126,At.size=2,At.buffer=u,At.normalized=!1,At.offset=16,At.stride=24),0!==At.divisor&&(o.vertexAttribDivisorANGLE(xt,0),At.divisor=0),St=d.location,(Et=_t[St]).buffer||ht.enableVertexAttribArray(St),5126===Et.type&&2===Et.size&&Et.buffer===u&&!1===Et.normalized&&0===Et.offset&&24===Et.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(St,2,5126,!1,24,0),Et.type=5126,Et.size=2,Et.buffer=u,Et.normalized=!1,Et.offset=0,Et.stride=24),0!==Et.divisor&&(o.vertexAttribDivisorANGLE(St,0),Et.divisor=0),Ct=y.location,(Yt=_t[Ct]).buffer||ht.enableVertexAttribArray(Ct),5126===Yt.type&&2===Yt.size&&Yt.buffer===u&&!1===Yt.normalized&&8===Yt.offset&&24===Yt.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(Ct,2,5126,!1,24,8),Yt.type=5126,Yt.size=2,Yt.buffer=u,Yt.normalized=!1,Yt.offset=8,Yt.stride=24),0!==Yt.divisor&&(o.vertexAttribDivisorANGLE(Ct,0),Yt.divisor=0),((Xt=yt.elements)||wt.currentVAO&&(Xt=vt.getElements(wt.currentVAO.elements)))&&ht.bindBuffer(34963,Xt.buffer.buffer),re=yt.offset,s=0;s0?Qt.constant[0]:0,be=Qt.constant.length>1?Qt.constant[1]:0,xe=Qt.constant.length>2?Qt.constant[2]:0,_e=Qt.constant.length>3?Qt.constant[3]:0)):(we=Mt(Qt.buffer)?bt.createStream(34962,Qt.buffer):bt.getBuffer(Qt.buffer),Te="type"in Qt?Kt[Qt.type]:we.dtype,ke=!!Qt.normalized,Ae=0|Qt.size,Me=0|Qt.offset,Se=0|Qt.stride,ze=0|Qt.divisor),Ee=h.location,Le=_t[Ee],1===ye?(Le.buffer||ht.enableVertexAttribArray(Ee),Ce=Ae||4,Le.type===Te&&Le.size===Ce&&Le.buffer===we&&Le.normalized===ke&&Le.offset===Me&&Le.stride===Se||(ht.bindBuffer(34962,we.buffer),ht.vertexAttribPointer(Ee,Ce,Te,ke,Se,Me),Le.type=Te,Le.size=Ce,Le.buffer=we,Le.normalized=ke,Le.offset=Me,Le.stride=Se),Le.divisor!==ze&&(o.vertexAttribDivisorANGLE(Ee,ze),Le.divisor=ze)):(Le.buffer&&(ht.disableVertexAttribArray(Ee),Le.buffer=null),Le.x===ve&&Le.y===be&&Le.z===xe&&Le.w===_e||(ht.vertexAttrib4f(Ee,ve,be,xe,_e),Le.x=ve,Le.y=be,Le.z=xe,Le.w=_e)),Pe=m.call(this,dt,l,s),ee.offset=Pe,Oe=!1,Ie=1,De=0,Re=0,Fe=0,Be=0,Ne=null,je=0,Ve=!1,Ue=5126,He=0,qe=0,Ge=0,Mt(ee)?(Oe=!0,Ue=(Ne=bt.createStream(34962,ee)).dtype):(Ne=bt.getBuffer(ee))?Ue=Ne.dtype:"constant"in ee?(Ie=2,"number"==typeof ee.constant?(De=ee.constant,Re=Fe=Be=0):(De=ee.constant.length>0?ee.constant[0]:0,Re=ee.constant.length>1?ee.constant[1]:0,Fe=ee.constant.length>2?ee.constant[2]:0,Be=ee.constant.length>3?ee.constant[3]:0)):(Ne=Mt(ee.buffer)?bt.createStream(34962,ee.buffer):bt.getBuffer(ee.buffer),Ue="type"in ee?Kt[ee.type]:Ne.dtype,Ve=!!ee.normalized,je=0|ee.size,He=0|ee.offset,qe=0|ee.stride,Ge=0|ee.divisor),We=g.location,Ye=_t[We],1===Ie?(Ye.buffer||ht.enableVertexAttribArray(We),Ze=je||4,Ye.type===Ue&&Ye.size===Ze&&Ye.buffer===Ne&&Ye.normalized===Ve&&Ye.offset===He&&Ye.stride===qe||(ht.bindBuffer(34962,Ne.buffer),ht.vertexAttribPointer(We,Ze,Ue,Ve,qe,He),Ye.type=Ue,Ye.size=Ze,Ye.buffer=Ne,Ye.normalized=Ve,Ye.offset=He,Ye.stride=qe),Ye.divisor!==Ge&&(o.vertexAttribDivisorANGLE(We,Ge),Ye.divisor=Ge)):(Ye.buffer&&(ht.disableVertexAttribArray(We),Ye.buffer=null),Ye.x===De&&Ye.y===Re&&Ye.z===Fe&&Ye.w===Be||(ht.vertexAttrib4f(We,De,Re,Fe,Be),Ye.x=De,Ye.y=Re,Ye.z=Fe,Ye.w=Be)),Xe=v.call(this,dt,l,s),$t.offset=Xe,Je=!1,Ke=1,Qe=0,$e=0,tr=0,er=0,rr=null,nr=0,ir=!1,ar=5126,or=0,sr=0,lr=0,Mt($t)?(Je=!0,ar=(rr=bt.createStream(34962,$t)).dtype):(rr=bt.getBuffer($t))?ar=rr.dtype:"constant"in $t?(Ke=2,"number"==typeof $t.constant?(Qe=$t.constant,$e=tr=er=0):(Qe=$t.constant.length>0?$t.constant[0]:0,$e=$t.constant.length>1?$t.constant[1]:0,tr=$t.constant.length>2?$t.constant[2]:0,er=$t.constant.length>3?$t.constant[3]:0)):(rr=Mt($t.buffer)?bt.createStream(34962,$t.buffer):bt.getBuffer($t.buffer),ar="type"in $t?Kt[$t.type]:rr.dtype,ir=!!$t.normalized,nr=0|$t.size,or=0|$t.offset,sr=0|$t.stride,lr=0|$t.divisor),cr=b.location,ur=_t[cr],1===Ke?(ur.buffer||ht.enableVertexAttribArray(cr),fr=nr||2,ur.type===ar&&ur.size===fr&&ur.buffer===rr&&ur.normalized===ir&&ur.offset===or&&ur.stride===sr||(ht.bindBuffer(34962,rr.buffer),ht.vertexAttribPointer(cr,fr,ar,ir,sr,or),ur.type=ar,ur.size=fr,ur.buffer=rr,ur.normalized=ir,ur.offset=or,ur.stride=sr),ur.divisor!==lr&&(o.vertexAttribDivisorANGLE(cr,lr),ur.divisor=lr)):(ur.buffer&&(ht.disableVertexAttribArray(cr),ur.buffer=null),ur.x===Qe&&ur.y===$e&&ur.z===tr&&ur.w===er||(ht.vertexAttrib4f(cr,Qe,$e,tr,er),ur.x=Qe,ur.y=$e,ur.z=tr,ur.w=er)),pr=x.call(this,dt,l,s),te.offset=pr,hr=!1,dr=1,mr=0,gr=0,yr=0,vr=0,br=null,xr=0,_r=!1,wr=5126,Ar=0,kr=0,Tr=0,Mt(te)?(hr=!0,wr=(br=bt.createStream(34962,te)).dtype):(br=bt.getBuffer(te))?wr=br.dtype:"constant"in te?(dr=2,"number"==typeof te.constant?(mr=te.constant,gr=yr=vr=0):(mr=te.constant.length>0?te.constant[0]:0,gr=te.constant.length>1?te.constant[1]:0,yr=te.constant.length>2?te.constant[2]:0,vr=te.constant.length>3?te.constant[3]:0)):(br=Mt(te.buffer)?bt.createStream(34962,te.buffer):bt.getBuffer(te.buffer),wr="type"in te?Kt[te.type]:br.dtype,_r=!!te.normalized,xr=0|te.size,Ar=0|te.offset,kr=0|te.stride,Tr=0|te.divisor),Mr=_.location,Sr=_t[Mr],1===dr?(Sr.buffer||ht.enableVertexAttribArray(Mr),zr=xr||2,Sr.type===wr&&Sr.size===zr&&Sr.buffer===br&&Sr.normalized===_r&&Sr.offset===Ar&&Sr.stride===kr||(ht.bindBuffer(34962,br.buffer),ht.vertexAttribPointer(Mr,zr,wr,_r,kr,Ar),Sr.type=wr,Sr.size=zr,Sr.buffer=br,Sr.normalized=_r,Sr.offset=Ar,Sr.stride=kr),Sr.divisor!==Tr&&(o.vertexAttribDivisorANGLE(Mr,Tr),Sr.divisor=Tr)):(Sr.buffer&&(ht.disableVertexAttribArray(Mr),Sr.buffer=null),Sr.x===mr&&Sr.y===gr&&Sr.z===yr&&Sr.w===vr||(ht.vertexAttrib4f(Mr,mr,gr,yr,vr),Sr.x=mr,Sr.y=gr,Sr.z=yr,Sr.w=vr)),Er=l.capSize,s&&Lr===Er||(Lr=Er,ht.uniform1f(w.location,Er)),Cr=l.lineWidth,s&&Pr===Cr||(Pr=Cr,ht.uniform1f(A.location,Cr)),Or=l.opacity,s&&Ir===Or||(Ir=Or,ht.uniform1f(k.location,Or)),Rr=(Dr=l.scale)[0],Br=Dr[1],s&&Fr===Rr&&Nr===Br||(Fr=Rr,Nr=Br,ht.uniform2f(T.location,Rr,Br)),Vr=(jr=l.scaleFract)[0],Hr=jr[1],s&&Ur===Vr&&qr===Hr||(Ur=Vr,qr=Hr,ht.uniform2f(M.location,Vr,Hr)),Wr=(Gr=l.translate)[0],Zr=Gr[1],s&&Yr===Wr&&Xr===Zr||(Yr=Wr,Xr=Zr,ht.uniform2f(S.location,Wr,Zr)),Kr=(Jr=l.translateFract)[0],$r=Jr[1],s&&Qr===Kr&&tn===$r||(Qr=Kr,tn=$r,ht.uniform2f(z.location,Kr,$r)),rn=(en=L.call(this,dt,l,s))[0],an=en[1],sn=en[2],cn=en[3],s&&nn===rn&&on===an&&ln===sn&&un===cn||(nn=rn,on=an,ln=sn,un=cn,ht.uniform4f(E.location,rn,an,sn,cn)),(fn=l.count)>0?Xt?o.drawElementsInstancedANGLE(4,36,Xt.type,re<<(Xt.type-5121>>1),fn):o.drawArraysInstancedANGLE(4,re,36,fn):fn<0&&(Xt?ht.drawElements(4,36,Xt.type,re<<(Xt.type-5121>>1)):ht.drawArrays(4,re,36)),dt.viewportWidth=le,dt.viewportHeight=ce,ge&&bt.destroyStream(we),Oe&&bt.destroyStream(Ne),Je&&bt.destroyStream(rr),hr&&bt.destroyStream(br)}gt.dirty=!0,wt.setVAO(null),i&&(e.cpuTime+=performance.now()-a)}}}},{}],497:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st){"use strict";var lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt;return lt=t.gl,ct=t.context,t.strings,ut=t.next,ft=t.current,pt=t.draw,ht=t.elements,dt=t.buffer,mt=t.shader,gt=t.attributes,yt=t.vao,vt=t.uniforms,bt=t.framebuffer,xt=t.extensions,t.timer,_t=t.isBufferArgs,wt=ut.blend_color,At=ft.blend_color,kt=ut.blend_equation,Tt=ft.blend_equation,Mt=ut.blend_func,St=ft.blend_func,zt=ut.depth_range,Et=ft.depth_range,Lt=ut.colorMask,Ct=ft.colorMask,Pt=ut.polygonOffset_offset,Ot=ft.polygonOffset_offset,It=ut.sample_coverage,Dt=ft.sample_coverage,Rt=ut.stencil_func,Ft=ft.stencil_func,Bt=ut.stencil_opFront,Nt=ft.stencil_opFront,jt=ut.stencil_opBack,Vt=ft.stencil_opBack,Ut=ut.scissor_box,Ht=ft.scissor_box,qt=ut.viewport,Gt=ft.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Wt={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(Yt={}).offset=4,Yt.stride=8,(Zt={}).offset=0,Zt.stride=8,{draw:function(t){var z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,mt,vt,wt,Mt,qt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en;(xt.angle_instanced_arrays,(z=bt.next)!==bt.cur&&(z?lt.bindFramebuffer(36160,z.framebuffer):lt.bindFramebuffer(36160,null),bt.cur=z),ft.dirty)&&((yr=ut.dither)!==ft.dither&&(yr?lt.enable(3024):lt.disable(3024),ft.dither=yr),vr=kt[0],br=kt[1],vr===Tt[0]&&br===Tt[1]||(lt.blendEquationSeparate(vr,br),Tt[0]=vr,Tt[1]=br),(xr=ut.depth_func)!==ft.depth_func&&(lt.depthFunc(xr),ft.depth_func=xr),_r=zt[0],wr=zt[1],_r===Et[0]&&wr===Et[1]||(lt.depthRange(_r,wr),Et[0]=_r,Et[1]=wr),(Ar=ut.depth_mask)!==ft.depth_mask&&(lt.depthMask(Ar),ft.depth_mask=Ar),kr=Lt[0],Tr=Lt[1],Mr=Lt[2],Sr=Lt[3],kr===Ct[0]&&Tr===Ct[1]&&Mr===Ct[2]&&Sr===Ct[3]||(lt.colorMask(kr,Tr,Mr,Sr),Ct[0]=kr,Ct[1]=Tr,Ct[2]=Mr,Ct[3]=Sr),(zr=ut.cull_enable)!==ft.cull_enable&&(zr?lt.enable(2884):lt.disable(2884),ft.cull_enable=zr),(Er=ut.cull_face)!==ft.cull_face&&(lt.cullFace(Er),ft.cull_face=Er),(Lr=ut.frontFace)!==ft.frontFace&&(lt.frontFace(Lr),ft.frontFace=Lr),(Cr=ut.lineWidth)!==ft.lineWidth&&(lt.lineWidth(Cr),ft.lineWidth=Cr),(Pr=ut.polygonOffset_enable)!==ft.polygonOffset_enable&&(Pr?lt.enable(32823):lt.disable(32823),ft.polygonOffset_enable=Pr),Or=Pt[0],Ir=Pt[1],Or===Ot[0]&&Ir===Ot[1]||(lt.polygonOffset(Or,Ir),Ot[0]=Or,Ot[1]=Ir),(Dr=ut.sample_alpha)!==ft.sample_alpha&&(Dr?lt.enable(32926):lt.disable(32926),ft.sample_alpha=Dr),(Rr=ut.sample_enable)!==ft.sample_enable&&(Rr?lt.enable(32928):lt.disable(32928),ft.sample_enable=Rr),Fr=It[0],Br=It[1],Fr===Dt[0]&&Br===Dt[1]||(lt.sampleCoverage(Fr,Br),Dt[0]=Fr,Dt[1]=Br),(Nr=ut.stencil_mask)!==ft.stencil_mask&&(lt.stencilMask(Nr),ft.stencil_mask=Nr),jr=Rt[0],Vr=Rt[1],Ur=Rt[2],jr===Ft[0]&&Vr===Ft[1]&&Ur===Ft[2]||(lt.stencilFunc(jr,Vr,Ur),Ft[0]=jr,Ft[1]=Vr,Ft[2]=Ur),Hr=Bt[0],qr=Bt[1],Gr=Bt[2],Wr=Bt[3],Hr===Nt[0]&&qr===Nt[1]&&Gr===Nt[2]&&Wr===Nt[3]||(lt.stencilOpSeparate(Hr,qr,Gr,Wr),Nt[0]=Hr,Nt[1]=qr,Nt[2]=Gr,Nt[3]=Wr),Yr=jt[0],Zr=jt[1],Xr=jt[2],Jr=jt[3],Yr===Vt[0]&&Zr===Vt[1]&&Xr===Vt[2]&&Jr===Vt[3]||(lt.stencilOpSeparate(Yr,Zr,Xr,Jr),Vt[0]=Yr,Vt[1]=Zr,Vt[2]=Xr,Vt[3]=Jr),(Kr=ut.scissor_enable)!==ft.scissor_enable&&(Kr?lt.enable(3089):lt.disable(3089),ft.scissor_enable=Kr),Qr=Ut[0],$r=Ut[1],tn=Ut[2],en=Ut[3],Qr===Ht[0]&&$r===Ht[1]&&tn===Ht[2]&&en===Ht[3]||(lt.scissor(Qr,$r,tn,en),Ht[0]=Qr,Ht[1]=$r,Ht[2]=tn,Ht[3]=en));L=0|(E=this.viewport).x,C=0|E.y,P="width"in E?0|E.width:ct.framebufferWidth-L,O="height"in E?0|E.height:ct.framebufferHeight-C,I=ct.viewportWidth,ct.viewportWidth=P,D=ct.viewportHeight,ct.viewportHeight=O,lt.viewport(L,C,P,O),Gt[0]=L,Gt[1]=C,Gt[2]=P,Gt[3]=O,lt.blendColor(0,0,0,1),At[0]=0,At[1]=0,At[2]=0,At[3]=1,r?lt.enable(3042):lt.disable(3042),ft.blend_enable=r,lt.blendFuncSeparate(770,771,773,1),St[0]=770,St[1]=771,St[2]=773,St[3]=1,n?lt.enable(2929):lt.disable(2929),ft.depth_enable=n,i?lt.enable(2960):lt.disable(2960),ft.stencil_enable=i,(R=ft.profile)&&(F=performance.now(),e.count++),lt.useProgram(a.program),B=xt.angle_instanced_arrays,yt.setVAO(null),N=this.charBuffer,j=!1,V=1,U=0,H=0,q=0,G=0,W=null,Y=0,Z=!1,X=5126,J=0,K=0,Q=0,_t(N)?(j=!0,X=(W=dt.createStream(34962,N)).dtype):(W=dt.getBuffer(N))?X=W.dtype:"constant"in N?(V=2,"number"==typeof N.constant?(U=N.constant,H=q=G=0):(U=N.constant.length>0?N.constant[0]:0,H=N.constant.length>1?N.constant[1]:0,q=N.constant.length>2?N.constant[2]:0,G=N.constant.length>3?N.constant[3]:0)):(W=_t(N.buffer)?dt.createStream(34962,N.buffer):dt.getBuffer(N.buffer),X="type"in N?Wt[N.type]:W.dtype,Z=!!N.normalized,Y=0|N.size,J=0|N.offset,K=0|N.stride,Q=0|N.divisor),$=o.location,tt=gt[$],1===V?(tt.buffer||lt.enableVertexAttribArray($),et=Y||1,tt.type===X&&tt.size===et&&tt.buffer===W&&tt.normalized===Z&&tt.offset===J&&tt.stride===K||(lt.bindBuffer(34962,W.buffer),lt.vertexAttribPointer($,et,X,Z,K,J),tt.type=X,tt.size=et,tt.buffer=W,tt.normalized=Z,tt.offset=J,tt.stride=K),tt.divisor!==Q&&(B.vertexAttribDivisorANGLE($,Q),tt.divisor=Q)):(tt.buffer&&(lt.disableVertexAttribArray($),tt.buffer=null),tt.x===U&&tt.y===H&&tt.z===q&&tt.w===G||(lt.vertexAttrib4f($,U,H,q,G),tt.x=U,tt.y=H,tt.z=q,tt.w=G)),rt=this.sizeBuffer,Yt.buffer=rt,nt=!1,it=1,at=0,ot=0,st=0,mt=0,vt=null,wt=0,Mt=!1,qt=5126,Xt=0,Jt=0,Kt=0,_t(Yt)?(nt=!0,qt=(vt=dt.createStream(34962,Yt)).dtype):(vt=dt.getBuffer(Yt))?qt=vt.dtype:"constant"in Yt?(it=2,"number"==typeof Yt.constant?(at=Yt.constant,ot=st=mt=0):(at=Yt.constant.length>0?Yt.constant[0]:0,ot=Yt.constant.length>1?Yt.constant[1]:0,st=Yt.constant.length>2?Yt.constant[2]:0,mt=Yt.constant.length>3?Yt.constant[3]:0)):(vt=_t(Yt.buffer)?dt.createStream(34962,Yt.buffer):dt.getBuffer(Yt.buffer),qt="type"in Yt?Wt[Yt.type]:vt.dtype,Mt=!!Yt.normalized,wt=0|Yt.size,Xt=0|Yt.offset,Jt=0|Yt.stride,Kt=0|Yt.divisor),Qt=s.location,$t=gt[Qt],1===it?($t.buffer||lt.enableVertexAttribArray(Qt),te=wt||1,$t.type===qt&&$t.size===te&&$t.buffer===vt&&$t.normalized===Mt&&$t.offset===Xt&&$t.stride===Jt||(lt.bindBuffer(34962,vt.buffer),lt.vertexAttribPointer(Qt,te,qt,Mt,Jt,Xt),$t.type=qt,$t.size=te,$t.buffer=vt,$t.normalized=Mt,$t.offset=Xt,$t.stride=Jt),$t.divisor!==Kt&&(B.vertexAttribDivisorANGLE(Qt,Kt),$t.divisor=Kt)):($t.buffer&&(lt.disableVertexAttribArray(Qt),$t.buffer=null),$t.x===at&&$t.y===ot&&$t.z===st&&$t.w===mt||(lt.vertexAttrib4f(Qt,at,ot,st,mt),$t.x=at,$t.y=ot,$t.z=st,$t.w=mt)),ee=this.position,re=!1,ne=1,ie=0,ae=0,oe=0,se=0,le=null,ce=0,ue=!1,fe=5126,pe=0,he=0,de=0,_t(ee)?(re=!0,fe=(le=dt.createStream(34962,ee)).dtype):(le=dt.getBuffer(ee))?fe=le.dtype:"constant"in ee?(ne=2,"number"==typeof ee.constant?(ie=ee.constant,ae=oe=se=0):(ie=ee.constant.length>0?ee.constant[0]:0,ae=ee.constant.length>1?ee.constant[1]:0,oe=ee.constant.length>2?ee.constant[2]:0,se=ee.constant.length>3?ee.constant[3]:0)):(le=_t(ee.buffer)?dt.createStream(34962,ee.buffer):dt.getBuffer(ee.buffer),fe="type"in ee?Wt[ee.type]:le.dtype,ue=!!ee.normalized,ce=0|ee.size,pe=0|ee.offset,he=0|ee.stride,de=0|ee.divisor),me=l.location,ge=gt[me],1===ne?(ge.buffer||lt.enableVertexAttribArray(me),ye=ce||2,ge.type===fe&&ge.size===ye&&ge.buffer===le&&ge.normalized===ue&&ge.offset===pe&&ge.stride===he||(lt.bindBuffer(34962,le.buffer),lt.vertexAttribPointer(me,ye,fe,ue,he,pe),ge.type=fe,ge.size=ye,ge.buffer=le,ge.normalized=ue,ge.offset=pe,ge.stride=he),ge.divisor!==de&&(B.vertexAttribDivisorANGLE(me,de),ge.divisor=de)):(ge.buffer&&(lt.disableVertexAttribArray(me),ge.buffer=null),ge.x===ie&&ge.y===ae&&ge.z===oe&&ge.w===se||(lt.vertexAttrib4f(me,ie,ae,oe,se),ge.x=ie,ge.y=ae,ge.z=oe,ge.w=se)),ve=this.sizeBuffer,Zt.buffer=ve,be=!1,xe=1,_e=0,we=0,Ae=0,ke=0,Te=null,Me=0,Se=!1,ze=5126,Ee=0,Le=0,Ce=0,_t(Zt)?(be=!0,ze=(Te=dt.createStream(34962,Zt)).dtype):(Te=dt.getBuffer(Zt))?ze=Te.dtype:"constant"in Zt?(xe=2,"number"==typeof Zt.constant?(_e=Zt.constant,we=Ae=ke=0):(_e=Zt.constant.length>0?Zt.constant[0]:0,we=Zt.constant.length>1?Zt.constant[1]:0,Ae=Zt.constant.length>2?Zt.constant[2]:0,ke=Zt.constant.length>3?Zt.constant[3]:0)):(Te=_t(Zt.buffer)?dt.createStream(34962,Zt.buffer):dt.getBuffer(Zt.buffer),ze="type"in Zt?Wt[Zt.type]:Te.dtype,Se=!!Zt.normalized,Me=0|Zt.size,Ee=0|Zt.offset,Le=0|Zt.stride,Ce=0|Zt.divisor),Pe=c.location,Oe=gt[Pe],1===xe?(Oe.buffer||lt.enableVertexAttribArray(Pe),Ie=Me||1,Oe.type===ze&&Oe.size===Ie&&Oe.buffer===Te&&Oe.normalized===Se&&Oe.offset===Ee&&Oe.stride===Le||(lt.bindBuffer(34962,Te.buffer),lt.vertexAttribPointer(Pe,Ie,ze,Se,Le,Ee),Oe.type=ze,Oe.size=Ie,Oe.buffer=Te,Oe.normalized=Se,Oe.offset=Ee,Oe.stride=Le),Oe.divisor!==Ce&&(B.vertexAttribDivisorANGLE(Pe,Ce),Oe.divisor=Ce)):(Oe.buffer&&(lt.disableVertexAttribArray(Pe),Oe.buffer=null),Oe.x===_e&&Oe.y===we&&Oe.z===Ae&&Oe.w===ke||(lt.vertexAttrib4f(Pe,_e,we,Ae,ke),Oe.x=_e,Oe.y=we,Oe.z=Ae,Oe.w=ke)),De=t.align,lt.uniform1f(u.location,De),(Re=p.call(this,ct,t,0))&&"framebuffer"===Re._reglType&&(Re=Re.color[0]),Fe=Re._texture,lt.uniform1i(f.location,Fe.bind()),Ne=(Be=d.call(this,ct,t,0))[0],je=Be[1],lt.uniform2f(h.location,Ne,je),Ue=(Ve=g.call(this,ct,t,0))[0],He=Ve[1],lt.uniform2f(m.location,Ue,He),qe=t.baseline,lt.uniform1f(y.location,qe),Ge=b.call(this,ct,t,0),lt.uniform1f(v.location,Ge),Ye=(We=t.color)[0],Ze=We[1],Xe=We[2],Je=We[3],lt.uniform4f(x.location,Ye,Ze,Xe,Je),Ke=w.call(this,ct,t,0),lt.uniform1f(_.location,Ke),Qe=t.opacity,lt.uniform1f(A.location,Qe),tr=($e=t.positionOffset)[0],er=$e[1],lt.uniform2f(k.location,tr,er),nr=(rr=this.scale)[0],ir=rr[1],lt.uniform2f(T.location,nr,ir),or=(ar=this.translate)[0],sr=ar[1],lt.uniform2f(M.location,or,sr),cr=(lr=this.viewportArray)[0],ur=lr[1],fr=lr[2],pr=lr[3],lt.uniform4f(S.location,cr,ur,fr,pr),((hr=pt.elements)||yt.currentVAO&&(hr=ht.getElements(yt.currentVAO.elements)))&<.bindBuffer(34963,hr.buffer.buffer),dr=t.offset,(mr=t.count)&&((gr=pt.instances)>0?hr?B.drawElementsInstancedANGLE(0,mr,hr.type,dr<<(hr.type-5121>>1),gr):B.drawArraysInstancedANGLE(0,dr,mr,gr):gr<0&&(hr?lt.drawElements(0,mr,hr.type,dr<<(hr.type-5121>>1)):lt.drawArrays(0,dr,mr)),ft.dirty=!0,yt.setVAO(null),ct.viewportWidth=I,ct.viewportHeight=D,R&&(e.cpuTime+=performance.now()-F),j&&dt.destroyStream(W),nt&&dt.destroyStream(vt),re&&dt.destroyStream(le),be&&dt.destroyStream(Te),Fe.unbind())},scope:function(t,r,n){var i,a,o,s,l,c,u,f,h,m,y,v,x,_,A,k,T,M,S,at,ot,st,lt,ht,gt,yt,bt,xt,At,kt,Tt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,Gt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr;a=0|(i=this.viewport).x,o=0|i.y,s="width"in i?0|i.width:ct.framebufferWidth-a,l="height"in i?0|i.height:ct.framebufferHeight-o,c=ct.viewportWidth,ct.viewportWidth=s,u=ct.viewportHeight,ct.viewportHeight=l,f=qt[0],qt[0]=a,h=qt[1],qt[1]=o,m=qt[2],qt[2]=s,y=qt[3],qt[3]=l,v=wt[0],wt[0]=z,x=wt[1],wt[1]=E,_=wt[2],wt[2]=L,A=wt[3],wt[3]=C,k=ut.blend_enable,ut.blend_enable=P,T=Mt[0],Mt[0]=O,M=Mt[1],Mt[1]=I,S=Mt[2],Mt[2]=D,at=Mt[3],Mt[3]=R,ot=ut.depth_enable,ut.depth_enable=F,st=ut.stencil_enable,ut.stencil_enable=B,(lt=ft.profile)&&(ht=performance.now(),e.count++),gt=t.offset,yt=pt.offset,pt.offset=gt,bt=t.count,xt=pt.count,pt.count=bt,At=pt.primitive,pt.primitive=N,kt=g.call(this,ct,t,n),Tt=vt[j],vt[j]=kt,St=d.call(this,ct,t,n),zt=vt[V],vt[V]=St,Et=p.call(this,ct,t,n),Lt=vt[U],vt[U]=Et,Ct=b.call(this,ct,t,n),Pt=vt[H],vt[H]=Ct,Ot=w.call(this,ct,t,n),It=vt[q],vt[q]=Ot,Dt=t.color,Rt=vt[G],vt[G]=Dt,Ft=t.opacity,Bt=vt[W],vt[W]=Ft,Nt=this.viewportArray,jt=vt[Y],vt[Y]=Nt,Vt=this.scale,Ut=vt[Z],vt[Z]=Vt,Ht=t.align,Gt=vt[X],vt[X]=Ht,Xt=t.baseline,Jt=vt[J],vt[J]=Xt,Kt=this.translate,Qt=vt[K],vt[K]=Kt,$t=t.positionOffset,te=vt[Q],vt[Q]=$t,ee=this.charBuffer,re=!1,ne=1,ie=0,ae=0,oe=0,se=0,le=null,ce=0,ue=!1,fe=5126,pe=0,he=0,de=0,_t(ee)?(re=!0,fe=(le=dt.createStream(34962,ee)).dtype):(le=dt.getBuffer(ee))?fe=le.dtype:"constant"in ee?(ne=2,"number"==typeof ee.constant?(ie=ee.constant,ae=oe=se=0):(ie=ee.constant.length>0?ee.constant[0]:0,ae=ee.constant.length>1?ee.constant[1]:0,oe=ee.constant.length>2?ee.constant[2]:0,se=ee.constant.length>3?ee.constant[3]:0)):(le=_t(ee.buffer)?dt.createStream(34962,ee.buffer):dt.getBuffer(ee.buffer),fe="type"in ee?Wt[ee.type]:le.dtype,ue=!!ee.normalized,ce=0|ee.size,pe=0|ee.offset,he=0|ee.stride,de=0|ee.divisor),me=$.state,$.state=ne,ge=$.x,$.x=ie,ye=$.y,$.y=ae,ve=$.z,$.z=oe,be=$.w,$.w=se,xe=$.buffer,$.buffer=le,_e=$.size,$.size=ce,we=$.normalized,$.normalized=ue,Ae=$.type,$.type=fe,ke=$.offset,$.offset=pe,Te=$.stride,$.stride=he,Me=$.divisor,$.divisor=de,Se=this.position,ze=!1,Ee=1,Le=0,Ce=0,Pe=0,Oe=0,Ie=null,De=0,Re=!1,Fe=5126,Be=0,Ne=0,je=0,_t(Se)?(ze=!0,Fe=(Ie=dt.createStream(34962,Se)).dtype):(Ie=dt.getBuffer(Se))?Fe=Ie.dtype:"constant"in Se?(Ee=2,"number"==typeof Se.constant?(Le=Se.constant,Ce=Pe=Oe=0):(Le=Se.constant.length>0?Se.constant[0]:0,Ce=Se.constant.length>1?Se.constant[1]:0,Pe=Se.constant.length>2?Se.constant[2]:0,Oe=Se.constant.length>3?Se.constant[3]:0)):(Ie=_t(Se.buffer)?dt.createStream(34962,Se.buffer):dt.getBuffer(Se.buffer),Fe="type"in Se?Wt[Se.type]:Ie.dtype,Re=!!Se.normalized,De=0|Se.size,Be=0|Se.offset,Ne=0|Se.stride,je=0|Se.divisor),Ve=tt.state,tt.state=Ee,Ue=tt.x,tt.x=Le,He=tt.y,tt.y=Ce,qe=tt.z,tt.z=Pe,Ge=tt.w,tt.w=Oe,We=tt.buffer,tt.buffer=Ie,Ye=tt.size,tt.size=De,Ze=tt.normalized,tt.normalized=Re,Xe=tt.type,tt.type=Fe,Je=tt.offset,tt.offset=Be,Ke=tt.stride,tt.stride=Ne,Qe=tt.divisor,tt.divisor=je,$e=this.sizeBuffer,Yt.buffer=$e,tr=!1,er=1,rr=0,nr=0,ir=0,ar=0,or=null,sr=0,lr=!1,cr=5126,ur=0,fr=0,pr=0,_t(Yt)?(tr=!0,cr=(or=dt.createStream(34962,Yt)).dtype):(or=dt.getBuffer(Yt))?cr=or.dtype:"constant"in Yt?(er=2,"number"==typeof Yt.constant?(rr=Yt.constant,nr=ir=ar=0):(rr=Yt.constant.length>0?Yt.constant[0]:0,nr=Yt.constant.length>1?Yt.constant[1]:0,ir=Yt.constant.length>2?Yt.constant[2]:0,ar=Yt.constant.length>3?Yt.constant[3]:0)):(or=_t(Yt.buffer)?dt.createStream(34962,Yt.buffer):dt.getBuffer(Yt.buffer),cr="type"in Yt?Wt[Yt.type]:or.dtype,lr=!!Yt.normalized,sr=0|Yt.size,ur=0|Yt.offset,fr=0|Yt.stride,pr=0|Yt.divisor),hr=et.state,et.state=er,dr=et.x,et.x=rr,mr=et.y,et.y=nr,gr=et.z,et.z=ir,yr=et.w,et.w=ar,vr=et.buffer,et.buffer=or,br=et.size,et.size=sr,xr=et.normalized,et.normalized=lr,_r=et.type,et.type=cr,wr=et.offset,et.offset=ur,Ar=et.stride,et.stride=fr,kr=et.divisor,et.divisor=pr,Tr=this.sizeBuffer,Zt.buffer=Tr,Mr=!1,Sr=1,zr=0,Er=0,Lr=0,Cr=0,Pr=null,Or=0,Ir=!1,Dr=5126,Rr=0,Fr=0,Br=0,_t(Zt)?(Mr=!0,Dr=(Pr=dt.createStream(34962,Zt)).dtype):(Pr=dt.getBuffer(Zt))?Dr=Pr.dtype:"constant"in Zt?(Sr=2,"number"==typeof Zt.constant?(zr=Zt.constant,Er=Lr=Cr=0):(zr=Zt.constant.length>0?Zt.constant[0]:0,Er=Zt.constant.length>1?Zt.constant[1]:0,Lr=Zt.constant.length>2?Zt.constant[2]:0,Cr=Zt.constant.length>3?Zt.constant[3]:0)):(Pr=_t(Zt.buffer)?dt.createStream(34962,Zt.buffer):dt.getBuffer(Zt.buffer),Dr="type"in Zt?Wt[Zt.type]:Pr.dtype,Ir=!!Zt.normalized,Or=0|Zt.size,Rr=0|Zt.offset,Fr=0|Zt.stride,Br=0|Zt.divisor),Nr=rt.state,rt.state=Sr,jr=rt.x,rt.x=zr,Vr=rt.y,rt.y=Er,Ur=rt.z,rt.z=Lr,Hr=rt.w,rt.w=Cr,qr=rt.buffer,rt.buffer=Pr,Gr=rt.size,rt.size=Or,Wr=rt.normalized,rt.normalized=Ir,Yr=rt.type,rt.type=Dr,Zr=rt.offset,rt.offset=Rr,Xr=rt.stride,rt.stride=Fr,Jr=rt.divisor,rt.divisor=Br,Kr=mt.vert,mt.vert=nt,Qr=mt.frag,mt.frag=it,ft.dirty=!0,r(ct,t,n),ct.viewportWidth=c,ct.viewportHeight=u,qt[0]=f,qt[1]=h,qt[2]=m,qt[3]=y,wt[0]=v,wt[1]=x,wt[2]=_,wt[3]=A,ut.blend_enable=k,Mt[0]=T,Mt[1]=M,Mt[2]=S,Mt[3]=at,ut.depth_enable=ot,ut.stencil_enable=st,lt&&(e.cpuTime+=performance.now()-ht),pt.offset=yt,pt.count=xt,pt.primitive=At,vt[j]=Tt,vt[V]=zt,vt[U]=Lt,vt[H]=Pt,vt[q]=It,vt[G]=Rt,vt[W]=Bt,vt[Y]=jt,vt[Z]=Ut,vt[X]=Gt,vt[J]=Jt,vt[K]=Qt,vt[Q]=te,re&&dt.destroyStream(le),$.state=me,$.x=ge,$.y=ye,$.z=ve,$.w=be,$.buffer=xe,$.size=_e,$.normalized=we,$.type=Ae,$.offset=ke,$.stride=Te,$.divisor=Me,ze&&dt.destroyStream(Ie),tt.state=Ve,tt.x=Ue,tt.y=He,tt.z=qe,tt.w=Ge,tt.buffer=We,tt.size=Ye,tt.normalized=Ze,tt.type=Xe,tt.offset=Je,tt.stride=Ke,tt.divisor=Qe,tr&&dt.destroyStream(or),et.state=hr,et.x=dr,et.y=mr,et.z=gr,et.w=yr,et.buffer=vr,et.size=br,et.normalized=xr,et.type=_r,et.offset=wr,et.stride=Ar,et.divisor=kr,Mr&&dt.destroyStream(Pr),rt.state=Nr,rt.x=jr,rt.y=Vr,rt.z=Ur,rt.w=Hr,rt.buffer=qr,rt.size=Gr,rt.normalized=Wr,rt.type=Yr,rt.offset=Zr,rt.stride=Xr,rt.divisor=Jr,mt.vert=Kr,mt.frag=Qr,ft.dirty=!0},batch:function(t,r){var n,i,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,mt,vt,wt,Mt,qt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr;(xt.angle_instanced_arrays,(n=bt.next)!==bt.cur&&(n?lt.bindFramebuffer(36160,n.framebuffer):lt.bindFramebuffer(36160,null),bt.cur=n),ft.dirty)&&((N=ut.dither)!==ft.dither&&(N?lt.enable(3024):lt.disable(3024),ft.dither=N),j=kt[0],V=kt[1],j===Tt[0]&&V===Tt[1]||(lt.blendEquationSeparate(j,V),Tt[0]=j,Tt[1]=V),(U=ut.depth_func)!==ft.depth_func&&(lt.depthFunc(U),ft.depth_func=U),H=zt[0],q=zt[1],H===Et[0]&&q===Et[1]||(lt.depthRange(H,q),Et[0]=H,Et[1]=q),(G=ut.depth_mask)!==ft.depth_mask&&(lt.depthMask(G),ft.depth_mask=G),W=Lt[0],Y=Lt[1],Z=Lt[2],X=Lt[3],W===Ct[0]&&Y===Ct[1]&&Z===Ct[2]&&X===Ct[3]||(lt.colorMask(W,Y,Z,X),Ct[0]=W,Ct[1]=Y,Ct[2]=Z,Ct[3]=X),(J=ut.cull_enable)!==ft.cull_enable&&(J?lt.enable(2884):lt.disable(2884),ft.cull_enable=J),(K=ut.cull_face)!==ft.cull_face&&(lt.cullFace(K),ft.cull_face=K),(Q=ut.frontFace)!==ft.frontFace&&(lt.frontFace(Q),ft.frontFace=Q),($=ut.lineWidth)!==ft.lineWidth&&(lt.lineWidth($),ft.lineWidth=$),(tt=ut.polygonOffset_enable)!==ft.polygonOffset_enable&&(tt?lt.enable(32823):lt.disable(32823),ft.polygonOffset_enable=tt),et=Pt[0],rt=Pt[1],et===Ot[0]&&rt===Ot[1]||(lt.polygonOffset(et,rt),Ot[0]=et,Ot[1]=rt),(nt=ut.sample_alpha)!==ft.sample_alpha&&(nt?lt.enable(32926):lt.disable(32926),ft.sample_alpha=nt),(it=ut.sample_enable)!==ft.sample_enable&&(it?lt.enable(32928):lt.disable(32928),ft.sample_enable=it),mt=It[0],vt=It[1],mt===Dt[0]&&vt===Dt[1]||(lt.sampleCoverage(mt,vt),Dt[0]=mt,Dt[1]=vt),(wt=ut.stencil_mask)!==ft.stencil_mask&&(lt.stencilMask(wt),ft.stencil_mask=wt),Mt=Rt[0],qt=Rt[1],Xt=Rt[2],Mt===Ft[0]&&qt===Ft[1]&&Xt===Ft[2]||(lt.stencilFunc(Mt,qt,Xt),Ft[0]=Mt,Ft[1]=qt,Ft[2]=Xt),Jt=Bt[0],Kt=Bt[1],Qt=Bt[2],$t=Bt[3],Jt===Nt[0]&&Kt===Nt[1]&&Qt===Nt[2]&&$t===Nt[3]||(lt.stencilOpSeparate(Jt,Kt,Qt,$t),Nt[0]=Jt,Nt[1]=Kt,Nt[2]=Qt,Nt[3]=$t),te=jt[0],ee=jt[1],re=jt[2],ne=jt[3],te===Vt[0]&&ee===Vt[1]&&re===Vt[2]&&ne===Vt[3]||(lt.stencilOpSeparate(te,ee,re,ne),Vt[0]=te,Vt[1]=ee,Vt[2]=re,Vt[3]=ne),(ie=ut.scissor_enable)!==ft.scissor_enable&&(ie?lt.enable(3089):lt.disable(3089),ft.scissor_enable=ie),ae=Ut[0],oe=Ut[1],se=Ut[2],le=Ut[3],ae===Ht[0]&&oe===Ht[1]&&se===Ht[2]&&le===Ht[3]||(lt.scissor(ae,oe,se,le),Ht[0]=ae,Ht[1]=oe,Ht[2]=se,Ht[3]=le));z=0|(i=this.viewport).x,E=0|i.y,L="width"in i?0|i.width:ct.framebufferWidth-z,C="height"in i?0|i.height:ct.framebufferHeight-E,P=ct.viewportWidth,ct.viewportWidth=L,O=ct.viewportHeight,ct.viewportHeight=C,lt.viewport(z,E,L,C),Gt[0]=z,Gt[1]=E,Gt[2]=L,Gt[3]=C,lt.blendColor(0,0,0,1),At[0]=0,At[1]=0,At[2]=0,At[3]=1,at?lt.enable(3042):lt.disable(3042),ft.blend_enable=at,lt.blendFuncSeparate(770,771,773,1),St[0]=770,St[1]=771,St[2]=773,St[3]=1,ot?lt.enable(2929):lt.disable(2929),ft.depth_enable=ot,st?lt.enable(2960):lt.disable(2960),ft.stencil_enable=st,(I=ft.profile)&&(D=performance.now(),e.count+=r),lt.useProgram(a.program),R=xt.angle_instanced_arrays,yt.setVAO(null),ce=this.charBuffer,ue=!1,fe=1,pe=0,he=0,de=0,me=0,ge=null,ye=0,ve=!1,be=5126,xe=0,_e=0,we=0,_t(ce)?(ue=!0,be=(ge=dt.createStream(34962,ce)).dtype):(ge=dt.getBuffer(ce))?be=ge.dtype:"constant"in ce?(fe=2,"number"==typeof ce.constant?(pe=ce.constant,he=de=me=0):(pe=ce.constant.length>0?ce.constant[0]:0,he=ce.constant.length>1?ce.constant[1]:0,de=ce.constant.length>2?ce.constant[2]:0,me=ce.constant.length>3?ce.constant[3]:0)):(ge=_t(ce.buffer)?dt.createStream(34962,ce.buffer):dt.getBuffer(ce.buffer),be="type"in ce?Wt[ce.type]:ge.dtype,ve=!!ce.normalized,ye=0|ce.size,xe=0|ce.offset,_e=0|ce.stride,we=0|ce.divisor),Ae=o.location,ke=gt[Ae],1===fe?(ke.buffer||lt.enableVertexAttribArray(Ae),Te=ye||1,ke.type===be&&ke.size===Te&&ke.buffer===ge&&ke.normalized===ve&&ke.offset===xe&&ke.stride===_e||(lt.bindBuffer(34962,ge.buffer),lt.vertexAttribPointer(Ae,Te,be,ve,_e,xe),ke.type=be,ke.size=Te,ke.buffer=ge,ke.normalized=ve,ke.offset=xe,ke.stride=_e),ke.divisor!==we&&(R.vertexAttribDivisorANGLE(Ae,we),ke.divisor=we)):(ke.buffer&&(lt.disableVertexAttribArray(Ae),ke.buffer=null),ke.x===pe&&ke.y===he&&ke.z===de&&ke.w===me||(lt.vertexAttrib4f(Ae,pe,he,de,me),ke.x=pe,ke.y=he,ke.z=de,ke.w=me)),Me=this.sizeBuffer,Yt.buffer=Me,Se=!1,ze=1,Ee=0,Le=0,Ce=0,Pe=0,Oe=null,Ie=0,De=!1,Re=5126,Fe=0,Be=0,Ne=0,_t(Yt)?(Se=!0,Re=(Oe=dt.createStream(34962,Yt)).dtype):(Oe=dt.getBuffer(Yt))?Re=Oe.dtype:"constant"in Yt?(ze=2,"number"==typeof Yt.constant?(Ee=Yt.constant,Le=Ce=Pe=0):(Ee=Yt.constant.length>0?Yt.constant[0]:0,Le=Yt.constant.length>1?Yt.constant[1]:0,Ce=Yt.constant.length>2?Yt.constant[2]:0,Pe=Yt.constant.length>3?Yt.constant[3]:0)):(Oe=_t(Yt.buffer)?dt.createStream(34962,Yt.buffer):dt.getBuffer(Yt.buffer),Re="type"in Yt?Wt[Yt.type]:Oe.dtype,De=!!Yt.normalized,Ie=0|Yt.size,Fe=0|Yt.offset,Be=0|Yt.stride,Ne=0|Yt.divisor),je=s.location,Ve=gt[je],1===ze?(Ve.buffer||lt.enableVertexAttribArray(je),Ue=Ie||1,Ve.type===Re&&Ve.size===Ue&&Ve.buffer===Oe&&Ve.normalized===De&&Ve.offset===Fe&&Ve.stride===Be||(lt.bindBuffer(34962,Oe.buffer),lt.vertexAttribPointer(je,Ue,Re,De,Be,Fe),Ve.type=Re,Ve.size=Ue,Ve.buffer=Oe,Ve.normalized=De,Ve.offset=Fe,Ve.stride=Be),Ve.divisor!==Ne&&(R.vertexAttribDivisorANGLE(je,Ne),Ve.divisor=Ne)):(Ve.buffer&&(lt.disableVertexAttribArray(je),Ve.buffer=null),Ve.x===Ee&&Ve.y===Le&&Ve.z===Ce&&Ve.w===Pe||(lt.vertexAttrib4f(je,Ee,Le,Ce,Pe),Ve.x=Ee,Ve.y=Le,Ve.z=Ce,Ve.w=Pe)),He=this.position,qe=!1,Ge=1,We=0,Ye=0,Ze=0,Xe=0,Je=null,Ke=0,Qe=!1,$e=5126,tr=0,er=0,rr=0,_t(He)?(qe=!0,$e=(Je=dt.createStream(34962,He)).dtype):(Je=dt.getBuffer(He))?$e=Je.dtype:"constant"in He?(Ge=2,"number"==typeof He.constant?(We=He.constant,Ye=Ze=Xe=0):(We=He.constant.length>0?He.constant[0]:0,Ye=He.constant.length>1?He.constant[1]:0,Ze=He.constant.length>2?He.constant[2]:0,Xe=He.constant.length>3?He.constant[3]:0)):(Je=_t(He.buffer)?dt.createStream(34962,He.buffer):dt.getBuffer(He.buffer),$e="type"in He?Wt[He.type]:Je.dtype,Qe=!!He.normalized,Ke=0|He.size,tr=0|He.offset,er=0|He.stride,rr=0|He.divisor),nr=l.location,ir=gt[nr],1===Ge?(ir.buffer||lt.enableVertexAttribArray(nr),ar=Ke||2,ir.type===$e&&ir.size===ar&&ir.buffer===Je&&ir.normalized===Qe&&ir.offset===tr&&ir.stride===er||(lt.bindBuffer(34962,Je.buffer),lt.vertexAttribPointer(nr,ar,$e,Qe,er,tr),ir.type=$e,ir.size=ar,ir.buffer=Je,ir.normalized=Qe,ir.offset=tr,ir.stride=er),ir.divisor!==rr&&(R.vertexAttribDivisorANGLE(nr,rr),ir.divisor=rr)):(ir.buffer&&(lt.disableVertexAttribArray(nr),ir.buffer=null),ir.x===We&&ir.y===Ye&&ir.z===Ze&&ir.w===Xe||(lt.vertexAttrib4f(nr,We,Ye,Ze,Xe),ir.x=We,ir.y=Ye,ir.z=Ze,ir.w=Xe)),or=this.sizeBuffer,Zt.buffer=or,sr=!1,lr=1,cr=0,ur=0,fr=0,pr=0,hr=null,dr=0,mr=!1,gr=5126,yr=0,vr=0,br=0,_t(Zt)?(sr=!0,gr=(hr=dt.createStream(34962,Zt)).dtype):(hr=dt.getBuffer(Zt))?gr=hr.dtype:"constant"in Zt?(lr=2,"number"==typeof Zt.constant?(cr=Zt.constant,ur=fr=pr=0):(cr=Zt.constant.length>0?Zt.constant[0]:0,ur=Zt.constant.length>1?Zt.constant[1]:0,fr=Zt.constant.length>2?Zt.constant[2]:0,pr=Zt.constant.length>3?Zt.constant[3]:0)):(hr=_t(Zt.buffer)?dt.createStream(34962,Zt.buffer):dt.getBuffer(Zt.buffer),gr="type"in Zt?Wt[Zt.type]:hr.dtype,mr=!!Zt.normalized,dr=0|Zt.size,yr=0|Zt.offset,vr=0|Zt.stride,br=0|Zt.divisor),xr=c.location,_r=gt[xr],1===lr?(_r.buffer||lt.enableVertexAttribArray(xr),wr=dr||1,_r.type===gr&&_r.size===wr&&_r.buffer===hr&&_r.normalized===mr&&_r.offset===yr&&_r.stride===vr||(lt.bindBuffer(34962,hr.buffer),lt.vertexAttribPointer(xr,wr,gr,mr,vr,yr),_r.type=gr,_r.size=wr,_r.buffer=hr,_r.normalized=mr,_r.offset=yr,_r.stride=vr),_r.divisor!==br&&(R.vertexAttribDivisorANGLE(xr,br),_r.divisor=br)):(_r.buffer&&(lt.disableVertexAttribArray(xr),_r.buffer=null),_r.x===cr&&_r.y===ur&&_r.z===fr&&_r.w===pr||(lt.vertexAttrib4f(xr,cr,ur,fr,pr),_r.x=cr,_r.y=ur,_r.z=fr,_r.w=pr)),kr=(Ar=this.scale)[0],Tr=Ar[1],lt.uniform2f(T.location,kr,Tr),Sr=(Mr=this.translate)[0],zr=Mr[1],lt.uniform2f(M.location,Sr,zr),Lr=(Er=this.viewportArray)[0],Cr=Er[1],Pr=Er[2],Or=Er[3],lt.uniform4f(S.location,Lr,Cr,Pr,Or),((Ir=pt.elements)||yt.currentVAO&&(Ir=ht.getElements(yt.currentVAO.elements)))&<.bindBuffer(34963,Ir.buffer.buffer),Dr=pt.instances;for(F=0;F0?Ir?R.drawElementsInstancedANGLE(0,xn,Ir.type,bn<<(Ir.type-5121>>1),Dr):R.drawArraysInstancedANGLE(0,bn,xn,Dr):Dr<0&&(Ir?lt.drawElements(0,xn,Ir.type,bn<<(Ir.type-5121>>1)):lt.drawArrays(0,bn,xn)),Nr.unbind())}ue&&dt.destroyStream(ge),Se&&dt.destroyStream(Oe),qe&&dt.destroyStream(Je),sr&&dt.destroyStream(hr),ft.dirty=!0,yt.setVAO(null),ct.viewportWidth=P,ct.viewportHeight=O,I&&(e.cpuTime+=performance.now()-D)}}}},{}],498:[function(t,e,r){e.exports=function(t,e,r,n){"use strict";var i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F;return i=t.gl,a=t.context,t.strings,o=t.next,s=t.current,t.draw,t.elements,t.buffer,l=t.shader,t.attributes,c=t.vao,t.uniforms,u=t.framebuffer,f=t.extensions,t.timer,t.isBufferArgs,p=o.blend_color,h=s.blend_color,d=o.blend_equation,m=s.blend_equation,g=o.blend_func,y=s.blend_func,v=o.depth_range,b=s.depth_range,x=o.colorMask,_=s.colorMask,w=o.polygonOffset_offset,A=s.polygonOffset_offset,k=o.sample_coverage,T=s.sample_coverage,M=o.stencil_func,S=s.stencil_func,z=o.stencil_opFront,E=s.stencil_opFront,L=o.stencil_opBack,C=s.stencil_opBack,P=o.scissor_box,O=s.scissor_box,I=o.viewport,D=s.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},R={},F={},{draw:function(t){var n,a,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut;(f.angle_instanced_arrays,(n=u.next)!==u.cur&&(n?i.bindFramebuffer(36160,n.framebuffer):i.bindFramebuffer(36160,null),u.cur=n),s.dirty)&&((H=o.dither)!==s.dither&&(H?i.enable(3024):i.disable(3024),s.dither=H),(q=o.blend_enable)!==s.blend_enable&&(q?i.enable(3042):i.disable(3042),s.blend_enable=q),G=p[0],W=p[1],Y=p[2],Z=p[3],G===h[0]&&W===h[1]&&Y===h[2]&&Z===h[3]||(i.blendColor(G,W,Y,Z),h[0]=G,h[1]=W,h[2]=Y,h[3]=Z),X=d[0],J=d[1],X===m[0]&&J===m[1]||(i.blendEquationSeparate(X,J),m[0]=X,m[1]=J),K=g[0],Q=g[1],$=g[2],tt=g[3],K===y[0]&&Q===y[1]&&$===y[2]&&tt===y[3]||(i.blendFuncSeparate(K,Q,$,tt),y[0]=K,y[1]=Q,y[2]=$,y[3]=tt),(et=o.depth_enable)!==s.depth_enable&&(et?i.enable(2929):i.disable(2929),s.depth_enable=et),(rt=o.depth_func)!==s.depth_func&&(i.depthFunc(rt),s.depth_func=rt),nt=v[0],it=v[1],nt===b[0]&&it===b[1]||(i.depthRange(nt,it),b[0]=nt,b[1]=it),(at=o.depth_mask)!==s.depth_mask&&(i.depthMask(at),s.depth_mask=at),ot=x[0],st=x[1],lt=x[2],ct=x[3],ot===_[0]&&st===_[1]&<===_[2]&&ct===_[3]||(i.colorMask(ot,st,lt,ct),_[0]=ot,_[1]=st,_[2]=lt,_[3]=ct),(ut=o.cull_enable)!==s.cull_enable&&(ut?i.enable(2884):i.disable(2884),s.cull_enable=ut),(ft=o.cull_face)!==s.cull_face&&(i.cullFace(ft),s.cull_face=ft),(pt=o.frontFace)!==s.frontFace&&(i.frontFace(pt),s.frontFace=pt),(ht=o.lineWidth)!==s.lineWidth&&(i.lineWidth(ht),s.lineWidth=ht),(dt=o.polygonOffset_enable)!==s.polygonOffset_enable&&(dt?i.enable(32823):i.disable(32823),s.polygonOffset_enable=dt),mt=w[0],gt=w[1],mt===A[0]&>===A[1]||(i.polygonOffset(mt,gt),A[0]=mt,A[1]=gt),(yt=o.sample_alpha)!==s.sample_alpha&&(yt?i.enable(32926):i.disable(32926),s.sample_alpha=yt),(vt=o.sample_enable)!==s.sample_enable&&(vt?i.enable(32928):i.disable(32928),s.sample_enable=vt),bt=k[0],xt=k[1],bt===T[0]&&xt===T[1]||(i.sampleCoverage(bt,xt),T[0]=bt,T[1]=xt),(_t=o.stencil_enable)!==s.stencil_enable&&(_t?i.enable(2960):i.disable(2960),s.stencil_enable=_t),(wt=o.stencil_mask)!==s.stencil_mask&&(i.stencilMask(wt),s.stencil_mask=wt),At=M[0],kt=M[1],Tt=M[2],At===S[0]&&kt===S[1]&&Tt===S[2]||(i.stencilFunc(At,kt,Tt),S[0]=At,S[1]=kt,S[2]=Tt),Mt=z[0],St=z[1],zt=z[2],Et=z[3],Mt===E[0]&&St===E[1]&&zt===E[2]&&Et===E[3]||(i.stencilOpSeparate(Mt,St,zt,Et),E[0]=Mt,E[1]=St,E[2]=zt,E[3]=Et),Lt=L[0],Ct=L[1],Pt=L[2],Ot=L[3],Lt===C[0]&&Ct===C[1]&&Pt===C[2]&&Ot===C[3]||(i.stencilOpSeparate(Lt,Ct,Pt,Ot),C[0]=Lt,C[1]=Ct,C[2]=Pt,C[3]=Ot),(It=o.scissor_enable)!==s.scissor_enable&&(It?i.enable(3089):i.disable(3089),s.scissor_enable=It),Dt=P[0],Rt=P[1],Ft=P[2],Bt=P[3],Dt===O[0]&&Rt===O[1]&&Ft===O[2]&&Bt===O[3]||(i.scissor(Dt,Rt,Ft,Bt),O[0]=Dt,O[1]=Rt,O[2]=Ft,O[3]=Bt),Nt=I[0],jt=I[1],Vt=I[2],Ut=I[3],Nt===D[0]&&jt===D[1]&&Vt===D[2]&&Ut===D[3]||(i.viewport(Nt,jt,Vt,Ut),D[0]=Nt,D[1]=jt,D[2]=Vt,D[3]=Ut),s.dirty=!1);(a=s.profile)&&(F=performance.now(),e.count++),B=l.frag,N=l.vert,j=l.program(N,B),i.useProgram(j.program),c.setVAO(null),V=j.id,(U=R[V])?U.call(this,t):(U=R[V]=r(j)).call(this,t),c.setVAO(null),a&&(e.cpuTime+=performance.now()-F)},scope:function(t,r,n){var i,o;(i=s.profile)&&(o=performance.now(),e.count++),r(a,t,n),i&&(e.cpuTime+=performance.now()-o)},batch:function(t,r){var a,R,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht;(f.angle_instanced_arrays,(a=u.next)!==u.cur&&(a?i.bindFramebuffer(36160,a.framebuffer):i.bindFramebuffer(36160,null),u.cur=a),s.dirty)&&((q=o.dither)!==s.dither&&(q?i.enable(3024):i.disable(3024),s.dither=q),(G=o.blend_enable)!==s.blend_enable&&(G?i.enable(3042):i.disable(3042),s.blend_enable=G),W=p[0],Y=p[1],Z=p[2],X=p[3],W===h[0]&&Y===h[1]&&Z===h[2]&&X===h[3]||(i.blendColor(W,Y,Z,X),h[0]=W,h[1]=Y,h[2]=Z,h[3]=X),J=d[0],K=d[1],J===m[0]&&K===m[1]||(i.blendEquationSeparate(J,K),m[0]=J,m[1]=K),Q=g[0],$=g[1],tt=g[2],et=g[3],Q===y[0]&&$===y[1]&&tt===y[2]&&et===y[3]||(i.blendFuncSeparate(Q,$,tt,et),y[0]=Q,y[1]=$,y[2]=tt,y[3]=et),(rt=o.depth_enable)!==s.depth_enable&&(rt?i.enable(2929):i.disable(2929),s.depth_enable=rt),(nt=o.depth_func)!==s.depth_func&&(i.depthFunc(nt),s.depth_func=nt),it=v[0],at=v[1],it===b[0]&&at===b[1]||(i.depthRange(it,at),b[0]=it,b[1]=at),(ot=o.depth_mask)!==s.depth_mask&&(i.depthMask(ot),s.depth_mask=ot),st=x[0],lt=x[1],ct=x[2],ut=x[3],st===_[0]&<===_[1]&&ct===_[2]&&ut===_[3]||(i.colorMask(st,lt,ct,ut),_[0]=st,_[1]=lt,_[2]=ct,_[3]=ut),(ft=o.cull_enable)!==s.cull_enable&&(ft?i.enable(2884):i.disable(2884),s.cull_enable=ft),(pt=o.cull_face)!==s.cull_face&&(i.cullFace(pt),s.cull_face=pt),(ht=o.frontFace)!==s.frontFace&&(i.frontFace(ht),s.frontFace=ht),(dt=o.lineWidth)!==s.lineWidth&&(i.lineWidth(dt),s.lineWidth=dt),(mt=o.polygonOffset_enable)!==s.polygonOffset_enable&&(mt?i.enable(32823):i.disable(32823),s.polygonOffset_enable=mt),gt=w[0],yt=w[1],gt===A[0]&&yt===A[1]||(i.polygonOffset(gt,yt),A[0]=gt,A[1]=yt),(vt=o.sample_alpha)!==s.sample_alpha&&(vt?i.enable(32926):i.disable(32926),s.sample_alpha=vt),(bt=o.sample_enable)!==s.sample_enable&&(bt?i.enable(32928):i.disable(32928),s.sample_enable=bt),xt=k[0],_t=k[1],xt===T[0]&&_t===T[1]||(i.sampleCoverage(xt,_t),T[0]=xt,T[1]=_t),(wt=o.stencil_enable)!==s.stencil_enable&&(wt?i.enable(2960):i.disable(2960),s.stencil_enable=wt),(At=o.stencil_mask)!==s.stencil_mask&&(i.stencilMask(At),s.stencil_mask=At),kt=M[0],Tt=M[1],Mt=M[2],kt===S[0]&&Tt===S[1]&&Mt===S[2]||(i.stencilFunc(kt,Tt,Mt),S[0]=kt,S[1]=Tt,S[2]=Mt),St=z[0],zt=z[1],Et=z[2],Lt=z[3],St===E[0]&&zt===E[1]&&Et===E[2]&&Lt===E[3]||(i.stencilOpSeparate(St,zt,Et,Lt),E[0]=St,E[1]=zt,E[2]=Et,E[3]=Lt),Ct=L[0],Pt=L[1],Ot=L[2],It=L[3],Ct===C[0]&&Pt===C[1]&&Ot===C[2]&&It===C[3]||(i.stencilOpSeparate(Ct,Pt,Ot,It),C[0]=Ct,C[1]=Pt,C[2]=Ot,C[3]=It),(Dt=o.scissor_enable)!==s.scissor_enable&&(Dt?i.enable(3089):i.disable(3089),s.scissor_enable=Dt),Rt=P[0],Ft=P[1],Bt=P[2],Nt=P[3],Rt===O[0]&&Ft===O[1]&&Bt===O[2]&&Nt===O[3]||(i.scissor(Rt,Ft,Bt,Nt),O[0]=Rt,O[1]=Ft,O[2]=Bt,O[3]=Nt),jt=I[0],Vt=I[1],Ut=I[2],Ht=I[3],jt===D[0]&&Vt===D[1]&&Ut===D[2]&&Ht===D[3]||(i.viewport(jt,Vt,Ut,Ht),D[0]=jt,D[1]=Vt,D[2]=Ut,D[3]=Ht),s.dirty=!1);(R=s.profile)&&(B=performance.now(),e.count+=r),N=l.frag,j=l.vert,V=l.program(j,N),i.useProgram(V.program),c.setVAO(null),U=V.id,(H=F[U])?H.call(this,t,r):(H=F[U]=n(V)).call(this,t,r),c.setVAO(null),R&&(e.cpuTime+=performance.now()-B)}}}},{}],499:[function(t,e,r){e.exports=function(t,e,r,n){"use strict";var i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R;return i=t.gl,a=t.context,t.strings,o=t.next,s=t.current,t.draw,t.elements,t.buffer,l=t.shader,t.attributes,c=t.vao,t.uniforms,u=t.framebuffer,t.extensions,t.timer,t.isBufferArgs,f=o.blend_color,p=s.blend_color,h=o.blend_equation,d=s.blend_equation,m=o.blend_func,g=s.blend_func,y=o.depth_range,v=s.depth_range,b=o.colorMask,x=s.colorMask,_=o.polygonOffset_offset,w=s.polygonOffset_offset,A=o.sample_coverage,k=s.sample_coverage,T=o.stencil_func,M=s.stencil_func,S=o.stencil_opFront,z=s.stencil_opFront,E=o.stencil_opBack,L=s.stencil_opBack,C=o.scissor_box,P=s.scissor_box,O=o.viewport,I=s.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},D={},R={},{draw:function(t){var n,a,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt;((n=u.next)!==u.cur&&(n?i.bindFramebuffer(36160,n.framebuffer):i.bindFramebuffer(36160,null),u.cur=n),s.dirty)&&((U=o.dither)!==s.dither&&(U?i.enable(3024):i.disable(3024),s.dither=U),(H=o.blend_enable)!==s.blend_enable&&(H?i.enable(3042):i.disable(3042),s.blend_enable=H),q=f[0],G=f[1],W=f[2],Y=f[3],q===p[0]&&G===p[1]&&W===p[2]&&Y===p[3]||(i.blendColor(q,G,W,Y),p[0]=q,p[1]=G,p[2]=W,p[3]=Y),Z=h[0],X=h[1],Z===d[0]&&X===d[1]||(i.blendEquationSeparate(Z,X),d[0]=Z,d[1]=X),J=m[0],K=m[1],Q=m[2],$=m[3],J===g[0]&&K===g[1]&&Q===g[2]&&$===g[3]||(i.blendFuncSeparate(J,K,Q,$),g[0]=J,g[1]=K,g[2]=Q,g[3]=$),(tt=o.depth_enable)!==s.depth_enable&&(tt?i.enable(2929):i.disable(2929),s.depth_enable=tt),(et=o.depth_func)!==s.depth_func&&(i.depthFunc(et),s.depth_func=et),rt=y[0],nt=y[1],rt===v[0]&&nt===v[1]||(i.depthRange(rt,nt),v[0]=rt,v[1]=nt),(it=o.depth_mask)!==s.depth_mask&&(i.depthMask(it),s.depth_mask=it),at=b[0],ot=b[1],st=b[2],lt=b[3],at===x[0]&&ot===x[1]&&st===x[2]&<===x[3]||(i.colorMask(at,ot,st,lt),x[0]=at,x[1]=ot,x[2]=st,x[3]=lt),(ct=o.cull_enable)!==s.cull_enable&&(ct?i.enable(2884):i.disable(2884),s.cull_enable=ct),(ut=o.cull_face)!==s.cull_face&&(i.cullFace(ut),s.cull_face=ut),(ft=o.frontFace)!==s.frontFace&&(i.frontFace(ft),s.frontFace=ft),(pt=o.lineWidth)!==s.lineWidth&&(i.lineWidth(pt),s.lineWidth=pt),(ht=o.polygonOffset_enable)!==s.polygonOffset_enable&&(ht?i.enable(32823):i.disable(32823),s.polygonOffset_enable=ht),dt=_[0],mt=_[1],dt===w[0]&&mt===w[1]||(i.polygonOffset(dt,mt),w[0]=dt,w[1]=mt),(gt=o.sample_alpha)!==s.sample_alpha&&(gt?i.enable(32926):i.disable(32926),s.sample_alpha=gt),(yt=o.sample_enable)!==s.sample_enable&&(yt?i.enable(32928):i.disable(32928),s.sample_enable=yt),vt=A[0],bt=A[1],vt===k[0]&&bt===k[1]||(i.sampleCoverage(vt,bt),k[0]=vt,k[1]=bt),(xt=o.stencil_enable)!==s.stencil_enable&&(xt?i.enable(2960):i.disable(2960),s.stencil_enable=xt),(_t=o.stencil_mask)!==s.stencil_mask&&(i.stencilMask(_t),s.stencil_mask=_t),wt=T[0],At=T[1],kt=T[2],wt===M[0]&&At===M[1]&&kt===M[2]||(i.stencilFunc(wt,At,kt),M[0]=wt,M[1]=At,M[2]=kt),Tt=S[0],Mt=S[1],St=S[2],zt=S[3],Tt===z[0]&&Mt===z[1]&&St===z[2]&&zt===z[3]||(i.stencilOpSeparate(Tt,Mt,St,zt),z[0]=Tt,z[1]=Mt,z[2]=St,z[3]=zt),Et=E[0],Lt=E[1],Ct=E[2],Pt=E[3],Et===L[0]&&Lt===L[1]&&Ct===L[2]&&Pt===L[3]||(i.stencilOpSeparate(Et,Lt,Ct,Pt),L[0]=Et,L[1]=Lt,L[2]=Ct,L[3]=Pt),(Ot=o.scissor_enable)!==s.scissor_enable&&(Ot?i.enable(3089):i.disable(3089),s.scissor_enable=Ot),It=C[0],Dt=C[1],Rt=C[2],Ft=C[3],It===P[0]&&Dt===P[1]&&Rt===P[2]&&Ft===P[3]||(i.scissor(It,Dt,Rt,Ft),P[0]=It,P[1]=Dt,P[2]=Rt,P[3]=Ft),Bt=O[0],Nt=O[1],jt=O[2],Vt=O[3],Bt===I[0]&&Nt===I[1]&&jt===I[2]&&Vt===I[3]||(i.viewport(Bt,Nt,jt,Vt),I[0]=Bt,I[1]=Nt,I[2]=jt,I[3]=Vt),s.dirty=!1);(a=s.profile)&&(R=performance.now(),e.count++),F=l.frag,B=l.vert,N=l.program(B,F),i.useProgram(N.program),c.setVAO(null),j=N.id,(V=D[j])?V.call(this,t):(V=D[j]=r(N)).call(this,t),c.setVAO(null),a&&(e.cpuTime+=performance.now()-R)},scope:function(t,r,n){var i,o;(i=s.profile)&&(o=performance.now(),e.count++),r(a,t,n),i&&(e.cpuTime+=performance.now()-o)},batch:function(t,r){var a,D,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut;((a=u.next)!==u.cur&&(a?i.bindFramebuffer(36160,a.framebuffer):i.bindFramebuffer(36160,null),u.cur=a),s.dirty)&&((H=o.dither)!==s.dither&&(H?i.enable(3024):i.disable(3024),s.dither=H),(q=o.blend_enable)!==s.blend_enable&&(q?i.enable(3042):i.disable(3042),s.blend_enable=q),G=f[0],W=f[1],Y=f[2],Z=f[3],G===p[0]&&W===p[1]&&Y===p[2]&&Z===p[3]||(i.blendColor(G,W,Y,Z),p[0]=G,p[1]=W,p[2]=Y,p[3]=Z),X=h[0],J=h[1],X===d[0]&&J===d[1]||(i.blendEquationSeparate(X,J),d[0]=X,d[1]=J),K=m[0],Q=m[1],$=m[2],tt=m[3],K===g[0]&&Q===g[1]&&$===g[2]&&tt===g[3]||(i.blendFuncSeparate(K,Q,$,tt),g[0]=K,g[1]=Q,g[2]=$,g[3]=tt),(et=o.depth_enable)!==s.depth_enable&&(et?i.enable(2929):i.disable(2929),s.depth_enable=et),(rt=o.depth_func)!==s.depth_func&&(i.depthFunc(rt),s.depth_func=rt),nt=y[0],it=y[1],nt===v[0]&&it===v[1]||(i.depthRange(nt,it),v[0]=nt,v[1]=it),(at=o.depth_mask)!==s.depth_mask&&(i.depthMask(at),s.depth_mask=at),ot=b[0],st=b[1],lt=b[2],ct=b[3],ot===x[0]&&st===x[1]&<===x[2]&&ct===x[3]||(i.colorMask(ot,st,lt,ct),x[0]=ot,x[1]=st,x[2]=lt,x[3]=ct),(ut=o.cull_enable)!==s.cull_enable&&(ut?i.enable(2884):i.disable(2884),s.cull_enable=ut),(ft=o.cull_face)!==s.cull_face&&(i.cullFace(ft),s.cull_face=ft),(pt=o.frontFace)!==s.frontFace&&(i.frontFace(pt),s.frontFace=pt),(ht=o.lineWidth)!==s.lineWidth&&(i.lineWidth(ht),s.lineWidth=ht),(dt=o.polygonOffset_enable)!==s.polygonOffset_enable&&(dt?i.enable(32823):i.disable(32823),s.polygonOffset_enable=dt),mt=_[0],gt=_[1],mt===w[0]&>===w[1]||(i.polygonOffset(mt,gt),w[0]=mt,w[1]=gt),(yt=o.sample_alpha)!==s.sample_alpha&&(yt?i.enable(32926):i.disable(32926),s.sample_alpha=yt),(vt=o.sample_enable)!==s.sample_enable&&(vt?i.enable(32928):i.disable(32928),s.sample_enable=vt),bt=A[0],xt=A[1],bt===k[0]&&xt===k[1]||(i.sampleCoverage(bt,xt),k[0]=bt,k[1]=xt),(_t=o.stencil_enable)!==s.stencil_enable&&(_t?i.enable(2960):i.disable(2960),s.stencil_enable=_t),(wt=o.stencil_mask)!==s.stencil_mask&&(i.stencilMask(wt),s.stencil_mask=wt),At=T[0],kt=T[1],Tt=T[2],At===M[0]&&kt===M[1]&&Tt===M[2]||(i.stencilFunc(At,kt,Tt),M[0]=At,M[1]=kt,M[2]=Tt),Mt=S[0],St=S[1],zt=S[2],Et=S[3],Mt===z[0]&&St===z[1]&&zt===z[2]&&Et===z[3]||(i.stencilOpSeparate(Mt,St,zt,Et),z[0]=Mt,z[1]=St,z[2]=zt,z[3]=Et),Lt=E[0],Ct=E[1],Pt=E[2],Ot=E[3],Lt===L[0]&&Ct===L[1]&&Pt===L[2]&&Ot===L[3]||(i.stencilOpSeparate(Lt,Ct,Pt,Ot),L[0]=Lt,L[1]=Ct,L[2]=Pt,L[3]=Ot),(It=o.scissor_enable)!==s.scissor_enable&&(It?i.enable(3089):i.disable(3089),s.scissor_enable=It),Dt=C[0],Rt=C[1],Ft=C[2],Bt=C[3],Dt===P[0]&&Rt===P[1]&&Ft===P[2]&&Bt===P[3]||(i.scissor(Dt,Rt,Ft,Bt),P[0]=Dt,P[1]=Rt,P[2]=Ft,P[3]=Bt),Nt=O[0],jt=O[1],Vt=O[2],Ut=O[3],Nt===I[0]&&jt===I[1]&&Vt===I[2]&&Ut===I[3]||(i.viewport(Nt,jt,Vt,Ut),I[0]=Nt,I[1]=jt,I[2]=Vt,I[3]=Ut),s.dirty=!1);(D=s.profile)&&(F=performance.now(),e.count+=r),B=l.frag,N=l.vert,j=l.program(N,B),i.useProgram(j.program),c.setVAO(null),V=j.id,(U=R[V])?U.call(this,t,r):(U=R[V]=n(j)).call(this,t,r),c.setVAO(null),D&&(e.cpuTime+=performance.now()-F)}}}},{}],500:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt){"use strict";var _t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae;return _t=t.gl,wt=t.context,t.strings,At=t.next,kt=t.current,Tt=t.draw,Mt=t.elements,St=t.buffer,zt=t.shader,Et=t.attributes,Lt=t.vao,Ct=t.uniforms,Pt=t.framebuffer,Ot=t.extensions,t.timer,It=t.isBufferArgs,Dt=At.blend_color,Rt=kt.blend_color,Ft=At.blend_equation,Bt=kt.blend_equation,Nt=At.blend_func,jt=kt.blend_func,Vt=At.depth_range,Ut=kt.depth_range,Ht=At.colorMask,qt=kt.colorMask,Gt=At.polygonOffset_offset,Wt=kt.polygonOffset_offset,Yt=At.sample_coverage,Zt=kt.sample_coverage,Xt=At.stencil_func,Jt=kt.stencil_func,Kt=At.stencil_opFront,Qt=kt.stencil_opFront,$t=At.stencil_opBack,te=kt.stencil_opBack,ee=At.scissor_box,re=kt.scissor_box,ne=At.viewport,ie=kt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ae={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},{draw:function(t){var R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,zt,Ct,Dt,Nt,ee,ne,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti;(Ot.angle_instanced_arrays,(R=Pt.next)!==Pt.cur&&(R?_t.bindFramebuffer(36160,R.framebuffer):_t.bindFramebuffer(36160,null),Pt.cur=R),kt.dirty)&&((Wn=At.dither)!==kt.dither&&(Wn?_t.enable(3024):_t.disable(3024),kt.dither=Wn),Yn=Ft[0],Zn=Ft[1],Yn===Bt[0]&&Zn===Bt[1]||(_t.blendEquationSeparate(Yn,Zn),Bt[0]=Yn,Bt[1]=Zn),(Xn=At.depth_func)!==kt.depth_func&&(_t.depthFunc(Xn),kt.depth_func=Xn),Jn=Vt[0],Kn=Vt[1],Jn===Ut[0]&&Kn===Ut[1]||(_t.depthRange(Jn,Kn),Ut[0]=Jn,Ut[1]=Kn),(Qn=At.depth_mask)!==kt.depth_mask&&(_t.depthMask(Qn),kt.depth_mask=Qn),$n=Ht[0],ti=Ht[1],ei=Ht[2],ri=Ht[3],$n===qt[0]&&ti===qt[1]&&ei===qt[2]&&ri===qt[3]||(_t.colorMask($n,ti,ei,ri),qt[0]=$n,qt[1]=ti,qt[2]=ei,qt[3]=ri),(ni=At.cull_enable)!==kt.cull_enable&&(ni?_t.enable(2884):_t.disable(2884),kt.cull_enable=ni),(ii=At.cull_face)!==kt.cull_face&&(_t.cullFace(ii),kt.cull_face=ii),(ai=At.frontFace)!==kt.frontFace&&(_t.frontFace(ai),kt.frontFace=ai),(oi=At.lineWidth)!==kt.lineWidth&&(_t.lineWidth(oi),kt.lineWidth=oi),(si=At.polygonOffset_enable)!==kt.polygonOffset_enable&&(si?_t.enable(32823):_t.disable(32823),kt.polygonOffset_enable=si),li=Gt[0],ci=Gt[1],li===Wt[0]&&ci===Wt[1]||(_t.polygonOffset(li,ci),Wt[0]=li,Wt[1]=ci),(ui=At.sample_alpha)!==kt.sample_alpha&&(ui?_t.enable(32926):_t.disable(32926),kt.sample_alpha=ui),(fi=At.sample_enable)!==kt.sample_enable&&(fi?_t.enable(32928):_t.disable(32928),kt.sample_enable=fi),pi=Yt[0],hi=Yt[1],pi===Zt[0]&&hi===Zt[1]||(_t.sampleCoverage(pi,hi),Zt[0]=pi,Zt[1]=hi),(di=At.stencil_mask)!==kt.stencil_mask&&(_t.stencilMask(di),kt.stencil_mask=di),mi=Xt[0],gi=Xt[1],yi=Xt[2],mi===Jt[0]&&gi===Jt[1]&&yi===Jt[2]||(_t.stencilFunc(mi,gi,yi),Jt[0]=mi,Jt[1]=gi,Jt[2]=yi),vi=Kt[0],bi=Kt[1],xi=Kt[2],_i=Kt[3],vi===Qt[0]&&bi===Qt[1]&&xi===Qt[2]&&_i===Qt[3]||(_t.stencilOpSeparate(vi,bi,xi,_i),Qt[0]=vi,Qt[1]=bi,Qt[2]=xi,Qt[3]=_i),wi=$t[0],Ai=$t[1],ki=$t[2],Ti=$t[3],wi===te[0]&&Ai===te[1]&&ki===te[2]&&Ti===te[3]||(_t.stencilOpSeparate(wi,Ai,ki,Ti),te[0]=wi,te[1]=Ai,te[2]=ki,te[3]=Ti));B=0|(F=t.viewport).x,N=0|F.y,j="width"in F?0|F.width:wt.framebufferWidth-B,V="height"in F?0|F.height:wt.framebufferHeight-N,U=wt.viewportWidth,wt.viewportWidth=j,H=wt.viewportHeight,wt.viewportHeight=V,_t.viewport(B,N,j,V),ie[0]=B,ie[1]=N,ie[2]=j,ie[3]=V,_t.blendColor(0,0,0,1),Rt[0]=0,Rt[1]=0,Rt[2]=0,Rt[3]=1,r?_t.enable(3042):_t.disable(3042),kt.blend_enable=r,_t.blendFuncSeparate(770,771,773,1),jt[0]=770,jt[1]=771,jt[2]=773,jt[3]=1,n?_t.enable(2929):_t.disable(2929),kt.depth_enable=n,G=0|(q=t.viewport).x,W=0|q.y,Y="width"in q?0|q.width:wt.framebufferWidth-G,Z="height"in q?0|q.height:wt.framebufferHeight-W,_t.scissor(G,W,Y,Z),re[0]=G,re[1]=W,re[2]=Y,re[3]=Z,i?_t.enable(3089):_t.disable(3089),kt.scissor_enable=i,a?_t.enable(2960):_t.disable(2960),kt.stencil_enable=a,(X=kt.profile)&&(J=performance.now(),e.count++),_t.useProgram(o.program),K=Ot.angle_instanced_arrays,Lt.setVAO(null),Q=s.call(this,wt,t,0),$=!1,tt=1,et=0,rt=0,nt=0,it=0,at=null,ot=0,st=!1,lt=5126,ct=0,ut=0,ft=0,It(Q)?($=!0,lt=(at=St.createStream(34962,Q)).dtype):(at=St.getBuffer(Q))?lt=at.dtype:"constant"in Q?(tt=2,"number"==typeof Q.constant?(et=Q.constant,rt=nt=it=0):(et=Q.constant.length>0?Q.constant[0]:0,rt=Q.constant.length>1?Q.constant[1]:0,nt=Q.constant.length>2?Q.constant[2]:0,it=Q.constant.length>3?Q.constant[3]:0)):(at=It(Q.buffer)?St.createStream(34962,Q.buffer):St.getBuffer(Q.buffer),lt="type"in Q?ae[Q.type]:at.dtype,st=!!Q.normalized,ot=0|Q.size,ct=0|Q.offset,ut=0|Q.stride,ft=0|Q.divisor),pt=l.location,ht=Et[pt],1===tt?(ht.buffer||_t.enableVertexAttribArray(pt),dt=ot||4,ht.type===lt&&ht.size===dt&&ht.buffer===at&&ht.normalized===st&&ht.offset===ct&&ht.stride===ut||(_t.bindBuffer(34962,at.buffer),_t.vertexAttribPointer(pt,dt,lt,st,ut,ct),ht.type=lt,ht.size=dt,ht.buffer=at,ht.normalized=st,ht.offset=ct,ht.stride=ut),ht.divisor!==ft&&(K.vertexAttribDivisorANGLE(pt,ft),ht.divisor=ft)):(ht.buffer&&(_t.disableVertexAttribArray(pt),ht.buffer=null),ht.x===et&&ht.y===rt&&ht.z===nt&&ht.w===it||(_t.vertexAttrib4f(pt,et,rt,nt,it),ht.x=et,ht.y=rt,ht.z=nt,ht.w=it)),mt=c.call(this,wt,t,0),gt=!1,yt=1,vt=0,bt=0,xt=0,zt=0,Ct=null,Dt=0,Nt=!1,ee=5126,ne=0,oe=0,se=0,It(mt)?(gt=!0,ee=(Ct=St.createStream(34962,mt)).dtype):(Ct=St.getBuffer(mt))?ee=Ct.dtype:"constant"in mt?(yt=2,"number"==typeof mt.constant?(vt=mt.constant,bt=xt=zt=0):(vt=mt.constant.length>0?mt.constant[0]:0,bt=mt.constant.length>1?mt.constant[1]:0,xt=mt.constant.length>2?mt.constant[2]:0,zt=mt.constant.length>3?mt.constant[3]:0)):(Ct=It(mt.buffer)?St.createStream(34962,mt.buffer):St.getBuffer(mt.buffer),ee="type"in mt?ae[mt.type]:Ct.dtype,Nt=!!mt.normalized,Dt=0|mt.size,ne=0|mt.offset,oe=0|mt.stride,se=0|mt.divisor),le=u.location,ce=Et[le],1===yt?(ce.buffer||_t.enableVertexAttribArray(le),ue=Dt||1,ce.type===ee&&ce.size===ue&&ce.buffer===Ct&&ce.normalized===Nt&&ce.offset===ne&&ce.stride===oe||(_t.bindBuffer(34962,Ct.buffer),_t.vertexAttribPointer(le,ue,ee,Nt,oe,ne),ce.type=ee,ce.size=ue,ce.buffer=Ct,ce.normalized=Nt,ce.offset=ne,ce.stride=oe),ce.divisor!==se&&(K.vertexAttribDivisorANGLE(le,se),ce.divisor=se)):(ce.buffer&&(_t.disableVertexAttribArray(le),ce.buffer=null),ce.x===vt&&ce.y===bt&&ce.z===xt&&ce.w===zt||(_t.vertexAttrib4f(le,vt,bt,xt,zt),ce.x=vt,ce.y=bt,ce.z=xt,ce.w=zt)),fe=f.call(this,wt,t,0),pe=!1,he=1,de=0,me=0,ge=0,ye=0,ve=null,be=0,xe=!1,_e=5126,we=0,Ae=0,ke=0,It(fe)?(pe=!0,_e=(ve=St.createStream(34962,fe)).dtype):(ve=St.getBuffer(fe))?_e=ve.dtype:"constant"in fe?(he=2,"number"==typeof fe.constant?(de=fe.constant,me=ge=ye=0):(de=fe.constant.length>0?fe.constant[0]:0,me=fe.constant.length>1?fe.constant[1]:0,ge=fe.constant.length>2?fe.constant[2]:0,ye=fe.constant.length>3?fe.constant[3]:0)):(ve=It(fe.buffer)?St.createStream(34962,fe.buffer):St.getBuffer(fe.buffer),_e="type"in fe?ae[fe.type]:ve.dtype,xe=!!fe.normalized,be=0|fe.size,we=0|fe.offset,Ae=0|fe.stride,ke=0|fe.divisor),Te=p.location,Me=Et[Te],1===he?(Me.buffer||_t.enableVertexAttribArray(Te),Se=be||4,Me.type===_e&&Me.size===Se&&Me.buffer===ve&&Me.normalized===xe&&Me.offset===we&&Me.stride===Ae||(_t.bindBuffer(34962,ve.buffer),_t.vertexAttribPointer(Te,Se,_e,xe,Ae,we),Me.type=_e,Me.size=Se,Me.buffer=ve,Me.normalized=xe,Me.offset=we,Me.stride=Ae),Me.divisor!==ke&&(K.vertexAttribDivisorANGLE(Te,ke),Me.divisor=ke)):(Me.buffer&&(_t.disableVertexAttribArray(Te),Me.buffer=null),Me.x===de&&Me.y===me&&Me.z===ge&&Me.w===ye||(_t.vertexAttrib4f(Te,de,me,ge,ye),Me.x=de,Me.y=me,Me.z=ge,Me.w=ye)),ze=h.call(this,wt,t,0),Ee=!1,Le=1,Ce=0,Pe=0,Oe=0,Ie=0,De=null,Re=0,Fe=!1,Be=5126,Ne=0,je=0,Ve=0,It(ze)?(Ee=!0,Be=(De=St.createStream(34962,ze)).dtype):(De=St.getBuffer(ze))?Be=De.dtype:"constant"in ze?(Le=2,"number"==typeof ze.constant?(Ce=ze.constant,Pe=Oe=Ie=0):(Ce=ze.constant.length>0?ze.constant[0]:0,Pe=ze.constant.length>1?ze.constant[1]:0,Oe=ze.constant.length>2?ze.constant[2]:0,Ie=ze.constant.length>3?ze.constant[3]:0)):(De=It(ze.buffer)?St.createStream(34962,ze.buffer):St.getBuffer(ze.buffer),Be="type"in ze?ae[ze.type]:De.dtype,Fe=!!ze.normalized,Re=0|ze.size,Ne=0|ze.offset,je=0|ze.stride,Ve=0|ze.divisor),Ue=d.location,He=Et[Ue],1===Le?(He.buffer||_t.enableVertexAttribArray(Ue),qe=Re||1,He.type===Be&&He.size===qe&&He.buffer===De&&He.normalized===Fe&&He.offset===Ne&&He.stride===je||(_t.bindBuffer(34962,De.buffer),_t.vertexAttribPointer(Ue,qe,Be,Fe,je,Ne),He.type=Be,He.size=qe,He.buffer=De,He.normalized=Fe,He.offset=Ne,He.stride=je),He.divisor!==Ve&&(K.vertexAttribDivisorANGLE(Ue,Ve),He.divisor=Ve)):(He.buffer&&(_t.disableVertexAttribArray(Ue),He.buffer=null),He.x===Ce&&He.y===Pe&&He.z===Oe&&He.w===Ie||(_t.vertexAttrib4f(Ue,Ce,Pe,Oe,Ie),He.x=Ce,He.y=Pe,He.z=Oe,He.w=Ie)),Ge=m.call(this,wt,t,0),We=!1,Ye=1,Ze=0,Xe=0,Je=0,Ke=0,Qe=null,$e=0,tr=!1,er=5126,rr=0,nr=0,ir=0,It(Ge)?(We=!0,er=(Qe=St.createStream(34962,Ge)).dtype):(Qe=St.getBuffer(Ge))?er=Qe.dtype:"constant"in Ge?(Ye=2,"number"==typeof Ge.constant?(Ze=Ge.constant,Xe=Je=Ke=0):(Ze=Ge.constant.length>0?Ge.constant[0]:0,Xe=Ge.constant.length>1?Ge.constant[1]:0,Je=Ge.constant.length>2?Ge.constant[2]:0,Ke=Ge.constant.length>3?Ge.constant[3]:0)):(Qe=It(Ge.buffer)?St.createStream(34962,Ge.buffer):St.getBuffer(Ge.buffer),er="type"in Ge?ae[Ge.type]:Qe.dtype,tr=!!Ge.normalized,$e=0|Ge.size,rr=0|Ge.offset,nr=0|Ge.stride,ir=0|Ge.divisor),ar=g.location,or=Et[ar],1===Ye?(or.buffer||_t.enableVertexAttribArray(ar),sr=$e||1,or.type===er&&or.size===sr&&or.buffer===Qe&&or.normalized===tr&&or.offset===rr&&or.stride===nr||(_t.bindBuffer(34962,Qe.buffer),_t.vertexAttribPointer(ar,sr,er,tr,nr,rr),or.type=er,or.size=sr,or.buffer=Qe,or.normalized=tr,or.offset=rr,or.stride=nr),or.divisor!==ir&&(K.vertexAttribDivisorANGLE(ar,ir),or.divisor=ir)):(or.buffer&&(_t.disableVertexAttribArray(ar),or.buffer=null),or.x===Ze&&or.y===Xe&&or.z===Je&&or.w===Ke||(_t.vertexAttrib4f(ar,Ze,Xe,Je,Ke),or.x=Ze,or.y=Xe,or.z=Je,or.w=Ke)),lr=y.call(this,wt,t,0),cr=!1,ur=1,fr=0,pr=0,hr=0,dr=0,mr=null,gr=0,yr=!1,vr=5126,br=0,xr=0,_r=0,It(lr)?(cr=!0,vr=(mr=St.createStream(34962,lr)).dtype):(mr=St.getBuffer(lr))?vr=mr.dtype:"constant"in lr?(ur=2,"number"==typeof lr.constant?(fr=lr.constant,pr=hr=dr=0):(fr=lr.constant.length>0?lr.constant[0]:0,pr=lr.constant.length>1?lr.constant[1]:0,hr=lr.constant.length>2?lr.constant[2]:0,dr=lr.constant.length>3?lr.constant[3]:0)):(mr=It(lr.buffer)?St.createStream(34962,lr.buffer):St.getBuffer(lr.buffer),vr="type"in lr?ae[lr.type]:mr.dtype,yr=!!lr.normalized,gr=0|lr.size,br=0|lr.offset,xr=0|lr.stride,_r=0|lr.divisor),wr=v.location,Ar=Et[wr],1===ur?(Ar.buffer||_t.enableVertexAttribArray(wr),kr=gr||1,Ar.type===vr&&Ar.size===kr&&Ar.buffer===mr&&Ar.normalized===yr&&Ar.offset===br&&Ar.stride===xr||(_t.bindBuffer(34962,mr.buffer),_t.vertexAttribPointer(wr,kr,vr,yr,xr,br),Ar.type=vr,Ar.size=kr,Ar.buffer=mr,Ar.normalized=yr,Ar.offset=br,Ar.stride=xr),Ar.divisor!==_r&&(K.vertexAttribDivisorANGLE(wr,_r),Ar.divisor=_r)):(Ar.buffer&&(_t.disableVertexAttribArray(wr),Ar.buffer=null),Ar.x===fr&&Ar.y===pr&&Ar.z===hr&&Ar.w===dr||(_t.vertexAttrib4f(wr,fr,pr,hr,dr),Ar.x=fr,Ar.y=pr,Ar.z=hr,Ar.w=dr)),Tr=b.call(this,wt,t,0),Mr=!1,Sr=1,zr=0,Er=0,Lr=0,Cr=0,Pr=null,Or=0,Ir=!1,Dr=5126,Rr=0,Fr=0,Br=0,It(Tr)?(Mr=!0,Dr=(Pr=St.createStream(34962,Tr)).dtype):(Pr=St.getBuffer(Tr))?Dr=Pr.dtype:"constant"in Tr?(Sr=2,"number"==typeof Tr.constant?(zr=Tr.constant,Er=Lr=Cr=0):(zr=Tr.constant.length>0?Tr.constant[0]:0,Er=Tr.constant.length>1?Tr.constant[1]:0,Lr=Tr.constant.length>2?Tr.constant[2]:0,Cr=Tr.constant.length>3?Tr.constant[3]:0)):(Pr=It(Tr.buffer)?St.createStream(34962,Tr.buffer):St.getBuffer(Tr.buffer),Dr="type"in Tr?ae[Tr.type]:Pr.dtype,Ir=!!Tr.normalized,Or=0|Tr.size,Rr=0|Tr.offset,Fr=0|Tr.stride,Br=0|Tr.divisor),Nr=x.location,jr=Et[Nr],1===Sr?(jr.buffer||_t.enableVertexAttribArray(Nr),Vr=Or||1,jr.type===Dr&&jr.size===Vr&&jr.buffer===Pr&&jr.normalized===Ir&&jr.offset===Rr&&jr.stride===Fr||(_t.bindBuffer(34962,Pr.buffer),_t.vertexAttribPointer(Nr,Vr,Dr,Ir,Fr,Rr),jr.type=Dr,jr.size=Vr,jr.buffer=Pr,jr.normalized=Ir,jr.offset=Rr,jr.stride=Fr),jr.divisor!==Br&&(K.vertexAttribDivisorANGLE(Nr,Br),jr.divisor=Br)):(jr.buffer&&(_t.disableVertexAttribArray(Nr),jr.buffer=null),jr.x===zr&&jr.y===Er&&jr.z===Lr&&jr.w===Cr||(_t.vertexAttrib4f(Nr,zr,Er,Lr,Cr),jr.x=zr,jr.y=Er,jr.z=Lr,jr.w=Cr)),Ur=_.call(this,wt,t,0),Hr=!1,qr=1,Gr=0,Wr=0,Yr=0,Zr=0,Xr=null,Jr=0,Kr=!1,Qr=5126,$r=0,tn=0,en=0,It(Ur)?(Hr=!0,Qr=(Xr=St.createStream(34962,Ur)).dtype):(Xr=St.getBuffer(Ur))?Qr=Xr.dtype:"constant"in Ur?(qr=2,"number"==typeof Ur.constant?(Gr=Ur.constant,Wr=Yr=Zr=0):(Gr=Ur.constant.length>0?Ur.constant[0]:0,Wr=Ur.constant.length>1?Ur.constant[1]:0,Yr=Ur.constant.length>2?Ur.constant[2]:0,Zr=Ur.constant.length>3?Ur.constant[3]:0)):(Xr=It(Ur.buffer)?St.createStream(34962,Ur.buffer):St.getBuffer(Ur.buffer),Qr="type"in Ur?ae[Ur.type]:Xr.dtype,Kr=!!Ur.normalized,Jr=0|Ur.size,$r=0|Ur.offset,tn=0|Ur.stride,en=0|Ur.divisor),rn=w.location,nn=Et[rn],1===qr?(nn.buffer||_t.enableVertexAttribArray(rn),an=Jr||1,nn.type===Qr&&nn.size===an&&nn.buffer===Xr&&nn.normalized===Kr&&nn.offset===$r&&nn.stride===tn||(_t.bindBuffer(34962,Xr.buffer),_t.vertexAttribPointer(rn,an,Qr,Kr,tn,$r),nn.type=Qr,nn.size=an,nn.buffer=Xr,nn.normalized=Kr,nn.offset=$r,nn.stride=tn),nn.divisor!==en&&(K.vertexAttribDivisorANGLE(rn,en),nn.divisor=en)):(nn.buffer&&(_t.disableVertexAttribArray(rn),nn.buffer=null),nn.x===Gr&&nn.y===Wr&&nn.z===Yr&&nn.w===Zr||(_t.vertexAttrib4f(rn,Gr,Wr,Yr,Zr),nn.x=Gr,nn.y=Wr,nn.z=Yr,nn.w=Zr)),on=A.call(this,wt,t,0),sn=!1,ln=1,cn=0,un=0,fn=0,pn=0,hn=null,dn=0,mn=!1,gn=5126,yn=0,vn=0,bn=0,It(on)?(sn=!0,gn=(hn=St.createStream(34962,on)).dtype):(hn=St.getBuffer(on))?gn=hn.dtype:"constant"in on?(ln=2,"number"==typeof on.constant?(cn=on.constant,un=fn=pn=0):(cn=on.constant.length>0?on.constant[0]:0,un=on.constant.length>1?on.constant[1]:0,fn=on.constant.length>2?on.constant[2]:0,pn=on.constant.length>3?on.constant[3]:0)):(hn=It(on.buffer)?St.createStream(34962,on.buffer):St.getBuffer(on.buffer),gn="type"in on?ae[on.type]:hn.dtype,mn=!!on.normalized,dn=0|on.size,yn=0|on.offset,vn=0|on.stride,bn=0|on.divisor),xn=k.location,_n=Et[xn],1===ln?(_n.buffer||_t.enableVertexAttribArray(xn),wn=dn||1,_n.type===gn&&_n.size===wn&&_n.buffer===hn&&_n.normalized===mn&&_n.offset===yn&&_n.stride===vn||(_t.bindBuffer(34962,hn.buffer),_t.vertexAttribPointer(xn,wn,gn,mn,vn,yn),_n.type=gn,_n.size=wn,_n.buffer=hn,_n.normalized=mn,_n.offset=yn,_n.stride=vn),_n.divisor!==bn&&(K.vertexAttribDivisorANGLE(xn,bn),_n.divisor=bn)):(_n.buffer&&(_t.disableVertexAttribArray(xn),_n.buffer=null),_n.x===cn&&_n.y===un&&_n.z===fn&&_n.w===pn||(_t.vertexAttrib4f(xn,cn,un,fn,pn),_n.x=cn,_n.y=un,_n.z=fn,_n.w=pn)),_t.uniform1i(T.location,!1),An=t.opacity,_t.uniform1f(M.location,An),Tn=(kn=z.call(this,wt,t,0))[0],Mn=kn[1],_t.uniform2f(S.location,Tn,Mn),_t.uniform1i(E.location,L.bind()),Sn=wt.pixelRatio,_t.uniform1f(C.location,Sn),En=(zn=t.scale)[0],Ln=zn[1],_t.uniform2f(P.location,En,Ln),Pn=(Cn=t.scaleFract)[0],On=Cn[1],_t.uniform2f(O.location,Pn,On),Dn=(In=t.translate)[0],Rn=In[1],_t.uniform2f(I.location,Dn,Rn),Bn=(Fn=t.translateFract)[0],Nn=Fn[1],_t.uniform2f(D.location,Bn,Nn),jn=t.elements,Vn=null,(Vn=(Un=It(jn))?Mt.createStream(jn):Mt.getElements(jn))&&_t.bindBuffer(34963,Vn.buffer.buffer),Hn=t.offset,(qn=t.count)&&((Gn=Tt.instances)>0?Vn?K.drawElementsInstancedANGLE(0,qn,Vn.type,Hn<<(Vn.type-5121>>1),Gn):K.drawArraysInstancedANGLE(0,Hn,qn,Gn):Gn<0&&(Vn?_t.drawElements(0,qn,Vn.type,Hn<<(Vn.type-5121>>1)):_t.drawArrays(0,Hn,qn)),kt.dirty=!0,Lt.setVAO(null),wt.viewportWidth=U,wt.viewportHeight=H,X&&(e.cpuTime+=performance.now()-J),$&&St.destroyStream(at),gt&&St.destroyStream(Ct),pe&&St.destroyStream(ve),Ee&&St.destroyStream(De),We&&St.destroyStream(Qe),cr&&St.destroyStream(mr),Mr&&St.destroyStream(Pr),Hr&&St.destroyStream(Xr),sn&&St.destroyStream(hn),L.unbind(),Un&&Mt.destroyStream(Vn))},scope:function(t,r,n){var i,a,o,l,u,p,d,g,v,x,w,k,T,M,S,E,L,C,P,O,I,D,yt,vt,bt,xt,_t,Et,Lt,Pt,Ot,Rt,Ft,Bt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,re,ie,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi,Ei,Li,Ci,Pi,Oi,Ii,Di,Ri,Fi,Bi,Ni,ji,Vi,Ui,Hi,qi,Gi,Wi,Yi,Zi,Xi,Ji,Ki,Qi,$i,ta,ea,ra,na,ia,aa,oa,sa,la,ca,ua,fa,pa,ha,da,ma,ga,ya,va,ba,xa,_a,wa,Aa,ka,Ta,Ma,Sa,za,Ea,La,Ca,Pa,Oa,Ia,Da,Ra;a=0|(i=t.viewport).x,o=0|i.y,l="width"in i?0|i.width:wt.framebufferWidth-a,u="height"in i?0|i.height:wt.framebufferHeight-o,p=wt.viewportWidth,wt.viewportWidth=l,d=wt.viewportHeight,wt.viewportHeight=u,g=ne[0],ne[0]=a,v=ne[1],ne[1]=o,x=ne[2],ne[2]=l,w=ne[3],ne[3]=u,k=Dt[0],Dt[0]=R,T=Dt[1],Dt[1]=F,M=Dt[2],Dt[2]=B,S=Dt[3],Dt[3]=N,E=At.blend_enable,At.blend_enable=j,L=Nt[0],Nt[0]=V,C=Nt[1],Nt[1]=U,P=Nt[2],Nt[2]=H,O=Nt[3],Nt[3]=q,I=At.depth_enable,At.depth_enable=G,yt=0|(D=t.viewport).x,vt=0|D.y,bt="width"in D?0|D.width:wt.framebufferWidth-yt,xt="height"in D?0|D.height:wt.framebufferHeight-vt,_t=ee[0],ee[0]=yt,Et=ee[1],ee[1]=vt,Lt=ee[2],ee[2]=bt,Pt=ee[3],ee[3]=xt,Ot=At.scissor_enable,At.scissor_enable=W,Rt=At.stencil_enable,At.stencil_enable=Y,(Ft=kt.profile)&&(Bt=performance.now(),e.count++),jt=t.elements,Vt=null,Vt=(Ut=It(jt))?Mt.createStream(jt):Mt.getElements(jt),Ht=Tt.elements,Tt.elements=Vt,qt=t.offset,Gt=Tt.offset,Tt.offset=qt,Wt=t.count,Yt=Tt.count,Tt.count=Wt,Zt=Tt.primitive,Tt.primitive=Z,Xt=Ct[X],Ct[X]=!1,Jt=Ct[K],Ct[K]=J,Kt=t.opacity,Qt=Ct[Q],Ct[Q]=Kt,$t=z.call(this,wt,t,n),te=Ct[$],Ct[$]=$t,re=wt.pixelRatio,ie=Ct[tt],Ct[tt]=re,oe=t.scale,se=Ct[et],Ct[et]=oe,le=t.scaleFract,ce=Ct[rt],Ct[rt]=le,ue=t.translate,fe=Ct[nt],Ct[nt]=ue,pe=t.translateFract,he=Ct[it],Ct[it]=pe,de=t.markerTexture,me=Ct[at],Ct[at]=de,ge=y.call(this,wt,t,n),ye=!1,ve=1,be=0,xe=0,_e=0,we=0,Ae=null,ke=0,Te=!1,Me=5126,Se=0,ze=0,Ee=0,It(ge)?(ye=!0,Me=(Ae=St.createStream(34962,ge)).dtype):(Ae=St.getBuffer(ge))?Me=Ae.dtype:"constant"in ge?(ve=2,"number"==typeof ge.constant?(be=ge.constant,xe=_e=we=0):(be=ge.constant.length>0?ge.constant[0]:0,xe=ge.constant.length>1?ge.constant[1]:0,_e=ge.constant.length>2?ge.constant[2]:0,we=ge.constant.length>3?ge.constant[3]:0)):(Ae=It(ge.buffer)?St.createStream(34962,ge.buffer):St.getBuffer(ge.buffer),Me="type"in ge?ae[ge.type]:Ae.dtype,Te=!!ge.normalized,ke=0|ge.size,Se=0|ge.offset,ze=0|ge.stride,Ee=0|ge.divisor),Le=ot.state,ot.state=ve,Ce=ot.x,ot.x=be,Pe=ot.y,ot.y=xe,Oe=ot.z,ot.z=_e,Ie=ot.w,ot.w=we,De=ot.buffer,ot.buffer=Ae,Re=ot.size,ot.size=ke,Fe=ot.normalized,ot.normalized=Te,Be=ot.type,ot.type=Me,Ne=ot.offset,ot.offset=Se,je=ot.stride,ot.stride=ze,Ve=ot.divisor,ot.divisor=Ee,Ue=_.call(this,wt,t,n),He=!1,qe=1,Ge=0,We=0,Ye=0,Ze=0,Xe=null,Je=0,Ke=!1,Qe=5126,$e=0,tr=0,er=0,It(Ue)?(He=!0,Qe=(Xe=St.createStream(34962,Ue)).dtype):(Xe=St.getBuffer(Ue))?Qe=Xe.dtype:"constant"in Ue?(qe=2,"number"==typeof Ue.constant?(Ge=Ue.constant,We=Ye=Ze=0):(Ge=Ue.constant.length>0?Ue.constant[0]:0,We=Ue.constant.length>1?Ue.constant[1]:0,Ye=Ue.constant.length>2?Ue.constant[2]:0,Ze=Ue.constant.length>3?Ue.constant[3]:0)):(Xe=It(Ue.buffer)?St.createStream(34962,Ue.buffer):St.getBuffer(Ue.buffer),Qe="type"in Ue?ae[Ue.type]:Xe.dtype,Ke=!!Ue.normalized,Je=0|Ue.size,$e=0|Ue.offset,tr=0|Ue.stride,er=0|Ue.divisor),rr=st.state,st.state=qe,nr=st.x,st.x=Ge,ir=st.y,st.y=We,ar=st.z,st.z=Ye,or=st.w,st.w=Ze,sr=st.buffer,st.buffer=Xe,lr=st.size,st.size=Je,cr=st.normalized,st.normalized=Ke,ur=st.type,st.type=Qe,fr=st.offset,st.offset=$e,pr=st.stride,st.stride=tr,hr=st.divisor,st.divisor=er,dr=b.call(this,wt,t,n),mr=!1,gr=1,yr=0,vr=0,br=0,xr=0,_r=null,wr=0,Ar=!1,kr=5126,Tr=0,Mr=0,Sr=0,It(dr)?(mr=!0,kr=(_r=St.createStream(34962,dr)).dtype):(_r=St.getBuffer(dr))?kr=_r.dtype:"constant"in dr?(gr=2,"number"==typeof dr.constant?(yr=dr.constant,vr=br=xr=0):(yr=dr.constant.length>0?dr.constant[0]:0,vr=dr.constant.length>1?dr.constant[1]:0,br=dr.constant.length>2?dr.constant[2]:0,xr=dr.constant.length>3?dr.constant[3]:0)):(_r=It(dr.buffer)?St.createStream(34962,dr.buffer):St.getBuffer(dr.buffer),kr="type"in dr?ae[dr.type]:_r.dtype,Ar=!!dr.normalized,wr=0|dr.size,Tr=0|dr.offset,Mr=0|dr.stride,Sr=0|dr.divisor),zr=lt.state,lt.state=gr,Er=lt.x,lt.x=yr,Lr=lt.y,lt.y=vr,Cr=lt.z,lt.z=br,Pr=lt.w,lt.w=xr,Or=lt.buffer,lt.buffer=_r,Ir=lt.size,lt.size=wr,Dr=lt.normalized,lt.normalized=Ar,Rr=lt.type,lt.type=kr,Fr=lt.offset,lt.offset=Tr,Br=lt.stride,lt.stride=Mr,Nr=lt.divisor,lt.divisor=Sr,jr=A.call(this,wt,t,n),Vr=!1,Ur=1,Hr=0,qr=0,Gr=0,Wr=0,Yr=null,Zr=0,Xr=!1,Jr=5126,Kr=0,Qr=0,$r=0,It(jr)?(Vr=!0,Jr=(Yr=St.createStream(34962,jr)).dtype):(Yr=St.getBuffer(jr))?Jr=Yr.dtype:"constant"in jr?(Ur=2,"number"==typeof jr.constant?(Hr=jr.constant,qr=Gr=Wr=0):(Hr=jr.constant.length>0?jr.constant[0]:0,qr=jr.constant.length>1?jr.constant[1]:0,Gr=jr.constant.length>2?jr.constant[2]:0,Wr=jr.constant.length>3?jr.constant[3]:0)):(Yr=It(jr.buffer)?St.createStream(34962,jr.buffer):St.getBuffer(jr.buffer),Jr="type"in jr?ae[jr.type]:Yr.dtype,Xr=!!jr.normalized,Zr=0|jr.size,Kr=0|jr.offset,Qr=0|jr.stride,$r=0|jr.divisor),tn=ct.state,ct.state=Ur,en=ct.x,ct.x=Hr,rn=ct.y,ct.y=qr,nn=ct.z,ct.z=Gr,an=ct.w,ct.w=Wr,on=ct.buffer,ct.buffer=Yr,sn=ct.size,ct.size=Zr,ln=ct.normalized,ct.normalized=Xr,cn=ct.type,ct.type=Jr,un=ct.offset,ct.offset=Kr,fn=ct.stride,ct.stride=Qr,pn=ct.divisor,ct.divisor=$r,hn=m.call(this,wt,t,n),dn=!1,mn=1,gn=0,yn=0,vn=0,bn=0,xn=null,_n=0,wn=!1,An=5126,kn=0,Tn=0,Mn=0,It(hn)?(dn=!0,An=(xn=St.createStream(34962,hn)).dtype):(xn=St.getBuffer(hn))?An=xn.dtype:"constant"in hn?(mn=2,"number"==typeof hn.constant?(gn=hn.constant,yn=vn=bn=0):(gn=hn.constant.length>0?hn.constant[0]:0,yn=hn.constant.length>1?hn.constant[1]:0,vn=hn.constant.length>2?hn.constant[2]:0,bn=hn.constant.length>3?hn.constant[3]:0)):(xn=It(hn.buffer)?St.createStream(34962,hn.buffer):St.getBuffer(hn.buffer),An="type"in hn?ae[hn.type]:xn.dtype,wn=!!hn.normalized,_n=0|hn.size,kn=0|hn.offset,Tn=0|hn.stride,Mn=0|hn.divisor),Sn=ut.state,ut.state=mn,zn=ut.x,ut.x=gn,En=ut.y,ut.y=yn,Ln=ut.z,ut.z=vn,Cn=ut.w,ut.w=bn,Pn=ut.buffer,ut.buffer=xn,On=ut.size,ut.size=_n,In=ut.normalized,ut.normalized=wn,Dn=ut.type,ut.type=An,Rn=ut.offset,ut.offset=kn,Fn=ut.stride,ut.stride=Tn,Bn=ut.divisor,ut.divisor=Mn,Nn=c.call(this,wt,t,n),jn=!1,Vn=1,Un=0,Hn=0,qn=0,Gn=0,Wn=null,Yn=0,Zn=!1,Xn=5126,Jn=0,Kn=0,Qn=0,It(Nn)?(jn=!0,Xn=(Wn=St.createStream(34962,Nn)).dtype):(Wn=St.getBuffer(Nn))?Xn=Wn.dtype:"constant"in Nn?(Vn=2,"number"==typeof Nn.constant?(Un=Nn.constant,Hn=qn=Gn=0):(Un=Nn.constant.length>0?Nn.constant[0]:0,Hn=Nn.constant.length>1?Nn.constant[1]:0,qn=Nn.constant.length>2?Nn.constant[2]:0,Gn=Nn.constant.length>3?Nn.constant[3]:0)):(Wn=It(Nn.buffer)?St.createStream(34962,Nn.buffer):St.getBuffer(Nn.buffer),Xn="type"in Nn?ae[Nn.type]:Wn.dtype,Zn=!!Nn.normalized,Yn=0|Nn.size,Jn=0|Nn.offset,Kn=0|Nn.stride,Qn=0|Nn.divisor),$n=ft.state,ft.state=Vn,ti=ft.x,ft.x=Un,ei=ft.y,ft.y=Hn,ri=ft.z,ft.z=qn,ni=ft.w,ft.w=Gn,ii=ft.buffer,ft.buffer=Wn,ai=ft.size,ft.size=Yn,oi=ft.normalized,ft.normalized=Zn,si=ft.type,ft.type=Xn,li=ft.offset,ft.offset=Jn,ci=ft.stride,ft.stride=Kn,ui=ft.divisor,ft.divisor=Qn,fi=f.call(this,wt,t,n),pi=!1,hi=1,di=0,mi=0,gi=0,yi=0,vi=null,bi=0,xi=!1,_i=5126,wi=0,Ai=0,ki=0,It(fi)?(pi=!0,_i=(vi=St.createStream(34962,fi)).dtype):(vi=St.getBuffer(fi))?_i=vi.dtype:"constant"in fi?(hi=2,"number"==typeof fi.constant?(di=fi.constant,mi=gi=yi=0):(di=fi.constant.length>0?fi.constant[0]:0,mi=fi.constant.length>1?fi.constant[1]:0,gi=fi.constant.length>2?fi.constant[2]:0,yi=fi.constant.length>3?fi.constant[3]:0)):(vi=It(fi.buffer)?St.createStream(34962,fi.buffer):St.getBuffer(fi.buffer),_i="type"in fi?ae[fi.type]:vi.dtype,xi=!!fi.normalized,bi=0|fi.size,wi=0|fi.offset,Ai=0|fi.stride,ki=0|fi.divisor),Ti=pt.state,pt.state=hi,Mi=pt.x,pt.x=di,Si=pt.y,pt.y=mi,zi=pt.z,pt.z=gi,Ei=pt.w,pt.w=yi,Li=pt.buffer,pt.buffer=vi,Ci=pt.size,pt.size=bi,Pi=pt.normalized,pt.normalized=xi,Oi=pt.type,pt.type=_i,Ii=pt.offset,pt.offset=wi,Di=pt.stride,pt.stride=Ai,Ri=pt.divisor,pt.divisor=ki,Fi=s.call(this,wt,t,n),Bi=!1,Ni=1,ji=0,Vi=0,Ui=0,Hi=0,qi=null,Gi=0,Wi=!1,Yi=5126,Zi=0,Xi=0,Ji=0,It(Fi)?(Bi=!0,Yi=(qi=St.createStream(34962,Fi)).dtype):(qi=St.getBuffer(Fi))?Yi=qi.dtype:"constant"in Fi?(Ni=2,"number"==typeof Fi.constant?(ji=Fi.constant,Vi=Ui=Hi=0):(ji=Fi.constant.length>0?Fi.constant[0]:0,Vi=Fi.constant.length>1?Fi.constant[1]:0,Ui=Fi.constant.length>2?Fi.constant[2]:0,Hi=Fi.constant.length>3?Fi.constant[3]:0)):(qi=It(Fi.buffer)?St.createStream(34962,Fi.buffer):St.getBuffer(Fi.buffer),Yi="type"in Fi?ae[Fi.type]:qi.dtype,Wi=!!Fi.normalized,Gi=0|Fi.size,Zi=0|Fi.offset,Xi=0|Fi.stride,Ji=0|Fi.divisor),Ki=ht.state,ht.state=Ni,Qi=ht.x,ht.x=ji,$i=ht.y,ht.y=Vi,ta=ht.z,ht.z=Ui,ea=ht.w,ht.w=Hi,ra=ht.buffer,ht.buffer=qi,na=ht.size,ht.size=Gi,ia=ht.normalized,ht.normalized=Wi,aa=ht.type,ht.type=Yi,oa=ht.offset,ht.offset=Zi,sa=ht.stride,ht.stride=Xi,la=ht.divisor,ht.divisor=Ji,ca=h.call(this,wt,t,n),ua=!1,fa=1,pa=0,ha=0,da=0,ma=0,ga=null,ya=0,va=!1,ba=5126,xa=0,_a=0,wa=0,It(ca)?(ua=!0,ba=(ga=St.createStream(34962,ca)).dtype):(ga=St.getBuffer(ca))?ba=ga.dtype:"constant"in ca?(fa=2,"number"==typeof ca.constant?(pa=ca.constant,ha=da=ma=0):(pa=ca.constant.length>0?ca.constant[0]:0,ha=ca.constant.length>1?ca.constant[1]:0,da=ca.constant.length>2?ca.constant[2]:0,ma=ca.constant.length>3?ca.constant[3]:0)):(ga=It(ca.buffer)?St.createStream(34962,ca.buffer):St.getBuffer(ca.buffer),ba="type"in ca?ae[ca.type]:ga.dtype,va=!!ca.normalized,ya=0|ca.size,xa=0|ca.offset,_a=0|ca.stride,wa=0|ca.divisor),Aa=dt.state,dt.state=fa,ka=dt.x,dt.x=pa,Ta=dt.y,dt.y=ha,Ma=dt.z,dt.z=da,Sa=dt.w,dt.w=ma,za=dt.buffer,dt.buffer=ga,Ea=dt.size,dt.size=ya,La=dt.normalized,dt.normalized=va,Ca=dt.type,dt.type=ba,Pa=dt.offset,dt.offset=xa,Oa=dt.stride,dt.stride=_a,Ia=dt.divisor,dt.divisor=wa,Da=zt.vert,zt.vert=mt,Ra=zt.frag,zt.frag=gt,kt.dirty=!0,r(wt,t,n),wt.viewportWidth=p,wt.viewportHeight=d,ne[0]=g,ne[1]=v,ne[2]=x,ne[3]=w,Dt[0]=k,Dt[1]=T,Dt[2]=M,Dt[3]=S,At.blend_enable=E,Nt[0]=L,Nt[1]=C,Nt[2]=P,Nt[3]=O,At.depth_enable=I,ee[0]=_t,ee[1]=Et,ee[2]=Lt,ee[3]=Pt,At.scissor_enable=Ot,At.stencil_enable=Rt,Ft&&(e.cpuTime+=performance.now()-Bt),Ut&&Mt.destroyStream(Vt),Tt.elements=Ht,Tt.offset=Gt,Tt.count=Yt,Tt.primitive=Zt,Ct[X]=Xt,Ct[K]=Jt,Ct[Q]=Qt,Ct[$]=te,Ct[tt]=ie,Ct[et]=se,Ct[rt]=ce,Ct[nt]=fe,Ct[it]=he,Ct[at]=me,ye&&St.destroyStream(Ae),ot.state=Le,ot.x=Ce,ot.y=Pe,ot.z=Oe,ot.w=Ie,ot.buffer=De,ot.size=Re,ot.normalized=Fe,ot.type=Be,ot.offset=Ne,ot.stride=je,ot.divisor=Ve,He&&St.destroyStream(Xe),st.state=rr,st.x=nr,st.y=ir,st.z=ar,st.w=or,st.buffer=sr,st.size=lr,st.normalized=cr,st.type=ur,st.offset=fr,st.stride=pr,st.divisor=hr,mr&&St.destroyStream(_r),lt.state=zr,lt.x=Er,lt.y=Lr,lt.z=Cr,lt.w=Pr,lt.buffer=Or,lt.size=Ir,lt.normalized=Dr,lt.type=Rr,lt.offset=Fr,lt.stride=Br,lt.divisor=Nr,Vr&&St.destroyStream(Yr),ct.state=tn,ct.x=en,ct.y=rn,ct.z=nn,ct.w=an,ct.buffer=on,ct.size=sn,ct.normalized=ln,ct.type=cn,ct.offset=un,ct.stride=fn,ct.divisor=pn,dn&&St.destroyStream(xn),ut.state=Sn,ut.x=zn,ut.y=En,ut.z=Ln,ut.w=Cn,ut.buffer=Pn,ut.size=On,ut.normalized=In,ut.type=Dn,ut.offset=Rn,ut.stride=Fn,ut.divisor=Bn,jn&&St.destroyStream(Wn),ft.state=$n,ft.x=ti,ft.y=ei,ft.z=ri,ft.w=ni,ft.buffer=ii,ft.size=ai,ft.normalized=oi,ft.type=si,ft.offset=li,ft.stride=ci,ft.divisor=ui,pi&&St.destroyStream(vi),pt.state=Ti,pt.x=Mi,pt.y=Si,pt.z=zi,pt.w=Ei,pt.buffer=Li,pt.size=Ci,pt.normalized=Pi,pt.type=Oi,pt.offset=Ii,pt.stride=Di,pt.divisor=Ri,Bi&&St.destroyStream(qi),ht.state=Ki,ht.x=Qi,ht.y=$i,ht.z=ta,ht.w=ea,ht.buffer=ra,ht.size=na,ht.normalized=ia,ht.type=aa,ht.offset=oa,ht.stride=sa,ht.divisor=la,ua&&St.destroyStream(ga),dt.state=Aa,dt.x=ka,dt.y=Ta,dt.z=Ma,dt.w=Sa,dt.buffer=za,dt.size=Ea,dt.normalized=La,dt.type=Ca,dt.offset=Pa,dt.stride=Oa,dt.divisor=Ia,zt.vert=Da,zt.frag=Ra,kt.dirty=!0},batch:function(t,r){var n,i,a,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,zt,Ct,Dt;(Ot.angle_instanced_arrays,(n=Pt.next)!==Pt.cur&&(n?_t.bindFramebuffer(36160,n.framebuffer):_t.bindFramebuffer(36160,null),Pt.cur=n),kt.dirty)&&((N=At.dither)!==kt.dither&&(N?_t.enable(3024):_t.disable(3024),kt.dither=N),j=Ft[0],V=Ft[1],j===Bt[0]&&V===Bt[1]||(_t.blendEquationSeparate(j,V),Bt[0]=j,Bt[1]=V),(U=At.depth_func)!==kt.depth_func&&(_t.depthFunc(U),kt.depth_func=U),H=Vt[0],q=Vt[1],H===Ut[0]&&q===Ut[1]||(_t.depthRange(H,q),Ut[0]=H,Ut[1]=q),(G=At.depth_mask)!==kt.depth_mask&&(_t.depthMask(G),kt.depth_mask=G),W=Ht[0],Y=Ht[1],Z=Ht[2],X=Ht[3],W===qt[0]&&Y===qt[1]&&Z===qt[2]&&X===qt[3]||(_t.colorMask(W,Y,Z,X),qt[0]=W,qt[1]=Y,qt[2]=Z,qt[3]=X),(J=At.cull_enable)!==kt.cull_enable&&(J?_t.enable(2884):_t.disable(2884),kt.cull_enable=J),(K=At.cull_face)!==kt.cull_face&&(_t.cullFace(K),kt.cull_face=K),(Q=At.frontFace)!==kt.frontFace&&(_t.frontFace(Q),kt.frontFace=Q),($=At.lineWidth)!==kt.lineWidth&&(_t.lineWidth($),kt.lineWidth=$),(tt=At.polygonOffset_enable)!==kt.polygonOffset_enable&&(tt?_t.enable(32823):_t.disable(32823),kt.polygonOffset_enable=tt),et=Gt[0],rt=Gt[1],et===Wt[0]&&rt===Wt[1]||(_t.polygonOffset(et,rt),Wt[0]=et,Wt[1]=rt),(nt=At.sample_alpha)!==kt.sample_alpha&&(nt?_t.enable(32926):_t.disable(32926),kt.sample_alpha=nt),(it=At.sample_enable)!==kt.sample_enable&&(it?_t.enable(32928):_t.disable(32928),kt.sample_enable=it),at=Yt[0],ot=Yt[1],at===Zt[0]&&ot===Zt[1]||(_t.sampleCoverage(at,ot),Zt[0]=at,Zt[1]=ot),(st=At.stencil_mask)!==kt.stencil_mask&&(_t.stencilMask(st),kt.stencil_mask=st),lt=Xt[0],ct=Xt[1],ut=Xt[2],lt===Jt[0]&&ct===Jt[1]&&ut===Jt[2]||(_t.stencilFunc(lt,ct,ut),Jt[0]=lt,Jt[1]=ct,Jt[2]=ut),ft=Kt[0],pt=Kt[1],ht=Kt[2],dt=Kt[3],ft===Qt[0]&&pt===Qt[1]&&ht===Qt[2]&&dt===Qt[3]||(_t.stencilOpSeparate(ft,pt,ht,dt),Qt[0]=ft,Qt[1]=pt,Qt[2]=ht,Qt[3]=dt),mt=$t[0],gt=$t[1],zt=$t[2],Ct=$t[3],mt===te[0]&>===te[1]&&zt===te[2]&&Ct===te[3]||(_t.stencilOpSeparate(mt,gt,zt,Ct),te[0]=mt,te[1]=gt,te[2]=zt,te[3]=Ct));for(_t.blendColor(0,0,0,1),Rt[0]=0,Rt[1]=0,Rt[2]=0,Rt[3]=1,yt?_t.enable(3042):_t.disable(3042),kt.blend_enable=yt,_t.blendFuncSeparate(770,771,773,1),jt[0]=770,jt[1]=771,jt[2]=773,jt[3]=1,vt?_t.enable(2929):_t.disable(2929),kt.depth_enable=vt,bt?_t.enable(3089):_t.disable(3089),kt.scissor_enable=bt,xt?_t.enable(2960):_t.disable(2960),kt.stencil_enable=xt,(i=kt.profile)&&(a=performance.now(),e.count+=r),_t.useProgram(o.program),R=Ot.angle_instanced_arrays,Lt.setVAO(null),_t.uniform1i(T.location,!1),_t.uniform1i(E.location,L.bind()),Dt=Tt.instances,F=0;F0?me.constant[0]:0,be=me.constant.length>1?me.constant[1]:0,xe=me.constant.length>2?me.constant[2]:0,_e=me.constant.length>3?me.constant[3]:0)):(we=It(me.buffer)?St.createStream(34962,me.buffer):St.getBuffer(me.buffer),Te="type"in me?ae[me.type]:we.dtype,ke=!!me.normalized,Ae=0|me.size,Me=0|me.offset,Se=0|me.stride,ze=0|me.divisor),Ee=l.location,Le=Et[Ee],1===ye?(Le.buffer||_t.enableVertexAttribArray(Ee),Ce=Ae||4,Le.type===Te&&Le.size===Ce&&Le.buffer===we&&Le.normalized===ke&&Le.offset===Me&&Le.stride===Se||(_t.bindBuffer(34962,we.buffer),_t.vertexAttribPointer(Ee,Ce,Te,ke,Se,Me),Le.type=Te,Le.size=Ce,Le.buffer=we,Le.normalized=ke,Le.offset=Me,Le.stride=Se),Le.divisor!==ze&&(R.vertexAttribDivisorANGLE(Ee,ze),Le.divisor=ze)):(Le.buffer&&(_t.disableVertexAttribArray(Ee),Le.buffer=null),Le.x===ve&&Le.y===be&&Le.z===xe&&Le.w===_e||(_t.vertexAttrib4f(Ee,ve,be,xe,_e),Le.x=ve,Le.y=be,Le.z=xe,Le.w=_e)),Pe=c.call(this,wt,B,F),Oe=!1,Ie=1,De=0,Re=0,Fe=0,Be=0,Ne=null,je=0,Ve=!1,Ue=5126,He=0,qe=0,Ge=0,It(Pe)?(Oe=!0,Ue=(Ne=St.createStream(34962,Pe)).dtype):(Ne=St.getBuffer(Pe))?Ue=Ne.dtype:"constant"in Pe?(Ie=2,"number"==typeof Pe.constant?(De=Pe.constant,Re=Fe=Be=0):(De=Pe.constant.length>0?Pe.constant[0]:0,Re=Pe.constant.length>1?Pe.constant[1]:0,Fe=Pe.constant.length>2?Pe.constant[2]:0,Be=Pe.constant.length>3?Pe.constant[3]:0)):(Ne=It(Pe.buffer)?St.createStream(34962,Pe.buffer):St.getBuffer(Pe.buffer),Ue="type"in Pe?ae[Pe.type]:Ne.dtype,Ve=!!Pe.normalized,je=0|Pe.size,He=0|Pe.offset,qe=0|Pe.stride,Ge=0|Pe.divisor),We=u.location,Ye=Et[We],1===Ie?(Ye.buffer||_t.enableVertexAttribArray(We),Ze=je||1,Ye.type===Ue&&Ye.size===Ze&&Ye.buffer===Ne&&Ye.normalized===Ve&&Ye.offset===He&&Ye.stride===qe||(_t.bindBuffer(34962,Ne.buffer),_t.vertexAttribPointer(We,Ze,Ue,Ve,qe,He),Ye.type=Ue,Ye.size=Ze,Ye.buffer=Ne,Ye.normalized=Ve,Ye.offset=He,Ye.stride=qe),Ye.divisor!==Ge&&(R.vertexAttribDivisorANGLE(We,Ge),Ye.divisor=Ge)):(Ye.buffer&&(_t.disableVertexAttribArray(We),Ye.buffer=null),Ye.x===De&&Ye.y===Re&&Ye.z===Fe&&Ye.w===Be||(_t.vertexAttrib4f(We,De,Re,Fe,Be),Ye.x=De,Ye.y=Re,Ye.z=Fe,Ye.w=Be)),Xe=f.call(this,wt,B,F),Je=!1,Ke=1,Qe=0,$e=0,tr=0,er=0,rr=null,nr=0,ir=!1,ar=5126,or=0,sr=0,lr=0,It(Xe)?(Je=!0,ar=(rr=St.createStream(34962,Xe)).dtype):(rr=St.getBuffer(Xe))?ar=rr.dtype:"constant"in Xe?(Ke=2,"number"==typeof Xe.constant?(Qe=Xe.constant,$e=tr=er=0):(Qe=Xe.constant.length>0?Xe.constant[0]:0,$e=Xe.constant.length>1?Xe.constant[1]:0,tr=Xe.constant.length>2?Xe.constant[2]:0,er=Xe.constant.length>3?Xe.constant[3]:0)):(rr=It(Xe.buffer)?St.createStream(34962,Xe.buffer):St.getBuffer(Xe.buffer),ar="type"in Xe?ae[Xe.type]:rr.dtype,ir=!!Xe.normalized,nr=0|Xe.size,or=0|Xe.offset,sr=0|Xe.stride,lr=0|Xe.divisor),cr=p.location,ur=Et[cr],1===Ke?(ur.buffer||_t.enableVertexAttribArray(cr),fr=nr||4,ur.type===ar&&ur.size===fr&&ur.buffer===rr&&ur.normalized===ir&&ur.offset===or&&ur.stride===sr||(_t.bindBuffer(34962,rr.buffer),_t.vertexAttribPointer(cr,fr,ar,ir,sr,or),ur.type=ar,ur.size=fr,ur.buffer=rr,ur.normalized=ir,ur.offset=or,ur.stride=sr),ur.divisor!==lr&&(R.vertexAttribDivisorANGLE(cr,lr),ur.divisor=lr)):(ur.buffer&&(_t.disableVertexAttribArray(cr),ur.buffer=null),ur.x===Qe&&ur.y===$e&&ur.z===tr&&ur.w===er||(_t.vertexAttrib4f(cr,Qe,$e,tr,er),ur.x=Qe,ur.y=$e,ur.z=tr,ur.w=er)),pr=h.call(this,wt,B,F),hr=!1,dr=1,mr=0,gr=0,yr=0,vr=0,br=null,xr=0,_r=!1,wr=5126,Ar=0,kr=0,Tr=0,It(pr)?(hr=!0,wr=(br=St.createStream(34962,pr)).dtype):(br=St.getBuffer(pr))?wr=br.dtype:"constant"in pr?(dr=2,"number"==typeof pr.constant?(mr=pr.constant,gr=yr=vr=0):(mr=pr.constant.length>0?pr.constant[0]:0,gr=pr.constant.length>1?pr.constant[1]:0,yr=pr.constant.length>2?pr.constant[2]:0,vr=pr.constant.length>3?pr.constant[3]:0)):(br=It(pr.buffer)?St.createStream(34962,pr.buffer):St.getBuffer(pr.buffer),wr="type"in pr?ae[pr.type]:br.dtype,_r=!!pr.normalized,xr=0|pr.size,Ar=0|pr.offset,kr=0|pr.stride,Tr=0|pr.divisor),Mr=d.location,Sr=Et[Mr],1===dr?(Sr.buffer||_t.enableVertexAttribArray(Mr),zr=xr||1,Sr.type===wr&&Sr.size===zr&&Sr.buffer===br&&Sr.normalized===_r&&Sr.offset===Ar&&Sr.stride===kr||(_t.bindBuffer(34962,br.buffer),_t.vertexAttribPointer(Mr,zr,wr,_r,kr,Ar),Sr.type=wr,Sr.size=zr,Sr.buffer=br,Sr.normalized=_r,Sr.offset=Ar,Sr.stride=kr),Sr.divisor!==Tr&&(R.vertexAttribDivisorANGLE(Mr,Tr),Sr.divisor=Tr)):(Sr.buffer&&(_t.disableVertexAttribArray(Mr),Sr.buffer=null),Sr.x===mr&&Sr.y===gr&&Sr.z===yr&&Sr.w===vr||(_t.vertexAttrib4f(Mr,mr,gr,yr,vr),Sr.x=mr,Sr.y=gr,Sr.z=yr,Sr.w=vr)),Er=m.call(this,wt,B,F),Lr=!1,Cr=1,Pr=0,Or=0,Ir=0,Dr=0,Rr=null,Fr=0,Br=!1,Nr=5126,jr=0,Vr=0,Ur=0,It(Er)?(Lr=!0,Nr=(Rr=St.createStream(34962,Er)).dtype):(Rr=St.getBuffer(Er))?Nr=Rr.dtype:"constant"in Er?(Cr=2,"number"==typeof Er.constant?(Pr=Er.constant,Or=Ir=Dr=0):(Pr=Er.constant.length>0?Er.constant[0]:0,Or=Er.constant.length>1?Er.constant[1]:0,Ir=Er.constant.length>2?Er.constant[2]:0,Dr=Er.constant.length>3?Er.constant[3]:0)):(Rr=It(Er.buffer)?St.createStream(34962,Er.buffer):St.getBuffer(Er.buffer),Nr="type"in Er?ae[Er.type]:Rr.dtype,Br=!!Er.normalized,Fr=0|Er.size,jr=0|Er.offset,Vr=0|Er.stride,Ur=0|Er.divisor),Hr=g.location,qr=Et[Hr],1===Cr?(qr.buffer||_t.enableVertexAttribArray(Hr),Gr=Fr||1,qr.type===Nr&&qr.size===Gr&&qr.buffer===Rr&&qr.normalized===Br&&qr.offset===jr&&qr.stride===Vr||(_t.bindBuffer(34962,Rr.buffer),_t.vertexAttribPointer(Hr,Gr,Nr,Br,Vr,jr),qr.type=Nr,qr.size=Gr,qr.buffer=Rr,qr.normalized=Br,qr.offset=jr,qr.stride=Vr),qr.divisor!==Ur&&(R.vertexAttribDivisorANGLE(Hr,Ur),qr.divisor=Ur)):(qr.buffer&&(_t.disableVertexAttribArray(Hr),qr.buffer=null),qr.x===Pr&&qr.y===Or&&qr.z===Ir&&qr.w===Dr||(_t.vertexAttrib4f(Hr,Pr,Or,Ir,Dr),qr.x=Pr,qr.y=Or,qr.z=Ir,qr.w=Dr)),Wr=y.call(this,wt,B,F),Yr=!1,Zr=1,Xr=0,Jr=0,Kr=0,Qr=0,$r=null,tn=0,en=!1,rn=5126,nn=0,an=0,on=0,It(Wr)?(Yr=!0,rn=($r=St.createStream(34962,Wr)).dtype):($r=St.getBuffer(Wr))?rn=$r.dtype:"constant"in Wr?(Zr=2,"number"==typeof Wr.constant?(Xr=Wr.constant,Jr=Kr=Qr=0):(Xr=Wr.constant.length>0?Wr.constant[0]:0,Jr=Wr.constant.length>1?Wr.constant[1]:0,Kr=Wr.constant.length>2?Wr.constant[2]:0,Qr=Wr.constant.length>3?Wr.constant[3]:0)):($r=It(Wr.buffer)?St.createStream(34962,Wr.buffer):St.getBuffer(Wr.buffer),rn="type"in Wr?ae[Wr.type]:$r.dtype,en=!!Wr.normalized,tn=0|Wr.size,nn=0|Wr.offset,an=0|Wr.stride,on=0|Wr.divisor),sn=v.location,ln=Et[sn],1===Zr?(ln.buffer||_t.enableVertexAttribArray(sn),cn=tn||1,ln.type===rn&&ln.size===cn&&ln.buffer===$r&&ln.normalized===en&&ln.offset===nn&&ln.stride===an||(_t.bindBuffer(34962,$r.buffer),_t.vertexAttribPointer(sn,cn,rn,en,an,nn),ln.type=rn,ln.size=cn,ln.buffer=$r,ln.normalized=en,ln.offset=nn,ln.stride=an),ln.divisor!==on&&(R.vertexAttribDivisorANGLE(sn,on),ln.divisor=on)):(ln.buffer&&(_t.disableVertexAttribArray(sn),ln.buffer=null),ln.x===Xr&&ln.y===Jr&&ln.z===Kr&&ln.w===Qr||(_t.vertexAttrib4f(sn,Xr,Jr,Kr,Qr),ln.x=Xr,ln.y=Jr,ln.z=Kr,ln.w=Qr)),un=b.call(this,wt,B,F),fn=!1,pn=1,hn=0,dn=0,mn=0,gn=0,yn=null,vn=0,bn=!1,xn=5126,_n=0,wn=0,An=0,It(un)?(fn=!0,xn=(yn=St.createStream(34962,un)).dtype):(yn=St.getBuffer(un))?xn=yn.dtype:"constant"in un?(pn=2,"number"==typeof un.constant?(hn=un.constant,dn=mn=gn=0):(hn=un.constant.length>0?un.constant[0]:0,dn=un.constant.length>1?un.constant[1]:0,mn=un.constant.length>2?un.constant[2]:0,gn=un.constant.length>3?un.constant[3]:0)):(yn=It(un.buffer)?St.createStream(34962,un.buffer):St.getBuffer(un.buffer),xn="type"in un?ae[un.type]:yn.dtype,bn=!!un.normalized,vn=0|un.size,_n=0|un.offset,wn=0|un.stride,An=0|un.divisor),kn=x.location,Tn=Et[kn],1===pn?(Tn.buffer||_t.enableVertexAttribArray(kn),Mn=vn||1,Tn.type===xn&&Tn.size===Mn&&Tn.buffer===yn&&Tn.normalized===bn&&Tn.offset===_n&&Tn.stride===wn||(_t.bindBuffer(34962,yn.buffer),_t.vertexAttribPointer(kn,Mn,xn,bn,wn,_n),Tn.type=xn,Tn.size=Mn,Tn.buffer=yn,Tn.normalized=bn,Tn.offset=_n,Tn.stride=wn),Tn.divisor!==An&&(R.vertexAttribDivisorANGLE(kn,An),Tn.divisor=An)):(Tn.buffer&&(_t.disableVertexAttribArray(kn),Tn.buffer=null),Tn.x===hn&&Tn.y===dn&&Tn.z===mn&&Tn.w===gn||(_t.vertexAttrib4f(kn,hn,dn,mn,gn),Tn.x=hn,Tn.y=dn,Tn.z=mn,Tn.w=gn)),Sn=_.call(this,wt,B,F),zn=!1,En=1,Ln=0,Cn=0,Pn=0,On=0,In=null,Dn=0,Rn=!1,Fn=5126,Bn=0,Nn=0,jn=0,It(Sn)?(zn=!0,Fn=(In=St.createStream(34962,Sn)).dtype):(In=St.getBuffer(Sn))?Fn=In.dtype:"constant"in Sn?(En=2,"number"==typeof Sn.constant?(Ln=Sn.constant,Cn=Pn=On=0):(Ln=Sn.constant.length>0?Sn.constant[0]:0,Cn=Sn.constant.length>1?Sn.constant[1]:0,Pn=Sn.constant.length>2?Sn.constant[2]:0,On=Sn.constant.length>3?Sn.constant[3]:0)):(In=It(Sn.buffer)?St.createStream(34962,Sn.buffer):St.getBuffer(Sn.buffer),Fn="type"in Sn?ae[Sn.type]:In.dtype,Rn=!!Sn.normalized,Dn=0|Sn.size,Bn=0|Sn.offset,Nn=0|Sn.stride,jn=0|Sn.divisor),Vn=w.location,Un=Et[Vn],1===En?(Un.buffer||_t.enableVertexAttribArray(Vn),Hn=Dn||1,Un.type===Fn&&Un.size===Hn&&Un.buffer===In&&Un.normalized===Rn&&Un.offset===Bn&&Un.stride===Nn||(_t.bindBuffer(34962,In.buffer),_t.vertexAttribPointer(Vn,Hn,Fn,Rn,Nn,Bn),Un.type=Fn,Un.size=Hn,Un.buffer=In,Un.normalized=Rn,Un.offset=Bn,Un.stride=Nn),Un.divisor!==jn&&(R.vertexAttribDivisorANGLE(Vn,jn),Un.divisor=jn)):(Un.buffer&&(_t.disableVertexAttribArray(Vn),Un.buffer=null),Un.x===Ln&&Un.y===Cn&&Un.z===Pn&&Un.w===On||(_t.vertexAttrib4f(Vn,Ln,Cn,Pn,On),Un.x=Ln,Un.y=Cn,Un.z=Pn,Un.w=On)),qn=A.call(this,wt,B,F),Gn=!1,Wn=1,Yn=0,Zn=0,Xn=0,Jn=0,Kn=null,Qn=0,$n=!1,ti=5126,ei=0,ri=0,ni=0,It(qn)?(Gn=!0,ti=(Kn=St.createStream(34962,qn)).dtype):(Kn=St.getBuffer(qn))?ti=Kn.dtype:"constant"in qn?(Wn=2,"number"==typeof qn.constant?(Yn=qn.constant,Zn=Xn=Jn=0):(Yn=qn.constant.length>0?qn.constant[0]:0,Zn=qn.constant.length>1?qn.constant[1]:0,Xn=qn.constant.length>2?qn.constant[2]:0,Jn=qn.constant.length>3?qn.constant[3]:0)):(Kn=It(qn.buffer)?St.createStream(34962,qn.buffer):St.getBuffer(qn.buffer),ti="type"in qn?ae[qn.type]:Kn.dtype,$n=!!qn.normalized,Qn=0|qn.size,ei=0|qn.offset,ri=0|qn.stride,ni=0|qn.divisor),ii=k.location,ai=Et[ii],1===Wn?(ai.buffer||_t.enableVertexAttribArray(ii),oi=Qn||1,ai.type===ti&&ai.size===oi&&ai.buffer===Kn&&ai.normalized===$n&&ai.offset===ei&&ai.stride===ri||(_t.bindBuffer(34962,Kn.buffer),_t.vertexAttribPointer(ii,oi,ti,$n,ri,ei),ai.type=ti,ai.size=oi,ai.buffer=Kn,ai.normalized=$n,ai.offset=ei,ai.stride=ri),ai.divisor!==ni&&(R.vertexAttribDivisorANGLE(ii,ni),ai.divisor=ni)):(ai.buffer&&(_t.disableVertexAttribArray(ii),ai.buffer=null),ai.x===Yn&&ai.y===Zn&&ai.z===Xn&&ai.w===Jn||(_t.vertexAttrib4f(ii,Yn,Zn,Xn,Jn),ai.x=Yn,ai.y=Zn,ai.z=Xn,ai.w=Jn)),si=B.opacity,F&&li===si||(li=si,_t.uniform1f(M.location,si)),ui=(ci=z.call(this,wt,B,F))[0],pi=ci[1],F&&fi===ui&&hi===pi||(fi=ui,hi=pi,_t.uniform2f(S.location,ui,pi)),di=wt.pixelRatio,F&&mi===di||(mi=di,_t.uniform1f(C.location,di)),yi=(gi=B.scale)[0],bi=gi[1],F&&vi===yi&&xi===bi||(vi=yi,xi=bi,_t.uniform2f(P.location,yi,bi)),wi=(_i=B.scaleFract)[0],ki=_i[1],F&&Ai===wi&&Ti===ki||(Ai=wi,Ti=ki,_t.uniform2f(O.location,wi,ki)),Si=(Mi=B.translate)[0],Ei=Mi[1],F&&zi===Si&&Li===Ei||(zi=Si,Li=Ei,_t.uniform2f(I.location,Si,Ei)),Pi=(Ci=B.translateFract)[0],Ii=Ci[1],F&&Oi===Pi&&Di===Ii||(Oi=Pi,Di=Ii,_t.uniform2f(D.location,Pi,Ii)),Ri=B.elements,Fi=null,(Fi=(Bi=It(Ri))?Mt.createStream(Ri):Mt.getElements(Ri))&&_t.bindBuffer(34963,Fi.buffer.buffer),Ni=B.offset,(ji=B.count)&&(Dt>0?Fi?R.drawElementsInstancedANGLE(0,ji,Fi.type,Ni<<(Fi.type-5121>>1),Dt):R.drawArraysInstancedANGLE(0,Ni,ji,Dt):Dt<0&&(Fi?_t.drawElements(0,ji,Fi.type,Ni<<(Fi.type-5121>>1)):_t.drawArrays(0,Ni,ji)),wt.viewportWidth=le,wt.viewportHeight=ce,ge&&St.destroyStream(we),Oe&&St.destroyStream(Ne),Je&&St.destroyStream(rr),hr&&St.destroyStream(br),Lr&&St.destroyStream(Rr),Yr&&St.destroyStream($r),fn&&St.destroyStream(yn),zn&&St.destroyStream(In),Gn&&St.destroyStream(Kn),Bi&&Mt.destroyStream(Fi))}L.unbind(),kt.dirty=!0,Lt.setVAO(null),i&&(e.cpuTime+=performance.now()-a)}}}},{}],501:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s){"use strict";var l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V;return l=t.gl,c=t.context,t.strings,u=t.next,f=t.current,t.draw,t.elements,t.buffer,p=t.shader,t.attributes,h=t.vao,t.uniforms,d=t.framebuffer,m=t.extensions,t.timer,t.isBufferArgs,g=u.blend_color,y=f.blend_color,v=u.blend_equation,b=f.blend_equation,x=u.blend_func,_=f.blend_func,w=u.depth_range,A=f.depth_range,k=u.colorMask,T=f.colorMask,M=u.polygonOffset_offset,S=f.polygonOffset_offset,z=u.sample_coverage,E=f.sample_coverage,L=u.stencil_func,C=f.stencil_func,P=u.stencil_opFront,O=f.stencil_opFront,I=u.stencil_opBack,D=f.stencil_opBack,R=u.scissor_box,F=f.scissor_box,B=u.viewport,N=f.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},j={},V={},{draw:function(t){var n,i,a,o,s,R,B,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht;(m.angle_instanced_arrays,n=t.framebuffer,i=d.getFramebuffer(n),a=d.next,d.next=i,o=c.framebufferWidth,c.framebufferWidth=i?i.width:c.drawingBufferWidth,s=c.framebufferHeight,c.framebufferHeight=i?i.height:c.drawingBufferHeight,i!==d.cur&&(i?l.bindFramebuffer(36160,i.framebuffer):l.bindFramebuffer(36160,null),d.cur=i),f.dirty)&&((Q=u.dither)!==f.dither&&(Q?l.enable(3024):l.disable(3024),f.dither=Q),($=u.blend_enable)!==f.blend_enable&&($?l.enable(3042):l.disable(3042),f.blend_enable=$),tt=g[0],et=g[1],rt=g[2],nt=g[3],tt===y[0]&&et===y[1]&&rt===y[2]&&nt===y[3]||(l.blendColor(tt,et,rt,nt),y[0]=tt,y[1]=et,y[2]=rt,y[3]=nt),it=v[0],at=v[1],it===b[0]&&at===b[1]||(l.blendEquationSeparate(it,at),b[0]=it,b[1]=at),ot=x[0],st=x[1],lt=x[2],ct=x[3],ot===_[0]&&st===_[1]&<===_[2]&&ct===_[3]||(l.blendFuncSeparate(ot,st,lt,ct),_[0]=ot,_[1]=st,_[2]=lt,_[3]=ct),(ut=u.depth_enable)!==f.depth_enable&&(ut?l.enable(2929):l.disable(2929),f.depth_enable=ut),(ft=u.depth_func)!==f.depth_func&&(l.depthFunc(ft),f.depth_func=ft),pt=w[0],ht=w[1],pt===A[0]&&ht===A[1]||(l.depthRange(pt,ht),A[0]=pt,A[1]=ht),(dt=u.depth_mask)!==f.depth_mask&&(l.depthMask(dt),f.depth_mask=dt),mt=k[0],gt=k[1],yt=k[2],vt=k[3],mt===T[0]&>===T[1]&&yt===T[2]&&vt===T[3]||(l.colorMask(mt,gt,yt,vt),T[0]=mt,T[1]=gt,T[2]=yt,T[3]=vt),(bt=u.cull_enable)!==f.cull_enable&&(bt?l.enable(2884):l.disable(2884),f.cull_enable=bt),(xt=u.cull_face)!==f.cull_face&&(l.cullFace(xt),f.cull_face=xt),(_t=u.frontFace)!==f.frontFace&&(l.frontFace(_t),f.frontFace=_t),(wt=u.lineWidth)!==f.lineWidth&&(l.lineWidth(wt),f.lineWidth=wt),(At=u.polygonOffset_enable)!==f.polygonOffset_enable&&(At?l.enable(32823):l.disable(32823),f.polygonOffset_enable=At),kt=M[0],Tt=M[1],kt===S[0]&&Tt===S[1]||(l.polygonOffset(kt,Tt),S[0]=kt,S[1]=Tt),(Mt=u.sample_alpha)!==f.sample_alpha&&(Mt?l.enable(32926):l.disable(32926),f.sample_alpha=Mt),(St=u.sample_enable)!==f.sample_enable&&(St?l.enable(32928):l.disable(32928),f.sample_enable=St),zt=z[0],Et=z[1],zt===E[0]&&Et===E[1]||(l.sampleCoverage(zt,Et),E[0]=zt,E[1]=Et),(Lt=u.stencil_enable)!==f.stencil_enable&&(Lt?l.enable(2960):l.disable(2960),f.stencil_enable=Lt),(Ct=u.stencil_mask)!==f.stencil_mask&&(l.stencilMask(Ct),f.stencil_mask=Ct),Pt=L[0],Ot=L[1],It=L[2],Pt===C[0]&&Ot===C[1]&&It===C[2]||(l.stencilFunc(Pt,Ot,It),C[0]=Pt,C[1]=Ot,C[2]=It),Dt=P[0],Rt=P[1],Ft=P[2],Bt=P[3],Dt===O[0]&&Rt===O[1]&&Ft===O[2]&&Bt===O[3]||(l.stencilOpSeparate(Dt,Rt,Ft,Bt),O[0]=Dt,O[1]=Rt,O[2]=Ft,O[3]=Bt),Nt=I[0],jt=I[1],Vt=I[2],Ut=I[3],Nt===D[0]&&jt===D[1]&&Vt===D[2]&&Ut===D[3]||(l.stencilOpSeparate(Nt,jt,Vt,Ut),D[0]=Nt,D[1]=jt,D[2]=Vt,D[3]=Ut),(Ht=u.scissor_enable)!==f.scissor_enable&&(Ht?l.enable(3089):l.disable(3089),f.scissor_enable=Ht));R=c.framebufferWidth,B=c.framebufferHeight,V=c.viewportWidth,c.viewportWidth=R,U=c.viewportHeight,c.viewportHeight=B,l.viewport(0,0,R,B),N[0]=0,N[1]=0,N[2]=R,N[3]=B,H=c.framebufferWidth,q=c.framebufferHeight,l.scissor(0,0,H,q),F[0]=0,F[1]=0,F[2]=H,F[3]=q,(G=f.profile)&&(W=performance.now(),e.count++),Y=p.frag,Z=p.vert,X=p.program(Z,Y),l.useProgram(X.program),h.setVAO(null),J=X.id,(K=j[J])?K.call(this,t):(K=j[J]=r(X)).call(this,t),f.dirty=!0,h.setVAO(null),d.next=a,c.framebufferWidth=o,c.framebufferHeight=s,c.viewportWidth=V,c.viewportHeight=U,G&&(e.cpuTime+=performance.now()-W)},scope:function(t,r,s){var l,u,p,h,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C;l=t.framebuffer,u=d.getFramebuffer(l),p=d.next,d.next=u,h=c.framebufferWidth,c.framebufferWidth=u?u.width:c.drawingBufferWidth,m=c.framebufferHeight,c.framebufferHeight=u?u.height:c.drawingBufferHeight,g=c.framebufferWidth,y=c.framebufferHeight,v=c.viewportWidth,c.viewportWidth=g,b=c.viewportHeight,c.viewportHeight=y,x=B[0],B[0]=n,_=B[1],B[1]=i,w=B[2],B[2]=g,A=B[3],B[3]=y,k=c.framebufferWidth,T=c.framebufferHeight,M=R[0],R[0]=a,S=R[1],R[1]=o,z=R[2],R[2]=k,E=R[3],R[3]=T,(L=f.profile)&&(C=performance.now(),e.count++),f.dirty=!0,r(c,t,s),d.next=p,c.framebufferWidth=h,c.framebufferHeight=m,c.viewportWidth=v,c.viewportHeight=b,B[0]=x,B[1]=_,B[2]=w,B[3]=A,R[0]=M,R[1]=S,R[2]=z,R[3]=E,L&&(e.cpuTime+=performance.now()-C),f.dirty=!0},batch:function(t,r){var n,i,a,o,c,d,R,F,B,N,j,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et;(m.angle_instanced_arrays,f.dirty)&&((F=u.dither)!==f.dither&&(F?l.enable(3024):l.disable(3024),f.dither=F),(B=u.blend_enable)!==f.blend_enable&&(B?l.enable(3042):l.disable(3042),f.blend_enable=B),N=g[0],j=g[1],U=g[2],H=g[3],N===y[0]&&j===y[1]&&U===y[2]&&H===y[3]||(l.blendColor(N,j,U,H),y[0]=N,y[1]=j,y[2]=U,y[3]=H),q=v[0],G=v[1],q===b[0]&&G===b[1]||(l.blendEquationSeparate(q,G),b[0]=q,b[1]=G),W=x[0],Y=x[1],Z=x[2],X=x[3],W===_[0]&&Y===_[1]&&Z===_[2]&&X===_[3]||(l.blendFuncSeparate(W,Y,Z,X),_[0]=W,_[1]=Y,_[2]=Z,_[3]=X),(J=u.depth_enable)!==f.depth_enable&&(J?l.enable(2929):l.disable(2929),f.depth_enable=J),(K=u.depth_func)!==f.depth_func&&(l.depthFunc(K),f.depth_func=K),Q=w[0],$=w[1],Q===A[0]&&$===A[1]||(l.depthRange(Q,$),A[0]=Q,A[1]=$),(tt=u.depth_mask)!==f.depth_mask&&(l.depthMask(tt),f.depth_mask=tt),et=k[0],rt=k[1],nt=k[2],it=k[3],et===T[0]&&rt===T[1]&&nt===T[2]&&it===T[3]||(l.colorMask(et,rt,nt,it),T[0]=et,T[1]=rt,T[2]=nt,T[3]=it),(at=u.cull_enable)!==f.cull_enable&&(at?l.enable(2884):l.disable(2884),f.cull_enable=at),(ot=u.cull_face)!==f.cull_face&&(l.cullFace(ot),f.cull_face=ot),(st=u.frontFace)!==f.frontFace&&(l.frontFace(st),f.frontFace=st),(lt=u.lineWidth)!==f.lineWidth&&(l.lineWidth(lt),f.lineWidth=lt),(ct=u.polygonOffset_enable)!==f.polygonOffset_enable&&(ct?l.enable(32823):l.disable(32823),f.polygonOffset_enable=ct),ut=M[0],ft=M[1],ut===S[0]&&ft===S[1]||(l.polygonOffset(ut,ft),S[0]=ut,S[1]=ft),(pt=u.sample_alpha)!==f.sample_alpha&&(pt?l.enable(32926):l.disable(32926),f.sample_alpha=pt),(ht=u.sample_enable)!==f.sample_enable&&(ht?l.enable(32928):l.disable(32928),f.sample_enable=ht),dt=z[0],mt=z[1],dt===E[0]&&mt===E[1]||(l.sampleCoverage(dt,mt),E[0]=dt,E[1]=mt),(gt=u.stencil_enable)!==f.stencil_enable&&(gt?l.enable(2960):l.disable(2960),f.stencil_enable=gt),(yt=u.stencil_mask)!==f.stencil_mask&&(l.stencilMask(yt),f.stencil_mask=yt),vt=L[0],bt=L[1],xt=L[2],vt===C[0]&&bt===C[1]&&xt===C[2]||(l.stencilFunc(vt,bt,xt),C[0]=vt,C[1]=bt,C[2]=xt),_t=P[0],wt=P[1],At=P[2],kt=P[3],_t===O[0]&&wt===O[1]&&At===O[2]&&kt===O[3]||(l.stencilOpSeparate(_t,wt,At,kt),O[0]=_t,O[1]=wt,O[2]=At,O[3]=kt),Tt=I[0],Mt=I[1],St=I[2],zt=I[3],Tt===D[0]&&Mt===D[1]&&St===D[2]&&zt===D[3]||(l.stencilOpSeparate(Tt,Mt,St,zt),D[0]=Tt,D[1]=Mt,D[2]=St,D[3]=zt),(Et=u.scissor_enable)!==f.scissor_enable&&(Et?l.enable(3089):l.disable(3089),f.scissor_enable=Et));(n=f.profile)&&(i=performance.now(),e.count+=r),a=p.frag,o=p.vert,c=p.program(o,a),l.useProgram(c.program),h.setVAO(null),d=c.id,(R=V[d])?R.call(this,t,r):(R=V[d]=s(c)).call(this,t,r),f.dirty=!0,h.setVAO(null),n&&(e.cpuTime+=performance.now()-i)}}}},{}],502:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt){"use strict";var At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he;return At=t.gl,kt=t.context,t.strings,Tt=t.next,Mt=t.current,St=t.draw,zt=t.elements,Et=t.buffer,Lt=t.shader,Ct=t.attributes,Pt=t.vao,Ot=t.uniforms,It=t.framebuffer,Dt=t.extensions,t.timer,Rt=t.isBufferArgs,Ft=Tt.blend_color,Bt=Mt.blend_color,Nt=Tt.blend_equation,jt=Mt.blend_equation,Vt=Tt.blend_func,Ut=Mt.blend_func,Ht=Tt.depth_range,qt=Mt.depth_range,Gt=Tt.colorMask,Wt=Mt.colorMask,Yt=Tt.polygonOffset_offset,Zt=Mt.polygonOffset_offset,Xt=Tt.sample_coverage,Jt=Mt.sample_coverage,Kt=Tt.stencil_func,Qt=Mt.stencil_func,$t=Tt.stencil_opFront,te=Mt.stencil_opFront,ee=Tt.stencil_opBack,re=Mt.stencil_opBack,ne=Tt.scissor_box,ie=Mt.scissor_box,ae=Tt.viewport,oe=Mt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},se={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(le={}).stride=4,le.offset=0,le.divisor=1,(ce={}).stride=4,ce.offset=4,ce.divisor=1,(ue={}).stride=8,ue.offset=0,ue.divisor=1,(fe={}).stride=8,fe.offset=8,fe.divisor=1,(pe={}).stride=8,pe.offset=16,pe.divisor=1,(he={}).stride=8,he.offset=24,he.divisor=1,{draw:function(t){var L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,Lt,Ot,Ft,Nt,Vt,ne,ae,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn;(Dt.angle_instanced_arrays,(L=It.next)!==It.cur&&(L?At.bindFramebuffer(36160,L.framebuffer):At.bindFramebuffer(36160,null),It.cur=L),Mt.dirty)&&((Jr=Tt.dither)!==Mt.dither&&(Jr?At.enable(3024):At.disable(3024),Mt.dither=Jr),(Kr=Tt.depth_func)!==Mt.depth_func&&(At.depthFunc(Kr),Mt.depth_func=Kr),Qr=Ht[0],$r=Ht[1],Qr===qt[0]&&$r===qt[1]||(At.depthRange(Qr,$r),qt[0]=Qr,qt[1]=$r),(tn=Tt.depth_mask)!==Mt.depth_mask&&(At.depthMask(tn),Mt.depth_mask=tn),en=Gt[0],rn=Gt[1],nn=Gt[2],an=Gt[3],en===Wt[0]&&rn===Wt[1]&&nn===Wt[2]&&an===Wt[3]||(At.colorMask(en,rn,nn,an),Wt[0]=en,Wt[1]=rn,Wt[2]=nn,Wt[3]=an),(on=Tt.frontFace)!==Mt.frontFace&&(At.frontFace(on),Mt.frontFace=on),(sn=Tt.lineWidth)!==Mt.lineWidth&&(At.lineWidth(sn),Mt.lineWidth=sn),(ln=Tt.polygonOffset_enable)!==Mt.polygonOffset_enable&&(ln?At.enable(32823):At.disable(32823),Mt.polygonOffset_enable=ln),cn=Yt[0],un=Yt[1],cn===Zt[0]&&un===Zt[1]||(At.polygonOffset(cn,un),Zt[0]=cn,Zt[1]=un),(fn=Tt.sample_alpha)!==Mt.sample_alpha&&(fn?At.enable(32926):At.disable(32926),Mt.sample_alpha=fn),(pn=Tt.sample_enable)!==Mt.sample_enable&&(pn?At.enable(32928):At.disable(32928),Mt.sample_enable=pn),hn=Xt[0],dn=Xt[1],hn===Jt[0]&&dn===Jt[1]||(At.sampleCoverage(hn,dn),Jt[0]=hn,Jt[1]=dn),(mn=Tt.stencil_mask)!==Mt.stencil_mask&&(At.stencilMask(mn),Mt.stencil_mask=mn),gn=Kt[0],yn=Kt[1],vn=Kt[2],gn===Qt[0]&&yn===Qt[1]&&vn===Qt[2]||(At.stencilFunc(gn,yn,vn),Qt[0]=gn,Qt[1]=yn,Qt[2]=vn),bn=$t[0],xn=$t[1],_n=$t[2],wn=$t[3],bn===te[0]&&xn===te[1]&&_n===te[2]&&wn===te[3]||(At.stencilOpSeparate(bn,xn,_n,wn),te[0]=bn,te[1]=xn,te[2]=_n,te[3]=wn),An=ee[0],kn=ee[1],Tn=ee[2],Mn=ee[3],An===re[0]&&kn===re[1]&&Tn===re[2]&&Mn===re[3]||(At.stencilOpSeparate(An,kn,Tn,Mn),re[0]=An,re[1]=kn,re[2]=Tn,re[3]=Mn));P=0|(C=t.viewport).x,O=0|C.y,I="width"in C?0|C.width:kt.framebufferWidth-P,D="height"in C?0|C.height:kt.framebufferHeight-O,R=kt.viewportWidth,kt.viewportWidth=I,F=kt.viewportHeight,kt.viewportHeight=D,At.viewport(P,O,I,D),oe[0]=P,oe[1]=O,oe[2]=I,oe[3]=D,At.blendColor(0,0,0,0),Bt[0]=0,Bt[1]=0,Bt[2]=0,Bt[3]=0,r?At.enable(3042):At.disable(3042),Mt.blend_enable=r,At.blendEquationSeparate(32774,32774),jt[0]=32774,jt[1]=32774,At.blendFuncSeparate(770,771,773,1),Ut[0]=770,Ut[1]=771,Ut[2]=773,Ut[3]=1,n?At.enable(2884):At.disable(2884),Mt.cull_enable=n,At.cullFace(i),Mt.cull_face=i,(B=a.call(this,kt,t,0))?At.enable(2929):At.disable(2929),Mt.depth_enable=B,j=0|(N=t.viewport).x,V=0|N.y,U="width"in N?0|N.width:kt.framebufferWidth-j,H="height"in N?0|N.height:kt.framebufferHeight-V,At.scissor(j,V,U,H),ie[0]=j,ie[1]=V,ie[2]=U,ie[3]=H,o?At.enable(3089):At.disable(3089),Mt.scissor_enable=o,s?At.enable(2960):At.disable(2960),Mt.stencil_enable=s,(q=Mt.profile)&&(G=performance.now(),e.count++),At.useProgram(l.program),W=Dt.angle_instanced_arrays,Pt.setVAO(null),Y=t.colorBuffer,le.buffer=Y,Z=!1,X=1,J=0,K=0,Q=0,$=0,tt=null,et=0,rt=!1,nt=5126,it=0,at=0,ot=0,Rt(le)?(Z=!0,nt=(tt=Et.createStream(34962,le)).dtype):(tt=Et.getBuffer(le))?nt=tt.dtype:"constant"in le?(X=2,"number"==typeof le.constant?(J=le.constant,K=Q=$=0):(J=le.constant.length>0?le.constant[0]:0,K=le.constant.length>1?le.constant[1]:0,Q=le.constant.length>2?le.constant[2]:0,$=le.constant.length>3?le.constant[3]:0)):(tt=Rt(le.buffer)?Et.createStream(34962,le.buffer):Et.getBuffer(le.buffer),nt="type"in le?se[le.type]:tt.dtype,rt=!!le.normalized,et=0|le.size,it=0|le.offset,at=0|le.stride,ot=0|le.divisor),st=c.location,lt=Ct[st],1===X?(lt.buffer||At.enableVertexAttribArray(st),ct=et||4,lt.type===nt&<.size===ct&<.buffer===tt&<.normalized===rt&<.offset===it&<.stride===at||(At.bindBuffer(34962,tt.buffer),At.vertexAttribPointer(st,ct,nt,rt,at,it),lt.type=nt,lt.size=ct,lt.buffer=tt,lt.normalized=rt,lt.offset=it,lt.stride=at),lt.divisor!==ot&&(W.vertexAttribDivisorANGLE(st,ot),lt.divisor=ot)):(lt.buffer&&(At.disableVertexAttribArray(st),lt.buffer=null),lt.x===J&<.y===K&<.z===Q&<.w===$||(At.vertexAttrib4f(st,J,K,Q,$),lt.x=J,lt.y=K,lt.z=Q,lt.w=$)),ut=t.positionBuffer,fe.buffer=ut,ft=!1,pt=1,ht=0,dt=0,mt=0,gt=0,yt=null,vt=0,bt=!1,xt=5126,_t=0,wt=0,Lt=0,Rt(fe)?(ft=!0,xt=(yt=Et.createStream(34962,fe)).dtype):(yt=Et.getBuffer(fe))?xt=yt.dtype:"constant"in fe?(pt=2,"number"==typeof fe.constant?(ht=fe.constant,dt=mt=gt=0):(ht=fe.constant.length>0?fe.constant[0]:0,dt=fe.constant.length>1?fe.constant[1]:0,mt=fe.constant.length>2?fe.constant[2]:0,gt=fe.constant.length>3?fe.constant[3]:0)):(yt=Rt(fe.buffer)?Et.createStream(34962,fe.buffer):Et.getBuffer(fe.buffer),xt="type"in fe?se[fe.type]:yt.dtype,bt=!!fe.normalized,vt=0|fe.size,_t=0|fe.offset,wt=0|fe.stride,Lt=0|fe.divisor),Ot=u.location,Ft=Ct[Ot],1===pt?(Ft.buffer||At.enableVertexAttribArray(Ot),Nt=vt||2,Ft.type===xt&&Ft.size===Nt&&Ft.buffer===yt&&Ft.normalized===bt&&Ft.offset===_t&&Ft.stride===wt||(At.bindBuffer(34962,yt.buffer),At.vertexAttribPointer(Ot,Nt,xt,bt,wt,_t),Ft.type=xt,Ft.size=Nt,Ft.buffer=yt,Ft.normalized=bt,Ft.offset=_t,Ft.stride=wt),Ft.divisor!==Lt&&(W.vertexAttribDivisorANGLE(Ot,Lt),Ft.divisor=Lt)):(Ft.buffer&&(At.disableVertexAttribArray(Ot),Ft.buffer=null),Ft.x===ht&&Ft.y===dt&&Ft.z===mt&&Ft.w===gt||(At.vertexAttrib4f(Ot,ht,dt,mt,gt),Ft.x=ht,Ft.y=dt,Ft.z=mt,Ft.w=gt)),Vt=t.colorBuffer,ce.buffer=Vt,ne=!1,ae=1,de=0,me=0,ge=0,ye=0,ve=null,be=0,xe=!1,_e=5126,we=0,Ae=0,ke=0,Rt(ce)?(ne=!0,_e=(ve=Et.createStream(34962,ce)).dtype):(ve=Et.getBuffer(ce))?_e=ve.dtype:"constant"in ce?(ae=2,"number"==typeof ce.constant?(de=ce.constant,me=ge=ye=0):(de=ce.constant.length>0?ce.constant[0]:0,me=ce.constant.length>1?ce.constant[1]:0,ge=ce.constant.length>2?ce.constant[2]:0,ye=ce.constant.length>3?ce.constant[3]:0)):(ve=Rt(ce.buffer)?Et.createStream(34962,ce.buffer):Et.getBuffer(ce.buffer),_e="type"in ce?se[ce.type]:ve.dtype,xe=!!ce.normalized,be=0|ce.size,we=0|ce.offset,Ae=0|ce.stride,ke=0|ce.divisor),Te=f.location,Me=Ct[Te],1===ae?(Me.buffer||At.enableVertexAttribArray(Te),Se=be||4,Me.type===_e&&Me.size===Se&&Me.buffer===ve&&Me.normalized===xe&&Me.offset===we&&Me.stride===Ae||(At.bindBuffer(34962,ve.buffer),At.vertexAttribPointer(Te,Se,_e,xe,Ae,we),Me.type=_e,Me.size=Se,Me.buffer=ve,Me.normalized=xe,Me.offset=we,Me.stride=Ae),Me.divisor!==ke&&(W.vertexAttribDivisorANGLE(Te,ke),Me.divisor=ke)):(Me.buffer&&(At.disableVertexAttribArray(Te),Me.buffer=null),Me.x===de&&Me.y===me&&Me.z===ge&&Me.w===ye||(At.vertexAttrib4f(Te,de,me,ge,ye),Me.x=de,Me.y=me,Me.z=ge,Me.w=ye)),ze=t.positionBuffer,pe.buffer=ze,Ee=!1,Le=1,Ce=0,Pe=0,Oe=0,Ie=0,De=null,Re=0,Fe=!1,Be=5126,Ne=0,je=0,Ve=0,Rt(pe)?(Ee=!0,Be=(De=Et.createStream(34962,pe)).dtype):(De=Et.getBuffer(pe))?Be=De.dtype:"constant"in pe?(Le=2,"number"==typeof pe.constant?(Ce=pe.constant,Pe=Oe=Ie=0):(Ce=pe.constant.length>0?pe.constant[0]:0,Pe=pe.constant.length>1?pe.constant[1]:0,Oe=pe.constant.length>2?pe.constant[2]:0,Ie=pe.constant.length>3?pe.constant[3]:0)):(De=Rt(pe.buffer)?Et.createStream(34962,pe.buffer):Et.getBuffer(pe.buffer),Be="type"in pe?se[pe.type]:De.dtype,Fe=!!pe.normalized,Re=0|pe.size,Ne=0|pe.offset,je=0|pe.stride,Ve=0|pe.divisor),Ue=p.location,He=Ct[Ue],1===Le?(He.buffer||At.enableVertexAttribArray(Ue),qe=Re||2,He.type===Be&&He.size===qe&&He.buffer===De&&He.normalized===Fe&&He.offset===Ne&&He.stride===je||(At.bindBuffer(34962,De.buffer),At.vertexAttribPointer(Ue,qe,Be,Fe,je,Ne),He.type=Be,He.size=qe,He.buffer=De,He.normalized=Fe,He.offset=Ne,He.stride=je),He.divisor!==Ve&&(W.vertexAttribDivisorANGLE(Ue,Ve),He.divisor=Ve)):(He.buffer&&(At.disableVertexAttribArray(Ue),He.buffer=null),He.x===Ce&&He.y===Pe&&He.z===Oe&&He.w===Ie||(At.vertexAttrib4f(Ue,Ce,Pe,Oe,Ie),He.x=Ce,He.y=Pe,He.z=Oe,He.w=Ie)),Ge=d.location,(We=Ct[Ge]).buffer||At.enableVertexAttribArray(Ge),5126===We.type&&1===We.size&&We.buffer===h&&!1===We.normalized&&0===We.offset&&8===We.stride||(At.bindBuffer(34962,h.buffer),At.vertexAttribPointer(Ge,1,5126,!1,8,0),We.type=5126,We.size=1,We.buffer=h,We.normalized=!1,We.offset=0,We.stride=8),0!==We.divisor&&(W.vertexAttribDivisorANGLE(Ge,0),We.divisor=0),Ye=m.location,(Ze=Ct[Ye]).buffer||At.enableVertexAttribArray(Ye),5126===Ze.type&&1===Ze.size&&Ze.buffer===h&&!1===Ze.normalized&&4===Ze.offset&&8===Ze.stride||(At.bindBuffer(34962,h.buffer),At.vertexAttribPointer(Ye,1,5126,!1,8,4),Ze.type=5126,Ze.size=1,Ze.buffer=h,Ze.normalized=!1,Ze.offset=4,Ze.stride=8),0!==Ze.divisor&&(W.vertexAttribDivisorANGLE(Ye,0),Ze.divisor=0),Xe=t.positionBuffer,he.buffer=Xe,Je=!1,Ke=1,Qe=0,$e=0,tr=0,er=0,rr=null,nr=0,ir=!1,ar=5126,or=0,sr=0,lr=0,Rt(he)?(Je=!0,ar=(rr=Et.createStream(34962,he)).dtype):(rr=Et.getBuffer(he))?ar=rr.dtype:"constant"in he?(Ke=2,"number"==typeof he.constant?(Qe=he.constant,$e=tr=er=0):(Qe=he.constant.length>0?he.constant[0]:0,$e=he.constant.length>1?he.constant[1]:0,tr=he.constant.length>2?he.constant[2]:0,er=he.constant.length>3?he.constant[3]:0)):(rr=Rt(he.buffer)?Et.createStream(34962,he.buffer):Et.getBuffer(he.buffer),ar="type"in he?se[he.type]:rr.dtype,ir=!!he.normalized,nr=0|he.size,or=0|he.offset,sr=0|he.stride,lr=0|he.divisor),cr=g.location,ur=Ct[cr],1===Ke?(ur.buffer||At.enableVertexAttribArray(cr),fr=nr||2,ur.type===ar&&ur.size===fr&&ur.buffer===rr&&ur.normalized===ir&&ur.offset===or&&ur.stride===sr||(At.bindBuffer(34962,rr.buffer),At.vertexAttribPointer(cr,fr,ar,ir,sr,or),ur.type=ar,ur.size=fr,ur.buffer=rr,ur.normalized=ir,ur.offset=or,ur.stride=sr),ur.divisor!==lr&&(W.vertexAttribDivisorANGLE(cr,lr),ur.divisor=lr)):(ur.buffer&&(At.disableVertexAttribArray(cr),ur.buffer=null),ur.x===Qe&&ur.y===$e&&ur.z===tr&&ur.w===er||(At.vertexAttrib4f(cr,Qe,$e,tr,er),ur.x=Qe,ur.y=$e,ur.z=tr,ur.w=er)),pr=t.positionBuffer,ue.buffer=pr,hr=!1,dr=1,mr=0,gr=0,yr=0,vr=0,br=null,xr=0,_r=!1,wr=5126,Ar=0,kr=0,Tr=0,Rt(ue)?(hr=!0,wr=(br=Et.createStream(34962,ue)).dtype):(br=Et.getBuffer(ue))?wr=br.dtype:"constant"in ue?(dr=2,"number"==typeof ue.constant?(mr=ue.constant,gr=yr=vr=0):(mr=ue.constant.length>0?ue.constant[0]:0,gr=ue.constant.length>1?ue.constant[1]:0,yr=ue.constant.length>2?ue.constant[2]:0,vr=ue.constant.length>3?ue.constant[3]:0)):(br=Rt(ue.buffer)?Et.createStream(34962,ue.buffer):Et.getBuffer(ue.buffer),wr="type"in ue?se[ue.type]:br.dtype,_r=!!ue.normalized,xr=0|ue.size,Ar=0|ue.offset,kr=0|ue.stride,Tr=0|ue.divisor),Mr=y.location,Sr=Ct[Mr],1===dr?(Sr.buffer||At.enableVertexAttribArray(Mr),zr=xr||2,Sr.type===wr&&Sr.size===zr&&Sr.buffer===br&&Sr.normalized===_r&&Sr.offset===Ar&&Sr.stride===kr||(At.bindBuffer(34962,br.buffer),At.vertexAttribPointer(Mr,zr,wr,_r,kr,Ar),Sr.type=wr,Sr.size=zr,Sr.buffer=br,Sr.normalized=_r,Sr.offset=Ar,Sr.stride=kr),Sr.divisor!==Tr&&(W.vertexAttribDivisorANGLE(Mr,Tr),Sr.divisor=Tr)):(Sr.buffer&&(At.disableVertexAttribArray(Mr),Sr.buffer=null),Sr.x===mr&&Sr.y===gr&&Sr.z===yr&&Sr.w===vr||(At.vertexAttrib4f(Mr,mr,gr,yr,vr),Sr.x=mr,Sr.y=gr,Sr.z=yr,Sr.w=vr)),Er=t.dashLength,At.uniform1f(v.location,Er),(Lr=t.dashTexture)&&"framebuffer"===Lr._reglType&&(Lr=Lr.color[0]),Cr=Lr._texture,At.uniform1i(b.location,Cr.bind()),Pr=t.depth,At.uniform1f(x.location,Pr),Or=t.miterLimit,At.uniform1f(_.location,Or),Ir=A.call(this,kt,t,0),At.uniform1f(w.location,Ir),Dr=t.opacity,At.uniform1f(k.location,Dr),Fr=(Rr=t.scale)[0],Br=Rr[1],At.uniform2f(T.location,Fr,Br),Nr=t.thickness,At.uniform1f(M.location,Nr),Vr=(jr=t.translate)[0],Ur=jr[1],At.uniform2f(S.location,Vr,Ur),qr=(Hr=E.call(this,kt,t,0))[0],Gr=Hr[1],Wr=Hr[2],Yr=Hr[3],At.uniform4f(z.location,qr,Gr,Wr,Yr),((Zr=St.elements)||Pt.currentVAO&&(Zr=zt.getElements(Pt.currentVAO.elements)))&&At.bindBuffer(34963,Zr.buffer.buffer),(Xr=t.count)>0?Zr?W.drawElementsInstancedANGLE(5,4,Zr.type,0<<(Zr.type-5121>>1),Xr):W.drawArraysInstancedANGLE(5,0,4,Xr):Xr<0&&(Zr?At.drawElements(5,4,Zr.type,0<<(Zr.type-5121>>1)):At.drawArrays(5,0,4)),Mt.dirty=!0,Pt.setVAO(null),kt.viewportWidth=R,kt.viewportHeight=F,q&&(e.cpuTime+=performance.now()-G),Z&&Et.destroyStream(tt),ft&&Et.destroyStream(yt),ne&&Et.destroyStream(ve),Ee&&Et.destroyStream(De),Je&&Et.destroyStream(rr),hr&&Et.destroyStream(br),Cr.unbind()},scope:function(t,r,n){var i,o,s,l,c,u,f,p,d,m,g,y,v,b,x,_,w,k,T,M,S,z,vt,bt,xt,_t,wt,At,zt,Ct,Pt,It,Dt,Bt,jt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ie,oe,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi,Ei,Li,Ci,Pi,Oi,Ii,Di,Ri,Fi,Bi,Ni,ji,Vi,Ui,Hi,qi,Gi,Wi,Yi,Zi,Xi,Ji,Ki,Qi,$i,ta;o=0|(i=t.viewport).x,s=0|i.y,l="width"in i?0|i.width:kt.framebufferWidth-o,c="height"in i?0|i.height:kt.framebufferHeight-s,u=kt.viewportWidth,kt.viewportWidth=l,f=kt.viewportHeight,kt.viewportHeight=c,p=ae[0],ae[0]=o,d=ae[1],ae[1]=s,m=ae[2],ae[2]=l,g=ae[3],ae[3]=c,y=Ft[0],Ft[0]=L,v=Ft[1],Ft[1]=C,b=Ft[2],Ft[2]=P,x=Ft[3],Ft[3]=O,_=Tt.blend_enable,Tt.blend_enable=I,w=Nt[0],Nt[0]=D,k=Nt[1],Nt[1]=R,T=Vt[0],Vt[0]=F,M=Vt[1],Vt[1]=B,S=Vt[2],Vt[2]=N,z=Vt[3],Vt[3]=j,vt=Tt.cull_enable,Tt.cull_enable=V,bt=Tt.cull_face,Tt.cull_face=U,xt=a.call(this,kt,t,n),_t=Tt.depth_enable,Tt.depth_enable=xt,At=0|(wt=t.viewport).x,zt=0|wt.y,Ct="width"in wt?0|wt.width:kt.framebufferWidth-At,Pt="height"in wt?0|wt.height:kt.framebufferHeight-zt,It=ne[0],ne[0]=At,Dt=ne[1],ne[1]=zt,Bt=ne[2],ne[2]=Ct,jt=ne[3],ne[3]=Pt,Ut=Tt.scissor_enable,Tt.scissor_enable=H,Ht=Tt.stencil_enable,Tt.stencil_enable=q,(qt=Mt.profile)&&(Gt=performance.now(),e.count++),Wt=St.offset,St.offset=G,Yt=St.count,St.count=W,Zt=t.count,Xt=St.instances,St.instances=Zt,Jt=St.primitive,St.primitive=Y,Kt=A.call(this,kt,t,n),Qt=Ot[Z],Ot[Z]=Kt,$t=t.miterLimit,te=Ot[X],Ot[X]=$t,ee=t.scale,re=Ot[J],Ot[J]=ee,ie=t.scaleFract,oe=Ot[K],Ot[K]=ie,de=t.translateFract,me=Ot[Q],Ot[Q]=de,ge=t.translate,ye=Ot[$],Ot[$]=ge,ve=t.thickness,be=Ot[tt],Ot[tt]=ve,xe=t.dashTexture,_e=Ot[et],Ot[et]=xe,we=t.opacity,Ae=Ot[rt],Ot[rt]=we,ke=kt.pixelRatio,Te=Ot[nt],Ot[nt]=ke,Me=t.id,Se=Ot[it],Ot[it]=Me,ze=t.dashLength,Ee=Ot[at],Ot[at]=ze,Le=E.call(this,kt,t,n),Ce=Ot[ot],Ot[ot]=Le,Pe=t.depth,Oe=Ot[st],Ot[st]=Pe,Ie=lt.state,lt.state=1,De=lt.x,lt.x=0,Re=lt.y,lt.y=0,Fe=lt.z,lt.z=0,Be=lt.w,lt.w=0,Ne=lt.buffer,lt.buffer=h,je=lt.size,lt.size=0,Ve=lt.normalized,lt.normalized=!1,Ue=lt.type,lt.type=5126,He=lt.offset,lt.offset=0,qe=lt.stride,lt.stride=8,Ge=lt.divisor,lt.divisor=0,We=ct.state,ct.state=1,Ye=ct.x,ct.x=0,Ze=ct.y,ct.y=0,Xe=ct.z,ct.z=0,Je=ct.w,ct.w=0,Ke=ct.buffer,ct.buffer=h,Qe=ct.size,ct.size=0,$e=ct.normalized,ct.normalized=!1,tr=ct.type,ct.type=5126,er=ct.offset,ct.offset=4,rr=ct.stride,ct.stride=8,nr=ct.divisor,ct.divisor=0,ir=t.colorBuffer,le.buffer=ir,ar=!1,or=1,sr=0,lr=0,cr=0,ur=0,fr=null,pr=0,hr=!1,dr=5126,mr=0,gr=0,yr=0,Rt(le)?(ar=!0,dr=(fr=Et.createStream(34962,le)).dtype):(fr=Et.getBuffer(le))?dr=fr.dtype:"constant"in le?(or=2,"number"==typeof le.constant?(sr=le.constant,lr=cr=ur=0):(sr=le.constant.length>0?le.constant[0]:0,lr=le.constant.length>1?le.constant[1]:0,cr=le.constant.length>2?le.constant[2]:0,ur=le.constant.length>3?le.constant[3]:0)):(fr=Rt(le.buffer)?Et.createStream(34962,le.buffer):Et.getBuffer(le.buffer),dr="type"in le?se[le.type]:fr.dtype,hr=!!le.normalized,pr=0|le.size,mr=0|le.offset,gr=0|le.stride,yr=0|le.divisor),vr=ut.state,ut.state=or,br=ut.x,ut.x=sr,xr=ut.y,ut.y=lr,_r=ut.z,ut.z=cr,wr=ut.w,ut.w=ur,Ar=ut.buffer,ut.buffer=fr,kr=ut.size,ut.size=pr,Tr=ut.normalized,ut.normalized=hr,Mr=ut.type,ut.type=dr,Sr=ut.offset,ut.offset=mr,zr=ut.stride,ut.stride=gr,Er=ut.divisor,ut.divisor=yr,Lr=t.colorBuffer,ce.buffer=Lr,Cr=!1,Pr=1,Or=0,Ir=0,Dr=0,Rr=0,Fr=null,Br=0,Nr=!1,jr=5126,Vr=0,Ur=0,Hr=0,Rt(ce)?(Cr=!0,jr=(Fr=Et.createStream(34962,ce)).dtype):(Fr=Et.getBuffer(ce))?jr=Fr.dtype:"constant"in ce?(Pr=2,"number"==typeof ce.constant?(Or=ce.constant,Ir=Dr=Rr=0):(Or=ce.constant.length>0?ce.constant[0]:0,Ir=ce.constant.length>1?ce.constant[1]:0,Dr=ce.constant.length>2?ce.constant[2]:0,Rr=ce.constant.length>3?ce.constant[3]:0)):(Fr=Rt(ce.buffer)?Et.createStream(34962,ce.buffer):Et.getBuffer(ce.buffer),jr="type"in ce?se[ce.type]:Fr.dtype,Nr=!!ce.normalized,Br=0|ce.size,Vr=0|ce.offset,Ur=0|ce.stride,Hr=0|ce.divisor),qr=ft.state,ft.state=Pr,Gr=ft.x,ft.x=Or,Wr=ft.y,ft.y=Ir,Yr=ft.z,ft.z=Dr,Zr=ft.w,ft.w=Rr,Xr=ft.buffer,ft.buffer=Fr,Jr=ft.size,ft.size=Br,Kr=ft.normalized,ft.normalized=Nr,Qr=ft.type,ft.type=jr,$r=ft.offset,ft.offset=Vr,tn=ft.stride,ft.stride=Ur,en=ft.divisor,ft.divisor=Hr,rn=t.positionBuffer,ue.buffer=rn,nn=!1,an=1,on=0,sn=0,ln=0,cn=0,un=null,fn=0,pn=!1,hn=5126,dn=0,mn=0,gn=0,Rt(ue)?(nn=!0,hn=(un=Et.createStream(34962,ue)).dtype):(un=Et.getBuffer(ue))?hn=un.dtype:"constant"in ue?(an=2,"number"==typeof ue.constant?(on=ue.constant,sn=ln=cn=0):(on=ue.constant.length>0?ue.constant[0]:0,sn=ue.constant.length>1?ue.constant[1]:0,ln=ue.constant.length>2?ue.constant[2]:0,cn=ue.constant.length>3?ue.constant[3]:0)):(un=Rt(ue.buffer)?Et.createStream(34962,ue.buffer):Et.getBuffer(ue.buffer),hn="type"in ue?se[ue.type]:un.dtype,pn=!!ue.normalized,fn=0|ue.size,dn=0|ue.offset,mn=0|ue.stride,gn=0|ue.divisor),yn=pt.state,pt.state=an,vn=pt.x,pt.x=on,bn=pt.y,pt.y=sn,xn=pt.z,pt.z=ln,_n=pt.w,pt.w=cn,wn=pt.buffer,pt.buffer=un,An=pt.size,pt.size=fn,kn=pt.normalized,pt.normalized=pn,Tn=pt.type,pt.type=hn,Mn=pt.offset,pt.offset=dn,Sn=pt.stride,pt.stride=mn,zn=pt.divisor,pt.divisor=gn,En=t.positionBuffer,fe.buffer=En,Ln=!1,Cn=1,Pn=0,On=0,In=0,Dn=0,Rn=null,Fn=0,Bn=!1,Nn=5126,jn=0,Vn=0,Un=0,Rt(fe)?(Ln=!0,Nn=(Rn=Et.createStream(34962,fe)).dtype):(Rn=Et.getBuffer(fe))?Nn=Rn.dtype:"constant"in fe?(Cn=2,"number"==typeof fe.constant?(Pn=fe.constant,On=In=Dn=0):(Pn=fe.constant.length>0?fe.constant[0]:0,On=fe.constant.length>1?fe.constant[1]:0,In=fe.constant.length>2?fe.constant[2]:0,Dn=fe.constant.length>3?fe.constant[3]:0)):(Rn=Rt(fe.buffer)?Et.createStream(34962,fe.buffer):Et.getBuffer(fe.buffer),Nn="type"in fe?se[fe.type]:Rn.dtype,Bn=!!fe.normalized,Fn=0|fe.size,jn=0|fe.offset,Vn=0|fe.stride,Un=0|fe.divisor),Hn=ht.state,ht.state=Cn,qn=ht.x,ht.x=Pn,Gn=ht.y,ht.y=On,Wn=ht.z,ht.z=In,Yn=ht.w,ht.w=Dn,Zn=ht.buffer,ht.buffer=Rn,Xn=ht.size,ht.size=Fn,Jn=ht.normalized,ht.normalized=Bn,Kn=ht.type,ht.type=Nn,Qn=ht.offset,ht.offset=jn,$n=ht.stride,ht.stride=Vn,ti=ht.divisor,ht.divisor=Un,ei=t.positionBuffer,pe.buffer=ei,ri=!1,ni=1,ii=0,ai=0,oi=0,si=0,li=null,ci=0,ui=!1,fi=5126,pi=0,hi=0,di=0,Rt(pe)?(ri=!0,fi=(li=Et.createStream(34962,pe)).dtype):(li=Et.getBuffer(pe))?fi=li.dtype:"constant"in pe?(ni=2,"number"==typeof pe.constant?(ii=pe.constant,ai=oi=si=0):(ii=pe.constant.length>0?pe.constant[0]:0,ai=pe.constant.length>1?pe.constant[1]:0,oi=pe.constant.length>2?pe.constant[2]:0,si=pe.constant.length>3?pe.constant[3]:0)):(li=Rt(pe.buffer)?Et.createStream(34962,pe.buffer):Et.getBuffer(pe.buffer),fi="type"in pe?se[pe.type]:li.dtype,ui=!!pe.normalized,ci=0|pe.size,pi=0|pe.offset,hi=0|pe.stride,di=0|pe.divisor),mi=dt.state,dt.state=ni,gi=dt.x,dt.x=ii,yi=dt.y,dt.y=ai,vi=dt.z,dt.z=oi,bi=dt.w,dt.w=si,xi=dt.buffer,dt.buffer=li,_i=dt.size,dt.size=ci,wi=dt.normalized,dt.normalized=ui,Ai=dt.type,dt.type=fi,ki=dt.offset,dt.offset=pi,Ti=dt.stride,dt.stride=hi,Mi=dt.divisor,dt.divisor=di,Si=t.positionBuffer,he.buffer=Si,zi=!1,Ei=1,Li=0,Ci=0,Pi=0,Oi=0,Ii=null,Di=0,Ri=!1,Fi=5126,Bi=0,Ni=0,ji=0,Rt(he)?(zi=!0,Fi=(Ii=Et.createStream(34962,he)).dtype):(Ii=Et.getBuffer(he))?Fi=Ii.dtype:"constant"in he?(Ei=2,"number"==typeof he.constant?(Li=he.constant,Ci=Pi=Oi=0):(Li=he.constant.length>0?he.constant[0]:0,Ci=he.constant.length>1?he.constant[1]:0,Pi=he.constant.length>2?he.constant[2]:0,Oi=he.constant.length>3?he.constant[3]:0)):(Ii=Rt(he.buffer)?Et.createStream(34962,he.buffer):Et.getBuffer(he.buffer),Fi="type"in he?se[he.type]:Ii.dtype,Ri=!!he.normalized,Di=0|he.size,Bi=0|he.offset,Ni=0|he.stride,ji=0|he.divisor),Vi=mt.state,mt.state=Ei,Ui=mt.x,mt.x=Li,Hi=mt.y,mt.y=Ci,qi=mt.z,mt.z=Pi,Gi=mt.w,mt.w=Oi,Wi=mt.buffer,mt.buffer=Ii,Yi=mt.size,mt.size=Di,Zi=mt.normalized,mt.normalized=Ri,Xi=mt.type,mt.type=Fi,Ji=mt.offset,mt.offset=Bi,Ki=mt.stride,mt.stride=Ni,Qi=mt.divisor,mt.divisor=ji,$i=Lt.vert,Lt.vert=gt,ta=Lt.frag,Lt.frag=yt,Mt.dirty=!0,r(kt,t,n),kt.viewportWidth=u,kt.viewportHeight=f,ae[0]=p,ae[1]=d,ae[2]=m,ae[3]=g,Ft[0]=y,Ft[1]=v,Ft[2]=b,Ft[3]=x,Tt.blend_enable=_,Nt[0]=w,Nt[1]=k,Vt[0]=T,Vt[1]=M,Vt[2]=S,Vt[3]=z,Tt.cull_enable=vt,Tt.cull_face=bt,Tt.depth_enable=_t,ne[0]=It,ne[1]=Dt,ne[2]=Bt,ne[3]=jt,Tt.scissor_enable=Ut,Tt.stencil_enable=Ht,qt&&(e.cpuTime+=performance.now()-Gt),St.offset=Wt,St.count=Yt,St.instances=Xt,St.primitive=Jt,Ot[Z]=Qt,Ot[X]=te,Ot[J]=re,Ot[K]=oe,Ot[Q]=me,Ot[$]=ye,Ot[tt]=be,Ot[et]=_e,Ot[rt]=Ae,Ot[nt]=Te,Ot[it]=Se,Ot[at]=Ee,Ot[ot]=Ce,Ot[st]=Oe,lt.state=Ie,lt.x=De,lt.y=Re,lt.z=Fe,lt.w=Be,lt.buffer=Ne,lt.size=je,lt.normalized=Ve,lt.type=Ue,lt.offset=He,lt.stride=qe,lt.divisor=Ge,ct.state=We,ct.x=Ye,ct.y=Ze,ct.z=Xe,ct.w=Je,ct.buffer=Ke,ct.size=Qe,ct.normalized=$e,ct.type=tr,ct.offset=er,ct.stride=rr,ct.divisor=nr,ar&&Et.destroyStream(fr),ut.state=vr,ut.x=br,ut.y=xr,ut.z=_r,ut.w=wr,ut.buffer=Ar,ut.size=kr,ut.normalized=Tr,ut.type=Mr,ut.offset=Sr,ut.stride=zr,ut.divisor=Er,Cr&&Et.destroyStream(Fr),ft.state=qr,ft.x=Gr,ft.y=Wr,ft.z=Yr,ft.w=Zr,ft.buffer=Xr,ft.size=Jr,ft.normalized=Kr,ft.type=Qr,ft.offset=$r,ft.stride=tn,ft.divisor=en,nn&&Et.destroyStream(un),pt.state=yn,pt.x=vn,pt.y=bn,pt.z=xn,pt.w=_n,pt.buffer=wn,pt.size=An,pt.normalized=kn,pt.type=Tn,pt.offset=Mn,pt.stride=Sn,pt.divisor=zn,Ln&&Et.destroyStream(Rn),ht.state=Hn,ht.x=qn,ht.y=Gn,ht.z=Wn,ht.w=Yn,ht.buffer=Zn,ht.size=Xn,ht.normalized=Jn,ht.type=Kn,ht.offset=Qn,ht.stride=$n,ht.divisor=ti,ri&&Et.destroyStream(li),dt.state=mi,dt.x=gi,dt.y=yi,dt.z=vi,dt.w=bi,dt.buffer=xi,dt.size=_i,dt.normalized=wi,dt.type=Ai,dt.offset=ki,dt.stride=Ti,dt.divisor=Mi,zi&&Et.destroyStream(Ii),mt.state=Vi,mt.x=Ui,mt.y=Hi,mt.z=qi,mt.w=Gi,mt.buffer=Wi,mt.size=Yi,mt.normalized=Zi,mt.type=Xi,mt.offset=Ji,mt.stride=Ki,mt.divisor=Qi,Lt.vert=$i,Lt.frag=ta,Mt.dirty=!0},batch:function(t,r){var n,i,o,s,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt;(Dt.angle_instanced_arrays,(n=It.next)!==It.cur&&(n?At.bindFramebuffer(36160,n.framebuffer):At.bindFramebuffer(36160,null),It.cur=n),Mt.dirty)&&((P=Tt.dither)!==Mt.dither&&(P?At.enable(3024):At.disable(3024),Mt.dither=P),(O=Tt.depth_func)!==Mt.depth_func&&(At.depthFunc(O),Mt.depth_func=O),I=Ht[0],D=Ht[1],I===qt[0]&&D===qt[1]||(At.depthRange(I,D),qt[0]=I,qt[1]=D),(R=Tt.depth_mask)!==Mt.depth_mask&&(At.depthMask(R),Mt.depth_mask=R),F=Gt[0],B=Gt[1],N=Gt[2],j=Gt[3],F===Wt[0]&&B===Wt[1]&&N===Wt[2]&&j===Wt[3]||(At.colorMask(F,B,N,j),Wt[0]=F,Wt[1]=B,Wt[2]=N,Wt[3]=j),(V=Tt.frontFace)!==Mt.frontFace&&(At.frontFace(V),Mt.frontFace=V),(U=Tt.lineWidth)!==Mt.lineWidth&&(At.lineWidth(U),Mt.lineWidth=U),(H=Tt.polygonOffset_enable)!==Mt.polygonOffset_enable&&(H?At.enable(32823):At.disable(32823),Mt.polygonOffset_enable=H),q=Yt[0],G=Yt[1],q===Zt[0]&&G===Zt[1]||(At.polygonOffset(q,G),Zt[0]=q,Zt[1]=G),(W=Tt.sample_alpha)!==Mt.sample_alpha&&(W?At.enable(32926):At.disable(32926),Mt.sample_alpha=W),(Y=Tt.sample_enable)!==Mt.sample_enable&&(Y?At.enable(32928):At.disable(32928),Mt.sample_enable=Y),Z=Xt[0],X=Xt[1],Z===Jt[0]&&X===Jt[1]||(At.sampleCoverage(Z,X),Jt[0]=Z,Jt[1]=X),(J=Tt.stencil_mask)!==Mt.stencil_mask&&(At.stencilMask(J),Mt.stencil_mask=J),K=Kt[0],Q=Kt[1],$=Kt[2],K===Qt[0]&&Q===Qt[1]&&$===Qt[2]||(At.stencilFunc(K,Q,$),Qt[0]=K,Qt[1]=Q,Qt[2]=$),tt=$t[0],et=$t[1],rt=$t[2],nt=$t[3],tt===te[0]&&et===te[1]&&rt===te[2]&&nt===te[3]||(At.stencilOpSeparate(tt,et,rt,nt),te[0]=tt,te[1]=et,te[2]=rt,te[3]=nt),it=ee[0],at=ee[1],ot=ee[2],st=ee[3],it===re[0]&&at===re[1]&&ot===re[2]&&st===re[3]||(At.stencilOpSeparate(it,at,ot,st),re[0]=it,re[1]=at,re[2]=ot,re[3]=st));for(At.blendColor(0,0,0,0),Bt[0]=0,Bt[1]=0,Bt[2]=0,Bt[3]=0,vt?At.enable(3042):At.disable(3042),Mt.blend_enable=vt,At.blendEquationSeparate(32774,32774),jt[0]=32774,jt[1]=32774,At.blendFuncSeparate(770,771,773,1),Ut[0]=770,Ut[1]=771,Ut[2]=773,Ut[3]=1,bt?At.enable(2884):At.disable(2884),Mt.cull_enable=bt,At.cullFace(xt),Mt.cull_face=xt,_t?At.enable(3089):At.disable(3089),Mt.scissor_enable=_t,wt?At.enable(2960):At.disable(2960),Mt.stencil_enable=wt,(i=Mt.profile)&&(o=performance.now(),e.count+=r),At.useProgram(l.program),s=Dt.angle_instanced_arrays,Pt.setVAO(null),lt=d.location,(ct=Ct[lt]).buffer||At.enableVertexAttribArray(lt),5126===ct.type&&1===ct.size&&ct.buffer===h&&!1===ct.normalized&&0===ct.offset&&8===ct.stride||(At.bindBuffer(34962,h.buffer),At.vertexAttribPointer(lt,1,5126,!1,8,0),ct.type=5126,ct.size=1,ct.buffer=h,ct.normalized=!1,ct.offset=0,ct.stride=8),0!==ct.divisor&&(s.vertexAttribDivisorANGLE(lt,0),ct.divisor=0),ut=m.location,(ft=Ct[ut]).buffer||At.enableVertexAttribArray(ut),5126===ft.type&&1===ft.size&&ft.buffer===h&&!1===ft.normalized&&4===ft.offset&&8===ft.stride||(At.bindBuffer(34962,h.buffer),At.vertexAttribPointer(ut,1,5126,!1,8,4),ft.type=5126,ft.size=1,ft.buffer=h,ft.normalized=!1,ft.offset=4,ft.stride=8),0!==ft.divisor&&(s.vertexAttribDivisorANGLE(ut,0),ft.divisor=0),((pt=St.elements)||Pt.currentVAO&&(pt=zt.getElements(Pt.currentVAO.elements)))&&At.bindBuffer(34963,pt.buffer.buffer),L=0;L0?le.constant[0]:0,be=le.constant.length>1?le.constant[1]:0,xe=le.constant.length>2?le.constant[2]:0,_e=le.constant.length>3?le.constant[3]:0)):(we=Rt(le.buffer)?Et.createStream(34962,le.buffer):Et.getBuffer(le.buffer),Te="type"in le?se[le.type]:we.dtype,ke=!!le.normalized,Ae=0|le.size,Me=0|le.offset,Se=0|le.stride,ze=0|le.divisor),Ee=c.location,Le=Ct[Ee],1===ye?(Le.buffer||At.enableVertexAttribArray(Ee),Ce=Ae||4,Le.type===Te&&Le.size===Ce&&Le.buffer===we&&Le.normalized===ke&&Le.offset===Me&&Le.stride===Se||(At.bindBuffer(34962,we.buffer),At.vertexAttribPointer(Ee,Ce,Te,ke,Se,Me),Le.type=Te,Le.size=Ce,Le.buffer=we,Le.normalized=ke,Le.offset=Me,Le.stride=Se),Le.divisor!==ze&&(s.vertexAttribDivisorANGLE(Ee,ze),Le.divisor=ze)):(Le.buffer&&(At.disableVertexAttribArray(Ee),Le.buffer=null),Le.x===ve&&Le.y===be&&Le.z===xe&&Le.w===_e||(At.vertexAttrib4f(Ee,ve,be,xe,_e),Le.x=ve,Le.y=be,Le.z=xe,Le.w=_e)),Pe=C.positionBuffer,fe.buffer=Pe,Oe=!1,Ie=1,De=0,Re=0,Fe=0,Be=0,Ne=null,je=0,Ve=!1,Ue=5126,He=0,qe=0,Ge=0,Rt(fe)?(Oe=!0,Ue=(Ne=Et.createStream(34962,fe)).dtype):(Ne=Et.getBuffer(fe))?Ue=Ne.dtype:"constant"in fe?(Ie=2,"number"==typeof fe.constant?(De=fe.constant,Re=Fe=Be=0):(De=fe.constant.length>0?fe.constant[0]:0,Re=fe.constant.length>1?fe.constant[1]:0,Fe=fe.constant.length>2?fe.constant[2]:0,Be=fe.constant.length>3?fe.constant[3]:0)):(Ne=Rt(fe.buffer)?Et.createStream(34962,fe.buffer):Et.getBuffer(fe.buffer),Ue="type"in fe?se[fe.type]:Ne.dtype,Ve=!!fe.normalized,je=0|fe.size,He=0|fe.offset,qe=0|fe.stride,Ge=0|fe.divisor),We=u.location,Ye=Ct[We],1===Ie?(Ye.buffer||At.enableVertexAttribArray(We),Ze=je||2,Ye.type===Ue&&Ye.size===Ze&&Ye.buffer===Ne&&Ye.normalized===Ve&&Ye.offset===He&&Ye.stride===qe||(At.bindBuffer(34962,Ne.buffer),At.vertexAttribPointer(We,Ze,Ue,Ve,qe,He),Ye.type=Ue,Ye.size=Ze,Ye.buffer=Ne,Ye.normalized=Ve,Ye.offset=He,Ye.stride=qe),Ye.divisor!==Ge&&(s.vertexAttribDivisorANGLE(We,Ge),Ye.divisor=Ge)):(Ye.buffer&&(At.disableVertexAttribArray(We),Ye.buffer=null),Ye.x===De&&Ye.y===Re&&Ye.z===Fe&&Ye.w===Be||(At.vertexAttrib4f(We,De,Re,Fe,Be),Ye.x=De,Ye.y=Re,Ye.z=Fe,Ye.w=Be)),Xe=C.colorBuffer,ce.buffer=Xe,Je=!1,Ke=1,Qe=0,$e=0,tr=0,er=0,rr=null,nr=0,ir=!1,ar=5126,or=0,sr=0,lr=0,Rt(ce)?(Je=!0,ar=(rr=Et.createStream(34962,ce)).dtype):(rr=Et.getBuffer(ce))?ar=rr.dtype:"constant"in ce?(Ke=2,"number"==typeof ce.constant?(Qe=ce.constant,$e=tr=er=0):(Qe=ce.constant.length>0?ce.constant[0]:0,$e=ce.constant.length>1?ce.constant[1]:0,tr=ce.constant.length>2?ce.constant[2]:0,er=ce.constant.length>3?ce.constant[3]:0)):(rr=Rt(ce.buffer)?Et.createStream(34962,ce.buffer):Et.getBuffer(ce.buffer),ar="type"in ce?se[ce.type]:rr.dtype,ir=!!ce.normalized,nr=0|ce.size,or=0|ce.offset,sr=0|ce.stride,lr=0|ce.divisor),cr=f.location,ur=Ct[cr],1===Ke?(ur.buffer||At.enableVertexAttribArray(cr),fr=nr||4,ur.type===ar&&ur.size===fr&&ur.buffer===rr&&ur.normalized===ir&&ur.offset===or&&ur.stride===sr||(At.bindBuffer(34962,rr.buffer),At.vertexAttribPointer(cr,fr,ar,ir,sr,or),ur.type=ar,ur.size=fr,ur.buffer=rr,ur.normalized=ir,ur.offset=or,ur.stride=sr),ur.divisor!==lr&&(s.vertexAttribDivisorANGLE(cr,lr),ur.divisor=lr)):(ur.buffer&&(At.disableVertexAttribArray(cr),ur.buffer=null),ur.x===Qe&&ur.y===$e&&ur.z===tr&&ur.w===er||(At.vertexAttrib4f(cr,Qe,$e,tr,er),ur.x=Qe,ur.y=$e,ur.z=tr,ur.w=er)),pr=C.positionBuffer,pe.buffer=pr,hr=!1,dr=1,mr=0,gr=0,yr=0,vr=0,br=null,xr=0,_r=!1,wr=5126,Ar=0,kr=0,Tr=0,Rt(pe)?(hr=!0,wr=(br=Et.createStream(34962,pe)).dtype):(br=Et.getBuffer(pe))?wr=br.dtype:"constant"in pe?(dr=2,"number"==typeof pe.constant?(mr=pe.constant,gr=yr=vr=0):(mr=pe.constant.length>0?pe.constant[0]:0,gr=pe.constant.length>1?pe.constant[1]:0,yr=pe.constant.length>2?pe.constant[2]:0,vr=pe.constant.length>3?pe.constant[3]:0)):(br=Rt(pe.buffer)?Et.createStream(34962,pe.buffer):Et.getBuffer(pe.buffer),wr="type"in pe?se[pe.type]:br.dtype,_r=!!pe.normalized,xr=0|pe.size,Ar=0|pe.offset,kr=0|pe.stride,Tr=0|pe.divisor),Mr=p.location,Sr=Ct[Mr],1===dr?(Sr.buffer||At.enableVertexAttribArray(Mr),zr=xr||2,Sr.type===wr&&Sr.size===zr&&Sr.buffer===br&&Sr.normalized===_r&&Sr.offset===Ar&&Sr.stride===kr||(At.bindBuffer(34962,br.buffer),At.vertexAttribPointer(Mr,zr,wr,_r,kr,Ar),Sr.type=wr,Sr.size=zr,Sr.buffer=br,Sr.normalized=_r,Sr.offset=Ar,Sr.stride=kr),Sr.divisor!==Tr&&(s.vertexAttribDivisorANGLE(Mr,Tr),Sr.divisor=Tr)):(Sr.buffer&&(At.disableVertexAttribArray(Mr),Sr.buffer=null),Sr.x===mr&&Sr.y===gr&&Sr.z===yr&&Sr.w===vr||(At.vertexAttrib4f(Mr,mr,gr,yr,vr),Sr.x=mr,Sr.y=gr,Sr.z=yr,Sr.w=vr)),Er=C.positionBuffer,he.buffer=Er,Lr=!1,Cr=1,Pr=0,Or=0,Ir=0,Dr=0,Rr=null,Fr=0,Br=!1,Nr=5126,jr=0,Vr=0,Ur=0,Rt(he)?(Lr=!0,Nr=(Rr=Et.createStream(34962,he)).dtype):(Rr=Et.getBuffer(he))?Nr=Rr.dtype:"constant"in he?(Cr=2,"number"==typeof he.constant?(Pr=he.constant,Or=Ir=Dr=0):(Pr=he.constant.length>0?he.constant[0]:0,Or=he.constant.length>1?he.constant[1]:0,Ir=he.constant.length>2?he.constant[2]:0,Dr=he.constant.length>3?he.constant[3]:0)):(Rr=Rt(he.buffer)?Et.createStream(34962,he.buffer):Et.getBuffer(he.buffer),Nr="type"in he?se[he.type]:Rr.dtype,Br=!!he.normalized,Fr=0|he.size,jr=0|he.offset,Vr=0|he.stride,Ur=0|he.divisor),Hr=g.location,qr=Ct[Hr],1===Cr?(qr.buffer||At.enableVertexAttribArray(Hr),Gr=Fr||2,qr.type===Nr&&qr.size===Gr&&qr.buffer===Rr&&qr.normalized===Br&&qr.offset===jr&&qr.stride===Vr||(At.bindBuffer(34962,Rr.buffer),At.vertexAttribPointer(Hr,Gr,Nr,Br,Vr,jr),qr.type=Nr,qr.size=Gr,qr.buffer=Rr,qr.normalized=Br,qr.offset=jr,qr.stride=Vr),qr.divisor!==Ur&&(s.vertexAttribDivisorANGLE(Hr,Ur),qr.divisor=Ur)):(qr.buffer&&(At.disableVertexAttribArray(Hr),qr.buffer=null),qr.x===Pr&&qr.y===Or&&qr.z===Ir&&qr.w===Dr||(At.vertexAttrib4f(Hr,Pr,Or,Ir,Dr),qr.x=Pr,qr.y=Or,qr.z=Ir,qr.w=Dr)),Wr=C.positionBuffer,ue.buffer=Wr,Yr=!1,Zr=1,Xr=0,Jr=0,Kr=0,Qr=0,$r=null,tn=0,en=!1,rn=5126,nn=0,an=0,on=0,Rt(ue)?(Yr=!0,rn=($r=Et.createStream(34962,ue)).dtype):($r=Et.getBuffer(ue))?rn=$r.dtype:"constant"in ue?(Zr=2,"number"==typeof ue.constant?(Xr=ue.constant,Jr=Kr=Qr=0):(Xr=ue.constant.length>0?ue.constant[0]:0,Jr=ue.constant.length>1?ue.constant[1]:0,Kr=ue.constant.length>2?ue.constant[2]:0,Qr=ue.constant.length>3?ue.constant[3]:0)):($r=Rt(ue.buffer)?Et.createStream(34962,ue.buffer):Et.getBuffer(ue.buffer),rn="type"in ue?se[ue.type]:$r.dtype,en=!!ue.normalized,tn=0|ue.size,nn=0|ue.offset,an=0|ue.stride,on=0|ue.divisor),sn=y.location,ln=Ct[sn],1===Zr?(ln.buffer||At.enableVertexAttribArray(sn),cn=tn||2,ln.type===rn&&ln.size===cn&&ln.buffer===$r&&ln.normalized===en&&ln.offset===nn&&ln.stride===an||(At.bindBuffer(34962,$r.buffer),At.vertexAttribPointer(sn,cn,rn,en,an,nn),ln.type=rn,ln.size=cn,ln.buffer=$r,ln.normalized=en,ln.offset=nn,ln.stride=an),ln.divisor!==on&&(s.vertexAttribDivisorANGLE(sn,on),ln.divisor=on)):(ln.buffer&&(At.disableVertexAttribArray(sn),ln.buffer=null),ln.x===Xr&&ln.y===Jr&&ln.z===Kr&&ln.w===Qr||(At.vertexAttrib4f(sn,Xr,Jr,Kr,Qr),ln.x=Xr,ln.y=Jr,ln.z=Kr,ln.w=Qr)),un=C.dashLength,L&&fn===un||(fn=un,At.uniform1f(v.location,un)),(pn=C.dashTexture)&&"framebuffer"===pn._reglType&&(pn=pn.color[0]),hn=pn._texture,At.uniform1i(b.location,hn.bind()),dn=C.depth,L&&mn===dn||(mn=dn,At.uniform1f(x.location,dn)),gn=C.miterLimit,L&&yn===gn||(yn=gn,At.uniform1f(_.location,gn)),vn=A.call(this,kt,C,L),L&&bn===vn||(bn=vn,At.uniform1f(w.location,vn)),xn=C.opacity,L&&_n===xn||(_n=xn,At.uniform1f(k.location,xn)),An=(wn=C.scale)[0],Tn=wn[1],L&&kn===An&&Mn===Tn||(kn=An,Mn=Tn,At.uniform2f(T.location,An,Tn)),Sn=C.thickness,L&&zn===Sn||(zn=Sn,At.uniform1f(M.location,Sn)),Ln=(En=C.translate)[0],Pn=En[1],L&&Cn===Ln&&On===Pn||(Cn=Ln,On=Pn,At.uniform2f(S.location,Ln,Pn)),Dn=(In=E.call(this,kt,C,L))[0],Fn=In[1],Nn=In[2],Vn=In[3],L&&Rn===Dn&&Bn===Fn&&jn===Nn&&Un===Vn||(Rn=Dn,Bn=Fn,jn=Nn,Un=Vn,At.uniform4f(z.location,Dn,Fn,Nn,Vn)),(Hn=C.count)>0?pt?s.drawElementsInstancedANGLE(5,4,pt.type,0<<(pt.type-5121>>1),Hn):s.drawArraysInstancedANGLE(5,0,4,Hn):Hn<0&&(pt?At.drawElements(5,4,pt.type,0<<(pt.type-5121>>1)):At.drawArrays(5,0,4)),kt.viewportWidth=Lt,kt.viewportHeight=Ot,ge&&Et.destroyStream(we),Oe&&Et.destroyStream(Ne),Je&&Et.destroyStream(rr),hr&&Et.destroyStream(br),Lr&&Et.destroyStream(Rr),Yr&&Et.destroyStream($r),hn.unbind()}Mt.dirty=!0,Pt.setVAO(null),i&&(e.cpuTime+=performance.now()-o)}}}},{}],503:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t){"use strict";var wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe;return wt=t.gl,At=t.context,t.strings,kt=t.next,Tt=t.current,Mt=t.draw,St=t.elements,zt=t.buffer,Et=t.shader,Lt=t.attributes,Ct=t.vao,Pt=t.uniforms,Ot=t.framebuffer,It=t.extensions,t.timer,Dt=t.isBufferArgs,Rt=kt.blend_color,Ft=Tt.blend_color,Bt=kt.blend_equation,Nt=Tt.blend_equation,jt=kt.blend_func,Vt=Tt.blend_func,Ut=kt.depth_range,Ht=Tt.depth_range,qt=kt.colorMask,Gt=Tt.colorMask,Wt=kt.polygonOffset_offset,Yt=Tt.polygonOffset_offset,Zt=kt.sample_coverage,Xt=Tt.sample_coverage,Jt=kt.stencil_func,Kt=Tt.stencil_func,Qt=kt.stencil_opFront,$t=Tt.stencil_opFront,te=kt.stencil_opBack,ee=Tt.stencil_opBack,re=kt.scissor_box,ne=Tt.scissor_box,ie=kt.viewport,ae=Tt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},oe={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},{draw:function(t){var F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,Et,Pt,Rt,jt,re,ie,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi;(It.angle_instanced_arrays,(F=Ot.next)!==Ot.cur&&(F?wt.bindFramebuffer(36160,F.framebuffer):wt.bindFramebuffer(36160,null),Ot.cur=F),Tt.dirty)&&((Xn=kt.dither)!==Tt.dither&&(Xn?wt.enable(3024):wt.disable(3024),Tt.dither=Xn),Jn=Bt[0],Kn=Bt[1],Jn===Nt[0]&&Kn===Nt[1]||(wt.blendEquationSeparate(Jn,Kn),Nt[0]=Jn,Nt[1]=Kn),(Qn=kt.depth_func)!==Tt.depth_func&&(wt.depthFunc(Qn),Tt.depth_func=Qn),$n=Ut[0],ti=Ut[1],$n===Ht[0]&&ti===Ht[1]||(wt.depthRange($n,ti),Ht[0]=$n,Ht[1]=ti),(ei=kt.depth_mask)!==Tt.depth_mask&&(wt.depthMask(ei),Tt.depth_mask=ei),ri=qt[0],ni=qt[1],ii=qt[2],ai=qt[3],ri===Gt[0]&&ni===Gt[1]&&ii===Gt[2]&&ai===Gt[3]||(wt.colorMask(ri,ni,ii,ai),Gt[0]=ri,Gt[1]=ni,Gt[2]=ii,Gt[3]=ai),(oi=kt.cull_enable)!==Tt.cull_enable&&(oi?wt.enable(2884):wt.disable(2884),Tt.cull_enable=oi),(si=kt.cull_face)!==Tt.cull_face&&(wt.cullFace(si),Tt.cull_face=si),(li=kt.frontFace)!==Tt.frontFace&&(wt.frontFace(li),Tt.frontFace=li),(ci=kt.lineWidth)!==Tt.lineWidth&&(wt.lineWidth(ci),Tt.lineWidth=ci),(ui=kt.polygonOffset_enable)!==Tt.polygonOffset_enable&&(ui?wt.enable(32823):wt.disable(32823),Tt.polygonOffset_enable=ui),fi=Wt[0],pi=Wt[1],fi===Yt[0]&&pi===Yt[1]||(wt.polygonOffset(fi,pi),Yt[0]=fi,Yt[1]=pi),(hi=kt.sample_alpha)!==Tt.sample_alpha&&(hi?wt.enable(32926):wt.disable(32926),Tt.sample_alpha=hi),(di=kt.sample_enable)!==Tt.sample_enable&&(di?wt.enable(32928):wt.disable(32928),Tt.sample_enable=di),mi=Zt[0],gi=Zt[1],mi===Xt[0]&&gi===Xt[1]||(wt.sampleCoverage(mi,gi),Xt[0]=mi,Xt[1]=gi),(yi=kt.stencil_mask)!==Tt.stencil_mask&&(wt.stencilMask(yi),Tt.stencil_mask=yi),vi=Jt[0],bi=Jt[1],xi=Jt[2],vi===Kt[0]&&bi===Kt[1]&&xi===Kt[2]||(wt.stencilFunc(vi,bi,xi),Kt[0]=vi,Kt[1]=bi,Kt[2]=xi),_i=Qt[0],wi=Qt[1],Ai=Qt[2],ki=Qt[3],_i===$t[0]&&wi===$t[1]&&Ai===$t[2]&&ki===$t[3]||(wt.stencilOpSeparate(_i,wi,Ai,ki),$t[0]=_i,$t[1]=wi,$t[2]=Ai,$t[3]=ki),Ti=te[0],Mi=te[1],Si=te[2],zi=te[3],Ti===ee[0]&&Mi===ee[1]&&Si===ee[2]&&zi===ee[3]||(wt.stencilOpSeparate(Ti,Mi,Si,zi),ee[0]=Ti,ee[1]=Mi,ee[2]=Si,ee[3]=zi));N=0|(B=t.viewport).x,j=0|B.y,V="width"in B?0|B.width:At.framebufferWidth-N,U="height"in B?0|B.height:At.framebufferHeight-j,H=At.viewportWidth,At.viewportWidth=V,q=At.viewportHeight,At.viewportHeight=U,wt.viewport(N,j,V,U),ae[0]=N,ae[1]=j,ae[2]=V,ae[3]=U,wt.blendColor(0,0,0,1),Ft[0]=0,Ft[1]=0,Ft[2]=0,Ft[3]=1,r?wt.enable(3042):wt.disable(3042),Tt.blend_enable=r,wt.blendFuncSeparate(770,771,773,1),Vt[0]=770,Vt[1]=771,Vt[2]=773,Vt[3]=1,n?wt.enable(2929):wt.disable(2929),Tt.depth_enable=n,W=0|(G=t.viewport).x,Y=0|G.y,Z="width"in G?0|G.width:At.framebufferWidth-W,X="height"in G?0|G.height:At.framebufferHeight-Y,wt.scissor(W,Y,Z,X),ne[0]=W,ne[1]=Y,ne[2]=Z,ne[3]=X,i?wt.enable(3089):wt.disable(3089),Tt.scissor_enable=i,a?wt.enable(2960):wt.disable(2960),Tt.stencil_enable=a,(J=Tt.profile)&&(K=performance.now(),e.count++),wt.useProgram(o.program),Q=It.angle_instanced_arrays,Ct.setVAO(null),$=s.call(this,At,t,0),tt=!1,et=1,rt=0,nt=0,it=0,at=0,ot=null,st=0,lt=!1,ct=5126,ut=0,ft=0,pt=0,Dt($)?(tt=!0,ct=(ot=zt.createStream(34962,$)).dtype):(ot=zt.getBuffer($))?ct=ot.dtype:"constant"in $?(et=2,"number"==typeof $.constant?(rt=$.constant,nt=it=at=0):(rt=$.constant.length>0?$.constant[0]:0,nt=$.constant.length>1?$.constant[1]:0,it=$.constant.length>2?$.constant[2]:0,at=$.constant.length>3?$.constant[3]:0)):(ot=Dt($.buffer)?zt.createStream(34962,$.buffer):zt.getBuffer($.buffer),ct="type"in $?oe[$.type]:ot.dtype,lt=!!$.normalized,st=0|$.size,ut=0|$.offset,ft=0|$.stride,pt=0|$.divisor),ht=l.location,dt=Lt[ht],1===et?(dt.buffer||wt.enableVertexAttribArray(ht),mt=st||4,dt.type===ct&&dt.size===mt&&dt.buffer===ot&&dt.normalized===lt&&dt.offset===ut&&dt.stride===ft||(wt.bindBuffer(34962,ot.buffer),wt.vertexAttribPointer(ht,mt,ct,lt,ft,ut),dt.type=ct,dt.size=mt,dt.buffer=ot,dt.normalized=lt,dt.offset=ut,dt.stride=ft),dt.divisor!==pt&&(Q.vertexAttribDivisorANGLE(ht,pt),dt.divisor=pt)):(dt.buffer&&(wt.disableVertexAttribArray(ht),dt.buffer=null),dt.x===rt&&dt.y===nt&&dt.z===it&&dt.w===at||(wt.vertexAttrib4f(ht,rt,nt,it,at),dt.x=rt,dt.y=nt,dt.z=it,dt.w=at)),gt=c.call(this,At,t,0),yt=!1,vt=1,bt=0,xt=0,_t=0,Et=0,Pt=null,Rt=0,jt=!1,re=5126,ie=0,se=0,le=0,Dt(gt)?(yt=!0,re=(Pt=zt.createStream(34962,gt)).dtype):(Pt=zt.getBuffer(gt))?re=Pt.dtype:"constant"in gt?(vt=2,"number"==typeof gt.constant?(bt=gt.constant,xt=_t=Et=0):(bt=gt.constant.length>0?gt.constant[0]:0,xt=gt.constant.length>1?gt.constant[1]:0,_t=gt.constant.length>2?gt.constant[2]:0,Et=gt.constant.length>3?gt.constant[3]:0)):(Pt=Dt(gt.buffer)?zt.createStream(34962,gt.buffer):zt.getBuffer(gt.buffer),re="type"in gt?oe[gt.type]:Pt.dtype,jt=!!gt.normalized,Rt=0|gt.size,ie=0|gt.offset,se=0|gt.stride,le=0|gt.divisor),ce=u.location,ue=Lt[ce],1===vt?(ue.buffer||wt.enableVertexAttribArray(ce),fe=Rt||1,ue.type===re&&ue.size===fe&&ue.buffer===Pt&&ue.normalized===jt&&ue.offset===ie&&ue.stride===se||(wt.bindBuffer(34962,Pt.buffer),wt.vertexAttribPointer(ce,fe,re,jt,se,ie),ue.type=re,ue.size=fe,ue.buffer=Pt,ue.normalized=jt,ue.offset=ie,ue.stride=se),ue.divisor!==le&&(Q.vertexAttribDivisorANGLE(ce,le),ue.divisor=le)):(ue.buffer&&(wt.disableVertexAttribArray(ce),ue.buffer=null),ue.x===bt&&ue.y===xt&&ue.z===_t&&ue.w===Et||(wt.vertexAttrib4f(ce,bt,xt,_t,Et),ue.x=bt,ue.y=xt,ue.z=_t,ue.w=Et)),pe=f.call(this,At,t,0),he=!1,de=1,me=0,ge=0,ye=0,ve=0,be=null,xe=0,_e=!1,we=5126,Ae=0,ke=0,Te=0,Dt(pe)?(he=!0,we=(be=zt.createStream(34962,pe)).dtype):(be=zt.getBuffer(pe))?we=be.dtype:"constant"in pe?(de=2,"number"==typeof pe.constant?(me=pe.constant,ge=ye=ve=0):(me=pe.constant.length>0?pe.constant[0]:0,ge=pe.constant.length>1?pe.constant[1]:0,ye=pe.constant.length>2?pe.constant[2]:0,ve=pe.constant.length>3?pe.constant[3]:0)):(be=Dt(pe.buffer)?zt.createStream(34962,pe.buffer):zt.getBuffer(pe.buffer),we="type"in pe?oe[pe.type]:be.dtype,_e=!!pe.normalized,xe=0|pe.size,Ae=0|pe.offset,ke=0|pe.stride,Te=0|pe.divisor),Me=p.location,Se=Lt[Me],1===de?(Se.buffer||wt.enableVertexAttribArray(Me),ze=xe||4,Se.type===we&&Se.size===ze&&Se.buffer===be&&Se.normalized===_e&&Se.offset===Ae&&Se.stride===ke||(wt.bindBuffer(34962,be.buffer),wt.vertexAttribPointer(Me,ze,we,_e,ke,Ae),Se.type=we,Se.size=ze,Se.buffer=be,Se.normalized=_e,Se.offset=Ae,Se.stride=ke),Se.divisor!==Te&&(Q.vertexAttribDivisorANGLE(Me,Te),Se.divisor=Te)):(Se.buffer&&(wt.disableVertexAttribArray(Me),Se.buffer=null),Se.x===me&&Se.y===ge&&Se.z===ye&&Se.w===ve||(wt.vertexAttrib4f(Me,me,ge,ye,ve),Se.x=me,Se.y=ge,Se.z=ye,Se.w=ve)),Ee=h.call(this,At,t,0),Le=!1,Ce=1,Pe=0,Oe=0,Ie=0,De=0,Re=null,Fe=0,Be=!1,Ne=5126,je=0,Ve=0,Ue=0,Dt(Ee)?(Le=!0,Ne=(Re=zt.createStream(34962,Ee)).dtype):(Re=zt.getBuffer(Ee))?Ne=Re.dtype:"constant"in Ee?(Ce=2,"number"==typeof Ee.constant?(Pe=Ee.constant,Oe=Ie=De=0):(Pe=Ee.constant.length>0?Ee.constant[0]:0,Oe=Ee.constant.length>1?Ee.constant[1]:0,Ie=Ee.constant.length>2?Ee.constant[2]:0,De=Ee.constant.length>3?Ee.constant[3]:0)):(Re=Dt(Ee.buffer)?zt.createStream(34962,Ee.buffer):zt.getBuffer(Ee.buffer),Ne="type"in Ee?oe[Ee.type]:Re.dtype,Be=!!Ee.normalized,Fe=0|Ee.size,je=0|Ee.offset,Ve=0|Ee.stride,Ue=0|Ee.divisor),He=d.location,qe=Lt[He],1===Ce?(qe.buffer||wt.enableVertexAttribArray(He),Ge=Fe||1,qe.type===Ne&&qe.size===Ge&&qe.buffer===Re&&qe.normalized===Be&&qe.offset===je&&qe.stride===Ve||(wt.bindBuffer(34962,Re.buffer),wt.vertexAttribPointer(He,Ge,Ne,Be,Ve,je),qe.type=Ne,qe.size=Ge,qe.buffer=Re,qe.normalized=Be,qe.offset=je,qe.stride=Ve),qe.divisor!==Ue&&(Q.vertexAttribDivisorANGLE(He,Ue),qe.divisor=Ue)):(qe.buffer&&(wt.disableVertexAttribArray(He),qe.buffer=null),qe.x===Pe&&qe.y===Oe&&qe.z===Ie&&qe.w===De||(wt.vertexAttrib4f(He,Pe,Oe,Ie,De),qe.x=Pe,qe.y=Oe,qe.z=Ie,qe.w=De)),We=m.call(this,At,t,0),Ye=!1,Ze=1,Xe=0,Je=0,Ke=0,Qe=0,$e=null,tr=0,er=!1,rr=5126,nr=0,ir=0,ar=0,Dt(We)?(Ye=!0,rr=($e=zt.createStream(34962,We)).dtype):($e=zt.getBuffer(We))?rr=$e.dtype:"constant"in We?(Ze=2,"number"==typeof We.constant?(Xe=We.constant,Je=Ke=Qe=0):(Xe=We.constant.length>0?We.constant[0]:0,Je=We.constant.length>1?We.constant[1]:0,Ke=We.constant.length>2?We.constant[2]:0,Qe=We.constant.length>3?We.constant[3]:0)):($e=Dt(We.buffer)?zt.createStream(34962,We.buffer):zt.getBuffer(We.buffer),rr="type"in We?oe[We.type]:$e.dtype,er=!!We.normalized,tr=0|We.size,nr=0|We.offset,ir=0|We.stride,ar=0|We.divisor),or=g.location,sr=Lt[or],1===Ze?(sr.buffer||wt.enableVertexAttribArray(or),lr=tr||1,sr.type===rr&&sr.size===lr&&sr.buffer===$e&&sr.normalized===er&&sr.offset===nr&&sr.stride===ir||(wt.bindBuffer(34962,$e.buffer),wt.vertexAttribPointer(or,lr,rr,er,ir,nr),sr.type=rr,sr.size=lr,sr.buffer=$e,sr.normalized=er,sr.offset=nr,sr.stride=ir),sr.divisor!==ar&&(Q.vertexAttribDivisorANGLE(or,ar),sr.divisor=ar)):(sr.buffer&&(wt.disableVertexAttribArray(or),sr.buffer=null),sr.x===Xe&&sr.y===Je&&sr.z===Ke&&sr.w===Qe||(wt.vertexAttrib4f(or,Xe,Je,Ke,Qe),sr.x=Xe,sr.y=Je,sr.z=Ke,sr.w=Qe)),cr=y.call(this,At,t,0),ur=!1,fr=1,pr=0,hr=0,dr=0,mr=0,gr=null,yr=0,vr=!1,br=5126,xr=0,_r=0,wr=0,Dt(cr)?(ur=!0,br=(gr=zt.createStream(34962,cr)).dtype):(gr=zt.getBuffer(cr))?br=gr.dtype:"constant"in cr?(fr=2,"number"==typeof cr.constant?(pr=cr.constant,hr=dr=mr=0):(pr=cr.constant.length>0?cr.constant[0]:0,hr=cr.constant.length>1?cr.constant[1]:0,dr=cr.constant.length>2?cr.constant[2]:0,mr=cr.constant.length>3?cr.constant[3]:0)):(gr=Dt(cr.buffer)?zt.createStream(34962,cr.buffer):zt.getBuffer(cr.buffer),br="type"in cr?oe[cr.type]:gr.dtype,vr=!!cr.normalized,yr=0|cr.size,xr=0|cr.offset,_r=0|cr.stride,wr=0|cr.divisor),Ar=v.location,kr=Lt[Ar],1===fr?(kr.buffer||wt.enableVertexAttribArray(Ar),Tr=yr||1,kr.type===br&&kr.size===Tr&&kr.buffer===gr&&kr.normalized===vr&&kr.offset===xr&&kr.stride===_r||(wt.bindBuffer(34962,gr.buffer),wt.vertexAttribPointer(Ar,Tr,br,vr,_r,xr),kr.type=br,kr.size=Tr,kr.buffer=gr,kr.normalized=vr,kr.offset=xr,kr.stride=_r),kr.divisor!==wr&&(Q.vertexAttribDivisorANGLE(Ar,wr),kr.divisor=wr)):(kr.buffer&&(wt.disableVertexAttribArray(Ar),kr.buffer=null),kr.x===pr&&kr.y===hr&&kr.z===dr&&kr.w===mr||(wt.vertexAttrib4f(Ar,pr,hr,dr,mr),kr.x=pr,kr.y=hr,kr.z=dr,kr.w=mr)),Mr=b.call(this,At,t,0),Sr=!1,zr=1,Er=0,Lr=0,Cr=0,Pr=0,Or=null,Ir=0,Dr=!1,Rr=5126,Fr=0,Br=0,Nr=0,Dt(Mr)?(Sr=!0,Rr=(Or=zt.createStream(34962,Mr)).dtype):(Or=zt.getBuffer(Mr))?Rr=Or.dtype:"constant"in Mr?(zr=2,"number"==typeof Mr.constant?(Er=Mr.constant,Lr=Cr=Pr=0):(Er=Mr.constant.length>0?Mr.constant[0]:0,Lr=Mr.constant.length>1?Mr.constant[1]:0,Cr=Mr.constant.length>2?Mr.constant[2]:0,Pr=Mr.constant.length>3?Mr.constant[3]:0)):(Or=Dt(Mr.buffer)?zt.createStream(34962,Mr.buffer):zt.getBuffer(Mr.buffer),Rr="type"in Mr?oe[Mr.type]:Or.dtype,Dr=!!Mr.normalized,Ir=0|Mr.size,Fr=0|Mr.offset,Br=0|Mr.stride,Nr=0|Mr.divisor),jr=x.location,Vr=Lt[jr],1===zr?(Vr.buffer||wt.enableVertexAttribArray(jr),Ur=Ir||1,Vr.type===Rr&&Vr.size===Ur&&Vr.buffer===Or&&Vr.normalized===Dr&&Vr.offset===Fr&&Vr.stride===Br||(wt.bindBuffer(34962,Or.buffer),wt.vertexAttribPointer(jr,Ur,Rr,Dr,Br,Fr),Vr.type=Rr,Vr.size=Ur,Vr.buffer=Or,Vr.normalized=Dr,Vr.offset=Fr,Vr.stride=Br),Vr.divisor!==Nr&&(Q.vertexAttribDivisorANGLE(jr,Nr),Vr.divisor=Nr)):(Vr.buffer&&(wt.disableVertexAttribArray(jr),Vr.buffer=null),Vr.x===Er&&Vr.y===Lr&&Vr.z===Cr&&Vr.w===Pr||(wt.vertexAttrib4f(jr,Er,Lr,Cr,Pr),Vr.x=Er,Vr.y=Lr,Vr.z=Cr,Vr.w=Pr)),Hr=_.call(this,At,t,0),qr=!1,Gr=1,Wr=0,Yr=0,Zr=0,Xr=0,Jr=null,Kr=0,Qr=!1,$r=5126,tn=0,en=0,rn=0,Dt(Hr)?(qr=!0,$r=(Jr=zt.createStream(34962,Hr)).dtype):(Jr=zt.getBuffer(Hr))?$r=Jr.dtype:"constant"in Hr?(Gr=2,"number"==typeof Hr.constant?(Wr=Hr.constant,Yr=Zr=Xr=0):(Wr=Hr.constant.length>0?Hr.constant[0]:0,Yr=Hr.constant.length>1?Hr.constant[1]:0,Zr=Hr.constant.length>2?Hr.constant[2]:0,Xr=Hr.constant.length>3?Hr.constant[3]:0)):(Jr=Dt(Hr.buffer)?zt.createStream(34962,Hr.buffer):zt.getBuffer(Hr.buffer),$r="type"in Hr?oe[Hr.type]:Jr.dtype,Qr=!!Hr.normalized,Kr=0|Hr.size,tn=0|Hr.offset,en=0|Hr.stride,rn=0|Hr.divisor),nn=w.location,an=Lt[nn],1===Gr?(an.buffer||wt.enableVertexAttribArray(nn),on=Kr||1,an.type===$r&&an.size===on&&an.buffer===Jr&&an.normalized===Qr&&an.offset===tn&&an.stride===en||(wt.bindBuffer(34962,Jr.buffer),wt.vertexAttribPointer(nn,on,$r,Qr,en,tn),an.type=$r,an.size=on,an.buffer=Jr,an.normalized=Qr,an.offset=tn,an.stride=en),an.divisor!==rn&&(Q.vertexAttribDivisorANGLE(nn,rn),an.divisor=rn)):(an.buffer&&(wt.disableVertexAttribArray(nn),an.buffer=null),an.x===Wr&&an.y===Yr&&an.z===Zr&&an.w===Xr||(wt.vertexAttrib4f(nn,Wr,Yr,Zr,Xr),an.x=Wr,an.y=Yr,an.z=Zr,an.w=Xr)),sn=A.call(this,At,t,0),ln=!1,cn=1,un=0,fn=0,pn=0,hn=0,dn=null,mn=0,gn=!1,yn=5126,vn=0,bn=0,xn=0,Dt(sn)?(ln=!0,yn=(dn=zt.createStream(34962,sn)).dtype):(dn=zt.getBuffer(sn))?yn=dn.dtype:"constant"in sn?(cn=2,"number"==typeof sn.constant?(un=sn.constant,fn=pn=hn=0):(un=sn.constant.length>0?sn.constant[0]:0,fn=sn.constant.length>1?sn.constant[1]:0,pn=sn.constant.length>2?sn.constant[2]:0,hn=sn.constant.length>3?sn.constant[3]:0)):(dn=Dt(sn.buffer)?zt.createStream(34962,sn.buffer):zt.getBuffer(sn.buffer),yn="type"in sn?oe[sn.type]:dn.dtype,gn=!!sn.normalized,mn=0|sn.size,vn=0|sn.offset,bn=0|sn.stride,xn=0|sn.divisor),_n=k.location,wn=Lt[_n],1===cn?(wn.buffer||wt.enableVertexAttribArray(_n),An=mn||1,wn.type===yn&&wn.size===An&&wn.buffer===dn&&wn.normalized===gn&&wn.offset===vn&&wn.stride===bn||(wt.bindBuffer(34962,dn.buffer),wt.vertexAttribPointer(_n,An,yn,gn,bn,vn),wn.type=yn,wn.size=An,wn.buffer=dn,wn.normalized=gn,wn.offset=vn,wn.stride=bn),wn.divisor!==xn&&(Q.vertexAttribDivisorANGLE(_n,xn),wn.divisor=xn)):(wn.buffer&&(wt.disableVertexAttribArray(_n),wn.buffer=null),wn.x===un&&wn.y===fn&&wn.z===pn&&wn.w===hn||(wt.vertexAttrib4f(_n,un,fn,pn,hn),wn.x=un,wn.y=fn,wn.z=pn,wn.w=hn)),wt.uniform1i(T.location,!1),(kn=t.markerTexture)&&"framebuffer"===kn._reglType&&(kn=kn.color[0]),Tn=kn._texture,wt.uniform1i(M.location,Tn.bind()),Mn=t.opacity,wt.uniform1f(S.location,Mn),zn=(Sn=E.call(this,At,t,0))[0],En=Sn[1],wt.uniform2f(z.location,zn,En),wt.uniform1i(L.location,C.bind()),Ln=At.pixelRatio,wt.uniform1f(P.location,Ln),Pn=(Cn=t.scale)[0],On=Cn[1],wt.uniform2f(O.location,Pn,On),Dn=(In=t.scaleFract)[0],Rn=In[1],wt.uniform2f(I.location,Dn,Rn),Bn=(Fn=t.translate)[0],Nn=Fn[1],wt.uniform2f(D.location,Bn,Nn),Vn=(jn=t.translateFract)[0],Un=jn[1],wt.uniform2f(R.location,Vn,Un),Hn=t.elements,qn=null,(qn=(Gn=Dt(Hn))?St.createStream(Hn):St.getElements(Hn))&&wt.bindBuffer(34963,qn.buffer.buffer),Wn=t.offset,(Yn=t.count)&&((Zn=Mt.instances)>0?qn?Q.drawElementsInstancedANGLE(0,Yn,qn.type,Wn<<(qn.type-5121>>1),Zn):Q.drawArraysInstancedANGLE(0,Wn,Yn,Zn):Zn<0&&(qn?wt.drawElements(0,Yn,qn.type,Wn<<(qn.type-5121>>1)):wt.drawArrays(0,Wn,Yn)),Tt.dirty=!0,Ct.setVAO(null),At.viewportWidth=H,At.viewportHeight=q,J&&(e.cpuTime+=performance.now()-K),tt&&zt.destroyStream(ot),yt&&zt.destroyStream(Pt),he&&zt.destroyStream(be),Le&&zt.destroyStream(Re),Ye&&zt.destroyStream($e),ur&&zt.destroyStream(gr),Sr&&zt.destroyStream(Or),qr&&zt.destroyStream(Jr),ln&&zt.destroyStream(dn),Tn.unbind(),C.unbind(),Gn&&St.destroyStream(qn))},scope:function(t,r,n){var i,a,o,l,u,p,d,g,v,x,w,k,T,M,S,z,L,C,P,O,I,D,R,vt,bt,xt,_t,wt,Lt,Ct,Ot,It,Ft,Bt,Nt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,ne,ae,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi,Ei,Li,Ci,Pi,Oi,Ii,Di,Ri,Fi,Bi,Ni,ji,Vi,Ui,Hi,qi,Gi,Wi,Yi,Zi,Xi,Ji,Ki,Qi,$i,ta,ea,ra,na,ia,aa,oa,sa,la,ca,ua,fa,pa,ha,da,ma,ga,ya,va,ba,xa,_a,wa,Aa,ka,Ta,Ma,Sa,za,Ea,La,Ca,Pa,Oa,Ia,Da,Ra;a=0|(i=t.viewport).x,o=0|i.y,l="width"in i?0|i.width:At.framebufferWidth-a,u="height"in i?0|i.height:At.framebufferHeight-o,p=At.viewportWidth,At.viewportWidth=l,d=At.viewportHeight,At.viewportHeight=u,g=ie[0],ie[0]=a,v=ie[1],ie[1]=o,x=ie[2],ie[2]=l,w=ie[3],ie[3]=u,k=Rt[0],Rt[0]=F,T=Rt[1],Rt[1]=B,M=Rt[2],Rt[2]=N,S=Rt[3],Rt[3]=j,z=kt.blend_enable,kt.blend_enable=V,L=jt[0],jt[0]=U,C=jt[1],jt[1]=H,P=jt[2],jt[2]=q,O=jt[3],jt[3]=G,I=kt.depth_enable,kt.depth_enable=W,R=0|(D=t.viewport).x,vt=0|D.y,bt="width"in D?0|D.width:At.framebufferWidth-R,xt="height"in D?0|D.height:At.framebufferHeight-vt,_t=re[0],re[0]=R,wt=re[1],re[1]=vt,Lt=re[2],re[2]=bt,Ct=re[3],re[3]=xt,Ot=kt.scissor_enable,kt.scissor_enable=Y,It=kt.stencil_enable,kt.stencil_enable=Z,(Ft=Tt.profile)&&(Bt=performance.now(),e.count++),Nt=t.elements,Vt=null,Vt=(Ut=Dt(Nt))?St.createStream(Nt):St.getElements(Nt),Ht=Mt.elements,Mt.elements=Vt,qt=t.offset,Gt=Mt.offset,Mt.offset=qt,Wt=t.count,Yt=Mt.count,Mt.count=Wt,Zt=Mt.primitive,Mt.primitive=X,Xt=Pt[J],Pt[J]=!1,Jt=Pt[Q],Pt[Q]=K,Kt=t.opacity,Qt=Pt[$],Pt[$]=Kt,$t=E.call(this,At,t,n),te=Pt[tt],Pt[tt]=$t,ee=At.pixelRatio,ne=Pt[et],Pt[et]=ee,ae=t.scale,se=Pt[rt],Pt[rt]=ae,le=t.scaleFract,ce=Pt[nt],Pt[nt]=le,ue=t.translate,fe=Pt[it],Pt[it]=ue,pe=t.translateFract,he=Pt[at],Pt[at]=pe,de=t.markerTexture,me=Pt[ot],Pt[ot]=de,ge=y.call(this,At,t,n),ye=!1,ve=1,be=0,xe=0,_e=0,we=0,Ae=null,ke=0,Te=!1,Me=5126,Se=0,ze=0,Ee=0,Dt(ge)?(ye=!0,Me=(Ae=zt.createStream(34962,ge)).dtype):(Ae=zt.getBuffer(ge))?Me=Ae.dtype:"constant"in ge?(ve=2,"number"==typeof ge.constant?(be=ge.constant,xe=_e=we=0):(be=ge.constant.length>0?ge.constant[0]:0,xe=ge.constant.length>1?ge.constant[1]:0,_e=ge.constant.length>2?ge.constant[2]:0,we=ge.constant.length>3?ge.constant[3]:0)):(Ae=Dt(ge.buffer)?zt.createStream(34962,ge.buffer):zt.getBuffer(ge.buffer),Me="type"in ge?oe[ge.type]:Ae.dtype,Te=!!ge.normalized,ke=0|ge.size,Se=0|ge.offset,ze=0|ge.stride,Ee=0|ge.divisor),Le=st.state,st.state=ve,Ce=st.x,st.x=be,Pe=st.y,st.y=xe,Oe=st.z,st.z=_e,Ie=st.w,st.w=we,De=st.buffer,st.buffer=Ae,Re=st.size,st.size=ke,Fe=st.normalized,st.normalized=Te,Be=st.type,st.type=Me,Ne=st.offset,st.offset=Se,je=st.stride,st.stride=ze,Ve=st.divisor,st.divisor=Ee,Ue=_.call(this,At,t,n),He=!1,qe=1,Ge=0,We=0,Ye=0,Ze=0,Xe=null,Je=0,Ke=!1,Qe=5126,$e=0,tr=0,er=0,Dt(Ue)?(He=!0,Qe=(Xe=zt.createStream(34962,Ue)).dtype):(Xe=zt.getBuffer(Ue))?Qe=Xe.dtype:"constant"in Ue?(qe=2,"number"==typeof Ue.constant?(Ge=Ue.constant,We=Ye=Ze=0):(Ge=Ue.constant.length>0?Ue.constant[0]:0,We=Ue.constant.length>1?Ue.constant[1]:0,Ye=Ue.constant.length>2?Ue.constant[2]:0,Ze=Ue.constant.length>3?Ue.constant[3]:0)):(Xe=Dt(Ue.buffer)?zt.createStream(34962,Ue.buffer):zt.getBuffer(Ue.buffer),Qe="type"in Ue?oe[Ue.type]:Xe.dtype,Ke=!!Ue.normalized,Je=0|Ue.size,$e=0|Ue.offset,tr=0|Ue.stride,er=0|Ue.divisor),rr=lt.state,lt.state=qe,nr=lt.x,lt.x=Ge,ir=lt.y,lt.y=We,ar=lt.z,lt.z=Ye,or=lt.w,lt.w=Ze,sr=lt.buffer,lt.buffer=Xe,lr=lt.size,lt.size=Je,cr=lt.normalized,lt.normalized=Ke,ur=lt.type,lt.type=Qe,fr=lt.offset,lt.offset=$e,pr=lt.stride,lt.stride=tr,hr=lt.divisor,lt.divisor=er,dr=b.call(this,At,t,n),mr=!1,gr=1,yr=0,vr=0,br=0,xr=0,_r=null,wr=0,Ar=!1,kr=5126,Tr=0,Mr=0,Sr=0,Dt(dr)?(mr=!0,kr=(_r=zt.createStream(34962,dr)).dtype):(_r=zt.getBuffer(dr))?kr=_r.dtype:"constant"in dr?(gr=2,"number"==typeof dr.constant?(yr=dr.constant,vr=br=xr=0):(yr=dr.constant.length>0?dr.constant[0]:0,vr=dr.constant.length>1?dr.constant[1]:0,br=dr.constant.length>2?dr.constant[2]:0,xr=dr.constant.length>3?dr.constant[3]:0)):(_r=Dt(dr.buffer)?zt.createStream(34962,dr.buffer):zt.getBuffer(dr.buffer),kr="type"in dr?oe[dr.type]:_r.dtype,Ar=!!dr.normalized,wr=0|dr.size,Tr=0|dr.offset,Mr=0|dr.stride,Sr=0|dr.divisor),zr=ct.state,ct.state=gr,Er=ct.x,ct.x=yr,Lr=ct.y,ct.y=vr,Cr=ct.z,ct.z=br,Pr=ct.w,ct.w=xr,Or=ct.buffer,ct.buffer=_r,Ir=ct.size,ct.size=wr,Dr=ct.normalized,ct.normalized=Ar,Rr=ct.type,ct.type=kr,Fr=ct.offset,ct.offset=Tr,Br=ct.stride,ct.stride=Mr,Nr=ct.divisor,ct.divisor=Sr,jr=A.call(this,At,t,n),Vr=!1,Ur=1,Hr=0,qr=0,Gr=0,Wr=0,Yr=null,Zr=0,Xr=!1,Jr=5126,Kr=0,Qr=0,$r=0,Dt(jr)?(Vr=!0,Jr=(Yr=zt.createStream(34962,jr)).dtype):(Yr=zt.getBuffer(jr))?Jr=Yr.dtype:"constant"in jr?(Ur=2,"number"==typeof jr.constant?(Hr=jr.constant,qr=Gr=Wr=0):(Hr=jr.constant.length>0?jr.constant[0]:0,qr=jr.constant.length>1?jr.constant[1]:0,Gr=jr.constant.length>2?jr.constant[2]:0,Wr=jr.constant.length>3?jr.constant[3]:0)):(Yr=Dt(jr.buffer)?zt.createStream(34962,jr.buffer):zt.getBuffer(jr.buffer),Jr="type"in jr?oe[jr.type]:Yr.dtype,Xr=!!jr.normalized,Zr=0|jr.size,Kr=0|jr.offset,Qr=0|jr.stride,$r=0|jr.divisor),tn=ut.state,ut.state=Ur,en=ut.x,ut.x=Hr,rn=ut.y,ut.y=qr,nn=ut.z,ut.z=Gr,an=ut.w,ut.w=Wr,on=ut.buffer,ut.buffer=Yr,sn=ut.size,ut.size=Zr,ln=ut.normalized,ut.normalized=Xr,cn=ut.type,ut.type=Jr,un=ut.offset,ut.offset=Kr,fn=ut.stride,ut.stride=Qr,pn=ut.divisor,ut.divisor=$r,hn=m.call(this,At,t,n),dn=!1,mn=1,gn=0,yn=0,vn=0,bn=0,xn=null,_n=0,wn=!1,An=5126,kn=0,Tn=0,Mn=0,Dt(hn)?(dn=!0,An=(xn=zt.createStream(34962,hn)).dtype):(xn=zt.getBuffer(hn))?An=xn.dtype:"constant"in hn?(mn=2,"number"==typeof hn.constant?(gn=hn.constant,yn=vn=bn=0):(gn=hn.constant.length>0?hn.constant[0]:0,yn=hn.constant.length>1?hn.constant[1]:0,vn=hn.constant.length>2?hn.constant[2]:0,bn=hn.constant.length>3?hn.constant[3]:0)):(xn=Dt(hn.buffer)?zt.createStream(34962,hn.buffer):zt.getBuffer(hn.buffer),An="type"in hn?oe[hn.type]:xn.dtype,wn=!!hn.normalized,_n=0|hn.size,kn=0|hn.offset,Tn=0|hn.stride,Mn=0|hn.divisor),Sn=ft.state,ft.state=mn,zn=ft.x,ft.x=gn,En=ft.y,ft.y=yn,Ln=ft.z,ft.z=vn,Cn=ft.w,ft.w=bn,Pn=ft.buffer,ft.buffer=xn,On=ft.size,ft.size=_n,In=ft.normalized,ft.normalized=wn,Dn=ft.type,ft.type=An,Rn=ft.offset,ft.offset=kn,Fn=ft.stride,ft.stride=Tn,Bn=ft.divisor,ft.divisor=Mn,Nn=c.call(this,At,t,n),jn=!1,Vn=1,Un=0,Hn=0,qn=0,Gn=0,Wn=null,Yn=0,Zn=!1,Xn=5126,Jn=0,Kn=0,Qn=0,Dt(Nn)?(jn=!0,Xn=(Wn=zt.createStream(34962,Nn)).dtype):(Wn=zt.getBuffer(Nn))?Xn=Wn.dtype:"constant"in Nn?(Vn=2,"number"==typeof Nn.constant?(Un=Nn.constant,Hn=qn=Gn=0):(Un=Nn.constant.length>0?Nn.constant[0]:0,Hn=Nn.constant.length>1?Nn.constant[1]:0,qn=Nn.constant.length>2?Nn.constant[2]:0,Gn=Nn.constant.length>3?Nn.constant[3]:0)):(Wn=Dt(Nn.buffer)?zt.createStream(34962,Nn.buffer):zt.getBuffer(Nn.buffer),Xn="type"in Nn?oe[Nn.type]:Wn.dtype,Zn=!!Nn.normalized,Yn=0|Nn.size,Jn=0|Nn.offset,Kn=0|Nn.stride,Qn=0|Nn.divisor),$n=pt.state,pt.state=Vn,ti=pt.x,pt.x=Un,ei=pt.y,pt.y=Hn,ri=pt.z,pt.z=qn,ni=pt.w,pt.w=Gn,ii=pt.buffer,pt.buffer=Wn,ai=pt.size,pt.size=Yn,oi=pt.normalized,pt.normalized=Zn,si=pt.type,pt.type=Xn,li=pt.offset,pt.offset=Jn,ci=pt.stride,pt.stride=Kn,ui=pt.divisor,pt.divisor=Qn,fi=f.call(this,At,t,n),pi=!1,hi=1,di=0,mi=0,gi=0,yi=0,vi=null,bi=0,xi=!1,_i=5126,wi=0,Ai=0,ki=0,Dt(fi)?(pi=!0,_i=(vi=zt.createStream(34962,fi)).dtype):(vi=zt.getBuffer(fi))?_i=vi.dtype:"constant"in fi?(hi=2,"number"==typeof fi.constant?(di=fi.constant,mi=gi=yi=0):(di=fi.constant.length>0?fi.constant[0]:0,mi=fi.constant.length>1?fi.constant[1]:0,gi=fi.constant.length>2?fi.constant[2]:0,yi=fi.constant.length>3?fi.constant[3]:0)):(vi=Dt(fi.buffer)?zt.createStream(34962,fi.buffer):zt.getBuffer(fi.buffer),_i="type"in fi?oe[fi.type]:vi.dtype,xi=!!fi.normalized,bi=0|fi.size,wi=0|fi.offset,Ai=0|fi.stride,ki=0|fi.divisor),Ti=ht.state,ht.state=hi,Mi=ht.x,ht.x=di,Si=ht.y,ht.y=mi,zi=ht.z,ht.z=gi,Ei=ht.w,ht.w=yi,Li=ht.buffer,ht.buffer=vi,Ci=ht.size,ht.size=bi,Pi=ht.normalized,ht.normalized=xi,Oi=ht.type,ht.type=_i,Ii=ht.offset,ht.offset=wi,Di=ht.stride,ht.stride=Ai,Ri=ht.divisor,ht.divisor=ki,Fi=s.call(this,At,t,n),Bi=!1,Ni=1,ji=0,Vi=0,Ui=0,Hi=0,qi=null,Gi=0,Wi=!1,Yi=5126,Zi=0,Xi=0,Ji=0,Dt(Fi)?(Bi=!0,Yi=(qi=zt.createStream(34962,Fi)).dtype):(qi=zt.getBuffer(Fi))?Yi=qi.dtype:"constant"in Fi?(Ni=2,"number"==typeof Fi.constant?(ji=Fi.constant,Vi=Ui=Hi=0):(ji=Fi.constant.length>0?Fi.constant[0]:0,Vi=Fi.constant.length>1?Fi.constant[1]:0,Ui=Fi.constant.length>2?Fi.constant[2]:0,Hi=Fi.constant.length>3?Fi.constant[3]:0)):(qi=Dt(Fi.buffer)?zt.createStream(34962,Fi.buffer):zt.getBuffer(Fi.buffer),Yi="type"in Fi?oe[Fi.type]:qi.dtype,Wi=!!Fi.normalized,Gi=0|Fi.size,Zi=0|Fi.offset,Xi=0|Fi.stride,Ji=0|Fi.divisor),Ki=dt.state,dt.state=Ni,Qi=dt.x,dt.x=ji,$i=dt.y,dt.y=Vi,ta=dt.z,dt.z=Ui,ea=dt.w,dt.w=Hi,ra=dt.buffer,dt.buffer=qi,na=dt.size,dt.size=Gi,ia=dt.normalized,dt.normalized=Wi,aa=dt.type,dt.type=Yi,oa=dt.offset,dt.offset=Zi,sa=dt.stride,dt.stride=Xi,la=dt.divisor,dt.divisor=Ji,ca=h.call(this,At,t,n),ua=!1,fa=1,pa=0,ha=0,da=0,ma=0,ga=null,ya=0,va=!1,ba=5126,xa=0,_a=0,wa=0,Dt(ca)?(ua=!0,ba=(ga=zt.createStream(34962,ca)).dtype):(ga=zt.getBuffer(ca))?ba=ga.dtype:"constant"in ca?(fa=2,"number"==typeof ca.constant?(pa=ca.constant,ha=da=ma=0):(pa=ca.constant.length>0?ca.constant[0]:0,ha=ca.constant.length>1?ca.constant[1]:0,da=ca.constant.length>2?ca.constant[2]:0,ma=ca.constant.length>3?ca.constant[3]:0)):(ga=Dt(ca.buffer)?zt.createStream(34962,ca.buffer):zt.getBuffer(ca.buffer),ba="type"in ca?oe[ca.type]:ga.dtype,va=!!ca.normalized,ya=0|ca.size,xa=0|ca.offset,_a=0|ca.stride,wa=0|ca.divisor),Aa=mt.state,mt.state=fa,ka=mt.x,mt.x=pa,Ta=mt.y,mt.y=ha,Ma=mt.z,mt.z=da,Sa=mt.w,mt.w=ma,za=mt.buffer,mt.buffer=ga,Ea=mt.size,mt.size=ya,La=mt.normalized,mt.normalized=va,Ca=mt.type,mt.type=ba,Pa=mt.offset,mt.offset=xa,Oa=mt.stride,mt.stride=_a,Ia=mt.divisor,mt.divisor=wa,Da=Et.vert,Et.vert=gt,Ra=Et.frag,Et.frag=yt,Tt.dirty=!0,r(At,t,n),At.viewportWidth=p,At.viewportHeight=d,ie[0]=g,ie[1]=v,ie[2]=x,ie[3]=w,Rt[0]=k,Rt[1]=T,Rt[2]=M,Rt[3]=S,kt.blend_enable=z,jt[0]=L,jt[1]=C,jt[2]=P,jt[3]=O,kt.depth_enable=I,re[0]=_t,re[1]=wt,re[2]=Lt,re[3]=Ct,kt.scissor_enable=Ot,kt.stencil_enable=It,Ft&&(e.cpuTime+=performance.now()-Bt),Ut&&St.destroyStream(Vt),Mt.elements=Ht,Mt.offset=Gt,Mt.count=Yt,Mt.primitive=Zt,Pt[J]=Xt,Pt[Q]=Jt,Pt[$]=Qt,Pt[tt]=te,Pt[et]=ne,Pt[rt]=se,Pt[nt]=ce,Pt[it]=fe,Pt[at]=he,Pt[ot]=me,ye&&zt.destroyStream(Ae),st.state=Le,st.x=Ce,st.y=Pe,st.z=Oe,st.w=Ie,st.buffer=De,st.size=Re,st.normalized=Fe,st.type=Be,st.offset=Ne,st.stride=je,st.divisor=Ve,He&&zt.destroyStream(Xe),lt.state=rr,lt.x=nr,lt.y=ir,lt.z=ar,lt.w=or,lt.buffer=sr,lt.size=lr,lt.normalized=cr,lt.type=ur,lt.offset=fr,lt.stride=pr,lt.divisor=hr,mr&&zt.destroyStream(_r),ct.state=zr,ct.x=Er,ct.y=Lr,ct.z=Cr,ct.w=Pr,ct.buffer=Or,ct.size=Ir,ct.normalized=Dr,ct.type=Rr,ct.offset=Fr,ct.stride=Br,ct.divisor=Nr,Vr&&zt.destroyStream(Yr),ut.state=tn,ut.x=en,ut.y=rn,ut.z=nn,ut.w=an,ut.buffer=on,ut.size=sn,ut.normalized=ln,ut.type=cn,ut.offset=un,ut.stride=fn,ut.divisor=pn,dn&&zt.destroyStream(xn),ft.state=Sn,ft.x=zn,ft.y=En,ft.z=Ln,ft.w=Cn,ft.buffer=Pn,ft.size=On,ft.normalized=In,ft.type=Dn,ft.offset=Rn,ft.stride=Fn,ft.divisor=Bn,jn&&zt.destroyStream(Wn),pt.state=$n,pt.x=ti,pt.y=ei,pt.z=ri,pt.w=ni,pt.buffer=ii,pt.size=ai,pt.normalized=oi,pt.type=si,pt.offset=li,pt.stride=ci,pt.divisor=ui,pi&&zt.destroyStream(vi),ht.state=Ti,ht.x=Mi,ht.y=Si,ht.z=zi,ht.w=Ei,ht.buffer=Li,ht.size=Ci,ht.normalized=Pi,ht.type=Oi,ht.offset=Ii,ht.stride=Di,ht.divisor=Ri,Bi&&zt.destroyStream(qi),dt.state=Ki,dt.x=Qi,dt.y=$i,dt.z=ta,dt.w=ea,dt.buffer=ra,dt.size=na,dt.normalized=ia,dt.type=aa,dt.offset=oa,dt.stride=sa,dt.divisor=la,ua&&zt.destroyStream(ga),mt.state=Aa,mt.x=ka,mt.y=Ta,mt.z=Ma,mt.w=Sa,mt.buffer=za,mt.size=Ea,mt.normalized=La,mt.type=Ca,mt.offset=Pa,mt.stride=Oa,mt.divisor=Ia,Et.vert=Da,Et.frag=Ra,Tt.dirty=!0},batch:function(t,r){var n,i,a,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,Et,Pt,Rt;(It.angle_instanced_arrays,(n=Ot.next)!==Ot.cur&&(n?wt.bindFramebuffer(36160,n.framebuffer):wt.bindFramebuffer(36160,null),Ot.cur=n),Tt.dirty)&&((j=kt.dither)!==Tt.dither&&(j?wt.enable(3024):wt.disable(3024),Tt.dither=j),V=Bt[0],U=Bt[1],V===Nt[0]&&U===Nt[1]||(wt.blendEquationSeparate(V,U),Nt[0]=V,Nt[1]=U),(H=kt.depth_func)!==Tt.depth_func&&(wt.depthFunc(H),Tt.depth_func=H),q=Ut[0],G=Ut[1],q===Ht[0]&&G===Ht[1]||(wt.depthRange(q,G),Ht[0]=q,Ht[1]=G),(W=kt.depth_mask)!==Tt.depth_mask&&(wt.depthMask(W),Tt.depth_mask=W),Y=qt[0],Z=qt[1],X=qt[2],J=qt[3],Y===Gt[0]&&Z===Gt[1]&&X===Gt[2]&&J===Gt[3]||(wt.colorMask(Y,Z,X,J),Gt[0]=Y,Gt[1]=Z,Gt[2]=X,Gt[3]=J),(K=kt.cull_enable)!==Tt.cull_enable&&(K?wt.enable(2884):wt.disable(2884),Tt.cull_enable=K),(Q=kt.cull_face)!==Tt.cull_face&&(wt.cullFace(Q),Tt.cull_face=Q),($=kt.frontFace)!==Tt.frontFace&&(wt.frontFace($),Tt.frontFace=$),(tt=kt.lineWidth)!==Tt.lineWidth&&(wt.lineWidth(tt),Tt.lineWidth=tt),(et=kt.polygonOffset_enable)!==Tt.polygonOffset_enable&&(et?wt.enable(32823):wt.disable(32823),Tt.polygonOffset_enable=et),rt=Wt[0],nt=Wt[1],rt===Yt[0]&&nt===Yt[1]||(wt.polygonOffset(rt,nt),Yt[0]=rt,Yt[1]=nt),(it=kt.sample_alpha)!==Tt.sample_alpha&&(it?wt.enable(32926):wt.disable(32926),Tt.sample_alpha=it),(at=kt.sample_enable)!==Tt.sample_enable&&(at?wt.enable(32928):wt.disable(32928),Tt.sample_enable=at),ot=Zt[0],st=Zt[1],ot===Xt[0]&&st===Xt[1]||(wt.sampleCoverage(ot,st),Xt[0]=ot,Xt[1]=st),(lt=kt.stencil_mask)!==Tt.stencil_mask&&(wt.stencilMask(lt),Tt.stencil_mask=lt),ct=Jt[0],ut=Jt[1],ft=Jt[2],ct===Kt[0]&&ut===Kt[1]&&ft===Kt[2]||(wt.stencilFunc(ct,ut,ft),Kt[0]=ct,Kt[1]=ut,Kt[2]=ft),pt=Qt[0],ht=Qt[1],dt=Qt[2],mt=Qt[3],pt===$t[0]&&ht===$t[1]&&dt===$t[2]&&mt===$t[3]||(wt.stencilOpSeparate(pt,ht,dt,mt),$t[0]=pt,$t[1]=ht,$t[2]=dt,$t[3]=mt),gt=te[0],yt=te[1],Et=te[2],Pt=te[3],gt===ee[0]&&yt===ee[1]&&Et===ee[2]&&Pt===ee[3]||(wt.stencilOpSeparate(gt,yt,Et,Pt),ee[0]=gt,ee[1]=yt,ee[2]=Et,ee[3]=Pt));for(wt.blendColor(0,0,0,1),Ft[0]=0,Ft[1]=0,Ft[2]=0,Ft[3]=1,vt?wt.enable(3042):wt.disable(3042),Tt.blend_enable=vt,wt.blendFuncSeparate(770,771,773,1),Vt[0]=770,Vt[1]=771,Vt[2]=773,Vt[3]=1,bt?wt.enable(2929):wt.disable(2929),Tt.depth_enable=bt,xt?wt.enable(3089):wt.disable(3089),Tt.scissor_enable=xt,_t?wt.enable(2960):wt.disable(2960),Tt.stencil_enable=_t,(i=Tt.profile)&&(a=performance.now(),e.count+=r),wt.useProgram(o.program),F=It.angle_instanced_arrays,Ct.setVAO(null),wt.uniform1i(T.location,!1),wt.uniform1i(L.location,C.bind()),Rt=Mt.instances,B=0;B0?ge.constant[0]:0,xe=ge.constant.length>1?ge.constant[1]:0,_e=ge.constant.length>2?ge.constant[2]:0,we=ge.constant.length>3?ge.constant[3]:0)):(Ae=Dt(ge.buffer)?zt.createStream(34962,ge.buffer):zt.getBuffer(ge.buffer),Me="type"in ge?oe[ge.type]:Ae.dtype,Te=!!ge.normalized,ke=0|ge.size,Se=0|ge.offset,ze=0|ge.stride,Ee=0|ge.divisor),Le=l.location,Ce=Lt[Le],1===ve?(Ce.buffer||wt.enableVertexAttribArray(Le),Pe=ke||4,Ce.type===Me&&Ce.size===Pe&&Ce.buffer===Ae&&Ce.normalized===Te&&Ce.offset===Se&&Ce.stride===ze||(wt.bindBuffer(34962,Ae.buffer),wt.vertexAttribPointer(Le,Pe,Me,Te,ze,Se),Ce.type=Me,Ce.size=Pe,Ce.buffer=Ae,Ce.normalized=Te,Ce.offset=Se,Ce.stride=ze),Ce.divisor!==Ee&&(F.vertexAttribDivisorANGLE(Le,Ee),Ce.divisor=Ee)):(Ce.buffer&&(wt.disableVertexAttribArray(Le),Ce.buffer=null),Ce.x===be&&Ce.y===xe&&Ce.z===_e&&Ce.w===we||(wt.vertexAttrib4f(Le,be,xe,_e,we),Ce.x=be,Ce.y=xe,Ce.z=_e,Ce.w=we)),Oe=c.call(this,At,N,B),Ie=!1,De=1,Re=0,Fe=0,Be=0,Ne=0,je=null,Ve=0,Ue=!1,He=5126,qe=0,Ge=0,We=0,Dt(Oe)?(Ie=!0,He=(je=zt.createStream(34962,Oe)).dtype):(je=zt.getBuffer(Oe))?He=je.dtype:"constant"in Oe?(De=2,"number"==typeof Oe.constant?(Re=Oe.constant,Fe=Be=Ne=0):(Re=Oe.constant.length>0?Oe.constant[0]:0,Fe=Oe.constant.length>1?Oe.constant[1]:0,Be=Oe.constant.length>2?Oe.constant[2]:0,Ne=Oe.constant.length>3?Oe.constant[3]:0)):(je=Dt(Oe.buffer)?zt.createStream(34962,Oe.buffer):zt.getBuffer(Oe.buffer),He="type"in Oe?oe[Oe.type]:je.dtype,Ue=!!Oe.normalized,Ve=0|Oe.size,qe=0|Oe.offset,Ge=0|Oe.stride,We=0|Oe.divisor),Ye=u.location,Ze=Lt[Ye],1===De?(Ze.buffer||wt.enableVertexAttribArray(Ye),Xe=Ve||1,Ze.type===He&&Ze.size===Xe&&Ze.buffer===je&&Ze.normalized===Ue&&Ze.offset===qe&&Ze.stride===Ge||(wt.bindBuffer(34962,je.buffer),wt.vertexAttribPointer(Ye,Xe,He,Ue,Ge,qe),Ze.type=He,Ze.size=Xe,Ze.buffer=je,Ze.normalized=Ue,Ze.offset=qe,Ze.stride=Ge),Ze.divisor!==We&&(F.vertexAttribDivisorANGLE(Ye,We),Ze.divisor=We)):(Ze.buffer&&(wt.disableVertexAttribArray(Ye),Ze.buffer=null),Ze.x===Re&&Ze.y===Fe&&Ze.z===Be&&Ze.w===Ne||(wt.vertexAttrib4f(Ye,Re,Fe,Be,Ne),Ze.x=Re,Ze.y=Fe,Ze.z=Be,Ze.w=Ne)),Je=f.call(this,At,N,B),Ke=!1,Qe=1,$e=0,tr=0,er=0,rr=0,nr=null,ir=0,ar=!1,or=5126,sr=0,lr=0,cr=0,Dt(Je)?(Ke=!0,or=(nr=zt.createStream(34962,Je)).dtype):(nr=zt.getBuffer(Je))?or=nr.dtype:"constant"in Je?(Qe=2,"number"==typeof Je.constant?($e=Je.constant,tr=er=rr=0):($e=Je.constant.length>0?Je.constant[0]:0,tr=Je.constant.length>1?Je.constant[1]:0,er=Je.constant.length>2?Je.constant[2]:0,rr=Je.constant.length>3?Je.constant[3]:0)):(nr=Dt(Je.buffer)?zt.createStream(34962,Je.buffer):zt.getBuffer(Je.buffer),or="type"in Je?oe[Je.type]:nr.dtype,ar=!!Je.normalized,ir=0|Je.size,sr=0|Je.offset,lr=0|Je.stride,cr=0|Je.divisor),ur=p.location,fr=Lt[ur],1===Qe?(fr.buffer||wt.enableVertexAttribArray(ur),pr=ir||4,fr.type===or&&fr.size===pr&&fr.buffer===nr&&fr.normalized===ar&&fr.offset===sr&&fr.stride===lr||(wt.bindBuffer(34962,nr.buffer),wt.vertexAttribPointer(ur,pr,or,ar,lr,sr),fr.type=or,fr.size=pr,fr.buffer=nr,fr.normalized=ar,fr.offset=sr,fr.stride=lr),fr.divisor!==cr&&(F.vertexAttribDivisorANGLE(ur,cr),fr.divisor=cr)):(fr.buffer&&(wt.disableVertexAttribArray(ur),fr.buffer=null),fr.x===$e&&fr.y===tr&&fr.z===er&&fr.w===rr||(wt.vertexAttrib4f(ur,$e,tr,er,rr),fr.x=$e,fr.y=tr,fr.z=er,fr.w=rr)),hr=h.call(this,At,N,B),dr=!1,mr=1,gr=0,yr=0,vr=0,br=0,xr=null,_r=0,wr=!1,Ar=5126,kr=0,Tr=0,Mr=0,Dt(hr)?(dr=!0,Ar=(xr=zt.createStream(34962,hr)).dtype):(xr=zt.getBuffer(hr))?Ar=xr.dtype:"constant"in hr?(mr=2,"number"==typeof hr.constant?(gr=hr.constant,yr=vr=br=0):(gr=hr.constant.length>0?hr.constant[0]:0,yr=hr.constant.length>1?hr.constant[1]:0,vr=hr.constant.length>2?hr.constant[2]:0,br=hr.constant.length>3?hr.constant[3]:0)):(xr=Dt(hr.buffer)?zt.createStream(34962,hr.buffer):zt.getBuffer(hr.buffer),Ar="type"in hr?oe[hr.type]:xr.dtype,wr=!!hr.normalized,_r=0|hr.size,kr=0|hr.offset,Tr=0|hr.stride,Mr=0|hr.divisor),Sr=d.location,zr=Lt[Sr],1===mr?(zr.buffer||wt.enableVertexAttribArray(Sr),Er=_r||1,zr.type===Ar&&zr.size===Er&&zr.buffer===xr&&zr.normalized===wr&&zr.offset===kr&&zr.stride===Tr||(wt.bindBuffer(34962,xr.buffer),wt.vertexAttribPointer(Sr,Er,Ar,wr,Tr,kr),zr.type=Ar,zr.size=Er,zr.buffer=xr,zr.normalized=wr,zr.offset=kr,zr.stride=Tr),zr.divisor!==Mr&&(F.vertexAttribDivisorANGLE(Sr,Mr),zr.divisor=Mr)):(zr.buffer&&(wt.disableVertexAttribArray(Sr),zr.buffer=null),zr.x===gr&&zr.y===yr&&zr.z===vr&&zr.w===br||(wt.vertexAttrib4f(Sr,gr,yr,vr,br),zr.x=gr,zr.y=yr,zr.z=vr,zr.w=br)),Lr=m.call(this,At,N,B),Cr=!1,Pr=1,Or=0,Ir=0,Dr=0,Rr=0,Fr=null,Br=0,Nr=!1,jr=5126,Vr=0,Ur=0,Hr=0,Dt(Lr)?(Cr=!0,jr=(Fr=zt.createStream(34962,Lr)).dtype):(Fr=zt.getBuffer(Lr))?jr=Fr.dtype:"constant"in Lr?(Pr=2,"number"==typeof Lr.constant?(Or=Lr.constant,Ir=Dr=Rr=0):(Or=Lr.constant.length>0?Lr.constant[0]:0,Ir=Lr.constant.length>1?Lr.constant[1]:0,Dr=Lr.constant.length>2?Lr.constant[2]:0,Rr=Lr.constant.length>3?Lr.constant[3]:0)):(Fr=Dt(Lr.buffer)?zt.createStream(34962,Lr.buffer):zt.getBuffer(Lr.buffer),jr="type"in Lr?oe[Lr.type]:Fr.dtype,Nr=!!Lr.normalized,Br=0|Lr.size,Vr=0|Lr.offset,Ur=0|Lr.stride,Hr=0|Lr.divisor),qr=g.location,Gr=Lt[qr],1===Pr?(Gr.buffer||wt.enableVertexAttribArray(qr),Wr=Br||1,Gr.type===jr&&Gr.size===Wr&&Gr.buffer===Fr&&Gr.normalized===Nr&&Gr.offset===Vr&&Gr.stride===Ur||(wt.bindBuffer(34962,Fr.buffer),wt.vertexAttribPointer(qr,Wr,jr,Nr,Ur,Vr),Gr.type=jr,Gr.size=Wr,Gr.buffer=Fr,Gr.normalized=Nr,Gr.offset=Vr,Gr.stride=Ur),Gr.divisor!==Hr&&(F.vertexAttribDivisorANGLE(qr,Hr),Gr.divisor=Hr)):(Gr.buffer&&(wt.disableVertexAttribArray(qr),Gr.buffer=null),Gr.x===Or&&Gr.y===Ir&&Gr.z===Dr&&Gr.w===Rr||(wt.vertexAttrib4f(qr,Or,Ir,Dr,Rr),Gr.x=Or,Gr.y=Ir,Gr.z=Dr,Gr.w=Rr)),Yr=y.call(this,At,N,B),Zr=!1,Xr=1,Jr=0,Kr=0,Qr=0,$r=0,tn=null,en=0,rn=!1,nn=5126,an=0,on=0,sn=0,Dt(Yr)?(Zr=!0,nn=(tn=zt.createStream(34962,Yr)).dtype):(tn=zt.getBuffer(Yr))?nn=tn.dtype:"constant"in Yr?(Xr=2,"number"==typeof Yr.constant?(Jr=Yr.constant,Kr=Qr=$r=0):(Jr=Yr.constant.length>0?Yr.constant[0]:0,Kr=Yr.constant.length>1?Yr.constant[1]:0,Qr=Yr.constant.length>2?Yr.constant[2]:0,$r=Yr.constant.length>3?Yr.constant[3]:0)):(tn=Dt(Yr.buffer)?zt.createStream(34962,Yr.buffer):zt.getBuffer(Yr.buffer),nn="type"in Yr?oe[Yr.type]:tn.dtype,rn=!!Yr.normalized,en=0|Yr.size,an=0|Yr.offset,on=0|Yr.stride,sn=0|Yr.divisor),ln=v.location,cn=Lt[ln],1===Xr?(cn.buffer||wt.enableVertexAttribArray(ln),un=en||1,cn.type===nn&&cn.size===un&&cn.buffer===tn&&cn.normalized===rn&&cn.offset===an&&cn.stride===on||(wt.bindBuffer(34962,tn.buffer),wt.vertexAttribPointer(ln,un,nn,rn,on,an),cn.type=nn,cn.size=un,cn.buffer=tn,cn.normalized=rn,cn.offset=an,cn.stride=on),cn.divisor!==sn&&(F.vertexAttribDivisorANGLE(ln,sn),cn.divisor=sn)):(cn.buffer&&(wt.disableVertexAttribArray(ln),cn.buffer=null),cn.x===Jr&&cn.y===Kr&&cn.z===Qr&&cn.w===$r||(wt.vertexAttrib4f(ln,Jr,Kr,Qr,$r),cn.x=Jr,cn.y=Kr,cn.z=Qr,cn.w=$r)),fn=b.call(this,At,N,B),pn=!1,hn=1,dn=0,mn=0,gn=0,yn=0,vn=null,bn=0,xn=!1,_n=5126,wn=0,An=0,kn=0,Dt(fn)?(pn=!0,_n=(vn=zt.createStream(34962,fn)).dtype):(vn=zt.getBuffer(fn))?_n=vn.dtype:"constant"in fn?(hn=2,"number"==typeof fn.constant?(dn=fn.constant,mn=gn=yn=0):(dn=fn.constant.length>0?fn.constant[0]:0,mn=fn.constant.length>1?fn.constant[1]:0,gn=fn.constant.length>2?fn.constant[2]:0,yn=fn.constant.length>3?fn.constant[3]:0)):(vn=Dt(fn.buffer)?zt.createStream(34962,fn.buffer):zt.getBuffer(fn.buffer),_n="type"in fn?oe[fn.type]:vn.dtype,xn=!!fn.normalized,bn=0|fn.size,wn=0|fn.offset,An=0|fn.stride,kn=0|fn.divisor),Tn=x.location,Mn=Lt[Tn],1===hn?(Mn.buffer||wt.enableVertexAttribArray(Tn),Sn=bn||1,Mn.type===_n&&Mn.size===Sn&&Mn.buffer===vn&&Mn.normalized===xn&&Mn.offset===wn&&Mn.stride===An||(wt.bindBuffer(34962,vn.buffer),wt.vertexAttribPointer(Tn,Sn,_n,xn,An,wn),Mn.type=_n,Mn.size=Sn,Mn.buffer=vn,Mn.normalized=xn,Mn.offset=wn,Mn.stride=An),Mn.divisor!==kn&&(F.vertexAttribDivisorANGLE(Tn,kn),Mn.divisor=kn)):(Mn.buffer&&(wt.disableVertexAttribArray(Tn),Mn.buffer=null),Mn.x===dn&&Mn.y===mn&&Mn.z===gn&&Mn.w===yn||(wt.vertexAttrib4f(Tn,dn,mn,gn,yn),Mn.x=dn,Mn.y=mn,Mn.z=gn,Mn.w=yn)),zn=_.call(this,At,N,B),En=!1,Ln=1,Cn=0,Pn=0,On=0,In=0,Dn=null,Rn=0,Fn=!1,Bn=5126,Nn=0,jn=0,Vn=0,Dt(zn)?(En=!0,Bn=(Dn=zt.createStream(34962,zn)).dtype):(Dn=zt.getBuffer(zn))?Bn=Dn.dtype:"constant"in zn?(Ln=2,"number"==typeof zn.constant?(Cn=zn.constant,Pn=On=In=0):(Cn=zn.constant.length>0?zn.constant[0]:0,Pn=zn.constant.length>1?zn.constant[1]:0,On=zn.constant.length>2?zn.constant[2]:0,In=zn.constant.length>3?zn.constant[3]:0)):(Dn=Dt(zn.buffer)?zt.createStream(34962,zn.buffer):zt.getBuffer(zn.buffer),Bn="type"in zn?oe[zn.type]:Dn.dtype,Fn=!!zn.normalized,Rn=0|zn.size,Nn=0|zn.offset,jn=0|zn.stride,Vn=0|zn.divisor),Un=w.location,Hn=Lt[Un],1===Ln?(Hn.buffer||wt.enableVertexAttribArray(Un),qn=Rn||1,Hn.type===Bn&&Hn.size===qn&&Hn.buffer===Dn&&Hn.normalized===Fn&&Hn.offset===Nn&&Hn.stride===jn||(wt.bindBuffer(34962,Dn.buffer),wt.vertexAttribPointer(Un,qn,Bn,Fn,jn,Nn),Hn.type=Bn,Hn.size=qn,Hn.buffer=Dn,Hn.normalized=Fn,Hn.offset=Nn,Hn.stride=jn),Hn.divisor!==Vn&&(F.vertexAttribDivisorANGLE(Un,Vn),Hn.divisor=Vn)):(Hn.buffer&&(wt.disableVertexAttribArray(Un),Hn.buffer=null),Hn.x===Cn&&Hn.y===Pn&&Hn.z===On&&Hn.w===In||(wt.vertexAttrib4f(Un,Cn,Pn,On,In),Hn.x=Cn,Hn.y=Pn,Hn.z=On,Hn.w=In)),Gn=A.call(this,At,N,B),Wn=!1,Yn=1,Zn=0,Xn=0,Jn=0,Kn=0,Qn=null,$n=0,ti=!1,ei=5126,ri=0,ni=0,ii=0,Dt(Gn)?(Wn=!0,ei=(Qn=zt.createStream(34962,Gn)).dtype):(Qn=zt.getBuffer(Gn))?ei=Qn.dtype:"constant"in Gn?(Yn=2,"number"==typeof Gn.constant?(Zn=Gn.constant,Xn=Jn=Kn=0):(Zn=Gn.constant.length>0?Gn.constant[0]:0,Xn=Gn.constant.length>1?Gn.constant[1]:0,Jn=Gn.constant.length>2?Gn.constant[2]:0,Kn=Gn.constant.length>3?Gn.constant[3]:0)):(Qn=Dt(Gn.buffer)?zt.createStream(34962,Gn.buffer):zt.getBuffer(Gn.buffer),ei="type"in Gn?oe[Gn.type]:Qn.dtype,ti=!!Gn.normalized,$n=0|Gn.size,ri=0|Gn.offset,ni=0|Gn.stride,ii=0|Gn.divisor),ai=k.location,oi=Lt[ai],1===Yn?(oi.buffer||wt.enableVertexAttribArray(ai),si=$n||1,oi.type===ei&&oi.size===si&&oi.buffer===Qn&&oi.normalized===ti&&oi.offset===ri&&oi.stride===ni||(wt.bindBuffer(34962,Qn.buffer),wt.vertexAttribPointer(ai,si,ei,ti,ni,ri),oi.type=ei,oi.size=si,oi.buffer=Qn,oi.normalized=ti,oi.offset=ri,oi.stride=ni),oi.divisor!==ii&&(F.vertexAttribDivisorANGLE(ai,ii),oi.divisor=ii)):(oi.buffer&&(wt.disableVertexAttribArray(ai),oi.buffer=null),oi.x===Zn&&oi.y===Xn&&oi.z===Jn&&oi.w===Kn||(wt.vertexAttrib4f(ai,Zn,Xn,Jn,Kn),oi.x=Zn,oi.y=Xn,oi.z=Jn,oi.w=Kn)),(li=N.markerTexture)&&"framebuffer"===li._reglType&&(li=li.color[0]),ci=li._texture,wt.uniform1i(M.location,ci.bind()),ui=N.opacity,B&&fi===ui||(fi=ui,wt.uniform1f(S.location,ui)),hi=(pi=E.call(this,At,N,B))[0],mi=pi[1],B&&di===hi&&gi===mi||(di=hi,gi=mi,wt.uniform2f(z.location,hi,mi)),yi=At.pixelRatio,B&&vi===yi||(vi=yi,wt.uniform1f(P.location,yi)),xi=(bi=N.scale)[0],wi=bi[1],B&&_i===xi&&Ai===wi||(_i=xi,Ai=wi,wt.uniform2f(O.location,xi,wi)),Ti=(ki=N.scaleFract)[0],Si=ki[1],B&&Mi===Ti&&zi===Si||(Mi=Ti,zi=Si,wt.uniform2f(I.location,Ti,Si)),Li=(Ei=N.translate)[0],Pi=Ei[1],B&&Ci===Li&&Oi===Pi||(Ci=Li,Oi=Pi,wt.uniform2f(D.location,Li,Pi)),Di=(Ii=N.translateFract)[0],Fi=Ii[1],B&&Ri===Di&&Bi===Fi||(Ri=Di,Bi=Fi,wt.uniform2f(R.location,Di,Fi)),Ni=N.elements,ji=null,(ji=(Vi=Dt(Ni))?St.createStream(Ni):St.getElements(Ni))&&wt.bindBuffer(34963,ji.buffer.buffer),Ui=N.offset,(Hi=N.count)&&(Rt>0?ji?F.drawElementsInstancedANGLE(0,Hi,ji.type,Ui<<(ji.type-5121>>1),Rt):F.drawArraysInstancedANGLE(0,Ui,Hi,Rt):Rt<0&&(ji?wt.drawElements(0,Hi,ji.type,Ui<<(ji.type-5121>>1)):wt.drawArrays(0,Ui,Hi)),At.viewportWidth=ce,At.viewportHeight=ue,ye&&zt.destroyStream(Ae),Ie&&zt.destroyStream(je),Ke&&zt.destroyStream(nr),dr&&zt.destroyStream(xr),Cr&&zt.destroyStream(Fr),Zr&&zt.destroyStream(tn),pn&&zt.destroyStream(vn),En&&zt.destroyStream(Dn),Wn&&zt.destroyStream(Qn),ci.unbind(),Vi&&St.destroyStream(ji))}C.unbind(),Tt.dirty=!0,Ct.setVAO(null),i&&(e.cpuTime+=performance.now()-a)}}}},{}],504:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt){"use strict";var mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie;return mt=t.gl,gt=t.context,t.strings,yt=t.next,vt=t.current,bt=t.draw,xt=t.elements,_t=t.buffer,wt=t.shader,At=t.attributes,kt=t.vao,Tt=t.uniforms,Mt=t.framebuffer,St=t.extensions,t.timer,zt=t.isBufferArgs,Et=yt.blend_color,Lt=vt.blend_color,Ct=yt.blend_equation,Pt=vt.blend_equation,Ot=yt.blend_func,It=vt.blend_func,Dt=yt.depth_range,Rt=vt.depth_range,Ft=yt.colorMask,Bt=vt.colorMask,Nt=yt.polygonOffset_offset,jt=vt.polygonOffset_offset,Vt=yt.sample_coverage,Ut=vt.sample_coverage,Ht=yt.stencil_func,qt=vt.stencil_func,Gt=yt.stencil_opFront,Wt=vt.stencil_opFront,Yt=yt.stencil_opBack,Zt=vt.stencil_opBack,Xt=yt.scissor_box,Jt=vt.scissor_box,Kt=yt.viewport,Qt=vt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$t={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(te={}).stride=8,te.offset=8,te.divisor=1,(ee={}).stride=8,ee.offset=16,ee.divisor=1,(re={}).stride=8,re.offset=8,re.divisor=1,(ne={}).stride=8,ne.offset=16,ne.divisor=1,(ie={}).stride=4,ie.offset=0,ie.divisor=1,{draw:function(t){var M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,wt,Tt,Et,Ct,Ot,Xt,Kt,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un;(St.angle_instanced_arrays,(M=Mt.next)!==Mt.cur&&(M?mt.bindFramebuffer(36160,M.framebuffer):mt.bindFramebuffer(36160,null),Mt.cur=M),vt.dirty)&&((Pr=yt.dither)!==vt.dither&&(Pr?mt.enable(3024):mt.disable(3024),vt.dither=Pr),(Or=yt.depth_func)!==vt.depth_func&&(mt.depthFunc(Or),vt.depth_func=Or),Ir=Dt[0],Dr=Dt[1],Ir===Rt[0]&&Dr===Rt[1]||(mt.depthRange(Ir,Dr),Rt[0]=Ir,Rt[1]=Dr),(Rr=yt.depth_mask)!==vt.depth_mask&&(mt.depthMask(Rr),vt.depth_mask=Rr),Fr=Ft[0],Br=Ft[1],Nr=Ft[2],jr=Ft[3],Fr===Bt[0]&&Br===Bt[1]&&Nr===Bt[2]&&jr===Bt[3]||(mt.colorMask(Fr,Br,Nr,jr),Bt[0]=Fr,Bt[1]=Br,Bt[2]=Nr,Bt[3]=jr),(Vr=yt.cull_enable)!==vt.cull_enable&&(Vr?mt.enable(2884):mt.disable(2884),vt.cull_enable=Vr),(Ur=yt.cull_face)!==vt.cull_face&&(mt.cullFace(Ur),vt.cull_face=Ur),(Hr=yt.frontFace)!==vt.frontFace&&(mt.frontFace(Hr),vt.frontFace=Hr),(qr=yt.lineWidth)!==vt.lineWidth&&(mt.lineWidth(qr),vt.lineWidth=qr),(Gr=yt.polygonOffset_enable)!==vt.polygonOffset_enable&&(Gr?mt.enable(32823):mt.disable(32823),vt.polygonOffset_enable=Gr),Wr=Nt[0],Yr=Nt[1],Wr===jt[0]&&Yr===jt[1]||(mt.polygonOffset(Wr,Yr),jt[0]=Wr,jt[1]=Yr),(Zr=yt.sample_alpha)!==vt.sample_alpha&&(Zr?mt.enable(32926):mt.disable(32926),vt.sample_alpha=Zr),(Xr=yt.sample_enable)!==vt.sample_enable&&(Xr?mt.enable(32928):mt.disable(32928),vt.sample_enable=Xr),Jr=Vt[0],Kr=Vt[1],Jr===Ut[0]&&Kr===Ut[1]||(mt.sampleCoverage(Jr,Kr),Ut[0]=Jr,Ut[1]=Kr),(Qr=yt.stencil_mask)!==vt.stencil_mask&&(mt.stencilMask(Qr),vt.stencil_mask=Qr),$r=Ht[0],tn=Ht[1],en=Ht[2],$r===qt[0]&&tn===qt[1]&&en===qt[2]||(mt.stencilFunc($r,tn,en),qt[0]=$r,qt[1]=tn,qt[2]=en),rn=Gt[0],nn=Gt[1],an=Gt[2],on=Gt[3],rn===Wt[0]&&nn===Wt[1]&&an===Wt[2]&&on===Wt[3]||(mt.stencilOpSeparate(rn,nn,an,on),Wt[0]=rn,Wt[1]=nn,Wt[2]=an,Wt[3]=on),sn=Yt[0],ln=Yt[1],cn=Yt[2],un=Yt[3],sn===Zt[0]&&ln===Zt[1]&&cn===Zt[2]&&un===Zt[3]||(mt.stencilOpSeparate(sn,ln,cn,un),Zt[0]=sn,Zt[1]=ln,Zt[2]=cn,Zt[3]=un));z=0|(S=t.viewport).x,E=0|S.y,L="width"in S?0|S.width:gt.framebufferWidth-z,C="height"in S?0|S.height:gt.framebufferHeight-E,P=gt.viewportWidth,gt.viewportWidth=L,O=gt.viewportHeight,gt.viewportHeight=C,mt.viewport(z,E,L,C),Qt[0]=z,Qt[1]=E,Qt[2]=L,Qt[3]=C,mt.blendColor(0,0,0,0),Lt[0]=0,Lt[1]=0,Lt[2]=0,Lt[3]=0,r?mt.enable(3042):mt.disable(3042),vt.blend_enable=r,mt.blendEquationSeparate(32774,32774),Pt[0]=32774,Pt[1]=32774,mt.blendFuncSeparate(770,771,773,1),It[0]=770,It[1]=771,It[2]=773,It[3]=1,(I=n.call(this,gt,t,0))?mt.enable(2929):mt.disable(2929),vt.depth_enable=I,R=0|(D=t.viewport).x,F=0|D.y,B="width"in D?0|D.width:gt.framebufferWidth-R,N="height"in D?0|D.height:gt.framebufferHeight-F,mt.scissor(R,F,B,N),Jt[0]=R,Jt[1]=F,Jt[2]=B,Jt[3]=N,i?mt.enable(3089):mt.disable(3089),vt.scissor_enable=i,a?mt.enable(2960):mt.disable(2960),vt.stencil_enable=a,(j=vt.profile)&&(V=performance.now(),e.count++),mt.useProgram(o.program),U=St.angle_instanced_arrays,kt.setVAO(null),H=t.positionBuffer,te.buffer=H,q=!1,G=1,W=0,Y=0,Z=0,X=0,J=null,K=0,Q=!1,$=5126,tt=0,et=0,rt=0,zt(te)?(q=!0,$=(J=_t.createStream(34962,te)).dtype):(J=_t.getBuffer(te))?$=J.dtype:"constant"in te?(G=2,"number"==typeof te.constant?(W=te.constant,Y=Z=X=0):(W=te.constant.length>0?te.constant[0]:0,Y=te.constant.length>1?te.constant[1]:0,Z=te.constant.length>2?te.constant[2]:0,X=te.constant.length>3?te.constant[3]:0)):(J=zt(te.buffer)?_t.createStream(34962,te.buffer):_t.getBuffer(te.buffer),$="type"in te?$t[te.type]:J.dtype,Q=!!te.normalized,K=0|te.size,tt=0|te.offset,et=0|te.stride,rt=0|te.divisor),nt=s.location,it=At[nt],1===G?(it.buffer||mt.enableVertexAttribArray(nt),at=K||2,it.type===$&&it.size===at&&it.buffer===J&&it.normalized===Q&&it.offset===tt&&it.stride===et||(mt.bindBuffer(34962,J.buffer),mt.vertexAttribPointer(nt,at,$,Q,et,tt),it.type=$,it.size=at,it.buffer=J,it.normalized=Q,it.offset=tt,it.stride=et),it.divisor!==rt&&(U.vertexAttribDivisorANGLE(nt,rt),it.divisor=rt)):(it.buffer&&(mt.disableVertexAttribArray(nt),it.buffer=null),it.x===W&&it.y===Y&&it.z===Z&&it.w===X||(mt.vertexAttrib4f(nt,W,Y,Z,X),it.x=W,it.y=Y,it.z=Z,it.w=X)),ot=t.positionFractBuffer,re.buffer=ot,st=!1,lt=1,ct=0,ut=0,ft=0,pt=0,ht=null,dt=0,wt=!1,Tt=5126,Et=0,Ct=0,Ot=0,zt(re)?(st=!0,Tt=(ht=_t.createStream(34962,re)).dtype):(ht=_t.getBuffer(re))?Tt=ht.dtype:"constant"in re?(lt=2,"number"==typeof re.constant?(ct=re.constant,ut=ft=pt=0):(ct=re.constant.length>0?re.constant[0]:0,ut=re.constant.length>1?re.constant[1]:0,ft=re.constant.length>2?re.constant[2]:0,pt=re.constant.length>3?re.constant[3]:0)):(ht=zt(re.buffer)?_t.createStream(34962,re.buffer):_t.getBuffer(re.buffer),Tt="type"in re?$t[re.type]:ht.dtype,wt=!!re.normalized,dt=0|re.size,Et=0|re.offset,Ct=0|re.stride,Ot=0|re.divisor),Xt=l.location,Kt=At[Xt],1===lt?(Kt.buffer||mt.enableVertexAttribArray(Xt),ae=dt||2,Kt.type===Tt&&Kt.size===ae&&Kt.buffer===ht&&Kt.normalized===wt&&Kt.offset===Et&&Kt.stride===Ct||(mt.bindBuffer(34962,ht.buffer),mt.vertexAttribPointer(Xt,ae,Tt,wt,Ct,Et),Kt.type=Tt,Kt.size=ae,Kt.buffer=ht,Kt.normalized=wt,Kt.offset=Et,Kt.stride=Ct),Kt.divisor!==Ot&&(U.vertexAttribDivisorANGLE(Xt,Ot),Kt.divisor=Ot)):(Kt.buffer&&(mt.disableVertexAttribArray(Xt),Kt.buffer=null),Kt.x===ct&&Kt.y===ut&&Kt.z===ft&&Kt.w===pt||(mt.vertexAttrib4f(Xt,ct,ut,ft,pt),Kt.x=ct,Kt.y=ut,Kt.z=ft,Kt.w=pt)),oe=t.positionBuffer,ee.buffer=oe,se=!1,le=1,ce=0,ue=0,fe=0,pe=0,he=null,de=0,me=!1,ge=5126,ye=0,ve=0,be=0,zt(ee)?(se=!0,ge=(he=_t.createStream(34962,ee)).dtype):(he=_t.getBuffer(ee))?ge=he.dtype:"constant"in ee?(le=2,"number"==typeof ee.constant?(ce=ee.constant,ue=fe=pe=0):(ce=ee.constant.length>0?ee.constant[0]:0,ue=ee.constant.length>1?ee.constant[1]:0,fe=ee.constant.length>2?ee.constant[2]:0,pe=ee.constant.length>3?ee.constant[3]:0)):(he=zt(ee.buffer)?_t.createStream(34962,ee.buffer):_t.getBuffer(ee.buffer),ge="type"in ee?$t[ee.type]:he.dtype,me=!!ee.normalized,de=0|ee.size,ye=0|ee.offset,ve=0|ee.stride,be=0|ee.divisor),xe=c.location,_e=At[xe],1===le?(_e.buffer||mt.enableVertexAttribArray(xe),we=de||2,_e.type===ge&&_e.size===we&&_e.buffer===he&&_e.normalized===me&&_e.offset===ye&&_e.stride===ve||(mt.bindBuffer(34962,he.buffer),mt.vertexAttribPointer(xe,we,ge,me,ve,ye),_e.type=ge,_e.size=we,_e.buffer=he,_e.normalized=me,_e.offset=ye,_e.stride=ve),_e.divisor!==be&&(U.vertexAttribDivisorANGLE(xe,be),_e.divisor=be)):(_e.buffer&&(mt.disableVertexAttribArray(xe),_e.buffer=null),_e.x===ce&&_e.y===ue&&_e.z===fe&&_e.w===pe||(mt.vertexAttrib4f(xe,ce,ue,fe,pe),_e.x=ce,_e.y=ue,_e.z=fe,_e.w=pe)),Ae=t.positionFractBuffer,ne.buffer=Ae,ke=!1,Te=1,Me=0,Se=0,ze=0,Ee=0,Le=null,Ce=0,Pe=!1,Oe=5126,Ie=0,De=0,Re=0,zt(ne)?(ke=!0,Oe=(Le=_t.createStream(34962,ne)).dtype):(Le=_t.getBuffer(ne))?Oe=Le.dtype:"constant"in ne?(Te=2,"number"==typeof ne.constant?(Me=ne.constant,Se=ze=Ee=0):(Me=ne.constant.length>0?ne.constant[0]:0,Se=ne.constant.length>1?ne.constant[1]:0,ze=ne.constant.length>2?ne.constant[2]:0,Ee=ne.constant.length>3?ne.constant[3]:0)):(Le=zt(ne.buffer)?_t.createStream(34962,ne.buffer):_t.getBuffer(ne.buffer),Oe="type"in ne?$t[ne.type]:Le.dtype,Pe=!!ne.normalized,Ce=0|ne.size,Ie=0|ne.offset,De=0|ne.stride,Re=0|ne.divisor),Fe=u.location,Be=At[Fe],1===Te?(Be.buffer||mt.enableVertexAttribArray(Fe),Ne=Ce||2,Be.type===Oe&&Be.size===Ne&&Be.buffer===Le&&Be.normalized===Pe&&Be.offset===Ie&&Be.stride===De||(mt.bindBuffer(34962,Le.buffer),mt.vertexAttribPointer(Fe,Ne,Oe,Pe,De,Ie),Be.type=Oe,Be.size=Ne,Be.buffer=Le,Be.normalized=Pe,Be.offset=Ie,Be.stride=De),Be.divisor!==Re&&(U.vertexAttribDivisorANGLE(Fe,Re),Be.divisor=Re)):(Be.buffer&&(mt.disableVertexAttribArray(Fe),Be.buffer=null),Be.x===Me&&Be.y===Se&&Be.z===ze&&Be.w===Ee||(mt.vertexAttrib4f(Fe,Me,Se,ze,Ee),Be.x=Me,Be.y=Se,Be.z=ze,Be.w=Ee)),je=t.colorBuffer,ie.buffer=je,Ve=!1,Ue=1,He=0,qe=0,Ge=0,We=0,Ye=null,Ze=0,Xe=!1,Je=5126,Ke=0,Qe=0,$e=0,zt(ie)?(Ve=!0,Je=(Ye=_t.createStream(34962,ie)).dtype):(Ye=_t.getBuffer(ie))?Je=Ye.dtype:"constant"in ie?(Ue=2,"number"==typeof ie.constant?(He=ie.constant,qe=Ge=We=0):(He=ie.constant.length>0?ie.constant[0]:0,qe=ie.constant.length>1?ie.constant[1]:0,Ge=ie.constant.length>2?ie.constant[2]:0,We=ie.constant.length>3?ie.constant[3]:0)):(Ye=zt(ie.buffer)?_t.createStream(34962,ie.buffer):_t.getBuffer(ie.buffer),Je="type"in ie?$t[ie.type]:Ye.dtype,Xe=!!ie.normalized,Ze=0|ie.size,Ke=0|ie.offset,Qe=0|ie.stride,$e=0|ie.divisor),tr=f.location,er=At[tr],1===Ue?(er.buffer||mt.enableVertexAttribArray(tr),rr=Ze||4,er.type===Je&&er.size===rr&&er.buffer===Ye&&er.normalized===Xe&&er.offset===Ke&&er.stride===Qe||(mt.bindBuffer(34962,Ye.buffer),mt.vertexAttribPointer(tr,rr,Je,Xe,Qe,Ke),er.type=Je,er.size=rr,er.buffer=Ye,er.normalized=Xe,er.offset=Ke,er.stride=Qe),er.divisor!==$e&&(U.vertexAttribDivisorANGLE(tr,$e),er.divisor=$e)):(er.buffer&&(mt.disableVertexAttribArray(tr),er.buffer=null),er.x===He&&er.y===qe&&er.z===Ge&&er.w===We||(mt.vertexAttrib4f(tr,He,qe,Ge,We),er.x=He,er.y=qe,er.z=Ge,er.w=We)),nr=h.location,(ir=At[nr]).buffer||mt.enableVertexAttribArray(nr),5126===ir.type&&1===ir.size&&ir.buffer===p&&!1===ir.normalized&&0===ir.offset&&8===ir.stride||(mt.bindBuffer(34962,p.buffer),mt.vertexAttribPointer(nr,1,5126,!1,8,0),ir.type=5126,ir.size=1,ir.buffer=p,ir.normalized=!1,ir.offset=0,ir.stride=8),0!==ir.divisor&&(U.vertexAttribDivisorANGLE(nr,0),ir.divisor=0),ar=d.location,(or=At[ar]).buffer||mt.enableVertexAttribArray(ar),5126===or.type&&1===or.size&&or.buffer===p&&!1===or.normalized&&4===or.offset&&8===or.stride||(mt.bindBuffer(34962,p.buffer),mt.vertexAttribPointer(ar,1,5126,!1,8,4),or.type=5126,or.size=1,or.buffer=p,or.normalized=!1,or.offset=4,or.stride=8),0!==or.divisor&&(U.vertexAttribDivisorANGLE(ar,0),or.divisor=0),sr=t.dashLength,mt.uniform1f(m.location,sr),(lr=t.dashTexture)&&"framebuffer"===lr._reglType&&(lr=lr.color[0]),cr=lr._texture,mt.uniform1i(g.location,cr.bind()),ur=t.depth,mt.uniform1f(y.location,ur),fr=t.opacity,mt.uniform1f(v.location,fr),hr=(pr=t.scale)[0],dr=pr[1],mt.uniform2f(b.location,hr,dr),gr=(mr=t.scaleFract)[0],yr=mr[1],mt.uniform2f(x.location,gr,yr),vr=t.thickness,mt.uniform1f(_.location,vr),xr=(br=t.translate)[0],_r=br[1],mt.uniform2f(w.location,xr,_r),Ar=(wr=t.translateFract)[0],kr=wr[1],mt.uniform2f(A.location,Ar,kr),Mr=(Tr=T.call(this,gt,t,0))[0],Sr=Tr[1],zr=Tr[2],Er=Tr[3],mt.uniform4f(k.location,Mr,Sr,zr,Er),((Lr=bt.elements)||kt.currentVAO&&(Lr=xt.getElements(kt.currentVAO.elements)))&&mt.bindBuffer(34963,Lr.buffer.buffer),(Cr=t.count)>0?Lr?U.drawElementsInstancedANGLE(5,4,Lr.type,0<<(Lr.type-5121>>1),Cr):U.drawArraysInstancedANGLE(5,0,4,Cr):Cr<0&&(Lr?mt.drawElements(5,4,Lr.type,0<<(Lr.type-5121>>1)):mt.drawArrays(5,0,4)),vt.dirty=!0,kt.setVAO(null),gt.viewportWidth=P,gt.viewportHeight=O,j&&(e.cpuTime+=performance.now()-V),q&&_t.destroyStream(J),st&&_t.destroyStream(ht),se&&_t.destroyStream(he),ke&&_t.destroyStream(Le),Ve&&_t.destroyStream(Ye),cr.unbind()},scope:function(t,r,i){var a,o,s,l,c,u,f,h,d,m,g,y,v,b,x,_,w,A,k,pt,ht,dt,mt,xt,At,kt,Mt,St,Lt,Pt,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Jt,Qt,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi;o=0|(a=t.viewport).x,s=0|a.y,l="width"in a?0|a.width:gt.framebufferWidth-o,c="height"in a?0|a.height:gt.framebufferHeight-s,u=gt.viewportWidth,gt.viewportWidth=l,f=gt.viewportHeight,gt.viewportHeight=c,h=Kt[0],Kt[0]=o,d=Kt[1],Kt[1]=s,m=Kt[2],Kt[2]=l,g=Kt[3],Kt[3]=c,y=Et[0],Et[0]=M,v=Et[1],Et[1]=S,b=Et[2],Et[2]=z,x=Et[3],Et[3]=E,_=yt.blend_enable,yt.blend_enable=L,w=Ct[0],Ct[0]=C,A=Ct[1],Ct[1]=P,k=Ot[0],Ot[0]=O,pt=Ot[1],Ot[1]=I,ht=Ot[2],Ot[2]=D,dt=Ot[3],Ot[3]=R,mt=n.call(this,gt,t,i),xt=yt.depth_enable,yt.depth_enable=mt,kt=0|(At=t.viewport).x,Mt=0|At.y,St="width"in At?0|At.width:gt.framebufferWidth-kt,Lt="height"in At?0|At.height:gt.framebufferHeight-Mt,Pt=Xt[0],Xt[0]=kt,It=Xt[1],Xt[1]=Mt,Dt=Xt[2],Xt[2]=St,Rt=Xt[3],Xt[3]=Lt,Ft=yt.scissor_enable,yt.scissor_enable=F,Bt=yt.stencil_enable,yt.stencil_enable=B,(Nt=vt.profile)&&(jt=performance.now(),e.count++),Vt=bt.offset,bt.offset=N,Ut=bt.count,bt.count=j,Ht=t.count,qt=bt.instances,bt.instances=Ht,Gt=bt.primitive,bt.primitive=V,Wt=U.call(this,gt,t,i),Yt=Tt[H],Tt[H]=Wt,Zt=t.miterLimit,Jt=Tt[q],Tt[q]=Zt,Qt=t.scale,ae=Tt[G],Tt[G]=Qt,oe=t.scaleFract,se=Tt[W],Tt[W]=oe,le=t.translateFract,ce=Tt[Y],Tt[Y]=le,ue=t.translate,fe=Tt[Z],Tt[Z]=ue,pe=t.thickness,he=Tt[X],Tt[X]=pe,de=t.dashTexture,me=Tt[J],Tt[J]=de,ge=t.opacity,ye=Tt[K],Tt[K]=ge,ve=gt.pixelRatio,be=Tt[Q],Tt[Q]=ve,xe=t.id,_e=Tt[$],Tt[$]=xe,we=t.dashLength,Ae=Tt[tt],Tt[tt]=we,ke=T.call(this,gt,t,i),Te=Tt[et],Tt[et]=ke,Me=t.depth,Se=Tt[rt],Tt[rt]=Me,ze=nt.state,nt.state=1,Ee=nt.x,nt.x=0,Le=nt.y,nt.y=0,Ce=nt.z,nt.z=0,Pe=nt.w,nt.w=0,Oe=nt.buffer,nt.buffer=p,Ie=nt.size,nt.size=0,De=nt.normalized,nt.normalized=!1,Re=nt.type,nt.type=5126,Fe=nt.offset,nt.offset=0,Be=nt.stride,nt.stride=8,Ne=nt.divisor,nt.divisor=0,je=it.state,it.state=1,Ve=it.x,it.x=0,Ue=it.y,it.y=0,He=it.z,it.z=0,qe=it.w,it.w=0,Ge=it.buffer,it.buffer=p,We=it.size,it.size=0,Ye=it.normalized,it.normalized=!1,Ze=it.type,it.type=5126,Xe=it.offset,it.offset=4,Je=it.stride,it.stride=8,Ke=it.divisor,it.divisor=0,Qe=t.positionBuffer,te.buffer=Qe,$e=!1,tr=1,er=0,rr=0,nr=0,ir=0,ar=null,or=0,sr=!1,lr=5126,cr=0,ur=0,fr=0,zt(te)?($e=!0,lr=(ar=_t.createStream(34962,te)).dtype):(ar=_t.getBuffer(te))?lr=ar.dtype:"constant"in te?(tr=2,"number"==typeof te.constant?(er=te.constant,rr=nr=ir=0):(er=te.constant.length>0?te.constant[0]:0,rr=te.constant.length>1?te.constant[1]:0,nr=te.constant.length>2?te.constant[2]:0,ir=te.constant.length>3?te.constant[3]:0)):(ar=zt(te.buffer)?_t.createStream(34962,te.buffer):_t.getBuffer(te.buffer),lr="type"in te?$t[te.type]:ar.dtype,sr=!!te.normalized,or=0|te.size,cr=0|te.offset,ur=0|te.stride,fr=0|te.divisor),pr=at.state,at.state=tr,hr=at.x,at.x=er,dr=at.y,at.y=rr,mr=at.z,at.z=nr,gr=at.w,at.w=ir,yr=at.buffer,at.buffer=ar,vr=at.size,at.size=or,br=at.normalized,at.normalized=sr,xr=at.type,at.type=lr,_r=at.offset,at.offset=cr,wr=at.stride,at.stride=ur,Ar=at.divisor,at.divisor=fr,kr=t.positionBuffer,ee.buffer=kr,Tr=!1,Mr=1,Sr=0,zr=0,Er=0,Lr=0,Cr=null,Pr=0,Or=!1,Ir=5126,Dr=0,Rr=0,Fr=0,zt(ee)?(Tr=!0,Ir=(Cr=_t.createStream(34962,ee)).dtype):(Cr=_t.getBuffer(ee))?Ir=Cr.dtype:"constant"in ee?(Mr=2,"number"==typeof ee.constant?(Sr=ee.constant,zr=Er=Lr=0):(Sr=ee.constant.length>0?ee.constant[0]:0,zr=ee.constant.length>1?ee.constant[1]:0,Er=ee.constant.length>2?ee.constant[2]:0,Lr=ee.constant.length>3?ee.constant[3]:0)):(Cr=zt(ee.buffer)?_t.createStream(34962,ee.buffer):_t.getBuffer(ee.buffer),Ir="type"in ee?$t[ee.type]:Cr.dtype,Or=!!ee.normalized,Pr=0|ee.size,Dr=0|ee.offset,Rr=0|ee.stride,Fr=0|ee.divisor),Br=ot.state,ot.state=Mr,Nr=ot.x,ot.x=Sr,jr=ot.y,ot.y=zr,Vr=ot.z,ot.z=Er,Ur=ot.w,ot.w=Lr,Hr=ot.buffer,ot.buffer=Cr,qr=ot.size,ot.size=Pr,Gr=ot.normalized,ot.normalized=Or,Wr=ot.type,ot.type=Ir,Yr=ot.offset,ot.offset=Dr,Zr=ot.stride,ot.stride=Rr,Xr=ot.divisor,ot.divisor=Fr,Jr=t.positionFractBuffer,re.buffer=Jr,Kr=!1,Qr=1,$r=0,tn=0,en=0,rn=0,nn=null,an=0,on=!1,sn=5126,ln=0,cn=0,un=0,zt(re)?(Kr=!0,sn=(nn=_t.createStream(34962,re)).dtype):(nn=_t.getBuffer(re))?sn=nn.dtype:"constant"in re?(Qr=2,"number"==typeof re.constant?($r=re.constant,tn=en=rn=0):($r=re.constant.length>0?re.constant[0]:0,tn=re.constant.length>1?re.constant[1]:0,en=re.constant.length>2?re.constant[2]:0,rn=re.constant.length>3?re.constant[3]:0)):(nn=zt(re.buffer)?_t.createStream(34962,re.buffer):_t.getBuffer(re.buffer),sn="type"in re?$t[re.type]:nn.dtype,on=!!re.normalized,an=0|re.size,ln=0|re.offset,cn=0|re.stride,un=0|re.divisor),fn=st.state,st.state=Qr,pn=st.x,st.x=$r,hn=st.y,st.y=tn,dn=st.z,st.z=en,mn=st.w,st.w=rn,gn=st.buffer,st.buffer=nn,yn=st.size,st.size=an,vn=st.normalized,st.normalized=on,bn=st.type,st.type=sn,xn=st.offset,st.offset=ln,_n=st.stride,st.stride=cn,wn=st.divisor,st.divisor=un,An=t.positionFractBuffer,ne.buffer=An,kn=!1,Tn=1,Mn=0,Sn=0,zn=0,En=0,Ln=null,Cn=0,Pn=!1,On=5126,In=0,Dn=0,Rn=0,zt(ne)?(kn=!0,On=(Ln=_t.createStream(34962,ne)).dtype):(Ln=_t.getBuffer(ne))?On=Ln.dtype:"constant"in ne?(Tn=2,"number"==typeof ne.constant?(Mn=ne.constant,Sn=zn=En=0):(Mn=ne.constant.length>0?ne.constant[0]:0,Sn=ne.constant.length>1?ne.constant[1]:0,zn=ne.constant.length>2?ne.constant[2]:0,En=ne.constant.length>3?ne.constant[3]:0)):(Ln=zt(ne.buffer)?_t.createStream(34962,ne.buffer):_t.getBuffer(ne.buffer),On="type"in ne?$t[ne.type]:Ln.dtype,Pn=!!ne.normalized,Cn=0|ne.size,In=0|ne.offset,Dn=0|ne.stride,Rn=0|ne.divisor),Fn=lt.state,lt.state=Tn,Bn=lt.x,lt.x=Mn,Nn=lt.y,lt.y=Sn,jn=lt.z,lt.z=zn,Vn=lt.w,lt.w=En,Un=lt.buffer,lt.buffer=Ln,Hn=lt.size,lt.size=Cn,qn=lt.normalized,lt.normalized=Pn,Gn=lt.type,lt.type=On,Wn=lt.offset,lt.offset=In,Yn=lt.stride,lt.stride=Dn,Zn=lt.divisor,lt.divisor=Rn,Xn=t.colorBuffer,ie.buffer=Xn,Jn=!1,Kn=1,Qn=0,$n=0,ti=0,ei=0,ri=null,ni=0,ii=!1,ai=5126,oi=0,si=0,li=0,zt(ie)?(Jn=!0,ai=(ri=_t.createStream(34962,ie)).dtype):(ri=_t.getBuffer(ie))?ai=ri.dtype:"constant"in ie?(Kn=2,"number"==typeof ie.constant?(Qn=ie.constant,$n=ti=ei=0):(Qn=ie.constant.length>0?ie.constant[0]:0,$n=ie.constant.length>1?ie.constant[1]:0,ti=ie.constant.length>2?ie.constant[2]:0,ei=ie.constant.length>3?ie.constant[3]:0)):(ri=zt(ie.buffer)?_t.createStream(34962,ie.buffer):_t.getBuffer(ie.buffer),ai="type"in ie?$t[ie.type]:ri.dtype,ii=!!ie.normalized,ni=0|ie.size,oi=0|ie.offset,si=0|ie.stride,li=0|ie.divisor),ci=ct.state,ct.state=Kn,ui=ct.x,ct.x=Qn,fi=ct.y,ct.y=$n,pi=ct.z,ct.z=ti,hi=ct.w,ct.w=ei,di=ct.buffer,ct.buffer=ri,mi=ct.size,ct.size=ni,gi=ct.normalized,ct.normalized=ii,yi=ct.type,ct.type=ai,vi=ct.offset,ct.offset=oi,bi=ct.stride,ct.stride=si,xi=ct.divisor,ct.divisor=li,_i=wt.vert,wt.vert=ut,wi=wt.frag,wt.frag=ft,vt.dirty=!0,r(gt,t,i),gt.viewportWidth=u,gt.viewportHeight=f,Kt[0]=h,Kt[1]=d,Kt[2]=m,Kt[3]=g,Et[0]=y,Et[1]=v,Et[2]=b,Et[3]=x,yt.blend_enable=_,Ct[0]=w,Ct[1]=A,Ot[0]=k,Ot[1]=pt,Ot[2]=ht,Ot[3]=dt,yt.depth_enable=xt,Xt[0]=Pt,Xt[1]=It,Xt[2]=Dt,Xt[3]=Rt,yt.scissor_enable=Ft,yt.stencil_enable=Bt,Nt&&(e.cpuTime+=performance.now()-jt),bt.offset=Vt,bt.count=Ut,bt.instances=qt,bt.primitive=Gt,Tt[H]=Yt,Tt[q]=Jt,Tt[G]=ae,Tt[W]=se,Tt[Y]=ce,Tt[Z]=fe,Tt[X]=he,Tt[J]=me,Tt[K]=ye,Tt[Q]=be,Tt[$]=_e,Tt[tt]=Ae,Tt[et]=Te,Tt[rt]=Se,nt.state=ze,nt.x=Ee,nt.y=Le,nt.z=Ce,nt.w=Pe,nt.buffer=Oe,nt.size=Ie,nt.normalized=De,nt.type=Re,nt.offset=Fe,nt.stride=Be,nt.divisor=Ne,it.state=je,it.x=Ve,it.y=Ue,it.z=He,it.w=qe,it.buffer=Ge,it.size=We,it.normalized=Ye,it.type=Ze,it.offset=Xe,it.stride=Je,it.divisor=Ke,$e&&_t.destroyStream(ar),at.state=pr,at.x=hr,at.y=dr,at.z=mr,at.w=gr,at.buffer=yr,at.size=vr,at.normalized=br,at.type=xr,at.offset=_r,at.stride=wr,at.divisor=Ar,Tr&&_t.destroyStream(Cr),ot.state=Br,ot.x=Nr,ot.y=jr,ot.z=Vr,ot.w=Ur,ot.buffer=Hr,ot.size=qr,ot.normalized=Gr,ot.type=Wr,ot.offset=Yr,ot.stride=Zr,ot.divisor=Xr,Kr&&_t.destroyStream(nn),st.state=fn,st.x=pn,st.y=hn,st.z=dn,st.w=mn,st.buffer=gn,st.size=yn,st.normalized=vn,st.type=bn,st.offset=xn,st.stride=_n,st.divisor=wn,kn&&_t.destroyStream(Ln),lt.state=Fn,lt.x=Bn,lt.y=Nn,lt.z=jn,lt.w=Vn,lt.buffer=Un,lt.size=Hn,lt.normalized=qn,lt.type=Gn,lt.offset=Wn,lt.stride=Yn,lt.divisor=Zn,Jn&&_t.destroyStream(ri),ct.state=ci,ct.x=ui,ct.y=fi,ct.z=pi,ct.w=hi,ct.buffer=di,ct.size=mi,ct.normalized=gi,ct.type=yi,ct.offset=vi,ct.stride=bi,ct.divisor=xi,wt.vert=_i,wt.frag=wi,vt.dirty=!0},batch:function(t,r){var i,a,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,wt;(St.angle_instanced_arrays,(i=Mt.next)!==Mt.cur&&(i?mt.bindFramebuffer(36160,i.framebuffer):mt.bindFramebuffer(36160,null),Mt.cur=i),vt.dirty)&&((L=yt.dither)!==vt.dither&&(L?mt.enable(3024):mt.disable(3024),vt.dither=L),(C=yt.depth_func)!==vt.depth_func&&(mt.depthFunc(C),vt.depth_func=C),P=Dt[0],O=Dt[1],P===Rt[0]&&O===Rt[1]||(mt.depthRange(P,O),Rt[0]=P,Rt[1]=O),(I=yt.depth_mask)!==vt.depth_mask&&(mt.depthMask(I),vt.depth_mask=I),D=Ft[0],R=Ft[1],F=Ft[2],B=Ft[3],D===Bt[0]&&R===Bt[1]&&F===Bt[2]&&B===Bt[3]||(mt.colorMask(D,R,F,B),Bt[0]=D,Bt[1]=R,Bt[2]=F,Bt[3]=B),(N=yt.cull_enable)!==vt.cull_enable&&(N?mt.enable(2884):mt.disable(2884),vt.cull_enable=N),(j=yt.cull_face)!==vt.cull_face&&(mt.cullFace(j),vt.cull_face=j),(V=yt.frontFace)!==vt.frontFace&&(mt.frontFace(V),vt.frontFace=V),(U=yt.lineWidth)!==vt.lineWidth&&(mt.lineWidth(U),vt.lineWidth=U),(H=yt.polygonOffset_enable)!==vt.polygonOffset_enable&&(H?mt.enable(32823):mt.disable(32823),vt.polygonOffset_enable=H),q=Nt[0],G=Nt[1],q===jt[0]&&G===jt[1]||(mt.polygonOffset(q,G),jt[0]=q,jt[1]=G),(W=yt.sample_alpha)!==vt.sample_alpha&&(W?mt.enable(32926):mt.disable(32926),vt.sample_alpha=W),(Y=yt.sample_enable)!==vt.sample_enable&&(Y?mt.enable(32928):mt.disable(32928),vt.sample_enable=Y),Z=Vt[0],X=Vt[1],Z===Ut[0]&&X===Ut[1]||(mt.sampleCoverage(Z,X),Ut[0]=Z,Ut[1]=X),(J=yt.stencil_mask)!==vt.stencil_mask&&(mt.stencilMask(J),vt.stencil_mask=J),K=Ht[0],Q=Ht[1],$=Ht[2],K===qt[0]&&Q===qt[1]&&$===qt[2]||(mt.stencilFunc(K,Q,$),qt[0]=K,qt[1]=Q,qt[2]=$),tt=Gt[0],et=Gt[1],rt=Gt[2],nt=Gt[3],tt===Wt[0]&&et===Wt[1]&&rt===Wt[2]&&nt===Wt[3]||(mt.stencilOpSeparate(tt,et,rt,nt),Wt[0]=tt,Wt[1]=et,Wt[2]=rt,Wt[3]=nt),it=Yt[0],at=Yt[1],ot=Yt[2],st=Yt[3],it===Zt[0]&&at===Zt[1]&&ot===Zt[2]&&st===Zt[3]||(mt.stencilOpSeparate(it,at,ot,st),Zt[0]=it,Zt[1]=at,Zt[2]=ot,Zt[3]=st));for(mt.blendColor(0,0,0,0),Lt[0]=0,Lt[1]=0,Lt[2]=0,Lt[3]=0,pt?mt.enable(3042):mt.disable(3042),vt.blend_enable=pt,mt.blendEquationSeparate(32774,32774),Pt[0]=32774,Pt[1]=32774,mt.blendFuncSeparate(770,771,773,1),It[0]=770,It[1]=771,It[2]=773,It[3]=1,ht?mt.enable(3089):mt.disable(3089),vt.scissor_enable=ht,dt?mt.enable(2960):mt.disable(2960),vt.stencil_enable=dt,(a=vt.profile)&&(M=performance.now(),e.count+=r),mt.useProgram(o.program),S=St.angle_instanced_arrays,kt.setVAO(null),lt=h.location,(ct=At[lt]).buffer||mt.enableVertexAttribArray(lt),5126===ct.type&&1===ct.size&&ct.buffer===p&&!1===ct.normalized&&0===ct.offset&&8===ct.stride||(mt.bindBuffer(34962,p.buffer),mt.vertexAttribPointer(lt,1,5126,!1,8,0),ct.type=5126,ct.size=1,ct.buffer=p,ct.normalized=!1,ct.offset=0,ct.stride=8),0!==ct.divisor&&(S.vertexAttribDivisorANGLE(lt,0),ct.divisor=0),ut=d.location,(ft=At[ut]).buffer||mt.enableVertexAttribArray(ut),5126===ft.type&&1===ft.size&&ft.buffer===p&&!1===ft.normalized&&4===ft.offset&&8===ft.stride||(mt.bindBuffer(34962,p.buffer),mt.vertexAttribPointer(ut,1,5126,!1,8,4),ft.type=5126,ft.size=1,ft.buffer=p,ft.normalized=!1,ft.offset=4,ft.stride=8),0!==ft.divisor&&(S.vertexAttribDivisorANGLE(ut,0),ft.divisor=0),((wt=bt.elements)||kt.currentVAO&&(wt=xt.getElements(kt.currentVAO.elements)))&&mt.bindBuffer(34963,wt.buffer.buffer),z=0;z0?te.constant[0]:0,ge=te.constant.length>1?te.constant[1]:0,ye=te.constant.length>2?te.constant[2]:0,ve=te.constant.length>3?te.constant[3]:0)):(be=zt(te.buffer)?_t.createStream(34962,te.buffer):_t.getBuffer(te.buffer),we="type"in te?$t[te.type]:be.dtype,_e=!!te.normalized,xe=0|te.size,Ae=0|te.offset,ke=0|te.stride,Te=0|te.divisor),Me=s.location,Se=At[Me],1===de?(Se.buffer||mt.enableVertexAttribArray(Me),ze=xe||2,Se.type===we&&Se.size===ze&&Se.buffer===be&&Se.normalized===_e&&Se.offset===Ae&&Se.stride===ke||(mt.bindBuffer(34962,be.buffer),mt.vertexAttribPointer(Me,ze,we,_e,ke,Ae),Se.type=we,Se.size=ze,Se.buffer=be,Se.normalized=_e,Se.offset=Ae,Se.stride=ke),Se.divisor!==Te&&(S.vertexAttribDivisorANGLE(Me,Te),Se.divisor=Te)):(Se.buffer&&(mt.disableVertexAttribArray(Me),Se.buffer=null),Se.x===me&&Se.y===ge&&Se.z===ye&&Se.w===ve||(mt.vertexAttrib4f(Me,me,ge,ye,ve),Se.x=me,Se.y=ge,Se.z=ye,Se.w=ve)),Ee=E.positionFractBuffer,re.buffer=Ee,Le=!1,Ce=1,Pe=0,Oe=0,Ie=0,De=0,Re=null,Fe=0,Be=!1,Ne=5126,je=0,Ve=0,Ue=0,zt(re)?(Le=!0,Ne=(Re=_t.createStream(34962,re)).dtype):(Re=_t.getBuffer(re))?Ne=Re.dtype:"constant"in re?(Ce=2,"number"==typeof re.constant?(Pe=re.constant,Oe=Ie=De=0):(Pe=re.constant.length>0?re.constant[0]:0,Oe=re.constant.length>1?re.constant[1]:0,Ie=re.constant.length>2?re.constant[2]:0,De=re.constant.length>3?re.constant[3]:0)):(Re=zt(re.buffer)?_t.createStream(34962,re.buffer):_t.getBuffer(re.buffer),Ne="type"in re?$t[re.type]:Re.dtype,Be=!!re.normalized,Fe=0|re.size,je=0|re.offset,Ve=0|re.stride,Ue=0|re.divisor),He=l.location,qe=At[He],1===Ce?(qe.buffer||mt.enableVertexAttribArray(He),Ge=Fe||2,qe.type===Ne&&qe.size===Ge&&qe.buffer===Re&&qe.normalized===Be&&qe.offset===je&&qe.stride===Ve||(mt.bindBuffer(34962,Re.buffer),mt.vertexAttribPointer(He,Ge,Ne,Be,Ve,je),qe.type=Ne,qe.size=Ge,qe.buffer=Re,qe.normalized=Be,qe.offset=je,qe.stride=Ve),qe.divisor!==Ue&&(S.vertexAttribDivisorANGLE(He,Ue),qe.divisor=Ue)):(qe.buffer&&(mt.disableVertexAttribArray(He),qe.buffer=null),qe.x===Pe&&qe.y===Oe&&qe.z===Ie&&qe.w===De||(mt.vertexAttrib4f(He,Pe,Oe,Ie,De),qe.x=Pe,qe.y=Oe,qe.z=Ie,qe.w=De)),We=E.positionBuffer,ee.buffer=We,Ye=!1,Ze=1,Xe=0,Je=0,Ke=0,Qe=0,$e=null,tr=0,er=!1,rr=5126,nr=0,ir=0,ar=0,zt(ee)?(Ye=!0,rr=($e=_t.createStream(34962,ee)).dtype):($e=_t.getBuffer(ee))?rr=$e.dtype:"constant"in ee?(Ze=2,"number"==typeof ee.constant?(Xe=ee.constant,Je=Ke=Qe=0):(Xe=ee.constant.length>0?ee.constant[0]:0,Je=ee.constant.length>1?ee.constant[1]:0,Ke=ee.constant.length>2?ee.constant[2]:0,Qe=ee.constant.length>3?ee.constant[3]:0)):($e=zt(ee.buffer)?_t.createStream(34962,ee.buffer):_t.getBuffer(ee.buffer),rr="type"in ee?$t[ee.type]:$e.dtype,er=!!ee.normalized,tr=0|ee.size,nr=0|ee.offset,ir=0|ee.stride,ar=0|ee.divisor),or=c.location,sr=At[or],1===Ze?(sr.buffer||mt.enableVertexAttribArray(or),lr=tr||2,sr.type===rr&&sr.size===lr&&sr.buffer===$e&&sr.normalized===er&&sr.offset===nr&&sr.stride===ir||(mt.bindBuffer(34962,$e.buffer),mt.vertexAttribPointer(or,lr,rr,er,ir,nr),sr.type=rr,sr.size=lr,sr.buffer=$e,sr.normalized=er,sr.offset=nr,sr.stride=ir),sr.divisor!==ar&&(S.vertexAttribDivisorANGLE(or,ar),sr.divisor=ar)):(sr.buffer&&(mt.disableVertexAttribArray(or),sr.buffer=null),sr.x===Xe&&sr.y===Je&&sr.z===Ke&&sr.w===Qe||(mt.vertexAttrib4f(or,Xe,Je,Ke,Qe),sr.x=Xe,sr.y=Je,sr.z=Ke,sr.w=Qe)),cr=E.positionFractBuffer,ne.buffer=cr,ur=!1,fr=1,pr=0,hr=0,dr=0,mr=0,gr=null,yr=0,vr=!1,br=5126,xr=0,_r=0,wr=0,zt(ne)?(ur=!0,br=(gr=_t.createStream(34962,ne)).dtype):(gr=_t.getBuffer(ne))?br=gr.dtype:"constant"in ne?(fr=2,"number"==typeof ne.constant?(pr=ne.constant,hr=dr=mr=0):(pr=ne.constant.length>0?ne.constant[0]:0,hr=ne.constant.length>1?ne.constant[1]:0,dr=ne.constant.length>2?ne.constant[2]:0,mr=ne.constant.length>3?ne.constant[3]:0)):(gr=zt(ne.buffer)?_t.createStream(34962,ne.buffer):_t.getBuffer(ne.buffer),br="type"in ne?$t[ne.type]:gr.dtype,vr=!!ne.normalized,yr=0|ne.size,xr=0|ne.offset,_r=0|ne.stride,wr=0|ne.divisor),Ar=u.location,kr=At[Ar],1===fr?(kr.buffer||mt.enableVertexAttribArray(Ar),Tr=yr||2,kr.type===br&&kr.size===Tr&&kr.buffer===gr&&kr.normalized===vr&&kr.offset===xr&&kr.stride===_r||(mt.bindBuffer(34962,gr.buffer),mt.vertexAttribPointer(Ar,Tr,br,vr,_r,xr),kr.type=br,kr.size=Tr,kr.buffer=gr,kr.normalized=vr,kr.offset=xr,kr.stride=_r),kr.divisor!==wr&&(S.vertexAttribDivisorANGLE(Ar,wr),kr.divisor=wr)):(kr.buffer&&(mt.disableVertexAttribArray(Ar),kr.buffer=null),kr.x===pr&&kr.y===hr&&kr.z===dr&&kr.w===mr||(mt.vertexAttrib4f(Ar,pr,hr,dr,mr),kr.x=pr,kr.y=hr,kr.z=dr,kr.w=mr)),Mr=E.colorBuffer,ie.buffer=Mr,Sr=!1,zr=1,Er=0,Lr=0,Cr=0,Pr=0,Or=null,Ir=0,Dr=!1,Rr=5126,Fr=0,Br=0,Nr=0,zt(ie)?(Sr=!0,Rr=(Or=_t.createStream(34962,ie)).dtype):(Or=_t.getBuffer(ie))?Rr=Or.dtype:"constant"in ie?(zr=2,"number"==typeof ie.constant?(Er=ie.constant,Lr=Cr=Pr=0):(Er=ie.constant.length>0?ie.constant[0]:0,Lr=ie.constant.length>1?ie.constant[1]:0,Cr=ie.constant.length>2?ie.constant[2]:0,Pr=ie.constant.length>3?ie.constant[3]:0)):(Or=zt(ie.buffer)?_t.createStream(34962,ie.buffer):_t.getBuffer(ie.buffer),Rr="type"in ie?$t[ie.type]:Or.dtype,Dr=!!ie.normalized,Ir=0|ie.size,Fr=0|ie.offset,Br=0|ie.stride,Nr=0|ie.divisor),jr=f.location,Vr=At[jr],1===zr?(Vr.buffer||mt.enableVertexAttribArray(jr),Ur=Ir||4,Vr.type===Rr&&Vr.size===Ur&&Vr.buffer===Or&&Vr.normalized===Dr&&Vr.offset===Fr&&Vr.stride===Br||(mt.bindBuffer(34962,Or.buffer),mt.vertexAttribPointer(jr,Ur,Rr,Dr,Br,Fr),Vr.type=Rr,Vr.size=Ur,Vr.buffer=Or,Vr.normalized=Dr,Vr.offset=Fr,Vr.stride=Br),Vr.divisor!==Nr&&(S.vertexAttribDivisorANGLE(jr,Nr),Vr.divisor=Nr)):(Vr.buffer&&(mt.disableVertexAttribArray(jr),Vr.buffer=null),Vr.x===Er&&Vr.y===Lr&&Vr.z===Cr&&Vr.w===Pr||(mt.vertexAttrib4f(jr,Er,Lr,Cr,Pr),Vr.x=Er,Vr.y=Lr,Vr.z=Cr,Vr.w=Pr)),Hr=E.dashLength,z&&qr===Hr||(qr=Hr,mt.uniform1f(m.location,Hr)),(Gr=E.dashTexture)&&"framebuffer"===Gr._reglType&&(Gr=Gr.color[0]),Wr=Gr._texture,mt.uniform1i(g.location,Wr.bind()),Yr=E.depth,z&&Zr===Yr||(Zr=Yr,mt.uniform1f(y.location,Yr)),Xr=E.opacity,z&&Jr===Xr||(Jr=Xr,mt.uniform1f(v.location,Xr)),Qr=(Kr=E.scale)[0],tn=Kr[1],z&&$r===Qr&&en===tn||($r=Qr,en=tn,mt.uniform2f(b.location,Qr,tn)),nn=(rn=E.scaleFract)[0],on=rn[1],z&&an===nn&&sn===on||(an=nn,sn=on,mt.uniform2f(x.location,nn,on)),ln=E.thickness,z&&cn===ln||(cn=ln,mt.uniform1f(_.location,ln)),fn=(un=E.translate)[0],hn=un[1],z&&pn===fn&&dn===hn||(pn=fn,dn=hn,mt.uniform2f(w.location,fn,hn)),gn=(mn=E.translateFract)[0],vn=mn[1],z&&yn===gn&&bn===vn||(yn=gn,bn=vn,mt.uniform2f(A.location,gn,vn)),_n=(xn=T.call(this,gt,E,z))[0],An=xn[1],Tn=xn[2],Sn=xn[3],z&&wn===_n&&kn===An&&Mn===Tn&&zn===Sn||(wn=_n,kn=An,Mn=Tn,zn=Sn,mt.uniform4f(k.location,_n,An,Tn,Sn)),(En=E.count)>0?wt?S.drawElementsInstancedANGLE(5,4,wt.type,0<<(wt.type-5121>>1),En):S.drawArraysInstancedANGLE(5,0,4,En):En<0&&(wt?mt.drawElements(5,4,wt.type,0<<(wt.type-5121>>1)):mt.drawArrays(5,0,4)),gt.viewportWidth=Kt,gt.viewportHeight=ae,he&&_t.destroyStream(be),Le&&_t.destroyStream(Re),Ye&&_t.destroyStream($e),ur&&_t.destroyStream(gr),Sr&&_t.destroyStream(Or),Wr.unbind()}vt.dirty=!0,kt.setVAO(null),a&&(e.cpuTime+=performance.now()-M)}}}},{}],505:[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}},{}],506:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,p,h,d,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(u=0,f=o,p=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":532}],507:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(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(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),y=t.charAt(0);!c||"G"!==y&&"g"!==y||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),A=t.match(w?b:v);if(!A)return u;var k=A[1],T=A[3]||"1",M=Number(A[5]||1),S=Number(A[7]||0),z=Number(A[9]||0),E=Number(A[11]||0);if(c){if(2===k.length)return u;var L;k=Number(k);try{var C=g.getComponentMethod("calendars","getCal")(e);if(w){var P="i"===T.charAt(T.length-1);T=parseInt(T,10),L=C.newDate(k,C.toMonthIndex(k,T,P),M)}else L=C.newDate(k,Number(T),M)}catch(t){return u}return L?(L.toJD()-m)*f+S*p+z*h+E*d:u}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),T-=1;var O=new Date(Date.UTC(2e3,T,M,S,z));return O.setUTCFullYear(k),O.getUTCMonth()!==T||O.getUTCDate()!==M?u:O.getTime()+E*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var A=90*f,k=3*p,T=5*h;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,v,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var S=Math.floor(w/f)+m,z=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=y("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a("%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 s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,z=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function L(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(z,(function(){return E[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/p),2)+":"+w(l(Math.floor(r/h),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),C[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+L(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return L(e,t,n,i)};var P=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+m,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+P);return c.setUTCMonth(c.getUTCMonth()+e)+n-P},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=p.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(p.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var p=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,p=o-i,h=c-a,d=u*u+f*f,m=p*p+h*h,g=Math.min(l(u,f,d,i-t,a-e),l(u,f,d,o-t,c-e),l(p,h,m,t-i,e-a),l(p,h,m,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),p={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=p,p},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function p(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var h=p(c);h;){if((c+=h+r)>f)return;h=p(c)}for(h=p(f);h;){if(c>(f-=h+r))return;h=p(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,p=0,h=s;f0?h=i:p=i,f++}return a}},{"./mod":532}],521:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function p(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,h,d,m=t.color,g=l(m),y=l(e),v=o.extractOpts(t),b=[];if(n=void 0!==v.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=g?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=y?function(t,e){return void 0===t[e]?1:p(t[e])}:p,g||y)for(var x=0;x1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],525:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var p={};f.warnBadFormat=function(t){var e=String(t);p[e]||(p[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var h=t("./array");f.isTypedArray=h.isTypedArray,f.isArrayOrTypedArray=h.isArrayOrTypedArray,f.isArray1D=h.isArray1D,f.ensureArray=h.ensureArray,f.concat=h.concat,f.maxRowLength=h.maxRowLength,f.minRowLength=h.minRowLength;var d=t("./mod");f.mod=d.mod,f.modHalf=d.modHalf;var m=t("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var g=t("./dates");f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var y=t("./search");f.findBin=y.findBin,f.sorterAsc=y.sorterAsc,f.sorterDes=y.sorterDes,f.distinctVals=y.distinctVals,f.roundUp=y.roundUp,f.sort=y.sort,f.findIndexOfMin=y.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var v=t("./stats");f.aggNums=v.aggNums,f.len=v.len,f.mean=v.mean,f.median=v.median,f.midRange=v.midRange,f.variance=v.variance,f.stdev=v.stdev,f.interp=v.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var A=t("./extend");f.extendFlat=A.extendFlat,f.extendDeep=A.extendDeep,f.extendDeepAll=A.extendDeepAll,f.extendDeepNoArrays=A.extendDeepNoArrays;var k=t("./loggers");f.log=k.log,f.warn=k.warn,f.error=k.error;var T=t("./regex");f.counterRegex=T.counter;var M=t("./throttle");f.throttle=M.throttle,f.throttleDone=M.done,f.clearThrottle=M.clear;var S=t("./dom");function z(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.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},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return I.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var D={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return B.apply(D,arguments)};var R={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,p,h="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||h||m||d,y=s;if((h||d)&&(y=y.substring(1)),(m||d)&&(y=y.substring(0,y.length-1)),g){if(void 0===(c=e[y]))return""}else for(p=3;p=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var N=2e9;f.seedPseudoRandom=function(){N=2e9},f.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?f.pseudoRandom():N/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.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;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.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)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),V=null!==j&&j<86;f.getPositionFromD3Event=function(){return V?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":487,"./anchor_utils":505,"./angles":506,"./array":507,"./clean_number":508,"./clear_responsive":510,"./coerce":511,"./dates":512,"./dom":513,"./extend":515,"./filter_unique":516,"./filter_visible":517,"./geometry2d":520,"./identity":523,"./increment":524,"./is_plain_object":526,"./keyed_container":527,"./localize":528,"./loggers":529,"./make_trace_groups":530,"./matrix":531,"./mod":532,"./nested_property":533,"./noop":534,"./notifier":535,"./preserve_drawing_buffer":539,"./push_unique":540,"./regex":542,"./relative_attr":543,"./relink_private":544,"./search":545,"./sort_object_keys":548,"./stats":549,"./throttle":552,"./to_log_range":553,"@plotly/d3":54,"d3-format":108,"d3-time-format":116,"fast-isnumeric":186}],526:[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).hasOwnProperty("hasOwnProperty")}},{}],527:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],p.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":563,"./notifier":535}],530:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":54}],531:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],533:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,p,h,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;uMath.max(f,g)||c>Math.max(p,y)))if(cu||Math.abs(n(o,p))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":487,"./matrix":531}],538:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e,a){var o=t._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[],cachedCode:a||{}})}catch(t){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":547,regl:280}],539:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":186,"is-mobile":230}],540:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}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 a,o,f=0,p=e.length,h=0,d=p>1?(e[p-1]-e[0])/(p-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":507,"fast-isnumeric":186}],550:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":85}],551:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var M=t.text(),S=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&M.match(l),L=n.select(t.node().parentNode);if(!L.empty()){var C=t.attr("class")?t.attr("class").split(" ")[0]:"text";return C+="-math",L.selectAll("svg."+C).remove(),L.selectAll("g."+C+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),S?(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 a,o,s,l,p=parseInt((MathJax.version||"").split(".")[0]);if(2!==p&&3!==p)return void i.warn("No MathJax version:",MathJax.version);var h=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===p?MathJax.Hub.Typeset(a):MathJax.typeset([a])},d=function(){var e=l.select(2===p?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===p?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===p?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),h,d,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===p&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){h(),d(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}(S[2],o,(function(n,i,o){L.selectAll("svg."+C).remove(),L.selectAll("g."+C+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return P(),void e();var l=L.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",p=s.select("g");p.attr({fill:f,stroke:f});var h=p.node().getBoundingClientRect(),d=h.width,g=h.height;(d>c||g>u)&&(s.style("overflow","hidden"),d=(h=s.node().getBoundingClientRect()).width,g=h.height);var y=+t.attr("x"),v=+t.attr("y"),b=-(r||t.node().getBoundingClientRect().height)/4;if("y"===C[0])l.attr({transform:"rotate("+[-90,y,v]+")"+a(-d/2,b-g/2)});else if("l"===C[0])v=b-g/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))y=0,v=b;else{var x=t.attr("text-anchor");y-=d*("middle"===x?.5:"end"===x?1:0),v=v+b-g/2}s.attr({x:y,y:v}),m&&m.call(t,l),e(l)}))}))):P(),t}function P(){L.empty()||(C=t.attr("class")+"-math",L.select("svg."+C).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(y),L=0;L|>|>)/g;var f=[["$","$"],["\\(","\\)"]];var p={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"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\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&&z(n)}var T=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(y),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,d-i)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function z(t){return t.replace(S,(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)):M[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==m.indexOf(i)&&-1!==m.indexOf(a)?e:""}function L(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=z,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(y),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.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)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],553:[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":186}],554:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":606,"topojson-client":312}],555:[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"}}},{}],556:[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"}}},{}],557:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&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 a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,p=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),d(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;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var v=r[""][""];if(c(v))e.set(null);else{if(!Array.isArray(v))return a.warn("Unrecognized full array edit value",f,v),!0;e.set(v)}return!m&&(p(g,y),h(t),!0)}var b,x,_,w,A,k,T,M,S=Object.keys(r).map(Number).sort(o),z=e.get(),E=z||[],L=u(y,f).get(),C=[],P=-1,O=E.length;for(b=0;bE.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==k)A.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?C.push(_):T?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,k),-1===P&&(P=_);else for(x=0;x=0;b--)E.splice(C[b],1),L&&L.splice(C[b],1);if(E.length?z||e.set(E):e.set(null),m)return!1;if(p(g,y),d!==i){var I;if(-1===P)I=S;else{for(O=Math.max(E.length,O),I=[],b=0;b=P);b++)I.push(_);for(b=P;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),C(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in C(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,p=o.isPlainObject(n),h=[];for(var d in Array.isArray(r)||(r=[r]),r=L(r,t.data.length-1),e)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function V(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(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 i=Y(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[p.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(U(t,a,i)||p.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&H(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(M)),s.push(p.rehover,p.redrag,p.reselect),c.add(t,V,[t,i.undoit],V,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function U(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=h.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[h.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function H(t,e){var r=e?function(t){var r=[];for(var n in e){var i=h.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return h.draw(t,r,{skipTitle:!0})}:function(t){return h.draw(t,"redraw")};t.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,W=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,p=F(l._preGUI,c),d=Object.keys(e),m=h.list(t),g=o.extendDeepAll({},e),y={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof O.parts[D];)D--;var B=O.parts[D],N=O.parts[D-1]+"."+B,V=O.parts.slice(0,D).join("."),U=s(t.layout,V).get(),H=s(l,V).get(),Y=O.get();if(void 0!==I){M[P]=I,S[P]="reverse"===B?I:R(Y);var X=f.getLayoutValObject(l,O.parts);if(X&&X.impliedEdits&&null!==I)for(var J in X.impliedEdits)z(o.relativeAttr(P,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(P))if(I){z("autosize",null);var K="height"===P?"width":"height";z(K,l[K])}else l[P]=t._initialAutoSize[P];else if("autosize"===P)z("width",I?null:l.width),z("height",I?null:l.height);else if(N.match(q))C(N),s(l,V+"._inputRange").set(null);else if(N.match(G)){C(N),s(l,V+"._inputRange").set(null);var Q=s(l,V).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(W)&&s(l,V+"._inputDomain").set(null);if("type"===B){E=U;var $="linear"===H.type&&"log"===I,tt="log"===H.type&&"linear"===I;if($||tt){if(E&&E.range)if(H.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&z(V+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),z(V+".range[0]",Math.log(et)/Math.LN10),z(V+".range[1]",Math.log(rt)/Math.LN10)):(z(V+".range[0]",Math.pow(10,et)),z(V+".range[1]",Math.pow(10,rt)))}else z(V+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[O.parts[0]]&&"radialaxis"===O.parts[1]&&delete l[O.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,H,I,z),u.getComponentMethod("images","convertCoords")(t,H,I,z)}else z(V+".autorange",!0),z(V+".range",null);s(l,V+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,P).get(),it=(I||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,z),u.getComponentMethod("images","convertCoords")(t,nt,it,z)}var at=x.containerArrayMatch(P);if(at){r=at.array,n=at.index;var ot=at.property,st=X||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(I)?S[P]=null:x.isRemoveVal(I)?S[P]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(T,st),y[r]||(y[r]={});var lt=y[r][n];lt||(lt=y[r][n]={}),lt[ot]=I,delete e[P]}else"reverse"===B?(U.range?U.range.reverse():(z(V+".autorange",!0),U.range=[1,0]),H.autorange?T.calc=!0:T.plot=!0):("dragmode"===P&&(!1===I&&!1!==Y||!1!==I&&!1===Y)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===P&&("lasso"===I||"select"===I)&&"lasso"!==Y&&"select"!==Y||l._has("gl2d")?T.plot=!0:X?A.update(T,X):T.calc=!0,O.set(I))}}for(r in y){x.applyContainerArrayChanges(t,p(a,r),y[r],T,p)||(T.plot=!0)}for(var ct in L){var ut=(E=h.getFromId(t,ct))&&E._constraintGroup;if(ut)for(var ft in T.calc=!0,ut)L[ft]||(h.getFromId(t,ft)._constraintShrinkable=!0)}return(Z(t)||e.height||e.width)&&(T.plot=!0),(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:L,undoit:S,redoit:M,eventData:g}}function Z(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&p.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function X(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=N(t,o.extendFlat({},e),a),l=s.flags,u=Y(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var h=[];f.layoutReplot?h.push(w.layoutReplot):l.fullReplot?h.push(r._doPlot):(h.push(p.previousPromises),U(t,f,u)||p.supplyDefaults(t),l.style&&h.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&h.push(w.doColorBars),f.legend&&h.push(w.doLegend),f.layoutstyle&&h.push(w.layoutStyles),f.axrange&&H(h,u.rangesAltered),f.ticks&&h.push(w.doTicksRelayout),f.modebar&&h.push(w.doModeBar),f.camera&&h.push(w.doCamera),h.push(M)),h.push(p.rehover,p.redrag,p.reselect),c.add(t,X,[t,s.undoit,u.undoit,s.traces],X,[t,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(h,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}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(a,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,p.transition(t,e.frame.data,e.frame.layout,_.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 h(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var d,m,g=0;function y(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var v=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))v.push({type:"object",data:y(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&T.push(m);v=T}}v.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(u[m]||d[m]||{}).name,y=e[n].name,v=u[g]||d[g];g&&y&&"number"==typeof y&&v&&T<5&&(T++,o.warn('addFrames: overwriting frame "'+(u[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===T&&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.")),d[m]={name:m},h.push({frame:p.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}h.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=h[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=p.modifyFrames,u=p.modifyFrames,f=[t,s],h=[t,a];return c&&c.add(t,l,f,u,h),p.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,p=[e,l],h=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!v(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function v(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return y(i,e,s)},r.getLayoutValObject=function(t,e){return y(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":525,"../plots/attributes":572}],566:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),p=t("../plots/cartesian/axes"),h=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,g=d.clean,y=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function b(t){var e,i,s,u,d,m,g=t._fullLayout,y=g._size,b=y.p,_=p.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return a.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:y.l+y.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=A(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?A(u,k,h.OPPOSITE_SIDE[u.side]):null}var T=[],M=[],S=[],z=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,L=s.yaxis.domain,C=s.plotgroup;if(v(E,L,S)){var P=C.node(),O=s.bg=o.ensureSingle(C,"rect","bg");P.insertBefore(O.node(),P.childNodes[0]),M.push(i)}else C.select("rect.bg").remove(),S.push([E,L]),z||(T.push(i),M.push(i))}var I,D,R,F,B,N,j,V,U,H,q,G,W,Y=g._bgLayer.selectAll(".bg").data(T);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(t){g._plots[t].bg=n.select(this)})),e=0;eA?u.push({code:"unused",traceType:v,templateCount:w,dataCount:A}):A>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:A})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:h,layout:p},""),u.length)return u.map(y)}},{"../lib":525,"../plots/attributes":572,"../plots/plots":638,"./plot_config":563,"./plot_schema":564,"./plot_template":565}],568:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=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,p,h,d;function m(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],p=t.layout||{},h=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),p=o.extendDeep({},t.layout),h=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function y(t,r){return o.coerce(e,g,f,t,r)}var v=y("format"),b=y("width"),x=y("height"),_=y("scale"),w=y("setBackground"),A=y("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var T=o.extendFlat({},p);b?T.width=b:null===e.width&&n(d.width)&&(T.width=d.width),x?T.height=x:null===e.height&&n(d.height)&&(T.height=d.height);var M=o.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function z(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(k,v,_),n=k._fullLayout.width,f=k._fullLayout.height;function p(){i.purge(k),document.body.removeChild(k)}if("full-json"===v){var h=a.graphJson(k,!1,"keepdata","object",!0,!0);return h.version=u,h=JSON.stringify(h),p(),t(A?h:s.encodeJSON(h))}if(p(),"svg"===v)return t(A?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:v,width:n,height:f,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(k,r,T,M).then(S).then(z).then(E).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":525,"../plots/plots":638,"../snapshot/helpers":661,"../snapshot/svgtoimg":663,"../snapshot/tosvg":665,"../version":1150,"./plot_api":562,"fast-isnumeric":186}],569:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),p=0;pb.length&&i.push(d("unused",a,y.concat(b.length)));var T,M,S,z,E,L=b.length,C=Array.isArray(k);if(C&&(L=Math.min(L,k.length)),2===x.dimensions)for(M=0;Mb[M].length&&i.push(d("unused",a,y.concat(M,b[M].length)));var P=b[M].length;for(T=0;T<(C?Math.min(P,k[M].length):P);T++)S=C?k[M][T]:k,z=v[M][T],E=b[M][T],n.validate(z,S)?E!==z&&E!==+z&&i.push(d("dynamic",a,y.concat(M,T),z,E)):i.push(d("value",a,y.concat(M,T),z))}else i.push(d("array",a,y.concat(M),v[M]));else for(M=0;M1&&h.push(d("object","layout"))),i.supplyDefaults(m);for(var g=m._fullData,y=r.length,v=0;v0&&Math.round(f)===f))return{vals:i};c=f}for(var p=e.calendar,h="start"===l,d="end"===l,m=t[r+"period0"],g=a(m,p)||0,y=[],v=[],b=[],x=i.length,_=0;_T;)k=o(k,-c,p);for(;k<=T;)k=o(k,c,p);A=o(k,-c,p)}else{for(k=g+(w=Math.round((T-g)/u))*u;k>T;)k-=u;for(;k<=T;)k+=u;A=k-u}y[_]=h?A:d?k:(A+k)/2,v[_]=A,b[_]=k}return{vals:y,starts:v,ends:b}}},{"../../constants/numerical":487,"../../lib":525,"fast-isnumeric":186}],574:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],575:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function p(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=m(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var p=u[0].val,g=f[0].val;for(r=1;r0&&((A=z-s(b)-l(x))>E?k/A>L&&(_=b,w=x,L=k/A):k/z>L&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},L=k/z));if(p===g){var C=p-1,P=p+1;if(M)if(0===p)i=[0,1];else{var O=(p>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),I=p/(1-Math.min(.5,O/z));i=p>0?[0,I]:[I,0]}else i=S?[Math.max(0,C),Math.max(1,P)]:[C,P]}else M?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-L*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),L=(w.val-_.val-h(e,b.val,x.val))/(z-s(_)-l(w)),i=[_.val-L*s(_),w.val+L*l(w)];return y&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function h(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),z=T(r.vpadplus||r.vpad),E=T(r.vpadminus||r.vpad);if(!A){if(p=1/0,h=-1/0,w)for(n=0;n0&&(p=a),a>h&&a-o&&(p=a),a>h&&a=P;n--)C(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function p(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function b(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":385,"../../constants/numerical":487,"../../lib":525,"../../registry":657,"./axis_ids":580,"@plotly/d3":54,"fast-isnumeric":186}],576:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),p=t("../../components/drawing"),h=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),g=m.ONEMAXYEAR,y=m.ONEAVGYEAR,v=m.ONEMINYEAR,b=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,A=m.ONEAVGMONTH,k=m.ONEMINMONTH,T=m.ONEWEEK,M=m.ONEDAY,S=M/2,z=m.ONEHOUR,E=m.ONEMIN,L=m.ONESEC,C=m.MINUS_SIGN,P=m.BADNUM,O={K:"zeroline"},I={K:"gridline",L:"path"},D={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},B={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},N=t("../../constants/alignment"),j=N.MID_SHIFT,V=N.CAP_SHIFT,U=N.LINE_SPACING,H=N.OPPOSITE_SIDE,q=e.exports={};q.setConvert=t("./set_convert");var G=t("./axis_autotype"),W=t("./axis_ids"),Y=W.idSort,Z=W.isLinked;q.id2name=W.id2name,q.name2id=W.name2id,q.cleanId=W.cleanId,q.list=W.list,q.listIds=W.listIds,q.getFromId=W.getFromId,q.getFromTrace=W.getFromTrace;var X=t("./autorange");q.getAutoRange=X.getAutoRange,q.findExtremes=X.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}q.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},q.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},q.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==q.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=q.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},q.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:q.getFromId(e,r).cleanPos)(t)},q.redrawComponents=function(t,e){e=e||q.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;ur&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},q.saveRangeInitial=function(t,e){for(var r=q.list(t,"",!0),n=!1,i=0;i.3*p||u(n)||u(a))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=q.tickIncrement(t,"M6","reverse")+1.5*M:a.exactMonths>.8?t=q.tickIncrement(t,"M1","reverse")+15.5*M:t-=S;var l=q.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,y,c,a)),g=v,0;g<=u;)g=q.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:u-c}},q.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=q.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,q.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),f=c?e.dtick:+e.dtick.substring(1),p=u?t.dtick:+t.dtick.substring(1);c&&u?tt(f,p)?f===2*T&&p===2*M&&(t.dtick=T):f===2*T&&p===3*M?t.dtick=T:f!==T||(e._input.minor||{}).nticks?et(f/p,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=M:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":tt(f,p)?f>=12&&2===p&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,p)||(t.dtick=et(f/p,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},q.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,q.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!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=q.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=z,o&&!n&&t.dtick=(O?0:1);I--){var D=!I;I?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var R=I?t:s.extendFlat({},t,t.minor);if(D?q.prepMinorTicks(R,t,e):q.prepTicks(R,e),"array"!==R.tickmode){var F=J(u),B=F[0],N=F[1],j=i(R.dtick),V="log"===a&&!(j||"L"===R.dtick.charAt(0)),U=q.tickFirst(R,e);if(I){if(t._tmin=U,U=N:Y<=N;Y=q.tickIncrement(Y,Z,f,o)){if(I&&H++,R.rangebreaks&&!f){if(Y=h)break}if(L.length>d||Y===W)break;W=Y;var X={value:Y};I?(V&&Y!==(0|Y)&&(X.simpleLabel=!0),l>1&&H%l&&(X.skipLabel=!0),L.push(X)):(X.minor=!0,C.push(X))}}else I?(L=[],m=nt(t)):(C=[],E=nt(t))}if(O&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=L.map((function(t){return t.value})),Q=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,p=0;f>=v?p=u>=v&&u<=g?u:y:r===x&&f>=_?p=u>=_&&u<=b?u:x:f>=k?p=u>=k&&u<=w?u:A:r===T&&f>=T?p=T:f>=M?p=M:r===S&&f>=S?p=S:r===z&&f>=z&&(p=z),p>=u&&(p=u,s=!0);var h=i+p;if(e.rangebreaks&&p>0){for(var d=0,m=0;m<84;m++){var E=(m+.5)/84;e.maskBreaks(i*(1-E)+E*h)!==P&&d++}(p*=d/84)||(t[n].drop=!0),s&&u>T&&(p=u)}(p>0||0===n)&&(t[n].periodX=i+p/2)}}(L,t,t._definedDelta),t.rangebreaks){var at="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=L.length-1;r>-1;r--)if(L[r].drop)L.splice(r,1);else{L[r].value=Pt(L[r].value,t);var lt=t.c2p(L[r].value);(at?st>lt-ot:sth||uth&&(ct.periodX=h),ut10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&a<=10||e>=15*M)t._tickround="d";else if(e>=E&&a<=16||e>=z)t._tickround="M";else if(e>=L&&a<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(mt(t.exponentformat)&&!gt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function ht(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}}q.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>y)e/=y,n=a(10),t.dtick="M"+12*ft(e,n,it);else if(o>A)e/=A,t.dtick="M"+ft(e,1,at);else if(o>M){if(t.dtick=ft(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=q.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>z?t.dtick=ft(e,z,at):o>E?t.dtick=ft(e,E,ot):o>L?t.dtick=ft(e,L,ot):(n=a(10),t.dtick=ft(e,n,it))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=a(10),t.dtick="L"+ft(e,n,it)}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))):Ct(t)?(t.tick0=0,n=1,t.dtick=ft(e,n,ut)):(t.tick0=0,n=a(10),t.dtick=ft(e,n,it));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var p=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(p)}},q.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ct:lt,f=t+.01*o,p=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(e)},q.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=yt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),p=Math.abs(f),h=t.exponentformat;"power"===h||mt(h)&>(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":C)+p+"",e.fontSize*=1.25):("e"===h||"E"===h)&&p>2?e.text="1"+h+(f>0?"+":C)+p:(e.text=yt(Math.pow(10,l),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,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,c,m):"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),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Ct(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=yt(e.x,t,i,n);else{var a=e.x/180;if(0===a)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,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=yt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=C+e.text)}}}}(t,o,r,c,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=yt(e.x,t,i,n)}(t,o,0,c,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},q.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return q.hoverLabelText(t,n,r)+" - "+q.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=q.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":C+o:o};var dt=["f","p","n","\u03bc","m","","k","M","G","T"];function mt(t){return"SI"===t||"B"===t}function gt(t){return t>14||t<-15}function yt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=q.getTickFormat(e),f=e.separatethousands;if(n){var p={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};pt(p),o=(Number(p._tickround)||0)+4,c=p._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,C);var h,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+h+"":"B"===l&&9===c?t+="B":mt(l)&&(t+=dt[c/3+5]));return a?C+t:t}function vt(t,e){if(t){var r=Object.keys(B).reduce((function(t,r){return-1!==e.indexOf(r)&&B[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function bt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,p)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var h=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,p),h.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var y=e._offset-r.left;y>0&&(n.xl=0,n.l=y)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,p):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,p),h.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[h[0]],e.title.text!==c._dfltTitle[d]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=p),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[h[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][h[1]]))}it&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(vt(n,e.automargin),vt(i,e.automargin)),a.autoMargin(t,Tt(e),n),a.autoMargin(t,Mt(e),i),a.autoMargin(t,St(e),s)})),r.skipTitle||it&&"bottom"===e.side||rt.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+wt(e);else{var s=Ot(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"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,h,d,m=q.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,h="top"===e.side?m-r:m+r):(h=e._offset+e._length/2,f="right"===e.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(d={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var y=p.getTranslate(g.node().parentNode);d.offsetLeft=y.x,d.offsetTop=y.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:d,transform:c,attributes:{x:f,y:h,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function at(t){var r=h+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=kt(this),e=p.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},q.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},q.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},q.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,p=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=p*V,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=p*(1-V));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(xt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(xt(e)))}},q.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},q.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),p="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,h=0,d=0,m=p?t.ticklen:0;if(f?m*=-1:u&&(m=0),p&&(h+=m,r)){var g=s.deg2rad(r);h=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(p||t.showline)&&(h+=.2*t.tickfont.size);var y,v,b,x,_,w={labelStandoff:h+=(t.linewidth||1)/2*(f?-1:1),labelShift:d},A=0,k=t.side,T=t._id.charAt(0),M=t.tickangle;if("x"===T)x=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(x*=-1),y=d*x,v=e+h*x,b=_?1:-.2,90===Math.abs(M)&&(f?b+=j:b=-90===M&&"bottom"===k?V:90===M&&"top"===k?j:.5,A=j/2*(M/90)),w.xFn=function(t){return t.dx+y+A*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*b},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*x<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"===T){if(x=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(x*=-1),y=h,v=d*x,b=0,f||90!==Math.abs(M)||(b=-90===M&&"left"===k||90===M&&"right"===k?V:.5),f){var S=i(M)?+M:0;if(0!==S){var z=s.deg2rad(S);A=Math.abs(Math.sin(z))*V*x,b=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*b)*x+A*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*j},w.anchorFn=function(t,e){return i(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},q.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,_t);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return p.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),It(e,[R]),o.attr("transform",r.transFn)},q.drawGrid=function(t,e,r){r=r||{};var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&q.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;y--){var v=y?m:g;if(v){var b=v.selectAll("path."+i).data(y?s:o,_t);b.exit().remove(),b.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),b.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return p.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&b.attr("d",r.path)}}It(e,[I,D])},q.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=q.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.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 Y(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",p.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),It(e,[O])},q.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",h=r.vals.filter((function(t){return t.text})),d=r.labelFns,m=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[f],y=r.layer.selectAll("g."+f).data(e.showticklabels?h:[],_t),v=[];function b(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),u=d.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),h=c.lineCount(o),m=U*t.fontSize,g=d.heightFn(t,i(a)?+a:0,(h-1)*m);if(g&&(f+=l(0,g)),s.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":u}),y.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=p.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(v,0))}}))}y.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,d.xFn(e),d.yFn(e)).call(p.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[i]?v.push(t._promises.pop().then((function(){b(r,m)}))):b(r,m)})),It(e,[F]),y.exit().remove(),r.repositionOnUpdate&&y.each((function(t){n.select(this).select("text").call(c.positionText,d.xFn(t),d.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),h=Math.max(l,c),d=e.side,m=1/0,g=-1/0;for(var v in y.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=p.bBox(r.node()),s=0;o?(a.right>h||a.lefth||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},b(y,g+1?g:m);var x=null;e._selections&&(e._selections[f]=y);var _=[function(){return v.length&&Promise.all(v)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(x=90,_.push((function(){b(y,g)}))):_.push((function(){if(b(y,m),h.length&&"x"===u&&!i(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,a=[];if(y.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=kt(this),o=p.bBox(i.node());a.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=h.length,l=Math.abs((h[o-1].x-h[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},d=f("top"),g=f("left"),v=f("right"),_=f("bottom")||g||d||v?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=x(o[s])){u=g;break}var f=i("pattern",u);if(f===g)for(s=0;s<2;s++)(c=x(o[s]))&&(e.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case g: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 y: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 p=r.range;if(p[0]p[1])return void(e.enabled=!1)}else if(o[0]>p[0]&&o[1]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 a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":657,"./constants":583}],581:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*b)||A)for(r=0;rO&&FC&&(C=F);p/=(C-L)/(2*P),L=l.l2r(L),C=l.l2r(C),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function V(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(t,e,i,a)}function U(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 H(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(t){P&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),P=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,C)/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 W(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},p={},h=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(H(i),2!==t||yt||qt(),gt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Ct),o.indexOf("event")>-1&&h.click(i,r,e.id);else if(1===t&&yt){var s=m?O:P,c="s"===m||"w"===y?0:1,f=s._name+".range["+c+"]",p=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),d="left",g="middle";if(s.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===y&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(xt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(p),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function It(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ht*e+_t)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",At.r=At.l,At.t=At.b,Et.attr("d","M0,0Z")}if(At.l=Math.min(_t,n),At.r=Math.max(_t,n),At.t=Math.min(wt,i),At.b=Math.max(wt,i),rt.isSubplotConstrained)a>C||o>C?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?At.t=wt-o:At.b=wt+o):(a=o*tt/et,_t>n?At.l=_t-a:At.r=_t+a),Et.attr("d",G(At))):s();else if(nt.isSubplotConstrained)if(a>C||o>C){St="xy";var l=Math.min(At.l/tt,(et-At.b)/et),c=Math.max(At.r/tt,(et-At.t)/et);At.l=l*tt,At.r=c*tt,At.b=(1-l)*et,At.t=(1-c)*et,Et.attr("d",G(At))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;um[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":525,"fast-isnumeric":186}],593:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":596}],594:[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 i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":479}],595:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,p=a.isArrayOrTypedArray,h=t("../../constants/numerical"),d=h.FP_SAFE,m=h.BADNUM,g=h.LOG_CLIP,y=h.ONEWEEK,v=h.ONEDAY,b=h.ONEHOUR,x=h.ONEMIN,_=h.ONESEC,w=t("./axis_ids"),A=t("./constants"),k=A.HOUR_PATTERN,T=A.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",h=r.charAt(0);function z(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return m}function E(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function L(e,r,n){return c(e,r,n||t.calendar)}function C(e){return t._categories[Math.round(e)]}function P(e){if(S(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 m}function O(e){if(t._categoriesMap)return t._categoriesMap[e]}function I(t){var e=O(t);return void 0!==e?e:s(t)?+t:void 0}function D(t){return s(t)?+t:O(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===h;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?R(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?z:f,t.l2c="log"===t.type?M:f,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(z(t,e))}:B,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=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return z(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=z,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=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=L,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return L(N(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=P,t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=O,t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(i=0;id&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),f="y"===h;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(s=0;su&&(p=!p),p&&t._rangebreaks.reverse();var d=p?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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 g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,p=!!e.yr1,h=[];if(f){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),g=d[1]-d[0],y=m[1]-m[0];h[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,h[2]=c*(1-r+r*y/g),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else h[0]=0,h[2]=c;if(p){var v=a.simpleMap(e.yr0,l.r2l),b=a.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],_=b[1]-b[0];h[1]=(v[1]*(1-r)+r*b[1]-v[1])/(v[0]-v[1])*u,h[3]=u*(1-r+r*_/x),l.range[0]=i.l2r(v[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*b[1])}else h[1]=0,h[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/h[2]:1,A=p?u/h[3]:1,k=f?h[0]:0,T=p?h[1]:0,M=f?h[0]/h[2]*c:0,S=p?h[1]/h[3]*u:0,z=i._offset-M,E=l._offset-S;n.clipRect.call(o.setTranslate,k,T).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,z,E).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":385,"../../lib":525,"../../registry":657,"./axes":576,"@plotly/d3":54}],601:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],p={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(p.noMultiCategory=!0);if(p.autotypenumbers=t.autotypenumbers,o(c,l)){var h=a(c),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),d.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,u=n.domain,f=n.projection,p=n.lonaxis,h=n.lataxis,d=p._ax,m=h._ax,y=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(i[n]||s[n])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],p=function(t){return t?l:[]},h=0;hu*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance);u&&l.clipAngle(u-w.clipPad);return l}(n),v=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],b=n.center||{},x=f.rotation||{},_=p.range||[],A=h.range||[];if(n.fitbounds){d._length=v[1][0]-v[0][0],m._length=v[1][1]-v[0][1],d.range=g(r,d),m.range=g(r,m);var k=(d.range[0]+d.range[1])/2,T=(m.range[0]+m.range[1])/2;if(n._isScoped)b={lon:k,lat:T};else if(n._isClipped){b={lon:k,lat:T},x={lon:k,lat:T,roll:x.roll};var M=f.type,S=w.lonaxisSpan[M]/2||180,E=w.lataxisSpan[M]/2||90;_=[k-S,k+S],A=[T-E,T+E]}else b={lon:k,lat:T},x={lon:k,lat:x.lat,roll:x.roll}}y.center([b.lon-x.lon,b.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(f.parallels);var L=z(_,A);y.fitExtent(v,L);var C=this.bounds=y.getBounds(L),P=this.fitScale=y.scale(),O=y.translate();if(n.fitbounds){var I=y.getBounds(z(d.range,m.range)),D=Math.min((C[1][0]-C[0][0])/(I[1][0]-I[0][0]),(C[1][1]-C[0][1])/(I[1][1]-I[0][1]));isFinite(D)?y.scale(D*P):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(f.scale*P);var R=this.midPt=[(C[0][0]+C[1][0])/2,(C[0][1]+C[1][1])/2];if(y.translate([O[0]+(R[0]-O[0]),O[1]+(R[1]-O[1])]).clipExtent(C),n._isAlbersUsa){var F=y([b.lon,b.lat]),B=y.translate();y.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),h=r.framework.selectAll(".layer").data(u,String);h.exit().each((function(t){delete a[t],delete o[t],n.select(this).remove()})),h.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),h.order(),h.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(T(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};m.setConvert(l,r);var c=m.calcTicks(l);e.isScoped||"lonaxis"!==t||c.pop();for(var u=c.length,f=new Array(u),p=0;p-1&&x(n.event,i,[r.xaxis],[r.yaxis],r.id,u),s.indexOf("event")>-1&&h.click(i,n.event))}))}function f(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(p.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},c.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":363,"../../components/dragelement":382,"../../components/drawing":385,"../../components/fx":403,"../../components/selections":451,"../../lib":525,"../../lib/geo_location_utils":518,"../../lib/topojson_utils":554,"../../registry":657,"../cartesian/autorange":575,"../cartesian/axes":576,"../plots":638,"./constants":606,"./zoom":611,"@plotly/d3":54,"d3-geo":110,"d3-geo-projection":109,"topojson-client":312}],608:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./geo"),o="geo",s=i(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.geo,s=0;s0&&C<0&&(C+=360);var P,O,I,D=(L+C)/2;if(!h){var R=d?f.projRotate:[D,0,0];P=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&b)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!b&&void 0)&&r("oceancolor")}(h?(O=-96.6,I=38.7):(O=d?D:P,I=(E[0]+E[1])/2),r("center.lon",O),r("center.lat",I),m&&(r("projection.tilt"),r("projection.distance")),g)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!b&&void 0)&&r("landcolor"),r("showlakes",!!b&&void 0)&&r("lakecolor"),r("showrivers",!!b&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&b)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",b),r("subunitcolor"),r("subunitwidth")),d||r("showframe",b)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):y?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":525,"../get_data":612,"../subplot_defaults":651,"./constants":606,"./layout_attributes":609}],611:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],f={},p={};function h(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,c._preGUI,f);var r=i.nestedProperty(u,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),p[n+"."+t]=e)}r(h),h("projection.scale",e.scale()/t.fitScale),h("fitbounds",!1),o.emit("plotly_relayout",p)}function p(t,e){var r=u(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render(!0);var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(t,e,i)})),r}function h(t,e){var r,i,a,o,s,p,h,d,m,g=u(0,e);function y(t){return e.invert(t)}function v(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=y(r)})).on("zoom",(function(){if(p=n.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?y(p)&&(d=y(p),h=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(h),o=h):s=y(r=p),m=!0,t.render(!0);var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),m&&f(t,e,v)})),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=u(0,e),o=function(t){var e=0,r=arguments.length,i=[];for(;++ed?(a=(f>0?90:-90)-h,i=0):(a=Math.asin(f/d)*s-h,i=Math.sqrt(d*d-f*f));var m=180-a-2*h,g=(Math.atan2(p,u)-Math.atan2(c,i))*s,y=(Math.atan2(p,u)-Math.atan2(c,-i))*s;return x(r[0],r[1],a,g)<=x(r[0],r[1],m,y)?[a,g,r[2]]:[m,y,r[2]]}function x(t,e,r,n){var i=_(r-t),a=_(n-e);return Math.sqrt(i*i+a*a)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[a]=t[a]*l-t[s]*c,i[s]=t[s]*l+t[a]*c,i}function A(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(g(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n).999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":363,"../../../lib":525,"../../../registry":657,"../../get_data":612,"../../subplot_defaults":651,"./axis_defaults":620,"./layout_attributes":623}],623:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":525,"../../../lib/extend":515,"../../domain":603,"./axis_attributes":619}],624:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":550}],625:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var p=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/p)}for(var h=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=h,u.tickmode=f}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),u=null,p=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(A.valueLabel=h.hoverLabelText(e._mockAxis,e._mockAxis.d2l(p.traceCoordinate[3]),t.valuehoverformat),S.push("value: "+A.valueLabel),p.textLabel&&S.push(p.textLabel),b=S.join("
")):b=p.textLabel;var z={x:p.traceCoordinate[0],y:p.traceCoordinate[1],z:p.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};d.appendArrayPointValue(z,_,w),t._module.eventData&&(z=_._module.eventData(z,p,_,{},w));var E={points:[z]};if(e.fullSceneLayout.hovermode){var L=[];d.loneHover({trace:_,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:A.xLabel,yLabel:A.yLabel,zLabel:A.zLabel,text:b,name:u.name,color:d.castHoverOption(_,w,"bgcolor")||u.color,borderColor:d.castHoverOption(_,w,"bordercolor"),fontFamily:d.castHoverOption(_,w,"font.family"),fontSize:d.castHoverOption(_,w,"font.size"),fontColor:d.castHoverOption(_,w,"font.color"),nameLength:d.castHoverOption(_,w,"namelength"),textAlign:d.castHoverOption(_,w,"align"),hovertemplate:f.castOption(_,w,"hovertemplate"),hovertemplateLabels:f.extendFlat({},z,A),eventData:[z]},{container:n,gd:r,inOut_bbox:L}),z.bbox=L[0]}p.buttons&&p.distance<5?r.emit("plotly_click",E):r.emit("plotly_hover",E),this.oldEventData=E}else d.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function T(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var p,h=0;h<(u||l.length);h++)if(f.isArrayOrTypedArray(l[h]))for(var d=0;dg[1][a])g[0][a]=-1,g[1][a]=1;else{var E=g[1][a]-g[0][a];g[0][a]-=E/32,g[1][a]+=E/32}if("reversed"===s.autorange){var L=g[0][a];g[0][a]=g[1][a],g[1][a]=L}}else{var C=s.range;g[0][a]=s.r2l(C[0]),g[1][a]=s.r2l(C[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),y[a]=g[1][a]-g[0][a],this.glplot.setBounds(a,{min:g[0][a]*p[a],max:g[1][a]*p[a]})}var P=c.aspectmode;if("cube"===P)d=[1,1,1];else if("manual"===P){var O=c.aspectratio;d=[O.x,O.y,O.z]}else{if("auto"!==P&&"data"!==P)throw new Error("scene.js aspectRatio was not one of the enumerated types");var I=[1,1,1];for(a=0;a<3;++a){var D=v[l=(s=c[k[a]]).type];I[a]=Math.pow(D.acc,1/D.count)/p[a]}d="data"===P||Math.max.apply(null,I)/Math.min.apply(null,I)<=4?I:[1,1,1]}c.aspectratio.x=u.aspectratio.x=d[0],c.aspectratio.y=u.aspectratio.y=d[1],c.aspectratio.z=u.aspectratio.z=d[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var B=this.container.style;B.position="absolute",B.left=F.l+R.x[0]*F.w+"px",B.top=F.t+(1-R.y[1])*F.h+"px",B.width=F.w*(R.x[1]-R.x[0])+"px",B.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),p=l||c;if(p){var h={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),h[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),h[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,h),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return p},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",p={x:0,y:0,z:1},h={};h[c]=p;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,h),a.up=p,f.nestedProperty(d,c).set(p)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d",{willReadFrequently:!0}),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];h.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(this._mockAxis,t)},e.exports=_},{"../../../stackgl_modules":1151,"../../components/fx":403,"../../lib":525,"../../lib/show_no_webgl_msg":547,"../../lib/str2rgbarray":550,"../../plots/cartesian/axes":576,"../../registry":657,"./layout/convert":621,"./layout/spikes":624,"./layout/tick_marks":625,"./project":626,"has-passive-events":225,"webgl-context":328}],628:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;aOpenStreetMap contributors',a=['\xa9 Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":548}],631:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":525}],632:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),i=t("../../lib"),a=i.strTranslate,o=i.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),c=t("@plotly/d3"),u=t("../../components/drawing"),f=t("../../lib/svg_text_utils"),p=t("./mapbox"),h=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==h.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots.mapbox;if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(h.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;l_/2){var w=y.split("|").join("
");b.text(w).attr("data-unformatted",w).call(f.convertToTspans,t),x=u.bBox(b.node())}b.attr("transform",a(-3,8-x.height)),v.insert("rect",".static-attribution").attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:"rgba(255, 255, 255, 0.75)"});var A=1;x.width+6>_&&(A=_/(x.width+6));var k=[n.l+n.w*p.x[1],n.t+n.h*(1-p.y[0])];v.attr("transform",a(k[0],k[1])+o(A))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),p(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){h(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.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"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var A=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&I.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&I.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(p,l,f,n),x.cleanPlot(p,l,f,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),V=!(!n._has||!n._has("cartesian"))||N,U=!(!l._has||!l._has("cartesian"))||j;V&&!U?n._bgLayer.remove():U&&!V&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var p=x.layoutAttributes.width.min,h=x.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var p in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[p].sort(u.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(h){var v=(r.t+r.b)/h;v>1&&(r.t/=v,r.b/=v)}var b=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,A=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:b,size:r.l+g},r:{val:_,size:r.r+g},b:{val:A,size:r.b+g},t:{val:w,size:r.t+g}},m[e]=1}else delete d[e],delete m[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={}),L(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,p=a.t,d=a.b,m=e._pushmargin,g=e._pushmarginIds,y=e.minreducedwidth,v=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var b in m)g[b]||delete m[b];for(var _ in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:p},b:{val:0,size:d}},m){var w=m[_].l||{},A=m[_].b||{},k=w.val,T=w.size,M=A.val,S=A.size;for(var z in m){if(o(T)&&m[z].r){var E=m[z].r.val,C=m[z].r.size;if(E>k){var P=(T*E+(C-r)*k)/(E-k),O=(C*(1-k)+(T-r)*(1-E))/(E-k);P+O>c+f&&(c=P,f=O)}}if(o(S)&&m[z].t){var I=m[z].t.val,D=m[z].t.size;if(I>M){var R=(S*I+(D-n)*M)/(I-M),F=(D*(1-M)+(S-n)*(1-I))/(I-M);R+F>d+p&&(d=R,p=F)}}}}}var B=u.constrain(r-a.l-a.r,2,y),N=u.constrain(n-a.t-a.b,2,v),j=Math.max(0,r-B),V=Math.max(0,n-N);if(j){var U=(c+f)/j;U>1&&(c/=U,f/=U)}if(V){var H=(d+p)/V;H>1&&(d/=H,p/=H)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(p),i.b=Math.round(d),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&x.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var q=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var p=s._size;f.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:p,y:p}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(I(o,c,f),i=0;i1e-10?t:0}function p(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+p(u(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=90||s>90&&l>=450?1:u<=0&&p<=0?0:Math.max(u,p);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&p>=0?0:Math.min(u,p);n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f);return[e,r,n,i]}(h),x=b[2]-b[0],_=b[3]-b[1],w=p/f,A=Math.abs(_/x);w>A?(d=f,v=(p-(m=f*A))/n.h/2,g=[o[0],o[1]],y=[s[0]+v,s[1]-v]):(m=p,v=(f-(d=p/A))/n.w/2,g=[o[0]+v,o[1]-v],y=[s[0],s[1]]),this.xLength2=d,this.yLength2=m,this.xDomain2=g,this.yDomain2=y;var k,T=this.xOffset2=n.l+n.w*g[0],M=this.yOffset2=n.t+n.h*(1-y[1]),S=this.radius=d/x,z=this.innerRadius=this.getHole(e)*S,E=this.cx=T-S*b[0],L=this.cy=M+S*b[3],C=this.cxx=E-T,P=this.cyy=L-M,O=i.side;"counterclockwise"===O?(k=O,O="top"):"clockwise"===O&&(k=O,O="bottom"),this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:O,_trueSide:k,domain:[z/n.w,S/n.w]}),this.angularAxis=this.mockAxis(t,e,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:y});var I=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",I).attr("transform",l(C,P)),r.frontplot.attr("transform",l(T,M)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",I).attr("transform",l(E,L)).call(c.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=o.extendFlat({},r,n);return d(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);h(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*o,t[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=this.getRadial(e);m(r,n);var a=n.range;i.range=a.slice(),i._input.range=a.slice(),n._rl=[n.r2l(a[0],null,"gregorian"),n.r2l(a[1],null,"gregorian")]},N.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,h=r.cy,d=r.getRadial(e),m=D(r.getSector(e)[0],360),g=r.radialAxis,y=u90&&m<=270&&(g.tickangle=180);var b=v?function(t){var e=O(r,L([t.x,0]));return l(e[0]-f,e[1]-h)}:function(t){return l(g.l2p(t.x)+u,0)},x=v?function(t){return P(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},_=j(d);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),y){g.setScale();var w=0,A=v?(g.tickvals||[]).filter((function(t){return t>=0})).map((function(t){return p.tickText(g,t,!0,!1)})):p.calcTicks(g),k=v?A:p.clipEnds(g,A),T=p.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(T=-T),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),p.drawTicks(n,g,{vals:A,layer:i["radial-axis"],path:p.makeTickPath(g,0,T),transFn:b,crisp:!1}),p.drawGrid(n,g,{vals:k,layer:i["radial-grid"],path:x,transFn:o.noop,crisp:!1}),p.drawLabels(n,g,{vals:A,layer:i["radial-axis"],transFn:b,labelFns:p.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?F(V(R(d.angle),r.vangles)):d.angle,S=l(f,h),z=S+s(-M);U(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:z}),U(i["radial-grid"],y&&d.showgrid,{transform:v?"":S}),U(i["radial-line"].select("line"),y&&d.showline,{x1:v?-a:u,y1:0,x2:a,y2:0,transform:z}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=this.getRadial(e),l=this.id+"title",c=0;if(s.title){var f=u.bBox(this.layers["radial-axis"].node()).height,p=s.title.font.size,h=s.side;c="top"===h?p:"counterclockwise"===h?-(f+.4*p):f+.8*p}var d=void 0!==r?r:this.radialAxisAngle,m=R(d),g=Math.cos(m),y=Math.sin(m),v=a+i/2*g+c*y,x=o-i/2*y+c*g;this.layers["radial-axis-title"]=b.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:I(n,"Click to enter radial axis title"),attributes:{x:v,y:x,"text-anchor":"middle"},transform:{rotate:-d}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,h=r.cy,d=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var y=g?function(t){var e=O(r,L([0,t.x]));return Math.atan2(e[0]-f,e[1]-h)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=F(m.tick0),m.dtick=F(m.dtick));var v=function(t){return l(f+a*Math.cos(t),h-a*Math.sin(t))},b=g?function(t){var e=O(r,L([0,t.x]));return l(e[0],e[1])}:function(t){return v(y(t))},x=g?function(t){var e=O(r,L([0,t.x])),n=Math.atan2(e[0]-f,e[1]-h)-Math.PI/2;return l(e[0],e[1])+s(-F(n))}:function(t){var e=y(t);return v(e)+s(-F(e))},_=g?function(t){return C(r,t.x,0,1/0)}:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+u*r,h-u*n]+"L"+[f+a*r,h-a*n]},w=p.makeLabelFns(m,0).labelStandoff,A={xFn:function(t){var e=y(t);return Math.cos(e)*w},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},k=j(d);r.angularTickLayout!==k&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=k);var T,S=g?[1/0].concat(m.tickvals||[]).map((function(t){return p.tickText(m,t,!0,!1)})):p.calcTicks(m);if(g&&(S[0].text="\u221e",S[0].fontSize*=1.75),"linear"===e.gridshape?(T=S.map(y),o.angleDelta(T[0],T[1])<0&&(T=T.slice().reverse())):T=null,r.vangles=T,"category"===m.type&&(S=S.filter((function(t){return o.isAngleInsideSector(y(t),r.sectorInRad)}))),m.visible){var z="inside"===m.ticks?-1:1,E=(m.linewidth||1)/2;p.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+z*E+",0h"+z*m.ticklen,transFn:x,crisp:!1}),p.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:_,transFn:o.noop,crisp:!1}),p.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:b,labelFns:A})}U(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(f,h)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,r,s=this,c=s.isSmith,u=s.gd,f=s.layers,p=t._zoomlayer,h=S.MINZOOM,d=S.OFFEDGE,m=s.radius,b=s.innerRadius,A=s.cx,k=s.cy,T=s.cxx,M=s.cyy,E=s.sectorInRad,L=s.vangles,C=s.radialAxis,P=z.clampTiny,O=z.findXYatLength,I=z.findEnclosingVertexAngles,D=S.cornerHalfWidth,R=S.cornerLen/2,F=g.makeDragger(f,"path","maindrag",!1===t.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(A,k)),F.onmousemove=function(t){v.hover(u,t,s.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=s.id},F.onmouseout=function(t){u._dragging||y.unhover(u,t)};var B,N,j,V,U,H,q,G,W,Y={element:F,gd:u,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Z(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Z(t-T,e-M)}function J(t,e){return Math.atan2(M-e,t-T)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function Q(t,e){if(0===t)return s.pathSector(2*D);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,m)),o=a-D,l=a+D;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(l,i)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function $(t,e,r){if(0===t)return s.pathSector(2*D);var n,i,a=K(t,e),o=K(t,r),l=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(l&&c){var u=c/l,f=-1/u,p=O(D,u,l,c);n=O(R,f,p[0][0],p[0][1]),i=O(R,f,p[1][0],p[1][1])}else{var h,d;c?(h=R,d=D):(h=D,d=R),n=[[l-h,c-d],[l+h,c-d]],i=[[l-h,c+d],[l+h,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,m),b),th?(t-1&&1===t&&_(e,u,[s.xaxis],[s.yaxis],s.id,Y),r.indexOf("event")>-1&&v.click(u,e,s.id)}Y.prepFn=function(t,n,a){var l=u._fullLayout.dragmode,f=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var h=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,r=u._fullLayout._invScaleY;var d=o.apply3DTransform(h)(n-f.left,a-f.top);if(B=d[0],N=d[1],L){var y=z.findPolygonOffset(m,E[0],E[1],L);B+=T+y[0],N+=M+y[1]}switch(l){case"zoom":Y.clickFn=st,c||(Y.moveFn=L?it:rt,Y.doneFn=at,function(){j=null,V=null,U=s.pathSubplot(),H=!1;var t=u._fullLayout[s.id];q=i(t.bgcolor).getLuminance(),(G=g.makeZoombox(p,q,A,k,U)).attr("fill-rule","evenodd"),W=g.makeCorners(p,A,k),w(u)}());break;case"select":case"lasso":x(t,n,a,Y,l)}},y.init(Y)},N.updateRadialDrag=function(t,e,r){var i=this,c=i.gd,u=i.layers,f=i.radius,p=i.innerRadius,h=i.cx,d=i.cy,m=i.radialAxis,v=S.radialDragBoxSize,b=v/2;if(m.visible){var x,_,A,M=R(i.radialAxisAngle),z=m._rl,E=z[0],L=z[1],C=z[r],P=.75*(z[1]-z[0])/(1-i.getHole(e))/f;r?(x=h+(f+b)*Math.cos(M),_=d-(f+b)*Math.sin(M),A="radialdrag"):(x=h+(p-b)*Math.cos(M),_=d-(p-b)*Math.sin(M),A="radialdrag-inner");var O,I,D,B=g.makeRectDragger(u,A,"crosshair",-b,-b,v,v),N={element:B,gd:c};!1===t.dragmode&&(N.dragmode=!1),U(n.select(B),m.visible&&p0==(r?D>E:Dn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0?1:0}function i(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function a(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function o(t,e){return e*t.radius}e.exports={smith:i,reactanceArc:function(t,e,r,n){var s=a(t,i([r,e])),l=s[0],c=s[1],u=a(t,i([n,e])),f=u[0],p=u[1];if(0===e)return["M"+l+","+c,"L"+f+","+p].join(" ");var h=o(t,1/Math.abs(e));return["M"+l+","+c,"A"+h+","+h+" 0 0,"+(e<0?1:0)+" "+f+","+p].join(" ")},resistanceArc:function(t,e,r,s){var l=o(t,1/(e+1)),c=a(t,i([e,r])),u=c[0],f=c[1],p=a(t,i([e,s])),h=p[0],d=p[1];if(n(r)!==n(s)){var m=a(t,i([e,0]));return["M"+u+","+f,"A"+l+","+l+" 0 0,"+(00){for(var n=[],i=0;i=u&&(p.min=0,d.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function m(t,e,r,n){var i=p[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var h=o("color"),d=h!==i.color.dflt?h:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,y=o("title.text",g);e._hovertitle=y===g?y:m,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:d}),o("min"),u(t,e,o,"linear"),l(t,e,o,"linear"),s(t,e,o,"linear"),c(t,e,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:d}),o("tickangle"),o("tickformat")),f(t,e,o,{dfltColor:h,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:p,handleDefaults:d,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":363,"../../lib":525,"../../plot_api/plot_template":565,"../cartesian/line_grid_defaults":591,"../cartesian/prefix_suffix_defaults":593,"../cartesian/tick_label_defaults":597,"../cartesian/tick_mark_defaults":598,"../cartesian/tick_value_defaults":599,"../subplot_defaults":651,"./layout_attributes":654}],656:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o.strTranslate,l=o._,c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),p=t("../../lib/extend").extendFlat,h=t("../plots"),d=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/fx"),y=t("../../components/dragelement/helpers"),v=y.freeMode,b=y.rectMode,x=t("../../components/titles"),_=t("../../components/selections").prepSelect,w=t("../../components/selections").selectOnClick,A=t("../../components/selections").clearOutline,k=t("../../components/selections").clearSelectionsCache,T=t("../cartesian/constants");function M(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=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iz*x?i=(a=x)*z:a=(i=b)/z,o=y*i/b,l=v*a/x,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,h.x0=r,h.y0=n,h.w=i,h.h=a,h.sum=_,h.xaxis={type:"linear",range:[w+2*k-_,_-w-2*A],domain:[m-o/2,m+o/2],_id:"x"},f(h.xaxis,h.graphDiv._fullLayout),h.xaxis.setScale(),h.xaxis.isPtWithinRange=function(t){return t.a>=h.aaxis.range[0]&&t.a<=h.aaxis.range[1]&&t.b>=h.baxis.range[1]&&t.b<=h.baxis.range[0]&&t.c>=h.caxis.range[1]&&t.c<=h.caxis.range[0]},h.yaxis={type:"linear",range:[w,_-A-k],domain:[g-l/2,g+l/2],_id:"y"},f(h.yaxis,h.graphDiv._fullLayout),h.yaxis.setScale(),h.yaxis.isPtWithinRange=function(){return!0};var T=h.yaxis.domain[0],M=h.aaxis=p({},t.aaxis,{range:[w,_-A-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[T,T+l*z],anchor:"free",position:0,_id:"y",_length:i});f(M,h.graphDiv._fullLayout),M.setScale();var S=h.baxis=p({},t.baxis,{range:[_-w-k,A],side:"bottom",domain:h.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(S,h.graphDiv._fullLayout),S.setScale();var E=h.caxis=p({},t.caxis,{range:[_-w-A,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[T,T+l*z],anchor:"free",position:0,_id:"y",_length:i});f(E,h.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDef.select("path").attr("d",L),h.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDefRelative.select("path").attr("d",C);var P=s(r,n);h.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),h.clipDefRelative.select("path").attr("transform",null);var O=s(r-S._offset,n+a);h.layers.baxis.attr("transform",O),h.layers.bgrid.attr("transform",O);var I=s(r+i/2,n)+"rotate(30)"+s(0,-M._offset);h.layers.aaxis.attr("transform",I),h.layers.agrid.attr("transform",I);var D=s(r+i/2,n)+"rotate(-30)"+s(0,-E._offset);h.layers.caxis.attr("transform",D),h.layers.cgrid.attr("transform",D),h.drawAxes(!0),h.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),h.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),h.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),h.graphDiv._context.staticPlot||h.initInteractions(),u.setClipUrl(h.layers.frontplot,h._hasClipOnAxisFalse?null:h.clipId,h.graphDiv)},S.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,i=this.aaxis,a=this.baxis,o=this.caxis;if(this.drawAx(i),this.drawAx(a),this.drawAx(o),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=x.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=x.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*a.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=x.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(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"}})}},S.drawAx=function(t){var e,r=this.graphDiv,n=t._name,i=n.charAt(0),a=t._id,s=this.layers[n],l=i+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+a+"tick").remove(),this[l]=c),t.setScale();var u=d.calcTicks(t),f=d.clipEnds(t,u),p=d.makeTransTickFn(t),h=d.getTickSigns(t)[2],m=o.deg2rad(30),g=h*(t.linewidth||1)/2,y=h*t.ticklen,v=this.w,b=this.h,x="b"===i?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,_={a:"M0,0l"+b+",-"+v/2,b:"M0,0l-"+v/2+",-"+b,c:"M0,0l-"+b+","+v/2}[i];d.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:s,path:x,transFn:p,crisp:!1}),d.drawGrid(r,t,{vals:f,layer:this.layers[i+"grid"],path:_,transFn:p,crisp:!1}),d.drawLabels(r,t,{vals:u,layer:s,transFn:p,labelFns:d.makeLabelFns(t,0,30)})};var E=T.MINZOOM/2+.87,L="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",C="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",P="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",O=!0;function I(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){k(this.dragOptions),A(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,f,p,h,d,y,x,A,k,M=this,S=M.layers.plotbg.select("path").node(),E=M.graphDiv,D=E._fullLayout._zoomlayer;function R(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=E._fullLayout.clickmode;I(E),2===t&&(E.emit("plotly_doubleclick",null),a.call("_guiRelayout",E,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,E,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&g.click(E,e,M.id)}function B(t,e){return 1-e/M.h}function N(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function j(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function V(i,a){var o=r+i*t,s=n+a*e,l=Math.max(0,Math.min(1,B(0,n),B(0,s))),c=Math.max(0,Math.min(1,N(r,n),N(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),m=(l/2+u)*M.w,g=(1-l/2-c)*M.w,v=(m+g)/2,b=g-m,_=(1-l)*M.h,w=_-b/z;b.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),x=!0),E.emit("plotly_relayouting",R(h))}function U(){I(E),h!==f&&(a.call("_guiRelayout",E,R(h)),O&&E.data&&E._context.showTips&&(o.notifier(l(E,"Double-click to zoom back out"),"long"),O=!1))}function H(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(h={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,h.b,h.c].sort(o.sorterAsc),a=i.indexOf(h.a),l=i.indexOf(h.b),c=i.indexOf(h.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),h={a:i[a],b:i[l],c:i[c]},e=(f.a-h.a)*M.yaxis._m,t=(f.c-h.c-f.b+h.b)*M.xaxis._m);var p=s(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",p);var d=s(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[h.a,M.sum-h.b-h.c],M.baxis.range=[M.sum-h.a-h.c,h.b],M.caxis.range=[M.sum-h.a-h.b,h.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,M),E.emit("plotly_relayouting",R(h))}function q(){a.call("_guiRelayout",E,R(h))}this.dragOptions={element:S,gd:E,plotinfo:{id:M.id,domain:E._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(a,l,u){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=E._fullLayout._invScaleX,e=E._fullLayout._invScaleY;var m=M.dragOptions.dragmode=E._fullLayout.dragmode;v(m)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===m?(M.dragOptions.moveFn=V,M.dragOptions.clickFn=F,M.dragOptions.doneFn=U,function(t,e,a){var l=S.getBoundingClientRect();r=e-l.left,n=a-l.top,E._fullLayout._calcInverseTransform(E);var u=E._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},h=f,p=M.aaxis.range[1]-f.a,d=i(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),y="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",x=!1,A=D.append("path").attr("class","zoombox").attr("transform",s(M.x0,M.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",y),k=D.append("path").attr("class","zoombox-corners").attr("transform",s(M.x0,M.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(E)}(0,l,u)):"pan"===m?(M.dragOptions.moveFn=H,M.dragOptions.clickFn=F,M.dragOptions.doneFn=q,f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},h=f,M.clearOutline(E)):(b(m)||v(m))&&_(a,l,u,M.dragOptions,m)}},S.onmousemove=function(t){g.hover(E,t,M.id),E._fullLayout._lasthover=S,E._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){E._dragging||m.unhover(E,t)},m.init(this.dragOptions)}},{"../../components/color":363,"../../components/dragelement":382,"../../components/dragelement/helpers":381,"../../components/drawing":385,"../../components/fx":403,"../../components/selections":451,"../../components/titles":472,"../../lib":525,"../../lib/extend":515,"../../registry":657,"../cartesian/axes":576,"../cartesian/constants":583,"../cartesian/set_convert":595,"../plots":638,"@plotly/d3":54,tinycolor2:309}],657:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=l.extendFlat,p=l.extendDeepAll;function h(t){var e=t.name,i=t.categories,a=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 i in y(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(i,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(f[h[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":363,"../components/drawing":385,"../constants/xmlns_namespaces":488,"../lib":525,"@plotly/d3":54}],666:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rf+c||!n(u))}for(var h=0;ha))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return i(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)?e0?e+=r:u<0&&(e-=r)}return e}function I(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,_+(i-e)/(i-r)-1)}var D=t[f+"a"],R=t[p+"a"];m=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=n.getDistanceFunction(i,h,d,(function(t){return(h(t)+d(t))/2}));if(n.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==c){k||(E=function(t){return Math.min(T(t),t.p-v.bargroupwidth/2)},L=function(t){return Math.max(M(t),t.p+v.bargroupwidth/2)});var B=g[t.index],N=y.base?B.b+B.s:B.s;t[p+"0"]=t[p+"1"]=R.c2p(B[p],!0),t[p+"LabelVal"]=N;var j=v.extents[v.extents.round(B.p)];t[f+"0"]=D.c2p(b?E(B):j[0],!0),t[f+"1"]=D.c2p(b?L(B):j[1],!0);var V=void 0!==B.orig_p;return t[f+"LabelVal"]=V?B.orig_p:B.p,t.labelLabel=l(D,t[f+"LabelVal"],y[f+"hoverformat"]),t.valueLabel=l(R,t[p+"LabelVal"],y[p+"hoverformat"]),t.baseLabel=l(R,B.b,y[p+"hoverformat"]),t.spikeDistance=(function(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,w+(i-e)/(i-r)-1)}(B)+function(t){return C(T(t),M(t),w)}(B))/2,t[f+"Spike"]=D.c2p(B.p,!0),o(B,y,t),t.hovertemplate=y.hovertemplate,t}}function f(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,i=s(t,e);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(t,e,r,n,a){var o=u(t,e,r,n,a);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=f(l,c),i.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":363,"../../components/fx":403,"../../constants/numerical":487,"../../lib":525,"../../plots/cartesian/axes":576,"../../registry":657,"./helpers":673}],675:[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":588,"../scatter/marker_colorbar":966,"./arrays_to_calcdata":666,"./attributes":667,"./calc":668,"./cross_trace_calc":670,"./defaults":671,"./event_data":672,"./hover":674,"./layout_attributes":676,"./layout_defaults":677,"./plot":678,"./select":679,"./style":681}],676:[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"}}},{}],677:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,f={},p=s("barmode"),h=0;h0}function S(t){return"auto"===t?0:t}function z(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function E(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor||"end",u="end"===c,f="start"===c,p=((a.leftToRight||0)+1)/2,h=1-p,d=i.width,m=i.height,g=Math.abs(e-t),y=Math.abs(n-r),v=g>2*_&&y>2*_?_:0;g-=2*v,y-=2*v;var b=S(l);"auto"!==l||d<=g&&m<=y||!(d>g||m>y)||(d>y||m>g)&&d.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)};B=G(B,N,D),N=G(N,B,D),j=G(j,V,!D),V=G(V,j,!D)}var W=T(a.ensureSingle(P,"path"),C,g,y);if(W.style("vector-effect","non-scaling-stroke").attr("d",isNaN((N-B)*(V-j))||U&&t._context.staticPlot?"M0,0Z":"M"+B+","+j+"V"+V+"H"+N+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!C.uniformtext.mode&&R){var Y=l.makePointStyleFns(f);l.singlePointStyle(c,W,f,Y,t)}!function(t,e,r,n,i,s,c,f,h,g,y){var w,A=e.xaxis,M=e.yaxis,L=t._fullLayout;function C(e,r,n){return a.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var P=n[0].trace,O="h"===P.orientation,I=function(t,e,r,n,i){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,i){var o=e[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,c,f,p,h="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;g?(l="y",c=i,f="x",p=n):(l="x",c=n,f="y",p=i);function y(t){return u(p,p.c2l(t),!0).text}var v=e[r],b={};b.label=v.p,b.labelLabel=b[l+"Label"]=(_=v.p,u(c,c.c2l(_),!0).text);var _;var w=a.castOption(o,v.i,"text");(0===w||w)&&(b.text=w);b.value=v.s,b.valueLabel=b[f+"Label"]=y(v.s);var A={};x(A,o,v.i),(h||void 0===A.x)&&(A.x=g?b.value:b.label);(h||void 0===A.y)&&(A.y=g?b.label:b.value);(h||void 0===A.xLabel)&&(A.xLabel=g?b.valueLabel:b.labelLabel);(h||void 0===A.yLabel)&&(A.yLabel=g?b.labelLabel:b.valueLabel);d&&(b.delta=+v.rawS||v.s,b.deltaLabel=y(b.delta),b.final=v.v,b.finalLabel=y(b.final),b.initial=b.final-b.delta,b.initialLabel=y(b.initial));m&&(b.value=v.s,b.valueLabel=y(b.value),b.percentInitial=v.begR,b.percentInitialLabel=a.formatPercent(v.begR),b.percentPrevious=v.difR,b.percentPreviousLabel=a.formatPercent(v.difR),b.percentTotal=v.sumR,b.percenTotalLabel=a.formatPercent(v.sumR));var k=a.castOption(o,v.i,"customdata");k&&(b.customdata=k);return a.texttemplateString(s,b,t._d3locale,A,b,o._meta||{})}(t,e,r,n,i):s.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function c(t){return u(o?r:n,+t,!0).text}var f,p=i.textinfo,h=t[e],d=p.split("+"),m=[],g=function(t){return-1!==d.indexOf(t)};g("label")&&m.push((y=t[e].p,u(o?n:r,y,!0).text));var y;g("text")&&(0===(f=a.castOption(i,h.i,"text"))||f)&&m.push(f);if(s){var v=+h.rawS||h.s,b=h.v,x=b-v;g("initial")&&m.push(c(x)),g("delta")&&m.push(c(v)),g("final")&&m.push(c(b))}if(l){g("value")&&m.push(c(h.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(f=a.formatPercent(h.begR),w&&(f+=" of initial"),m.push(f)),g("percent previous")&&(f=a.formatPercent(h.difR),w&&(f+=" of previous"),m.push(f)),g("percent total")&&(f=a.formatPercent(h.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(e,r,n,i):m.getValue(s.text,r);return m.coerceString(v,o)}(L,n,i,A,M);w=function(t,e){var r=m.getValue(t.textposition,e);return m.coerceEnumerated(b,r)}(P,i);var D="stack"===g.mode||"relative"===g.mode,R=n[i],F=!D||R._outmost;if(!I||"none"===w||(R.isBlank||s===c||f===h)&&("auto"===w||"inside"===w))return void r.select("text").remove();var B=L.font,N=d.getBarColor(n[i],P),j=d.getInsideTextFont(P,i,B,N),V=d.getOutsideTextFont(P,i,B),U=r.datum();O?"log"===A.type&&U.s0<=0&&(s=A.range[0]=G*(X/W):X>=W*(Z/G);G>0&&W>0&&(J||K||Q)?w="inside":(w="outside",H.remove(),H=null)}else w="inside";if(!H){Y=a.ensureUniformFontSize(t,"outside"===w?V:j);var $=(H=C(r,I,Y)).attr("transform");if(H.attr("transform",""),q=l.bBox(H.node()),G=q.width,W=q.height,H.attr("transform",$),G<=0||W<=0)return void H.remove()}var tt,et,rt=P.textangle;"outside"===w?(et="both"===P.constraintext||"outside"===P.constraintext,tt=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,f=i.height,p=Math.abs(e-t),h=Math.abs(n-r);o=s?h>2*_?_:0:p>2*_?_:0;var d=1;l&&(d=s?Math.min(1,h/f):Math.min(1,p/u));var m=S(c),g=z(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,b=(i.top+i.bottom)/2,x=(t+e)/2,w=(r+n)/2,A=0,T=0,M=s?k(e,t):k(r,n);s?(x=e-M*o,A=M*y):(w=n+M*o,T=-M*y);return{textX:v,textY:b,targetX:x,targetY:w,anchorX:A,anchorY:T,scale:d,rotate:m}}(s,c,f,h,q,{isHorizontal:O,constrained:et,angle:rt})):(et="both"===P.constraintext||"inside"===P.constraintext,tt=E(s,c,f,h,q,{isHorizontal:O,constrained:et,angle:rt,anchor:P.insidetextanchor}));tt.fontSize=Y.size,p("histogram"===P.type?"bar":P.type,tt,L),R.transform=tt;var nt=T(H,L,g,y);a.setTransormAndDisplay(nt,tt)}(t,e,P,r,h,B,N,j,V,g,y),e.layerClipId&&l.hideOutsideRangePoint(c,P.select("text"),w,L,f.xcalendar,f.ycalendar)}));var j=!1===f.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,P,e,g)},toMoveInsideBar:E}},{"../../components/color":363,"../../components/drawing":385,"../../components/fx/helpers":399,"../../lib":525,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"../../registry":657,"./attributes":667,"./constants":669,"./helpers":673,"./style":681,"./uniform_text":683,"@plotly/d3":54,"fast-isnumeric":186}],679:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:m,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?function(t,e,r){a.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var i,s=n.select(this);if(t.selected){i=o.ensureUniformFontSize(r,g(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,i,t):(d(r,i,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:b,getBarColor:_,resizeText:l}},{"../../components/color":363,"../../components/drawing":385,"../../lib":525,"../../registry":657,"./attributes":667,"./helpers":673,"./uniform_text":683,"@plotly/d3":54}],682:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("../../lib").coercePattern;e.exports=function(t,e,r,s,l){var c=r("marker.color",s),u=i(t,"marker");u&&a(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":363,"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"../../lib":525}],683:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");function a(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=a(t),i=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=op.range[1]&&(b+=Math.PI);if(n.getClosest(c,(function(t){return m(v,b,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var x=c[t.index];t.x0=t.x1=x.ct[0],t.y0=t.y1=x.ct[1];var _=i.extendFlat({},x,{r:x.s,theta:x.p});return o(x,u,t),s(_,u,f,t),t.hovertemplate=u.hovertemplate,t.color=a(u,x),t.xLabelVal=t.yLabelVal=void 0,x.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":403,"../../lib":525,"../../plots/polar/helpers":640,"../bar/hover":674,"../scatterpolar/hover":1029}],688:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":641,"../bar/select":679,"../bar/style":681,"../scatter/marker_colorbar":966,"../scatterpolar/format_labels":1028,"./attributes":684,"./calc":685,"./defaults":686,"./hover":687,"./layout_attributes":689,"./layout_defaults":690,"./plot":691}],689:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],690:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a,o={};function s(r,o){return n.coerce(t[a]||{},e[a],i,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var f=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,i,c,u,f,e,r)};return function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),h=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(h,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),h=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(i(o)&&i(s)&&i(h)&&i(d)&&o!==s&&h!==d){var m=u.c2g(t.s1),g=(h+d)/2;t.ct=[l.c2p(m*Math.cos(g)),c.c2p(m*Math.sin(g))],e=p(o,s,h,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":385,"../../lib":525,"../../plots/polar/helpers":640,"@plotly/d3":54,"fast-isnumeric":186}],692:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,c=n.marker,u=c.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,xhoverformat:o("x"),yhoverformat:o("y"),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({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},c.angle,{arrayOk:!1,editType:"calc"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":362,"../../lib/extend":515,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652,"../bar/attributes":667,"../scatter/attributes":948}],693:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../plots/cartesian/align_period"),o=t("../../lib"),s=t("../../constants/numerical").BADNUM,l=o._;e.exports=function(t,e){var r,c,v,b,x,_,w,A=t._fullLayout,k=i.getFromId(t,e.xaxis||"x"),T=i.getFromId(t,e.yaxis||"y"),M=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(v=k,b="x",x=T,_="y",w=!!e.yperiodalignment):(v=T,b="y",x=k,_="x",w=!!e.xperiodalignment);var z,E,L,C,P,O,I=function(t,e,r,i){var s,l=e+"0"in t,c="d"+e in t;if(e in t||l&&c){var u=r.makeCalcdata(t,e);return[a(t,r,e,u).vals,u]}s=l?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:i;for(var f="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]),p=t._length,h=new Array(p),d=0;dz.uf};if(e._hasPreCompStats){var V=e[b],U=function(t){return v.d2c((e[t]||[])[r])},H=1/0,q=-1/0;for(r=0;r=z.q1&&z.q3>=z.med){var W=U("lowerfence");z.lf=W!==s&&W<=z.q1?W:h(z,L,C);var Y=U("upperfence");z.uf=Y!==s&&Y>=z.q3?Y:d(z,L,C);var Z=U("mean");z.mean=Z!==s?Z:C?o.mean(L,C):(z.q1+z.q3)/2;var X=U("sd");z.sd=Z!==s&&X>=0?X:C?o.stdev(L,C,z.mean):z.q3-z.q1,z.lo=m(z),z.uo=g(z);var J=U("notchspan");J=J!==s&&J>0?J:y(z,C),z.ln=z.med-J,z.un=z.med+J;var K=z.lf,Q=z.uf;e.boxpoints&&L.length&&(K=Math.min(K,L[0]),Q=Math.max(Q,L[C-1])),e.notched&&(K=Math.min(K,z.ln),Q=Math.max(Q,z.un)),z.min=K,z.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+z.q1,"median = "+z.med,"q3 = "+z.q3].join("\n")),$=z.med!==s?z.med:z.q1!==s?z.q3!==s?(z.q1+z.q3)/2:z.q1:z.q3!==s?z.q3:0,z.med=$,z.q1=z.q3=$,z.lf=z.uf=$,z.mean=z.sd=$,z.ln=z.un=$,z.min=z.max=$}H=Math.min(H,z.min),q=Math.max(q,z.max),z.pts2=E.filter(j),M.push(z)}}e._extremes[v._id]=i.findExtremes(v,[H,q],{padded:!0})}else{var tt=v.makeCalcdata(e,b),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ft;if((z={}).pos=z[_]=B[r],E=z.pts=nt[r].sort(f),C=(L=z[b]=E.map(p)).length,z.min=L[0],z.max=L[C-1],z.mean=o.mean(L,C),z.sd=o.stdev(L,C,z.mean),z.med=o.interp(L,.5),C%2&&(lt||ct))lt?(ut=L.slice(0,C/2),ft=L.slice(C/2+1)):ct&&(ut=L.slice(0,C/2+1),ft=L.slice(C/2)),z.q1=o.interp(ut,.5),z.q3=o.interp(ft,.5);else z.q1=o.interp(L,.25),z.q3=o.interp(L,.75);z.lf=h(z,L,C),z.uf=d(z,L,C),z.lo=m(z),z.uo=g(z);var pt=y(z,C);z.ln=z.med-pt,z.un=z.med+pt,at=Math.min(at,z.ln),ot=Math.max(ot,z.un),z.pts2=E.filter(j),M.push(z)}e._extremes[v._id]=i.findExtremes(v,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:A[S],dPos:N,posLetter:_,valLetter:b,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean \xb1 \u03c3:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},A[S]++,M):[{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 p(t){return t.v}function h(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 d(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 m(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function y(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":487,"../../lib":525,"../../plots/cartesian/align_period":573,"../../plots/cartesian/axes":576,"fast-isnumeric":186}],694:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,f=e._fullLayout,p=o._id,h=p.charAt(0),d=[],m=0;for(s=0;s1,x=1-f[t+"gap"],_=1-f[t+"groupgap"];for(s=0;s0){var q=z.pointpos,G=z.jitter,W=z.marker.size/2,Y=0;q+G>=0&&((Y=U*(q+G))>M?(H=!0,j=W,B=Y):Y>R&&(j=W,B=M)),Y<=M&&(B=M);var Z=0;q-G<=0&&((Z=-U*(q-G))>S?(H=!0,V=W,N=Z):Z>F&&(V=W,N=S)),Z<=S&&(N=S)}else B=M,N=S;var X=new Array(c.length);for(l=0;l0?(g="v",y=b>0?Math.min(_,x):Math.min(x)):b>0?(g="h",y=Math.min(_)):y=0;if(y){e._length=y;var S=r("orientation",g);e._hasPreCompStats?"v"===S&&0===b?(r("x0",0),r("dx",1)):"h"===S&&0===v&&(r("y0",0),r("dy",1)):"v"===S&&0===b?r("x0"):"h"===S&&0===v&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function f(t,e,r,i){var a=i.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(a+"points",l);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.angle"),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,i){function s(r,i){return n.coerce(t,e,c,r,i)}if(u(t,e,s,i),!1!==e.visible){o(t,e,i,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(e.line.color,.5));var p=!1;if(l){var h=s("mean"),d=s("sd");h&&h.length&&(p=!0,d&&d.length&&(p="sd"))}s("boxmean",p),s("whiskerwidth"),s("width"),s("quartilemethod");var m=!1;if(l){var g=s("notchspan");g&&g.length&&(m=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(m=!0);s("notched",m)&&s("notchwidth"),f(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,c,t)}for(var o=0;ot.lo&&(b.so=!0)}return a}));p.enter().append("path").classed("point",!0),p.exit().remove(),p.call(a.translatePoints,o,s)}function l(t,e,r,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,f=a.bPos,p=a.bPosPxOffset||0,h=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+f,!0),i=c.l2p(e-o)+p,a=c.l2p(e+s)+p,d=u?(i+a)/2:c.l2p(e)+p,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),y=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+i+"V"+a+("sd"===h?"m0,0L"+g+","+d+"L"+m+","+i+"L"+y+","+d+"Z":"")):n.select(this).attr("d","M"+i+","+m+"H"+a+("sd"===h?"m0,0L"+d+","+g+"L"+i+","+m+"L"+d+","+y+"Z":""))}))}e.exports={plot:function(t,e,r,a){var c=e.xaxis,u=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(t){var e,r,i=n.select(this),a=t[0],f=a.t,p=a.trace;(f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty)?i.remove():("h"===p.orientation?(e=u,r=c):(e=c,r=u),o(i,{pos:e,val:r},p,f),s(i,{x:c,y:u},p,f),l(i,{pos:e,val:r},p,f))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":385,"../../lib":525,"@plotly/d3":54}],702:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,P=E>0?Math.ceil:Math.floor,O=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,D=C(S+L),R=P(z-L),F=[[f=M(S)]];for(a=D;a*E=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],716:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,c,u,f,p,h,d,m,g,y,v,b=t["_"+e],x=t[e+"axis"],_=x._gridlines=[],w=x._minorgridlines=[],A=x._boundarylines=[],k=t["_"+r],T=t[r+"axis"];"array"===x.tickmode&&(x.tickvals=b.slice());var M=t._xctrl,S=t._yctrl,z=M[0].length,E=M.length,L=t._a.length,C=t._b.length;n.prepTicks(x),"array"===x.tickmode&&delete x.tickvals;var P=x.smoothing?3:1;function O(n){var i,a,o,s,l,c,u,f,h,d,m,g,y=[],v=[],b={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(C-2,a))),s=a-o,b.length=C,b.crossLength=L,b.xy=function(e){return t.evalxy([],e,a)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(h=t.dxydi([],i-1,o,0,s),y.push(l[0]+h[0]/3),v.push(l[1]+h[1]/3),d=t.dxydi([],i-1,o,1,s),y.push(f[0]-d[0]/3),v.push(f[1]-d[1]/3)),y.push(f[0]),v.push(f[1]),l=f;else for(i=t.a2i(n),c=Math.floor(Math.max(0,Math.min(L-2,i))),u=i-c,b.length=L,b.crossLength=C,b.xy=function(e){return t.evalxy([],i,e)},b.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),y.push(f[0]-g[0]/3),v.push(f[1]-g[1]/3)),y.push(f[0]),v.push(f[1]),l=f;return b.axisLetter=e,b.axis=x,b.crossAxis=T,b.value=n,b.constvar=r,b.index=p,b.x=y,b.y=v,b.smoothing=T.smoothing,b}function I(n){var i,a,o,s,l,c=[],u=[],f={};if(f.length=b.length,f.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(C-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(e){return t.evalxy([],e,n)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ib.length-1||_.push(i(I(o),{color:x.gridcolor,width:x.gridwidth,dash:x.griddash}));for(p=u;pb.length-1||m<0||m>b.length-1))for(g=b[s],y=b[m],a=0;ab[b.length-1]||w.push(i(O(d),{color:x.minorgridcolor,width:x.minorgridwidth,dash:x.minorgriddash}));x.startline&&A.push(i(I(0),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&A.push(i(I(b.length-1),{color:x.endlinecolor,width:x.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((b[b.length-1]-x.tick0)/x.dtick*(1+l)),Math.ceil((b[0]-x.tick0)/x.dtick/(1+l))].sort((function(t,e){return t-e})))[0],f=c[1],p=u;p<=f;p++)h=x.tick0+x.dtick*p,_.push(i(O(h),{color:x.gridcolor,width:x.gridwidth,dash:x.griddash}));for(p=u-1;pb[b.length-1]||w.push(i(O(d),{color:x.minorgridcolor,width:x.minorgridwidth,dash:x.minorgriddash}));x.startline&&A.push(i(O(b[0]),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&A.push(i(O(b[b.length-1]),{color:x.endlinecolor,width:x.endlinewidth}))}}},{"../../lib/extend":515,"../../plots/cartesian/axes":576}],717:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(h-=180,l=-l),{angle:h,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],731:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=c.strRotate,f=c.strTranslate,p=t("../../constants/alignment");function h(t,e,r,s,l,c){var u="const-"+l+"-lines",f=r.selectAll("."+u).data(c);f.enter().append("path").classed(u,!0).style("vector-effect","non-scaling-stroke"),f.each((function(r){var s=r,l=s.x,c=s.y,u=a([],l,t.c2p),f=a([],c,e.c2p),p="M"+o(u,f,s.smoothing);n.select(this).attr("d",p).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")})),f.exit().remove()}function d(t,e,r,a,o,c,p,h){var d=c.selectAll("text."+h).data(p);d.enter().append("text").classed(h,!0);var m=0,g={};return d.each((function(o,c){var p;if("auto"===o.axis.tickangle)p=s(a,e,r,o.xy,o.dxy);else{var h=(o.axis.tickangle+180)*Math.PI/180;p=s(a,e,r,o.xy,[Math.cos(h),Math.sin(h)])}c||(g={angle:p.angle,flip:p.flip});var d=(o.endAnchor?-1:1)*p.flip,y=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),v=i.bBox(this);y.attr("transform",f(p.p[0],p.p[1])+u(p.angle)+f(o.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+o.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,r,i){var l=e.xaxis,u=e.yaxis,f=t._fullLayout._clips;c.makeTraceGroups(i,r,"trace").each((function(e){var r=n.select(this),i=e[0],p=i.trace,m=p.aaxis,g=p.baxis,v=c.ensureSingle(r,"g","minorlayer"),b=c.ensureSingle(r,"g","majorlayer"),x=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",p.opacity),h(l,u,b,m,"a",m._gridlines),h(l,u,b,g,"b",g._gridlines),h(l,u,v,m,"a",m._minorgridlines),h(l,u,v,g,"b",g._minorgridlines),h(l,u,x,m,"a-boundary",m._boundarylines),h(l,u,x,g,"b-boundary",g._boundarylines);var w=d(t,l,u,p,i,_,m._labels,"a-label"),A=d(t,l,u,p,i,_,g._labels,"b-label");!function(t,e,r,n,i,a,o,l){var u,f,p,h,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),g=c.aggNums(Math.min,null,r.b),v=c.aggNums(Math.max,null,r.b);u=.5*(d+m),f=g,p=r.ab2xy(u,f,!0),h=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,i,a,p,r.dxydb_rough(u,f)));y(t,e,r,n,p,h,r.aaxis,i,a,o,"a-title"),u=d,f=.5*(g+v),p=r.ab2xy(u,f,!0),h=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,i,a,p,r.dxyda_rough(u,f)));y(t,e,r,n,p,h,r.baxis,i,a,l,"b-title")}(t,_,p,i,l,u,w,A),function(t,e,r,n,i){var s,l,u,f,p=r.select("#"+t._clipPathId);p.size()||(p=r.append("clipPath").classed("carpetclip",!0));var h=c.ensureSingle(p,"path","carpetboundary"),d=e.clipsegments,m=[];for(f=0;f90&&v<270,x=n.select(this);x.text(p.title.text).call(l.convertToTspans,t),b&&(_=(-l.lineCount(x)+g)*m*a-_),x.attr("transform",f(e.p[0],e.p[1])+u(e.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,p.title.font)})),x.exit().remove()}},{"../../components/drawing":385,"../../constants/alignment":479,"../../lib":525,"../../lib/svg_text_utils":551,"./makepath":728,"./map_1d_array":729,"./orient_text":730,"@plotly/d3":54}],732:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,f=t.aaxis,p=t.baxis,h=e[0],d=e[c-1],m=r[0],g=r[u-1],y=e[e.length-1]-e[0],v=r[r.length-1]-r[0],b=y*n.RELATIVE_CULL_TOLERANCE,x=v*n.RELATIVE_CULL_TOLERANCE;h-=b,d+=b,m-=x,g+=x,t.isVisible=function(t,e){return t>h&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,f.smoothing,p.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,f.smoothing,p.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,p.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,p.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,p,h,d,m=0,g=0,y=[];ne[c-1]?(f=c-2,p=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):p=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(h=u-2,d=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):d=s-(h=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(y,f,h,p,d),l[0]+=y[0]*m,l[1]+=y[1]*m),g&&(t.dxydj(y,f,h,p,d),l[0]+=y[0]*g,l[1]+=y[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":545,"./compute_control_points":720,"./constants":721,"./create_i_derivative_evaluator":722,"./create_j_derivative_evaluator":723,"./create_spline_evaluator":724}],733:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function f(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",k,"after",T,"iterations"),t}},{"../../lib":525}],734:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":525}],735:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":362,"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/template_attributes":652,"../scattergeo/attributes":990}],736:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var f=0;f")}(t,f,o),[t]}},{"../../lib":525,"../../plots/cartesian/axes":576,"./attributes":735}],740:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":608,"../heatmap/colorbar":814,"./attributes":735,"./calc":736,"./defaults":737,"./event_data":738,"./hover":739,"./plot":741,"./select":742,"./style":743}],741:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],i=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?a.extractTraceFeature(t):o(r,i.topojson),f=[],p=[],h=0;h=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":630,"./convert":745}],749:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652,"../mesh3d/attributes":886}],750:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":h>c&&(n.prefixBoundary=!0);break;case"<":(hc||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(h[0],h[1]),p=Math.max(h[0],h[1]),fc&&(n.prefixBoundary=!0)}}}},{}],757:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("./make_color_map"),a=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=i(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:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":375,"./end_plus":765,"./make_color_map":770}],758:[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}}},{}],759:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var p,h,d,m=e.contours,g=r("contours.operation");(m._operation=c[g],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,m),"="===g?p=m.showlines=!0:(p=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),p)&&(h=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,h,f)}},{"../../components/color":363,"../../constants/filter_ops":483,"./label_defaults":769,"fast-isnumeric":186}],760:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":483,"fast-isnumeric":186}],761:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],762:[function(t,e,r){"use strict";var n=t("../../lib");function i(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,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":525,"./constraint_mapping":760,"./end_plus":765}],765:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],766:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(f,r,e),h=[s(t,e,[-p[0],-p[1]])],d=t.z.length,m=t.z[0].length,g=e.slice(),y=p.slice();for(c=0;c<1e4;c++){if(f>20?(f=i.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],t.crossings[u]=i.SADDLEREMAINDER[f]):delete t.crossings[u],!(p=i.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}h.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],u=e.join(","),a(h[h.length-1],h[h.length-2],o,l)&&h.pop();var v=p[0]&&(e[0]<0||e[0]>m-2)||p[1]&&(e[1]<0||e[1]>d-2);if(e[0]===g[0]&&e[1]===g[1]&&p[0]===y[0]&&p[1]===y[1]||r&&v)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I=a(h[0],h[h.length-1],o,l),D=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((b=F[c])=B&&b+F[x]M&&S--,t.edgepaths[S]=E.concat(h,z));break}U||(t.edgepaths[M]=h.concat(z))}for(M=0;Mt?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,a,o,s,l,c,u,f,p=t[0].z,h=p.length,d=p[0].length,m=2===h||2===d;for(r=0;r=0&&(n=v,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,s>=0)break;f+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}p=s,(d=-1===h.indexOf(p))&&(p=h[0],f+="Z")}for(p=0;pn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),h=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*o);if(p<1||h<1)return 1/0;var d=y.EDGECOST*(1/(p-1)+1/(h-1));d+=y.ANGLECOST*c*c;for(var m=s-u,g=l-f,v=s+u,b=l+f,x=0;x2*y.MAXCOST)break;h&&(s/=2),l=(o=c-s/2)+1.5*s}if(p<=y.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),f=Math.cos(c),p=function(t,e){return[s+t*f-e*u,l+t*u+e*f]},h=[p(-a/2,-o/2),p(-a/2,o/2),p(a/2,o/2),p(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(h)},r.drawLabels=function(t,e,r,a,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.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,p=t._input.contours;if(u>f&&(r.start=p.start=f,f=r.end=p.end=u,u=r.start),!(r.size>0))c=u===f?1:a(u,f,t.ncontours).dtick,p.size=r.size=c}}},{"../../lib":525,"../../plots/cartesian/axes":576}],774:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,a=r.contours,s=r.line,l=a.size||1,c=a.start,u="constraint"===a.type,f=!u&&"lines"===a.coloring,p=!u&&"fill"===a.coloring,h=f||p?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?h(t.level):s.color,s.dash)}));var d=a.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(f?h(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(p){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),h(t.level+.5*l)})),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",h(m-.5*l))}})),a(t)}},{"../../components/drawing":385,"../heatmap/style":824,"./make_color_map":770,"@plotly/d3":54}],775:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":373,"./label_defaults":769}],776:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../contour/attributes":754,"../heatmap/attributes":811}],777:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),f=t("../carpet/lookup_carpetid"),p=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=f(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var h=t.data[r.index],d=t.data[e.index];d.a||(d.a=h.a),d.b||(d.b=h.b),u(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,u,f,p,h,d,m,g=e._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,i.isArray1D(e.z)&&a(e,y,v,"a","b",["z"]);r=e._a=e._a||e.a,p=e._b=e._b||e.b,r=r?y.makeCalcdata(e,"_a"):[],p=p?v.makeCalcdata(e,"_b"):[],u=e.a0||0,f=e.da||1,h=e.b0||0,d=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(m),s(m,e._emptypoints);var b=i.maxRowLength(m),x="scaled"===e.xtype?"":r,_=c(e,x,u,f,b,y),w="scaled"===e.ytype?"":p,A=c(e,w,h,d,m.length,v),k={a:_,b:A,z:m};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:m,containerStr:"",cLetter:"z"});return[k]}(t,e);return p(e,e._z),m}}},{"../../components/colorscale/calc":371,"../../lib":525,"../carpet/lookup_carpetid":727,"../contour/set_contours":773,"../heatmap/clean_2d_array":813,"../heatmap/convert_column_xyz":815,"../heatmap/find_empties":817,"../heatmap/interp2d":820,"../heatmap/make_bound_array":822,"./defaults":778}],778:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,a,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":525,"../contour/constraint_defaults":759,"../contour/contours_defaults":761,"../contour/style_defaults":775,"../heatmap/xyz_defaults":826,"./attributes":776}],779:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":588,"../contour/colorbar":757,"../contour/style":774,"./attributes":776,"./calc":777,"./defaults":778,"./plot":780}],780:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../carpet/map_1d_array"),a=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),f=t("../contour/constants"),p=t("../contour/convert_to_constraints"),h=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),m=t("../carpet/lookup_carpetid"),g=t("../carpet/axis_aligned_line");function y(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function v(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function b(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,x){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(x,r,"contour").each((function(r){var x=n.select(this),A=r[0],k=A.trace,T=k._carpetTrace=m(t,k),M=t.calcdata[T.index][0];if(T.visible&&"legendonly"!==T.visible){var S=A.a,z=A.b,E=k.contours,L=h(E,e,A),C="constraint"===E.type,P=E._operation,O=C?"="===P?"lines":"fill":E.coloring,I=[[S[0],z[z.length-1]],[S[S.length-1],z[z.length-1]],[S[S.length-1],z[0]],[S[0],z[0]]];l(L);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(z[z.length-1]-z[0]);c(L,D,R);var F,B,N,j,V=L;"constraint"===E.type&&(V=p(L,P)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r=0;j--)F=M.clipsegments[j],B=i([],F.x,_.c2p),N=i([],F.y,w.c2p),B.reverse(),N.reverse(),U.push(a(B,N,F.bicubic));var H="M"+U.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,f,p,h=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);h.enter().append("path"),h.exit().remove();var d=[];for(p=0;p=0&&(p=E,d=m):Math.abs(f[1]-p[1])=0&&(p=E,d=m):s.log("endpt to newendpt is not vert. or horz.",f,p,E)}if(d>=0)break;v+=S(f,p),f=p}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(x=-1===b.indexOf(u))&&(u=b[0],v+=S(f,p)+"Z",f=null)}for(u=0;ug&&(n.max=g);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/P),f.LABELMAX),a=0;a0?+h[u]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var x=o.extractOpts(e),_=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=_[0][1],A=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(u=1;u<_.length;u++)A.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],x.min,0,x.max,1];return i.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(x.max-x.min),"heatmap-color":A,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:f},c.heatmap.layout.visibility="visible",c}},{"../../components/color":363,"../../components/colorscale":375,"../../constants/numerical":487,"../../lib":525,"../../lib/geojson_utils":519,"fast-isnumeric":186}],784:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":373,"../../lib":525,"./attributes":781}],785:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],786:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover").hoverPoints,a=t("../scattermapbox/hover").getExtraText;e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var f=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(f,f.c2l(u.z),"hover").text}return s.extraText=a(c,u,l[0].t.labels),[s]}}},{"../../plots/cartesian/axes":576,"../scattermapbox/hover":1021}],787:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":630,"./convert":783}],789:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),l.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(i))return i;if(n(a)&&o)return a}(u,p),[l]}}},{"../../components/color":363,"../../lib":525,"../bar/hover":674}],797:[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"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":588,"../bar/select":679,"./attributes":790,"./calc":791,"./cross_trace_calc":793,"./defaults":794,"./event_data":795,"./hover":796,"./layout_attributes":798,"./layout_defaults":799,"./plot":800,"./style":801}],798:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],799:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":363,"../../components/drawing":385,"../../constants/interactions":486,"../bar/style":681,"../bar/uniform_text":683,"@plotly/d3":54}],802:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":515,"../../plots/attributes":572,"../../plots/domain":603,"../../plots/template_attributes":652,"../pie/attributes":922}],803:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":638}],804:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":924}],805:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}var u=c("labels"),f=c("values"),p=s(u,f),h=p.len;if(e._hasLabels=p.hasLabels,e._hasValues=p.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),h){e._length=h,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,m=c("text"),g=c("texttemplate");if(g||(d=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||d&&"none"!==d){var y=c("textposition");o(t,e,l,c,y,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":525,"../../plots/domain":603,"../bar/defaults":671,"../pie/defaults":925,"./attributes":802}],806:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":933,"./attributes":802,"./base_plot":803,"./calc":804,"./defaults":805,"./layout_attributes":807,"./layout_defaults":808,"./plot":809,"./style":810}],807:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":929}],808:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":525,"./layout_attributes":807}],809:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../../lib"),o=a.strScale,s=a.strTranslate,l=t("../../lib/svg_text_utils"),c=t("../bar/plot").toMoveInsideBar,u=t("../bar/uniform_text"),f=u.recordMinTextSize,p=u.clearMinTextSize,h=t("../pie/helpers"),d=t("../pie/plot"),m=d.attachFxHandlers,g=d.determineInsideTextFont,y=d.layoutAreas,v=d.prerenderTitles,b=d.positionTitleOutside,x=d.formatSliceLabel;function _(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._context.staticPlot,u=t._fullLayout;p("funnelarea",u),v(e,t),y(e,u._size),a.makeTraceGroups(u._funnelarealayer,e,"trace").each((function(e){var p=n.select(this),d=e[0],y=d.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o=Math.pow(i,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var f,p,h=[];for(h.push(u()),f=t.length-1;f>-1;f--)if(!(p=t[f]).hidden){var d=p.v/l;c+=d,h.push(u())}var m=1/0,g=-1/0;for(f=0;f-1;f--)if(!(p=t[f]).hidden){var T=h[k+=1][0],M=h[k][1];p.TL=[-T,M],p.TR=[T,M],p.BL=w,p.BR=A,p.pxmid=(S=p.TR,z=p.BR,[.5*(S[0]+z[0]),.5*(S[1]+z[1])]),w=p.TL,A=p.TR}var S,z}(e),p.each((function(){var p=n.select(this).selectAll("g.slice").data(e);p.enter().append("g").classed("slice",!0),p.exit().remove(),p.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=y.index;var p=d.cx,v=d.cy,b=n.select(this),w=b.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),b.call(m,t,e);var A="M"+(p+o.TR[0])+","+(v+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",A),x(t,o,d);var k=h.castOption(y.textposition,o.pts),T=b.selectAll("g.slicetext").data(o.text&&"none"!==k?[0]:[]);T.enter().append("g").classed("slicetext",!0),T.exit().remove(),T.each((function(){var r=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=a.ensureUniformFontSize(t,g(y,o,u.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,h).call(l.convertToTspans,t);var d,m,b,x=i.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+v,w=Math.max(o.TL[1],o.TR[1])+v;m=Math.max(o.TL[0],o.BL[0])+p,b=Math.min(o.TR[0],o.BR[0])+p,(d=c(m,b,_,w,x,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=h.size,f(y.type,d,u),e[s].transform=d,a.setTransormAndDisplay(r,d)}))}}));var v=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var e=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),r=y.title.text;y._meta&&(r=a.templateString(r,y._meta)),e.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,y.title.font).call(l.convertToTspans,t);var c=b(d,u._size);e.attr("transform",s(c.x,c.y)+o(Math.min(1,c.scale))+s(c.tx,c.ty))}))}))}))}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../bar/plot":678,"../bar/uniform_text":683,"../pie/helpers":927,"../pie/plot":931,"@plotly/d3":54}],810:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../pie/style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");a(t,e,"funnelarea"),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(i,t,e)}))}))}},{"../bar/uniform_text":683,"../pie/style_one":933,"@plotly/d3":54}],811:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../lib/extend").extendFlat;e.exports=u({z:{valType:"data_array",editType:"calc"},x:u({},n.x,{impliedEdits:{xtype:"array"}}),x0:u({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:u({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:u({},n.y,{impliedEdits:{ytype:"array"}}),y0:u({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:u({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:u({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:u({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:u({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:u({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:u({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:u({},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"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:a({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:u({},i.showlegend,{dflt:!1})},{transforms:void 0},c("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/font_attributes":604,"../../plots/template_attributes":652,"../scatter/attributes":948}],812:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),f=t("./interp2d"),p=t("./find_empties"),h=t("./make_bound_array"),d=t("../../constants/numerical").BADNUM;function m(t){for(var e=[],r=t.length,n=0;nD){O("x scale is not linear");break}}if(b.length&&"fast"===C){var R=(b[b.length-1]-b[0])/(b.length-1),F=Math.abs(R/100);for(k=0;kF){O("y scale is not linear");break}}}var B=i.maxRowLength(A),N="scaled"===e.xtype?"":r,j=h(e,N,g,y,B,M),V="scaled"===e.ytype?"":b,U=h(e,V,x,_,A.length,S);L||(e._extremes[M._id]=a.findExtremes(M,j),e._extremes[S._id]=a.findExtremes(S,U));var H={x:j,y:U,z:A,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&v&&(H.orig_x=v),e.yperiodalignment&&w&&(H.orig_y=w),N&&N.length===j.length-1&&(H.xCenter=N),V&&V.length===U.length-1&&(H.yCenter=V),E&&(H.xRanges=T.xRanges,H.yRanges=T.yRanges,H.pts=T.pts),z||l(t,e,{vals:A,cLetter:"z"}),z&&e.contours&&"heatmap"===e.contours.coloring){var q={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};H.xfill=h(q,N,g,y,B,M),H.yfill=h(q,V,x,_,A.length,S)}return[H]}},{"../../components/colorscale/calc":371,"../../constants/numerical":487,"../../lib":525,"../../plots/cartesian/align_period":573,"../../plots/cartesian/axes":576,"../../registry":657,"../histogram2d/calc":845,"./clean_2d_array":813,"./convert_column_xyz":815,"./find_empties":817,"./interp2d":820,"./make_bound_array":822}],813:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,f,p;function h(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(a=p[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],p.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":525}],818:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l){l||(l={});var c,u,f,p,h=l.isContour,d=t.cd[0],m=d.trace,g=t.xa,y=t.ya,v=d.x,b=d.y,x=d.z,_=d.xCenter,w=d.yCenter,A=d.zmask,k=m.zhoverformat,T=v,M=b;if(!1!==t.index){try{f=Math.round(t.index[1]),p=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=x[0].length||p<0||p>x.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1],0)>0||n.inbox(r-b[0],r-b[b.length-1],0)>0)return;if(h){var S;for(T=[2*v[0]-v[1]],S=1;Sm&&(y=Math.max(y,Math.abs(t[a][o]-d)/(g-m))))}return y}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":525}],821:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){t("texttemplate");var r=n.extendFlat({},e.font,{color:"auto",size:"auto"});n.coerceFont(t,"textfont",r)}},{"../../lib":525}],822:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,f=[],p=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!h&&"category"!==s.type){var m=e.length;if(!(m<=o))return p?e.slice(0,o):e.slice(0,o+1);if(p||d)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;u0;)_=w.c2p(R[S]),S--;for(_0;)M=A.c2p(F[S]),S--;if(MGt||Gt>A._length))for(z=Vt;zYt||Yt>w._length)){var Zt=u({x:Wt,y:qt},P,t._fullLayout);Zt.x=Wt,Zt.y=qt;var Xt=C.z[S][z];void 0===Xt?(Zt.z="",Zt.zLabel=""):(Zt.z=Xt,Zt.zLabel=s.tickText(Ft,Xt,"hover").text);var Jt=C.text&&C.text[S]&&C.text[S][z];void 0!==Jt&&!1!==Jt||(Jt=""),Zt.text=Jt;var Kt=l.texttemplateString(Dt,Zt,t._fullLayout._d3locale,Zt,P._meta||{});if(Kt){var Qt=Kt.split("
"),$t=Qt.length,te=0;for(E=0;E<$t;E++)te=Math.max(te,Qt[E].length);Ht.push({l:$t,c:te,t:Kt,x:Yt,y:Gt,z:Xt})}}}}var ee=P.textfont,re=ee.family,ne=ee.size,ie=t._fullLayout.font.size;if(!ne||"auto"===ne){var ae=1/0,oe=1/0,se=0,le=0;for(E=0;E0&&(a=!0);for(var l=0;la){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function h(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),c=d(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,p=-.1*e,h=t-p,d=r[0],m=r[1],g=Math.min(f(d+p,d+h,n,a),f(m+p,m+h,n,a)),y=Math.min(f(d+c,d+p,n,a),f(m+c,m+p,n,a));if(g>y&&yo){var v=s===i?1:6,b=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",v);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(B)&&(j=o.tickIncrement(j,x.size,!0,h)),I.start=r.l2r(j),F||i.nestedProperty(e,y+".start").set(I.start)}var V=x.end,U=r.r2l(O.end),H=void 0!==U;if((x.endFound||H)&&U!==r.r2l(V)){var q=H?U:i.aggNums(Math.max,null,d);I.end=r.l2r(q),H||i.nestedProperty(e,y+".start").set(I.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[y]=i.extendFlat({},e[y]||{}),delete e._input[G],delete e[G]),[I,d]}e.exports={calc:function(t,e){var r,a,h,d,m=[],g=[],y="h"===e.orientation,v=o.getFromId(t,y?e.yaxis:e.xaxis),b=y?"y":"x",x={x:"y",y:"x"}[b],_=e[b+"calendar"],w=e.cumulative,A=p(t,e,v,b),k=A[0],T=A[1],M="string"==typeof k.size,S=[],z=M?S:k,E=[],L=[],C=[],P=0,O=e.histnorm,I=e.histfunc,D=-1!==O.indexOf("density");w.enabled&&D&&(O=O.replace(/ ?density$/,""),D=!1);var R,F="max"===I||"min"===I?null:0,B=l.count,N=c[O],j=!1,V=function(t){return v.r2c(t,0,_)};for(i.isArrayOrTypedArray(e[x])&&"count"!==I&&(R=e[x],j="avg"===I,B=l[I]),r=V(k.start),h=V(k.end)+(r-o.tickIncrement(r,k.size,!1,_))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),Q=[],$=0,tt=K-1;for(r=0;r=$;r--)if(g[r]){tt=r;break}for(r=$;r<=tt;r++)if(n(m[r])&&n(g[r])){var et={p:m[r],s:g[r],b:0};w.enabled||(et.pts=C[r],W?et.ph0=et.ph1=C[r].length?T[C[r][0]]:m[r]:(e._computePh=!0,et.ph0=q(S[r]),et.ph1=q(S[r+1],!0))),Q.push(et)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,k.size,!1,_)-Q[0].p),s(Q,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(Q,e,X),Q},calcAllAutoBins:p}},{"../../lib":525,"../../plots/cartesian/axes":576,"../../registry":657,"../bar/arrays_to_calcdata":666,"./average":832,"./bin_functions":834,"./bin_label_vals":835,"./norm_functions":843,"fast-isnumeric":186}],837:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],838:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),a=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=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,p,h,d,m,g,y=e._histogramBinOpts={},v=[],b={},x=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function A(t,r,a){var o=t.uid+"__"+a;r||(r=o);var s=function(t,r){return i.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",c=y[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(y[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dS&&A.splice(S,A.length-S),M.length>S&&M.splice(S,M.length-S);var z=[],E=[],L=[],C="string"==typeof w.size,P="string"==typeof T.size,O=[],I=[],D=C?O:w,R=P?I:T,F=0,B=[],N=[],j=e.histnorm,V=e.histfunc,U=-1!==j.indexOf("density"),H="max"===V||"min"===V?null:0,q=a.count,G=o[j],W=!1,Y=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==V&&(W="avg"===V,q=a[V]);var J=w.size,K=b(w.start),Q=b(w.end)+(K-i.tickIncrement(K,J,!1,y))/1e6;for(r=K;r=0&&h=0&&d-1,flipY:E.tiling.flip.indexOf("y")>-1,orientation:E.tiling.orientation,pad:{inner:E.tiling.pad},maxDepth:E._maxDepth}).descendants(),I=1/0,D=-1/0;O.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(I=Math.min(I,e),D=Math.max(D,e))})),h=h.data(O,u.getPtId),E._maxVisibleLayers=isFinite(D)?D-I+1:0,h.enter().append("g").classed("slice",!0),A(h,!1,{},[m,g],b),h.order();var R=null;if(w&&M){var F=u.getPtId(M);h.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return R||{x0:0,x1:m,y0:0,y1:g}},N=h;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-E.tiling.pad),s._hoverY=v(P?s.y1-E.tiling.pad/2:s.y0+E.tiling.pad/2);var h=n.select(this),d=i.ensureSingle(h,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?d.transition().attrTween("d",(function(t){var e=k(t,!1,B(),[m,g],{orientation:E.tiling.orientation,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1});return function(t){return b(e(t))}})):d.attr("d",b),h.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),d.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p(s,r,E,e,z)||"";var A=i.ensureSingle(h,"g","slicetext"),M=i.ensureSingle(A,"text","",(function(t){t.attr("data-notex",1)})),O=i.ensureUniformFontSize(t,u.determineTextFont(E,s,z.font));M.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L?"start":"middle").call(a.font,O).call(o.convertToTspans,t),s.textBB=a.bBox(M.node()),s.transform=x(s,{fontSize:O.size}),s.transform.fontSize=O.size,w?M.transition().attrTween("transform",(function(t){var e=T(t,!1,B(),[m,g]);return function(t){return _(e(t))}})):M.attr("transform",_(s))})),R}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../sunburst/fx":1081,"../sunburst/helpers":1082,"../sunburst/plot":1086,"../treemap/constants":1105,"./partition":861,"./style":863,"@plotly/d3":54}],858:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":966,"./attributes":853,"./base_plot":854,"./calc":855,"./defaults":856,"./layout_attributes":859,"./layout_defaults":860,"./plot":862,"./style":863}],859:[function(t,e,r){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],860:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("iciclecolorway",e.colorway),r("extendiciclecolors")}},{"../../lib":525,"./layout_attributes":859}],861:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),i=t("../treemap/flip_tree");e.exports=function(t,e,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&i(f,e,{swapXY:s,flipX:a,flipY:o}),f}},{"../treemap/flip_tree":1110,"d3-hierarchy":111}],862:[function(t,e,r){"use strict";var n=t("../treemap/draw"),i=t("./draw_descendants");e.exports=function(t,e,r,a){return n(t,e,r,a,{type:"icicle",drawDescendants:i})}},{"../treemap/draw":1107,"./draw_descendants":857}],863:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");o(t,e,"icicle"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":363,"../../lib":525,"../bar/uniform_text":683,"@plotly/d3":54}],864:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,f=Math.floor((e-o.x0)/s.dx),p=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[p][f]:s._hasSource&&(u=s._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,p,1,1).data),u){var h,d=o.hi||s.hoverinfo;if(d){var m=d.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(h=!0)}var g,y=a.colormodel[s.colormodel],v=y.colormodel||s.colormodel,b=v.length,x=s._scaler(u),_=y.suffix,w=[];(s.hovertemplate||h)&&(w.push("["+[x[0]+_[0],x[1]+_[1],x[2]+_[2]].join(", ")),4===b&&w.push(", "+x[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=v.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[p])?g=s.hovertext[p][f]:Array.isArray(s.text)&&Array.isArray(s.text[p])&&(g=s.text[p][f]);var A=c.c2p(o.y0+(p+.5)*s.dy),k=o.x0+(f+.5)*s.dx,T=o.y0+(p+.5)*s.dy,M="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(t,{index:[p,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:A,y1:A,color:x,xVal:k,xLabelVal:k,yVal:T,yLabelVal:T,zLabelVal:M,text:g,hovertemplateLabels:{zLabel:M,colorLabel:w,"color[0]Label":x[0]+_[0],"color[1]Label":x[1]+_[1],"color[2]Label":x[2]+_[2],"color[3]Label":x[3]+_[3]}})]}}}},{"../../components/fx":403,"../../lib":525,"./constants":866}],871:[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":588,"./attributes":864,"./calc":865,"./defaults":867,"./event_data":868,"./hover":870,"./plot":872,"./style":873}],872:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.strTranslate,o=t("../../constants/xmlns_namespaces"),s=t("./constants"),l=i.isIOS()||i.isSafari()||i.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,f=e.yaxis,p=!(l||t._context._exportedPlot);i.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),l=e[0],c=l.trace,h=("fast"===c.zsmooth||!1===c.zsmooth&&p)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=h;var d,m,g,y,v,b,x=l.z,_=l.x0,w=l.y0,A=l.w,k=l.h,T=c.dx,M=c.dy;for(b=0;void 0===d&&b0;)m=u.c2p(_+b*T),b--;for(b=0;void 0===y&&b0;)v=f.c2p(w+b*M),b--;if(mP[0];if(O||I){var D=d+S/2,R=y+z/2;L+="transform:"+a(D+"px",R+"px")+"scale("+(O?-1:1)+","+(I?-1:1)+")"+a(-D+"px",-R+"px")+";"}}E.attr("style",L);var F=new Promise((function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===A&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=A,e.height=k;var r=e.getContext("2d",{willReadFrequently:!0});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=B((function(t,e){return x[e][t]})).toDataURL("image/png");else if(c._hasSource)if(h)t=c.source;else{var e=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,A,k).data;t=B((function(t,r){var n=4*(r*A+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}E.attr({"xlink:href":t,height:z,width:S,x:d,y:y})}));t._promises.push(F)}function B(t){var e=document.createElement("canvas");e.width=S,e.height=z;var r,n=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return i.constrain(Math.round(u.c2p(_+t*T)-d),0,S)},o=function(t){return i.constrain(Math.round(f.c2p(w+t*M)-y),0,z)},p=s.colormodel[c.colormodel],h=p.colormodel||c.colormodel,m=p.fmt;for(b=0;b0}function A(t){t.each((function(t){v.stroke(n.select(this),t.line.color)})).each((function(t){v.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),a={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(i,a,y,t,e)}return m(i,a,l,s,n),g(i,a,l,s),a}function T(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function M(t,e,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(h.convertToTspans,i).call(f.font,e),f.bBox(o.node())}function S(t,e,r,n,i,a){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=o.aggNums(a,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,m){var g,y=t._fullLayout;w(r)&&m&&(g=m()),o.makeTraceGroups(y._indicatorlayer,e,"trace").each((function(e){var m,z,E,L,C,P=e[0].trace,O=n.select(this),I=P._hasGauge,D=P._isAngular,R=P._isBullet,F=P.domain,B={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},N=B.l+B.w/2,j=B.t+B.h/2,V=Math.min(B.w/2,B.h),U=p.innerRadius*V,H=P.align||"center";if(z=j,I){if(D&&(m=N,z=j+V/2,E=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*U)}),R){var q=p.bulletPadding,G=1-p.bulletNumberDomainSize+q;m=B.l+(G+(1-G)*x[H])*B.w,E=function(t){return T(t,(p.bulletNumberDomainSize-q)*B.w,B.h)}}}else m=B.l+x[H]*B.w,E=function(t){return T(t,B.w,B.h)};!function(t,e,r,i){var c,u,p,m=r[0].trace,g=i.numbersX,y=i.numbersY,A=m.align||"center",T=b[A],z=i.transitionOpts,E=i.onComplete,L=o.ensureSingle(e,"g","numbers"),C=[];m._hasNumber&&C.push("number");m._hasDelta&&(C.push("delta"),"left"===m.delta.position&&C.reverse());var P=L.selectAll("text").data(C);function O(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}P.enter().append("text"),P.attr("text-anchor",(function(){return T})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var I,D=m.mode+m.align;m._hasDelta&&(I=function(){var e=k(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},c=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},p=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(r[0]));var g=L.select("text.delta");function y(){g.text(c(l(r[0]),i)).call(v.fill,p(r[0])).call(h.convertToTspans,t)}return g.call(f.font,m.delta.font).call(v.fill,p({delta:m._deltaLastValue})),w(z)?g.transition().duration(z.duration).ease(z.easing).tween("text",(function(){var t=n.select(this),e=l(r[0]),o=m._deltaLastValue,s=O(m.delta.valueformat,i,o,e),u=a(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(v.fill,p({delta:u(e)}))}})).each("end",(function(){y(),E&&E()})).each("interrupt",(function(){y(),E&&E()})):y(),u=M(c(l(r[0]),i),m.delta.font,T,t),g}(),D+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,D+=m.delta.increasing.symbol+m.delta.decreasing.symbol,p=u);m._hasNumber&&(!function(){var e=k(t,{tickformat:m.number.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=L.select("text.number");function u(){var e="number"==typeof r[0].y?s+i(r[0].y)+o:"-";l.text(e).call(f.font,m.number.font).call(h.convertToTspans,t)}w(z)?l.transition().duration(z.duration).ease(z.easing).each("end",(function(){u(),E&&E()})).each("interrupt",(function(){u(),E&&E()})).attrTween("text",(function(){var t=n.select(this),e=a(r[0].lastY,r[0].y);m._lastValue=r[0].y;var l=O(m.number.valueformat,i,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}})):u(),c=M(s+i(r[0].y)+o,m.number.font,T,t)}(),D+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,p=c);if(m._hasDelta&&m._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],N=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*m.delta.font.size;"left"===m.delta.position&&(R=S(m,"deltaPos",0,-1*(c.width*x[m.align]+u.width*(1-x[m.align])+j),D,Math.min),F=B[1]-N[1],p={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=S(m,"deltaPos",0,c.width*(1-x[m.align])+u.width*x[m.align]+j,D,Math.max),F=B[1]-N[1],p={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,p={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,p={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),I.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&L.attr("transform",(function(){var t=i.numbersScaler(p);D+=t[2];var e,r=S(m,"numbersScale",1,t[0],D,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?y-r*p.bottom:y-r*(p.top+p.bottom)/2,m._numbersTop=r*p.top+e;var n=p[A];"center"===A&&(n=(p.left+p.right)/2);var a=g-r*n;return a=S(m,"numbersTranslate",0,a,D,Math.max),l(a,e)+s(r)}))}(t,O,e,{numbersX:m,numbersY:z,numbersScaler:E,transitionOpts:r,onComplete:g}),I&&(L={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},C={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var W=O.selectAll("g.angular").data(D?e:[]);W.exit().remove();var Y=O.selectAll("g.angularaxis").data(D?e:[]);Y.exit().remove(),D&&function(t,e,r,a){var o,s,f,p,h=r[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,b=a.gaugeOutline,x=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,T=a.layer,M=a.transitionOpts,S=a.onComplete,z=Math.PI/2;function E(t){var e=h.gauge.axis.range[0],r=(t-e)/(h.gauge.axis.range[1]-e)*Math.PI-z;return r<-z?-z:r>z?z:r}function L(t){return n.svg.arc().innerRadius((y+g)/2-t/2*(g-y)).outerRadius((y+g)/2+t/2*(g-y)).startAngle(-z)}function C(t){t.attr("d",(function(t){return L(t.thickness).startAngle(E(t.range[0])).endAngle(E(t.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(x[0],x[1])),T.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),T.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,h.gauge.axis)).type="linear",o.range=h.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},O={},I=d.makeLabelFns(o,0).labelStandoff;O.xFn=function(t){var e=P(t);return Math.cos(e)*I},O.yFn=function(t){var e=P(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(I+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},O.anchorFn=function(t){var e=P(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},O.heightFn=function(t,e,r){var n=P(t);return-.5*(1+Math.sin(n))*r};var D=function(t){return l(x[0]+g*Math.cos(t),x[1]-g*Math.sin(t))};f=function(t){return D(P(t))};if(s=d.calcTicks(o),p=d.getTickSigns(o)[2],o.visible){p="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:T,path:"M"+p*R+",0h"+p*o.ticklen,transFn:function(t){var e=P(t);return D(e)+"rotate("+-c(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:T,transFn:f,labelFns:O})}var F=[v].concat(h.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(C).call(A),B.exit().remove();var N=L(h.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([h.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var V=j.select("path");w(M)?(V.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(U=N,H=E(r[0].lastY),q=E(r[0].y),function(){var t=i(H,q);return function(e){return U.endAngle(t(e))()}})),h._lastValue=r[0].y):V.attr("d","number"==typeof r[0].y?N.endAngle(E(r[0].y)):"M0,0Z");var U,H,q;V.call(A),j.exit().remove(),F=[];var G=h.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:h.gauge.threshold.color,line:{color:h.gauge.threshold.line.color,width:h.gauge.threshold.line.width},thickness:h.gauge.threshold.thickness});var W=_.selectAll("g.threshold-arc").data(F);W.enter().append("g").classed("threshold-arc",!0).append("path"),W.select("path").call(C).call(A),W.exit().remove();var Y=_.selectAll("g.gauge-outline").data([b]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(C).call(A),Y.exit().remove()}(t,0,e,{radius:V,innerRadius:U,gauge:W,layer:Y,size:B,gaugeBg:L,gaugeOutline:C,transitionOpts:r,onComplete:g});var Z=O.selectAll("g.bullet").data(R?e:[]);Z.exit().remove();var X=O.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,s,c,u=r[0].trace,f=n.gauge,h=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,b=u.domain,x=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(y.l,y.t)),h.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),h.selectAll("g.xbulletaxistick,path,text").remove();var T=y.h,M=u.gauge.bar.thickness*T,S=b.x[0],z=b.x[0]+(b.x[1]-b.x[0])*(u._hasNumber||u._hasDelta?1-p.bulletNumberDomainSize:1);(i=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,z],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),s=d.getTickSigns(i)[2],c=y.t+y.h,i.visible&&(d.drawTicks(t,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:h,path:d.makeTickPath(i,c,s),transFn:o}),d.drawLabels(t,i,{vals:a,layer:h,transFn:o,labelFns:d.makeLabelFns(i,c)}));function E(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*T})).attr("height",(function(t){return t.thickness*T}))}var L=[m].concat(u.gauge.steps),C=f.selectAll("g.bg-bullet").data(L);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(E).call(A),C.exit().remove();var P=f.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(T-M)/2).call(A),w(x)?P.select("rect").transition().duration(x.duration).ease(x.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var O=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),I=f.selectAll("g.threshold-bullet").data(O);I.enter().append("g").classed("threshold-bullet",!0).append("line"),I.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*T).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*T).call(v.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),I.exit().remove();var D=f.selectAll("g.gauge-outline").data([g]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(E).call(A),D.exit().remove()}(t,0,e,{gauge:Z,layer:X,size:B,gaugeBg:L,gaugeOutline:C,transitionOpts:r,onComplete:g});var J=O.selectAll("text.title").data(e);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?b.right:b[P.title.align]})).text(P.title.text).call(f.font,P.title.font).call(h.convertToTspans,t),J.attr("transform",(function(){var t,e=B.l+B.w*x[P.title.align],r=p.titlePadding,n=f.bBox(J.node());if(I){if(D)if(P.gauge.axis.visible)t=f.bBox(Y.node()).top-r-n.bottom;else t=B.t+B.h/2-V/2-n.bottom-r;R&&(t=z-(n.top+n.bottom)/2,e=B.l-p.bulletPadding*B.w)}else t=P._numbersTop-r-n.bottom;return l(e,t)}))}))}},{"../../components/color":363,"../../components/drawing":385,"../../constants/alignment":479,"../../lib":525,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"../../plots/cartesian/axis_defaults":578,"../../plots/cartesian/layout_attributes":589,"../../plots/cartesian/position_defaults":592,"./constants":877,"@plotly/d3":54,"d3-interpolate":112}],881:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plot_api/edit_types":558,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652,"../mesh3d/attributes":886}],882:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){L();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[h]:E(d,m,y);p[h]=b>-1?b:P(d,m,y,R(e,v))}i=p[0],a=p[1],o=p[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function B(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(z-S);return t>=S-e&&t<=z+e}function V(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function U(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,i),N(e[1][3],n,i),N(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):a<3&&U(t,e,r,S,z,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],p=e[a[2]],h=B(p,u,n,i),d=B(p,f,n,i);o=l(t,[d,h,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,f,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],p=e[a[2]],h=B(f,u,n,i),d=B(p,u,n,i);o=l(t,[d,h,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function H(t,e,r,n){var i=!1,a=V(e),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],p=a[l[3]];if(m)i=F(t,[c,u,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var h=B(p,c,r,n),d=B(p,u,r,n),g=B(p,f,r,n);i=F(null,[h,d,g],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],p=a[l[3]],h=B(f,c,r,n),d=B(f,u,r,n),g=B(p,u,r,n),y=B(p,c,r,n);m?(i=F(t,[c,y,h],[e[l[0]],-1,-1])||i,i=F(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[h,d,g,y],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],p=a[l[3]],h=B(u,c,r,n),d=B(f,c,r,n),g=B(p,c,r,n);m?(i=F(t,[c,h,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,h],[e[l[0]],-1,-1])||i):i=F(null,[h,d,g],[-1,-1,-1])||i,s=!0}})),i)}function q(t,e,r,n,i,a,o,s,l,c,u){var f=!1;return d&&(D(t,"A")&&(f=H(null,[e,r,n,a],c,u)||f),D(t,"B")&&(f=H(null,[r,n,i,l],c,u)||f),D(t,"C")&&(f=H(null,[r,a,o,l],c,u)||f),D(t,"D")&&(f=H(null,[n,a,s,l],c,u)||f),D(t,"E")&&(f=H(null,[r,n,a,l],c,u)||f)),m&&(f=H(t,[r,n,a,l],c,u)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||U(t,V([e,r,n]),[e,r,n],a,o),!0===s[1]||U(t,V([n,i,e]),[n,i,e],a,o)]}function W(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function Y(t,e,r,n,i,a,o){var s,l,c,u,f=!1,p=function(){f=U(t,[s,l,c],[-1,-1,-1],i,a)||f,f=U(t,[c,u,s],[-1,-1,-1],i,a)||f},h=o[0],d=o[1],m=o[2];return h&&(s=O(V([k(e,r-0,n-0)])[0],V([k(e-1,r-0,n-0)])[0],h),l=O(V([k(e,r-0,n-1)])[0],V([k(e-1,r-0,n-1)])[0],h),c=O(V([k(e,r-1,n-1)])[0],V([k(e-1,r-1,n-1)])[0],h),u=O(V([k(e,r-1,n-0)])[0],V([k(e-1,r-1,n-0)])[0],h),p()),d&&(s=O(V([k(e-0,r,n-0)])[0],V([k(e-0,r-1,n-0)])[0],d),l=O(V([k(e-0,r,n-1)])[0],V([k(e-0,r-1,n-1)])[0],d),c=O(V([k(e-1,r,n-1)])[0],V([k(e-1,r-1,n-1)])[0],d),u=O(V([k(e-1,r,n-0)])[0],V([k(e-1,r-1,n-0)])[0],d),p()),m&&(s=O(V([k(e-0,r-0,n)])[0],V([k(e-0,r-0,n-1)])[0],m),l=O(V([k(e-0,r-1,n)])[0],V([k(e-0,r-1,n-1)])[0],m),c=O(V([k(e-1,r-1,n)])[0],V([k(e-1,r-1,n-1)])[0],m),u=O(V([k(e-1,r-0,n)])[0],V([k(e-1,r-0,n-1)])[0],m),p()),f}function Z(t,e,r,n,i,a,o,s,l,c,u,f){var p=t;return f?(d&&"even"===t&&(p=null),q(p,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(p=null),q(p,l,s,o,a,i,n,r,e,c,u))}function X(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(d-M)?[T,d]:[d,M];$(e,A[0],A[1])}}var E=[[Math.min(S,M),Math.max(S,M)],[Math.min(T,z),Math.max(T,z)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(h.id),"x"===e?f.push([h.distRatio,0,0]):"y"===e?f.push([0,h.distRatio,0]):f.push([0,0,h.distRatio]))}else c=nt(1,"x"===e?x-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),c.length>0&&(r[i]="x"===e?X(null,c,a,o,r[i]):"y"===e?J(null,c,a,o,r[i]):K(null,c,a,o,r[i]),i++)}var d=t.caps[e];d.show&&d.fill&&(I(d.fill),r[i]="x"===e?X(null,[0,x-1],a,o,r[i]):"y"===e?J(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===g&&C(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=y,t._Ys=v,t._Zs=b}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:p,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../../stackgl_modules":1151,"../../components/colorscale":375,"../../lib/gl_format_color":521,"../../lib/str2rgbarray":550,"../../plots/gl3d/zip3":628}],884:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),f=a("z"),p=a("value");c&&c.length&&u&&u.length&&f&&f.length&&p&&p.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":373,"../../lib":525,"../../registry":657,"./attributes":881}],885:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":617,"./attributes":881,"./calc":882,"./convert":883,"./defaults":884}],886:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652,"../surface/attributes":1088}],887:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":371}],888:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_mesh3d,i=t("../../../stackgl_modules").delaunay_triangulate,a=t("../../../stackgl_modules").alpha_shape,o=t("../../../stackgl_modules").convex_hull,s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var p=f.prototype;function h(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}p.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},p.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,p=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=u(m(t.i),m(t.j),m(t.k))}else n=0===t.alphahull?o(p):t.alphahull>0?a(t.alphahull,p):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;oy):g=T>w,y=T;var M=c(w,A,k,T);M.pos=_,M.yc=(w+T)/2,M.i=x,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[k,A],v&&(M.orig_p=r[x]),d&&(M.tx=e.text[x]),m&&(M.htx=e.hovertext[x]),b.push(M)}else b.push({pos:_,empty:!0})}return e._extremes[l._id]=a.findExtremes(l,n.concat(p,f),{padded:!0}),b.length&&(b[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),b}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),s=function(t,e,r){var i=r._minDiff;if(!i){var a,s=t._fullData,l=[];for(i=1/0,a=0;a"+c.labels[b]+n.hoverLabelText(s,x,l.yhoverformat):((v=i.extendFlat({},p)).y0=v.y1=_,v.yLabelVal=x,v.yLabel=c.labels[b]+n.hoverLabelText(s,x,l.yhoverformat),v.name="",f.push(v),g[x]=v)}return f}function p(t,e,r,i){var a=t.cd,o=t.ya,l=a[0].trace,f=a[0].t,p=u(t,e,r,i);if(!p)return[];var h=a[p.index],d=p.index=h.i,m=h.dir;function g(t){return f.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var y=h.hi||l.hoverinfo,v=y.split("+"),b="all"===y,x=b||-1!==v.indexOf("y"),_=b||-1!==v.indexOf("text"),w=x?[g("open"),g("high"),g("low"),g("close")+" "+c[m]]:[];return _&&s(h,l,w),p.extraText=w.join("
"),p.y0=p.y1=o.c2p(h.yc,!0),[p]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?f(t,e,r,n):p(t,e,r,n)},hoverSplit:f,hoverOnPoints:p}},{"../../components/color":363,"../../components/fx":403,"../../constants/delta.js":481,"../../lib":525,"../../plots/cartesian/axes":576}],895:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":588,"./attributes":891,"./calc":892,"./defaults":893,"./hover":894,"./plot":897,"./select":898,"./style":899}],896:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var f=Math.min(s.length,l.length,c.length,u.length);return o&&(f=Math.min(f,i.minRowLength(o))),e._length=f,f}}},{"../../lib":525,"../../registry":657}],897:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],a=r.t;if(!0!==r.trace.visible||a.empty)e.remove();else{var c=a.tickLen,u=e.selectAll("path").data(i.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}},{"../../lib":525,"@plotly/d3":54}],898:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,f){function p(r,i){return n.coerce(t,e,l,r,i)}var h=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,f,p);o(e,f,p),Array.isArray(h)&&h.length||(e.visible=!1),c(e,h,"values",d),p("hoveron"),p("hovertemplate"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var m={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(p,"labelfont",m);var g={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(p,"tickfont",g)}},{"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"../../lib":525,"../../plots/array_container_defaults":571,"../../plots/domain":603,"../parcoords/merge_length":916,"./attributes":900}],904:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":900,"./base_plot":901,"./calc":902,"./defaults":903,"./plot":906}],905:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-interpolate").interpolateNumber,a=t("../../plot_api/plot_api"),o=t("../../components/fx"),s=t("../../lib"),l=s.strTranslate,c=t("../../components/drawing"),u=t("tinycolor2"),f=t("../../lib/svg_text_utils");function p(t,e,r,i){var a=e._context.staticPlot,o=t.map(F.bind(0,e,r)),u=i.selectAll("g.parcatslayer").data([null]);u.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var p=u.selectAll("g.trace.parcats").data(o,h),v=p.enter().append("g").attr("class","trace parcats");p.attr("transform",(function(t){return l(t.x,t.y)})),v.append("g").attr("class","paths");var b=p.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),h);b.attr("fill",(function(t){return t.model.color}));var w=b.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);_(w),b.attr("d",(function(t){return t.svgD})),w.empty()||b.sort(m),b.exit().remove(),b.on("mouseover",g).on("mouseout",y).on("click",x),v.append("g").attr("class","dimensions");var T=p.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),h);T.enter().append("g").attr("class","dimension"),T.attr("transform",(function(t){return l(t.x,0)})),T.exit().remove();var M=T.selectAll("g.category").data((function(t){return t.categories}),h),S=M.enter().append("g").attr("class","category");M.attr("transform",(function(t){return l(0,t.y)})),S.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),A(S);var z=M.selectAll("rect.bandrect").data((function(t){return t.bands}),h);z.each((function(){s.raiseToTop(this)})),z.attr("fill",(function(t){return t.color}));var I=z.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);z.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),k(I),z.exit().remove(),S.append("text").attr("class","catlabel").attr("pointer-events","none");var D=e._fullLayout.paper_bgcolor;M.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(D)).style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){c.font(n.select(this),t.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),e)})),S.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){c.font(n.select(this),t.parcatsViewModel.labelfont)})),M.selectAll("rect.bandrect").on("mouseover",E).on("mouseout",L),M.exit().remove(),T.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",C).on("drag",P).on("dragend",O)),p.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),p.exit().remove()}function h(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function m(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),E=n.mouse(f)[0];o.loneHover({trace:p,x:x-d.left+m.left,y:_-d.top+m.top,text:z,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:A,idealAlign:E1&&p.displayInd===f.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},b=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&b.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&b.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var x=b.join("
");return{trace:h,x:o*(i-e.left),y:s*(d-e.top),text:x,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:v,eventData:[{data:h._input,fullData:h,count:m,category:g,probability:y}]}}function E(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron;if("color"===l?(!function(t){var e=n.select(t).datum(),r=T(e);w(r),r.each((function(){s.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=T(t);w(e),e.each((function(){s.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),M(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===l?e=z(r,a,this):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),f=c.categoryViewModel,p=f.parcatsViewModel,h=p.model.dimensions[f.model.dimensionInd],d=p.trace,m=l.y+l.height/2;p.dimensions.length>1&&h.displayInd===p.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=f.model.categoryLabel,y=c.parcatsViewModel.model.count,v=0;c.categoryViewModel.bands.forEach((function(t){t.color===c.color&&(v+=t.count)}));var b=f.model.count,x=0;p.pathSelection.each((function(t){t.model.color===c.color&&(x+=t.model.count)}));var _=v/y,w=v/x,A=v/b,k={countLabel:y,categoryLabel:g,probabilityLabel:_.toFixed(3)},T=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&T.push(["Count:",k.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(T.push("P(color \u2229 "+g+"): "+k.probabilityLabel),T.push("P("+g+" | color): "+w.toFixed(3)),T.push("P(color | "+g+"): "+A.toFixed(3)));var M=T.join("
"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:_,categorycount:b,colorcount:x,bandcolorcount:v}]}}(r,a,this):"dimension"===l&&(e=function(t,e,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(z(t,e,this))})),i}(r,a,this)),e&&o.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r})}}function L(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(_(e.pathSelection),A(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(m),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):M(this,"plotly_unhover",n.event)}}function C(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var p=t.parcatsViewModel.dimensions[r],h=t.parcatsViewModel.dimensions[i];void 0!==p&&a.model.dragXh.x&&(a.model.displayInd=h.model.displayInd,h.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}j(t.parcatsViewModel),N(t.parcatsViewModel),R(t.parcatsViewModel),D(t.parcatsViewModel)}}function O(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=I(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),f=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[f],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):M(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),N(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){R(t.parcatsViewModel,!0),D(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function I(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),u+="l-"+r[s]+",0 ";return u+="Z"}function N(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function f(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=f(e),i=f(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var p=new Array(c.length),h=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(y.count/h):0;for(var v,b=new Array(n.length),x=0;x1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],f=t.model.maxCats,p=e.categories.length,h=e.count,d=t.height-8*(f-1),m=8*(f-p)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/h*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){p(r,t,n,e)}},{"../../components/drawing":385,"../../components/fx":403,"../../lib":525,"../../lib/svg_text_utils":551,"../../plot_api/plot_api":562,"@plotly/d3":54,"d3-interpolate":112,tinycolor2:309}],906:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},{"./parcats":905}],907:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plot_api/plot_template":565,"../../plots/cartesian/layout_attributes":589,"../../plots/domain":603,"../../plots/font_attributes":604}],908:[function(t,e,r){"use strict";var n=t("./constants"),i=t("@plotly/d3"),a=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=t("../../lib").strTranslate,c=n.bar.snapRatio;function u(t,e){return t*(1-c)+e*c}var f=n.bar.snapClose;function p(t,e){return t*(1-f)+e*f}function h(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*fe){p=r;break}}if(a=u,isNaN(a)&&(a=isNaN(f)||isNaN(p)?isNaN(f)?p:f:e-c[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var g=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&v<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),x(t.parentNode)}function A(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",(function(t){i.event.preventDefault(),t.parent.inBrushDrag||A(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||v()})).call(i.behavior.drag().on("dragstart",(function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(A(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,v(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),x(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?x(t.parentNode,s):(s(),x(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function T(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(T)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,r){var i=t.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e,r){var i=r._context.staticPlot,a=t.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(d).call(m).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(k).attr("height",(function(t){return t.height-n.verticalPadding}));var s=t.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(t){return t.height})).call(b);var c=t.selectAll(".highlight").data(o);c.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(b)}(i,e,r)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?S(t.sort(T)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[h(0,r,t[0],[]),h(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":525,"../../lib/gup":522,"./constants":912,"@plotly/d3":54}],909:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":907,"./base_plot":910,"./calc":911,"./defaults":913}],910:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":488,"../../plots/get_data":612,"./plot":919,"@plotly/d3":54}],911:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale"),a=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),d.splice(f));var m=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:h}),g=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(m)&&m.length||(e.visible=!1),p(e,m,"values",g);var y={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",y),n.coerceFont(u,"tickfont",y),n.coerceFont(u,"rangefont",y),u("labelangle"),u("labelside"),u("unselected.line.color"),u("unselected.line.opacity")}},{"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"../../lib":525,"../../plots/array_container_defaults":571,"../../plots/cartesian/axes":576,"../../plots/domain":603,"./attributes":907,"./axisbrush":908,"./constants":912,"./merge_length":916}],914:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":525}],915:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function p(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[i].dim1.canvasX,o=i);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var h=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&no._length&&(S=S.slice(0,o._length));var E,L=o.tickvals;function C(t,e){return{val:t,text:E[e]}}function P(t,e){return t.val-e.val}if(Array.isArray(L)&&L.length){E=o.ticktext,Array.isArray(E)&&E.length?E.length>L.length?E=E.slice(0,L.length):L.length>E.length&&(L=L.slice(0,E.length)):E=L.map(a(o.tickformat));for(var O=1;O=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,p={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==N&&(u?a.hover(p):a.unhover&&a.unhover(p),N=f)}})),B.style("opacity",(function(t){return t.pick?0:1})),h.style("background","rgba(255, 255, 255, 0)");var j=h.selectAll("."+v.cn.parcoords).data(F,d);j.exit().remove(),j.enter().append("g").classed(v.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var V=j.selectAll("."+v.cn.parcoordsControlView).data(m,d);V.enter().append("g").classed(v.cn.parcoordsControlView,!0),V.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var U=V.selectAll("."+v.cn.yAxis).data((function(t){return t.dimensions}),d);U.enter().append("g").classed(v.cn.yAxis,!0),V.each((function(t){O(U,t,A)})),B.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=x(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),U.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),U.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;R.linePickActive(!1),t.x=Math.max(-v.overdrag,Math.min(t.model.width+v.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,U.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),O(U,e,A),U.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",c(t.x,0)),U.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!z(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,O(U,e,A),n.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!z(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),R.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),U.exit().remove();var H=U.selectAll("."+v.cn.axisOverlays).data(m,d);H.enter().append("g").classed(v.cn.axisOverlays,!0),H.selectAll("."+v.cn.axis).remove();var q=H.selectAll("."+v.cn.axis).data(m,d);q.enter().append("g").classed(v.cn.axis,!0),q.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return y.isOrdinal(t)?e:I(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(q.selectAll("text"),t.model.tickFont)})),q.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),q.selectAll("text").style("text-shadow",u.makeTextShadow(T)).style("cursor","default");var G=H.selectAll("."+v.cn.axisHeading).data(m,d);G.enter().append("g").classed(v.cn.axisHeading,!0);var W=G.selectAll("."+v.cn.axisTitle).data(m,d);W.enter().append("text").classed(v.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),W.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=P(t.model.labelAngle,t.model.labelSide),r=v.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=P(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var Y=H.selectAll("."+v.cn.axisExtent).data(m,d);Y.enter().append("g").classed(v.cn.axisExtent,!0);var Z=Y.selectAll("."+v.cn.axisExtentTop).data(m,d);Z.enter().append("g").classed(v.cn.axisExtentTop,!0),Z.attr("transform",c(0,-v.axisExtentOffset));var X=Z.selectAll("."+v.cn.axisExtentTopText).data(m,d);X.enter().append("text").classed(v.cn.axisExtentTopText,!0).call(C),X.text((function(t){return D(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var J=Y.selectAll("."+v.cn.axisExtentBottom).data(m,d);J.enter().append("g").classed(v.cn.axisExtentBottom,!0),J.attr("transform",(function(t){return c(0,t.model.height+v.axisExtentOffset)}));var K=J.selectAll("."+v.cn.axisExtentBottomText).data(m,d);K.enter().append("text").classed(v.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(C),K.text((function(t){return D(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),b.ensureAxisBrush(H,T,t)}},{"../../components/colorscale":375,"../../components/drawing":385,"../../lib":525,"../../lib/gup":522,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"./axisbrush":908,"./constants":912,"./helpers":914,"./lines":915,"@plotly/d3":54,"color-rgba":87}],918:[function(t,e,r){"use strict";var n=t("./plot"),i=t("./regl_precompiled");Object.assign(n.reglPrecompiled,i),e.exports=n},{"./plot":919,"./regl_precompiled":920}],919:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl"),a=t("./helpers").isVisible,o={};function s(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var r=t._fullLayout;if(i(t,[],o)){var l={},c={},u={},f={},p=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=f[r]=n._fullInput.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()}));n(t,e,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{filterChanged:function(e,n,i){var a=c[e][n],o=i.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[s]){var p=a.constraintrange;l[s]=p||null}var h=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,h.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete h.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[f[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return s(t,e,r)-s(t,e,n)}}(r,c[e].filter(a));l[e].sort(n),c[e].filter((function(t){return!a(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[f[e]]])}})}}).reglPrecompiled=o},{"../../lib/prepare_regl":538,"./helpers":914,"./parcoords":917}],920:[function(t,e,r){"use strict";var n=t("../../generated/regl-codegen/453a70fefa48db31713162aeb1ac438cb8579f54504f3b23acf32128df3dfd45"),i=t("../../generated/regl-codegen/30680f8f6712ef1af5cf7547e0af35b036fb300c67b07967cf448492ff4de4d0"),a=t("../../generated/regl-codegen/a3970baf1d8cac9305ee830c7026550387343d4dde2353dd86a4d082c97d3470"),o=t("../../generated/regl-codegen/3fd666968f3ce90d1c048b7a9aab515f3ce387a5401a10f8b66121c9469d1c0d");e.exports={"453a70fefa48db31713162aeb1ac438cb8579f54504f3b23acf32128df3dfd45":n,"30680f8f6712ef1af5cf7547e0af35b036fb300c67b07967cf448492ff4de4d0":i,a3970baf1d8cac9305ee830c7026550387343d4dde2353dd86a4d082c97d3470:a,"3fd666968f3ce90d1c048b7a9aab515f3ce387a5401a10f8b66121c9469d1c0d":o}},{"../../generated/regl-codegen/30680f8f6712ef1af5cf7547e0af35b036fb300c67b07967cf448492ff4de4d0":491,"../../generated/regl-codegen/3fd666968f3ce90d1c048b7a9aab515f3ce387a5401a10f8b66121c9469d1c0d":493,"../../generated/regl-codegen/453a70fefa48db31713162aeb1ac438cb8579f54504f3b23acf32128df3dfd45":494,"../../generated/regl-codegen/a3970baf1d8cac9305ee830c7026550387343d4dde2353dd86a4d082c97d3470":499}],921:[function(t,e,r){"use strict";var n=t("./base_index");n.plot=t("./plot-strict"),e.exports=n},{"./base_index":909,"./plot-strict":918}],922:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),i=t("../../plots/domain").attributes,a=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=a({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:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({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:i({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:"angle",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":362,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/domain":603,"../../plots/font_attributes":604,"../../plots/template_attributes":652}],923:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":638}],924:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../../components/color"),o={};function s(t){return function(e,r){return!!e&&(!!(e=i(e)).isValid()&&(e=a.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function l(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r=0})),("funnelarea"===e.type?y:e.sort)&&a.sort((function(t,e){return e.v-t.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var c=0,u=0;u0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return i.coerce(t,e,a,r,n)}var u=l(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 p,h=c("text"),d=c("texttemplate");if(d||(p=c("textinfo",Array.isArray(h)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||p&&"none"!==p){var m=c("textposition");s(t,e,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(e,n,c);var g=c("hole");if(c("title.text")){var y=c("title.position",g?"middle center":"top center");g||"middle center"!==y||(e.title.position="top center"),i.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":525,"../../plots/domain":603,"../bar/defaults":671,"./attributes":922,"fast-isnumeric":186}],926:[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,bbox:t.bbox,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":399}],927:[function(t,e,r){"use strict";var n=t("../../lib");function i(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=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:f.hovertemplate||-1!==p.indexOf("name")?f.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,t.pts)||t.color,borderColor:g.castOption(_.bordercolor,t.pts),fontFamily:g.castOption(w.family,t.pts),fontSize:g.castOption(w.size,t.pts),fontColor:g.castOption(w.color,t.pts),nameLength:g.castOption(_.namelength,t.pts),textAlign:g.castOption(_.align,t.pts),hovertemplate:g.castOption(f.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[y(t,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:A}),t.bbox=A[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[y(t,f)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,i=e._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[y(o,i)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,i=e._fullData[c.index];e._dragging||!1===r.hovermode||(e._hoverdata=[y(t,i)],a.click(e,n.event))}))}function x(t,e,r){var n=g.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=g.castOption(t._input.textfont.color,e.pts));var i=g.castOption(t.insidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.insidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:i,size:a}}function _(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(f||h){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||f){var v=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||h)&&((a=A(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||p)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var b=0,x=0,_=0;_=1)break}return m[b]}function A(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:T(a,o/e),rotate:M(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:T(a,o/e),rotate:M(i+Math.PI/2)}}function T(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function z(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function E(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function L(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=P(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),f=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=C(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function C(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 P(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function O(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/i.aspectratio):(u=r.r,c=u*i.aspectratio),c*=(1+i.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var b=l.castOption(i,e.i,"texttemplate");if(b){var x=function(t){return{label:t.label,value:t.v,valueLabel:g.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:g.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(i,t.i,"customdata")}}(e),_=g.getFirstFilled(i.text,e.pts);(v(_)||""===_)&&(x.text=_),e.text=l.texttemplateString(b,x,t._fullLayout._d3locale,x,i._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._context.staticPlot,a=t._fullLayout,p=a._size;d("pie",a),_(e,t),O(e,p);var m=l.makeTraceGroups(a._pielayer,e,"trace").each((function(e){var d=n.select(this),m=e[0],y=m.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=g.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=z(r,i))}(e),d.attr("stroke-linejoin","round"),d.each((function(){var v=n.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var _=[[[],[]],[[],[]]],A=!1;v.each((function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=y.index,_[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var c=m.cx,u=m.cy,p=n.select(this),d=p.selectAll("path.surface").data([i]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),p.call(b,t,e),y.pull){var v=+g.castOption(y.pull,i.pts)||0;v>0&&(c+=v*i.pxmid[0],u+=v*i.pxmid[1])}i.cxFinal=c,i.cyFinal=u;var k=y.hole;if(i.v===m.vTotal){var T="M"+(c+i.px0[0])+","+(u+i.px0[1])+C(i.px0,i.pxmid,!0,1)+C(i.pxmid,i.px0,!0,1)+"Z";k?d.attr("d","M"+(c+k*i.px0[0])+","+(u+k*i.px0[1])+C(i.px0,i.pxmid,!1,k)+C(i.pxmid,i.px0,!1,k)+"Z"+T):d.attr("d",T)}else{var M=C(i.px0,i.px1,!0,1);if(k){var S=1-k;d.attr("d","M"+(c+k*i.px1[0])+","+(u+k*i.px1[1])+C(i.px1,i.px0,!1,k)+"l"+S*i.px0[0]+","+S*i.px0[1]+M+"Z")}else d.attr("d","M"+c+","+u+"l"+i.px0[0]+","+i.px0[1]+M+"Z")}D(t,i,m);var z=g.castOption(y.textposition,i.pts),L=p.selectAll("g.slicetext").data(i.text&&"none"!==z?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each((function(){var r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=l.ensureUniformFontSize(t,"outside"===z?function(t,e,r){var n=g.castOption(t.outsidetextfont.color,e.pts)||g.castOption(t.textfont.color,e.pts)||r.color,i=g.castOption(t.outsidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.outsidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(y,i,a.font):x(y,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,p).call(f.convertToTspans,t);var d,v=s.bBox(r.node());if("outside"===z)d=E(v,i);else if(d=w(v,i,m),"auto"===z&&d.scale<1){var b=l.ensureUniformFontSize(t,y.outsidetextfont);r.call(s.font,b),d=E(v=s.bBox(r.node()),i)}var _=d.textPosAngle,k=void 0===_?i.pxmid:I(m.r,_);if(d.targetX=c+k[0]*d.rCenter+(d.x||0),d.targetY=u+k[1]*d.rCenter+(d.y||0),R(d,v),d.outside){var T=d.targetY;i.yLabelMin=T-v.height/2,i.yLabelMid=T,i.yLabelMax=T+v.height/2,i.labelExtraX=0,i.labelExtraY=0,A=!0}d.fontSize=p.size,h(y.type,d,a),e[o].transform=d,l.setTransormAndDisplay(r,d)}))}function C(t,e,r,n){var a=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*m.r+","+n*m.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var k=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=l.templateString(i,y._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,y.title.font).call(f.convertToTspans,t),e="middle center"===y.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}}(m):L(m,p),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),A&&function(t,e){var r,n,i,a,o,s,l,c,u,f,p,h,d;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function y(t,e){return e.pxmid[1]-t.pxmid[1]}function v(t,r){r||(r={});var i,c,u,p,h=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,y=t.cyFinal+o(t.px0[1],t.px1[1]),v=h-d;if(v*l>0&&(t.labelExtraY=v),Array.isArray(e.pull))for(c=0;c=(g.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=v):(m+t.labelExtraY-y)*l>0&&(i=3*s*Math.abs(c-f.indexOf(t)),(p=u.cxFinal+a(u.px0[0],u.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=p)))}for(n=0;n<2;n++)for(i=n?m:y,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(i),u=t[1-n][r],f=u.concat(c),h=[],p=0;pMath.abs(f)?s+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(a+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(v,y),A&&y.automargin){var T=s.bBox(d.node()),M=y.domain,S=p.w*(M.x[1]-M.x[0]),z=p.h*(M.y[1]-M.y[0]),C=(.5*S-m.r)/p.w,P=(.5*z-m.r)/p.h;i.autoMargin(t,"pie."+y.uid+".automargin",{xl:M.x[0]-C,xr:M.x[1]+C,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(m.cx-m.r-T.left,0),r:Math.max(T.right-(m.cx+m.r),0),b:Math.max(T.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-T.top,0),pad:5})}}))}));setTimeout((function(){m.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:x,positionTitleOutside:L,prerenderTitles:_,layoutAreas:O,attachFxHandlers:b,computeTransform:R}},{"../../components/color":363,"../../components/drawing":385,"../../components/fx":403,"../../lib":525,"../../lib/svg_text_utils":551,"../../plots/plots":638,"../bar/constants":669,"../bar/uniform_text":683,"./event_data":926,"./helpers":927,"@plotly/d3":54}],932:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("./style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");a(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(i,t,e)}))}))}},{"../bar/uniform_text":683,"./style_one":933,"@plotly/d3":54}],933:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":363,"./helpers":927}],934:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":948}],935:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_pointcloud2d,i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,f=this.pickXYData=t.xy,p=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(f){if(n=f,e=f.length>>>1,p)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(h)r=h;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var m=i(t.marker.color),g=i(t.marker.border.color),y=t.opacity*t.marker.opacity;m[3]*=y,this.pointcloudOptions.color=m;var v=t.marker.blend;if(null===v){v=c.length<100||u.length<100}this.pointcloudOptions.blend=v,g[3]*=y,this.pointcloudOptions.borderColor=g;var b=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:A}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../../stackgl_modules":1151,"../../lib/str2rgbarray":550,"../../plots/cartesian/autorange":575,"../scatter/get_trace_color":958}],936:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),e._length=null}},{"../../lib":525,"./attributes":934}],937:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":615,"../scatter3d/calc":977,"./attributes":934,"./convert":935,"./defaults":936}],938:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,f=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,p=t("../../lib/extend").extendFlat,h=t("../../plot_api/edit_types").overrideAll;(e.exports=h({hoverinfo:p({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:p(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":362,"../../components/colorscale/attributes":370,"../../components/fx/attributes":394,"../../lib/extend":515,"../../plot_api/edit_types":558,"../../plot_api/plot_template":565,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/domain":603,"../../plots/font_attributes":604,"../../plots/template_attributes":652}],939:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../components/selections").prepSelect,u=t("../../lib"),f=t("../../registry");function p(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if(o&&"pan"!==i&&"zoom"!==i){s(o,a);var p={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},h={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:p,yaxis:h,fillRangeItems:u.noop},subplot:e,xaxes:[p],yaxes:[h],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;rv&&(v=a.source[e]),a.target[e]>v&&(v=a.target[e]);var b,x=v+1;t.node._count=x;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var A=_[e];for(b=0;b0&&s(z,x)&&s(E,x)&&(!w.hasOwnProperty(z)||!w.hasOwnProperty(E)||w[z]!==w[E])){w.hasOwnProperty(E)&&(E=w[E]),w.hasOwnProperty(z)&&(z=w[z]),E=+E,p[z=+z]=p[E]=!0;var L="";a.label&&a.label[e]&&(L=a.label[e]);var C=null;L&&h.hasOwnProperty(L)&&(C=h[L]),c.push({pointNumber:e,label:L,color:u?a.color[e]:a.color,customdata:f?a.customdata[e]:a.customdata,concentrationscale:C,source:z,target:E,value:+S}),M.source.push(z),M.target.push(E)}}var P=x+_.length,O=o(r.color),I=o(r.customdata),D=[];for(e=0;ex-1,childrenNodes:[],pointNumber:e,label:R,color:O?r.color[e]:r.color,customdata:I?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1}))}(P,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":375,"../../lib":525,"../../lib/gup":522,"strongly-connected-components":303}],941:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],942:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function f(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,p){function h(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(p.hoverlabel,t.hoverlabel),m=t.node,g=c.newContainer(e,"node");function y(t,e){return n.coerce(m,g,i.node,t,e)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",t.hoverinfo),l(m,g,y,d),y("hovertemplate");var v=p.colorway;y("color",g.label.map((function(t,e){return a.addOpacity(function(t){return v[t%v.length]}(e),.8)}))),y("customdata");var b=t.link||{},x=c.newContainer(e,"link");function _(t,e){return n.coerce(b,x,i.link,t,e)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(b,x,_,d),_("hovertemplate");var w,A=o(p.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(A,x.value.length)),_("customdata"),u(b,x,{name:"colorscales",handleItemDefaults:f}),s(e,p,h),h("orientation"),h("valueformat"),h("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),h("arrangement",w),n.coerceFont(h,"textfont",n.extendFlat({},p.font)),e._length=null}},{"../../components/color":363,"../../components/fx/hoverlabel_defaults":401,"../../lib":525,"../../plot_api/plot_template":565,"../../plots/array_container_defaults":571,"../../plots/domain":603,"./attributes":938,tinycolor2:309}],943:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":938,"./base_plot":939,"./calc":940,"./defaults":942,"./plot":944,"./select.js":946}],944:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("./render"),s=t("../../components/fx"),l=t("../../components/color"),c=t("./constants").cn,u=i._;function f(t){return""!==t}function p(t,e){return t.filter((function(t){return t.key===e.traceId}))}function h(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function m(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function y(t,e,r){e&&r&&p(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(b.bind(0,e,r,!1))}function v(t,e,r){e&&r&&p(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(x.bind(0,e,r,!1))}function b(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),i&&p(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&p(e,t).selectAll("."+c.sankeyNode).filter(g(t)).call(y)}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),i&&p(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&p(e,t).selectAll(c.sankeyNode).filter(g(t)).call(v)}function _(t,e){var r=t.hoverlabel||{},n=i.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,i=r._paper,p=r._size,m=0;m"),color:_(o,"bgcolor")||l.addOpacity(m.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:v,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});h(w,.85),d(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(v,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var a=r.node;a.originalEvent=n.event,t._hoverdata=[a],n.select(e).call(v,r,i),s.click(t,{target:!0})}}})}},{"../../components/color":363,"../../components/fx":403,"../../lib":525,"./constants":941,"./render":945,"@plotly/d3":54}],945:[function(t,e,r){"use strict";var n=t("d3-force"),i=t("d3-interpolate").interpolateNumber,a=t("@plotly/d3"),o=t("@plotly/d3-sankey"),s=t("@plotly/d3-sankey-circular"),l=t("./constants"),c=t("tinycolor2"),u=t("../../components/color"),f=t("../../components/drawing"),p=t("../../lib"),h=p.strTranslate,d=p.strRotate,m=t("../../lib/gup"),g=m.keyFun,y=m.repeat,v=m.unwrap,b=t("../../lib/svg_text_utils"),x=t("../../registry"),_=t("../../constants/alignment"),w=_.CAP_SHIFT,A=_.LINE_SPACING;function k(t,e,r){var n,i=v(e),a=i.trace,u=a.domain,f="h"===a.orientation,h=a.node.pad,d=a.node.thickness,m=t.width*(u.x[1]-u.x[0]),g=t.height*(u.y[1]-u.y[0]),y=i._nodes,b=i._links,x=i.circular;(n=x?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[m,g]:[g,m]).nodeWidth(d).nodePadding(h).nodeId((function(t){return t.pointNumber})).nodes(y).links(b);var _,w,A,k=n();for(var T in n.nodePadding()=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+h}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(y=k.nodes));n.update(k)}return{circular:x,key:r,trace:a,guid:p.randstr(),horizontal:f,width:m,height:g,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?g:m,dragPerpendicular:f?m:g,arrangement:a.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function T(t,e,r){var n=c(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:M,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function M(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r=t.width/2,n=t.circularPathData;return"top"===t.circularLinkType?"M "+(n.targetX-e)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"L"+(n.targetX-e)+" "+(n.targetY-r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-e)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"L"+(n.targetX-e)+" "+(n.targetY+r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var n=t.link.source.x1,a=t.link.target.x0-e,o=i(n,a),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,f=t.link.y1-t.link.width/2,p=t.link.y1+t.link.width/2,h="M"+n+","+c,d="C"+s+","+c+" "+l+","+f+" "+a+","+f,m="C"+l+","+p+" "+s+","+u+" "+n+","+u,g=e>0?"L"+(a+e)+","+(f+t.link.width/2):"";return h+d+(g+="L"+a+","+p)+m+"Z"}}function S(t,e){var r=c(e.color),n=l.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=p.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function z(t){t.attr("transform",(function(t){return h(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function E(t){t.call(z)}function L(t,e){t.call(E),e.attr("d",M())}function C(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function P(t){return t.link.width>1||t.linkLineWidth>0}function O(t){return h(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function I(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function D(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(p.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),p.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,i){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,a),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;el&&L[y].gap;)y--;for(b=L[y].s,m=L.length-1;m>y;m--)L[m].s=b;for(;lM[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],955:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),p=t("./line_defaults"),h=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults"),g=t("../../lib").coercePattern;e.exports=function(t,e,r,y){function v(r,i){return n.coerce(t,e,a,r,i)}var b=l(t,e,y,v);if(b||(e.visible=!1),e.visible){c(t,e,y,v),v("xhoverformat"),v("yhoverformat");var x=u(t,e,y,v),_=!x&&b=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.y)-m);return aY!=(N=I[P][1])>=Y&&(R=I[P-1][0],F=I[P][0],N-B&&(D=R+(F-R)*(Y-B)/(N-B),H=Math.min(H,D),q=Math.max(q,D)));H=Math.max(H,0),q=Math.min(q,p._length);var Z=s.defaultLine;return s.opacity(f.fillcolor)?Z=f.fillcolor:s.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:H,x1:q,y0:Y,y1:Y,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":363,"../../components/fx":403,"../../lib":525,"../../registry":657,"./get_trace_color":958}],960:[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":588,"./arrays_to_calcdata":947,"./attributes":948,"./calc":949,"./cross_trace_calc":953,"./cross_trace_defaults":954,"./defaults":955,"./format_labels":957,"./hover":959,"./marker_colorbar":966,"./plot":969,"./select":970,"./style":972,"./subtypes":973}],961:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){l||(l={});var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"../../lib":525}],962:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../../constants/numerical"),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,c=t("../../lib"),u=c.segmentsIntersect,f=c.constrain,p=t("./constants");e.exports=function(t,e){var r,i,o,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z=e.trace||{},E=e.xaxis,L=e.yaxis,C="log"===E.type,P="log"===L.type,O=E._length,I=L._length,D=e.backoff,R=z.marker,F=e.connectGaps,B=e.baseTolerance,N=e.shape,j="linear"===N,V=z.fill&&"none"!==z.fill,U=[],H=p.minTolerance,q=t.length,G=new Array(q),W=0;function Y(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),o=e.linearized?L.l2p(n.y):L.c2p(n.y);if(i===a){if(C&&(i=E.c2p(n.x,!0)),i===a)return!1;P&&o===a&&(i*=Math.abs(E._m*I*(E._m>0?s:l)/(L._m*O*(L._m>0?s:l)))),i*=1e3}if(o===a){if(P&&(o=L.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function Z(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function pt(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l);return s}}function ht(t){var e=t[0],r=t[1],n=e===G[W-1][0],i=r===G[W-1][1];if(!n||!i)if(W>1){var a=e===G[W-2][0],o=r===G[W-2][1];n&&(e===at||e===ot)&&a?o?W--:G[W-1]=t:i&&(r===st||r===lt)&&o?a?W--:G[W-1]=t:G[W++]=t}else G[W++]=t}function dt(t){G[W-1][0]!==t[0]&&G[W-1][1]!==t[1]&&ht([$,tt]),ht(t),et=null,$=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(W)if(et){var n=nt(et,e);n.length>1&&(dt(n[0]),G[W++]=n[1])}else rt=nt(G[W-1],e)[0],G[W++]=rt;else G[W++]=[K||e[0],Q||e[1]];var i=G[W-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?ht($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&ht([$,tt])),ht([K,Q])):$-K&&tt-Q&&ht([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&dt(nt(et,e)[0]),G[W++]=e;var a,o,s,l}for(r=0;rX(m,yt))break;o=m,(w=v[0]*y[0]+v[1]*y[1])>x?(x=w,h=m,g=!1):w<_&&(_=w,d=m,g=!0)}if(g?(gt(h),o!==d&>(d)):(d!==i&>(d),o!==h&>(h)),gt(o),r>=t.length||!m)break;gt(m),i=m}}else gt(h)}et&&ht([$||et[0],tt||et[1]]),U.push(G.slice(0,W))}var vt=N.slice(N.length-1);if(D&&"h"!==vt&&"v"!==vt){for(var bt=!1,xt=-1,_t=[],wt=0;wt=0?l=h:(l=h=p,p++),l0?Math.max(r,a):0}}},{"fast-isnumeric":186}],966:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],967:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":363,"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"./subtypes":973}],968:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":487,"../../lib":525}],969:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),p=t("../../lib/polygon").tester;function h(t,e,r,f,h,d,m){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),p=i[0].trace;if(!c.hasMarkers(p))return;var h=p.marker.maxdisplayed;if(0===h)return;var d=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),m=Math.ceil(d.length/h),g=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return y?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(d),k=o(A,"g","errorbars"),T=o(A,"g","lines"),M=o(A,"g","points"),S=o(A,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===_.visible){var z,E;v(A).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var C,P,O="",I=[],D=_._prevtrace;D&&(O=D._prevRevpath||"",E=D._nextFill,I=D._polygons);var R,F,B,N,j,V,U,H="",q="",G=[],W=a.noop;if(z=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=u(f,{xaxis:b,yaxis:x,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(f),t)v(r.style("opacity",0).attr("d",C).call(l.lineGroupStyle)).style("opacity",1);else{var i=v(r);i.attr("d",C),l.singleLineStyle(f,i)}}}}}var Y=T.selectAll(".js-line").data(G);v(Y.exit()).style("opacity",0).remove(),Y.each(W(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(Y,r.layerClipId,t),G.length?(z?(z.datum(f),N&&V&&(L?("y"===L?N[1]=V[1]=x.c2p(0,!0):"x"===L&&(N[0]=V[0]=b.c2p(0,!0)),v(z).attr("d","M"+V+"L"+N+"L"+H.substr(1)).call(l.singleFillStyle,t)):v(z).attr("d",H+"Z").call(l.singleFillStyle,t))):E&&("tonext"===_.fill.substr(0,6)&&H&&O?("tonext"===_.fill?v(E).attr("d",H+"Z"+O+"Z").call(l.singleFillStyle,t):v(E).attr("d",H+"L"+O.substr(1)+"Z").call(l.singleFillStyle,t),_._polygons=_._polygons.concat(I)):(X(E),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(z?X(z):E&&X(E),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),S.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),p=c.hasText(u),h=tt(u),d=et,m=et;if(f||p){var g=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?K:J:_&&!w&&(g=Q),f&&(d=g),p&&(m=g)}var A,k=(o=e.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);y&&k.call(l.pointStyle,u,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=v(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,u,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),y?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,h)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=v(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,S,f);var Z=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Z,t),l.setClipUrl(S,Z,t)}function X(t){v(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,p,d=!a,m=!!a&&a.duration>0,g=f(t,e,r);((u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),m)?(c&&(p=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){i.selectAll("g.trace").each((function(r,n){h(t,n,e,r,g,this,a)}))}))):u.each((function(r,n){h(t,n,e,r,g,this,a)}));d&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":385,"../../lib":525,"../../lib/polygon":537,"../../registry":657,"./line_points":962,"./link_traces":964,"./subtypes":973,"@plotly/d3":54}],970:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var p=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=p),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,p)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return h[t]}function A(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",p||h);for(var d=["x","y","z"],m=0;m<3;++m){var g="projection."+d[m];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(t,e,p||h||r,{axis:"z"}),y(t,e,p||h||r,{axis:"y",inherit:"z"}),y(t,e,p||h||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":525,"../../registry":657,"../scatter/line_defaults":961,"../scatter/marker_defaults":967,"../scatter/subtypes":973,"../scatter/text_defaults":974,"./attributes":976}],981:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":485,"../../plots/gl3d":617,"./attributes":976,"./calc":977,"./convert":979,"./defaults":980}],982:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/template_attributes":652,"../scatter/attributes":948}],983:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,p=e._length,h=new Array(p),d=!1;for(c=0;c")}return o}function v(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":525,"../scatter/hover":959}],988:[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:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":588,"../scatter/marker_colorbar":966,"../scatter/select":970,"../scatter/style":972,"./attributes":982,"./calc":983,"./defaults":984,"./event_data":985,"./format_labels":986,"./hover":987,"./plot":989}],989:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,f=i.getFromId(t,u.xaxis||"x"),p=i.getFromId(t,u.yaxis||"y"),h={xaxis:f,yaxis:p,plot:e.plot};for(s=0;s")}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":403,"../../constants/numerical":487,"../../lib":525,"../scatter/get_trace_color":958,"./attributes":990}],996:[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"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":608,"../scatter/marker_colorbar":966,"../scatter/style":972,"./attributes":990,"./calc":991,"./defaults":992,"./event_data":993,"./format_labels":994,"./hover":995,"./plot":997,"./select":998,"./style":999}],997:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,f=t("../scatter/subtypes"),p=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,i=t[0].trace,o=e[i.geo],f=o._subplot,p=i._length;if(Array.isArray(i.locations)){var h=i.locationmode,d="geojson-id"===h?s.extractTraceFeature(t):a(i,f.topojson);for(r=0;r=g,w=2*x,A={},k=l.makeCalcdata(e,"x"),T=v.makeCalcdata(e,"y"),M=s(e,l,"x",k),S=s(e,v,"y",T),z=M.vals,E=S.vals;e._x=z,e._y=E,e.xperiodalignment&&(e._origX=k,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=T,e._yStarts=S.starts,e._yEnds=S.ends);var L=new Array(w),C=new Array(x);for(r=0;r1&&i.extendFlat(s.line,h.linePositions(t,r,n));if(s.errorX||s.errorY){var l=h.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}s.text&&(i.extendFlat(s.text,{positions:n},h.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},h.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},h.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,L,z,E),I=d(t,b);return f(o,e),_?O.marker&&(P=O.marker.sizeAvg||Math.max(O.marker.size,3)):P=c(e,x),u(t,e,l,v,z,E,P),O.errorX&&y(e,l,O.errorX),O.errorY&&y(e,v,O.errorY),O.fill&&!I.fill2d&&(I.fill2d=!0),O.marker&&!I.scatter2d&&(I.scatter2d=!0),O.line&&!I.line2d&&(I.line2d=!0),!O.errorX&&!O.errorY||I.error2d||(I.error2d=!0),O.text&&!I.glText&&(I.glText=!0),O.marker&&(O.marker.snap=x),I.lineOptions.push(O.line),I.errorXOptions.push(O.errorX),I.errorYOptions.push(O.errorY),I.fillOptions.push(O.fill),I.markerOptions.push(O.marker),I.markerSelectedOptions.push(O.markerSel),I.markerUnselectedOptions.push(O.markerUnsel),I.textOptions.push(O.text),I.textSelectedOptions.push(O.textSel),I.textUnselectedOptions.push(O.textUnsel),I.selectBatch.push([]),I.unselectBatch.push([]),A._scene=I,A.index=I.count,A.x=z,A.y=E,A.positions=L,I.count++,[{x:!1,y:!1,t:A,trace:e}]}},{"../../constants/numerical":487,"../../lib":525,"../../plots/cartesian/align_period":573,"../../plots/cartesian/autorange":575,"../../plots/cartesian/axis_ids":580,"../scatter/calc":949,"../scatter/colorscale_calc":951,"./constants":1003,"./convert":1004,"./scene_update":1013,"@plotly/point-cluster":55}],1003:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],1004:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("svg-path-sdf"),a=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),p=t("../scatter/make_bubble_size_func"),h=t("./helpers"),d=t("./constants"),m=t("../../constants/interactions").DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=t("../../components/fx/helpers").appendArrayPointValue;function v(t,e){var r,i=t._fullLayout,a=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,p=o.family,h={},d=t._context.plotGlPixelRatio,m=e.texttemplate;if(m){h.text=[];var g=i._d3locale,v=Array.isArray(m),b=v?Math.min(m.length,a):a,x=v?function(t){return m[t]}:function(){return m};for(r=0;rd.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var p=n[0],h=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(c)?c.length>1?c[i]:c[0]:c,m=g[h],y=g[d],v=u?u/.8+1:0,b=-y*v-.5*y;o.offset[i]=[m*v/p,b/p]}}return o}}},{"../../components/drawing":385,"../../components/fx/helpers":399,"../../constants/interactions":486,"../../lib":525,"../../lib/gl_format_color":521,"../../plots/cartesian/axis_ids":580,"../../registry":657,"../scatter/make_bubble_size_func":965,"../scatter/subtypes":973,"./constants":1003,"./helpers":1008,"color-normalize":85,"fast-isnumeric":186,"svg-path-sdf":307}],1005:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),p=t("../scatter/line_defaults"),h=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,m){function g(r,i){return n.coerce(t,e,o,r,i)}var y=!!t.marker&&a.isOpenSymbol(t.marker.symbol),v=l.isBubble(t),b=c(t,e,m,g);if(b){u(t,e,m,g),g("xhoverformat"),g("yhoverformat");var x=b100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":1003}],1009:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,f=t.index,p={pointNumber:f,x:e[f],y:r[f]};p.tx=Array.isArray(o.text)?o.text[f]:o.text,p.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,p.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,p.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var h=o.textfont;h&&(p.ts=i.isArrayOrTypedArray(h.size)?h.size[f]:h.size,p.tc=Array.isArray(h.color)?h.color[f]:h.color,p.tf=Array.isArray(h.family)?h.family[f]:h.family);var d=o.marker;d&&(p.ms=i.isArrayOrTypedArray(d.size)?d.size[f]:d.size,p.mo=i.isArrayOrTypedArray(d.opacity)?d.opacity[f]:d.opacity,p.mx=i.isArrayOrTypedArray(d.symbol)?d.symbol[f]:d.symbol,p.ma=i.isArrayOrTypedArray(d.angle)?d.angle[f]:d.angle,p.mc=i.isArrayOrTypedArray(d.color)?d.color[f]:d.color);var m=d&&d.line;m&&(p.mlc=Array.isArray(m.color)?m.color[f]:m.color,p.mlw=i.isArrayOrTypedArray(m.width)?m.width[f]:m.width);var g=d&&d.gradient;g&&"none"!==g.type&&(p.mgt=Array.isArray(g.type)?g.type[f]:g.type,p.mgc=Array.isArray(g.color)?g.color[f]:g.color);var y=s.c2p(p.x,!0),v=l.c2p(p.y,!0),b=p.mrc||1,x=o.hoverlabel;x&&(p.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,p.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,p.hts=i.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,p.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,p.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,p.hnl=i.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(p.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(p.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=p;var k=o._origX,T=o._origY,M=i.extendFlat({},t,{color:a(o,p),x0:y-b,x1:y+b,xLabelVal:k?k[f]:p.x,y0:v-b,y1:v+b,yLabelVal:T?T[f]:p.y,cd:A,distance:c,spikeDistance:u,hovertemplate:p.ht});return p.htx?M.text=p.htx:p.tx?M.text=p.tx:o.text&&(M.text=o.text),i.fillText(p,o,M),n.getComponentMethod("errorbars","hoverInfo")(p,o,M),M}e.exports={hoverPoints:function(t,e,r,n){var i,a,s,l,c,u,f,p,h,d,m=t.cd,g=m[0].t,y=m[0].trace,v=t.xa,b=t.ya,x=g.x,_=g.y,w=v.c2p(e),A=b.c2p(r),k=t.distance;if(g.tree){var T=v.p2c(w-k),M=v.p2c(w+k),S=b.p2c(A-k),z=b.p2c(A+k);i="x"===n?g.tree.range(Math.min(T,M),Math.min(b._rl[0],b._rl[1]),Math.max(T,M),Math.max(b._rl[0],b._rl[1])):g.tree.range(Math.min(T,M),Math.min(S,z),Math.max(T,M),Math.max(S,z))}else i=g.ids;var E=k;if("x"===n){var L=!!y.xperiodalignment,C=!!y.yperiodalignment;for(u=0;u=Math.min(P,O)&&w<=Math.max(P,O)?0:1/0}if(f=Math.min(I,D)&&A<=Math.max(I,D)?0:1/0}d=Math.sqrt(f*f+p*p),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=x[a=i[u]],c=_[a],f=v.c2p(l)-w,p=b.c2p(c)-A,(h=Math.sqrt(f*f+p*p))v.glText.length){var A=_-v.glText.length;for(m=0;mr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var T=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(T)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=s.repeat(null,_),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,c=v.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(v.fillOrder[e]=u);var f,p,h=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(d[p+1]);)p-=2;0!==d[f+1]&&(h=[d[f],0]),h=h.concat(d.slice(f,p+2)),0!==d[p+1]&&(h=h.concat([d[p],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(d[p]);)p-=2;0!==d[f]&&(h=[0,d[f+1]]),h=h.concat(d.slice(f,p+2)),0!==d[p]&&(h=h.concat([0,d[p+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(h=[],i=0,t.splitNull=!0,a=0;a-1;for(m=0;m<_;m++){var E=r[m][0],L=E.trace,C=E.t,P=C.index,O=L._length,I=C.x,D=C.y;if(L.selectedpoints||S||z){if(S||(S=!0),L.selectedpoints){var R=v.selectBatch[P]=s.selIndices2selPoints(L),F={};for(g=0;g")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,u=o[0].trace,f=t.xa,p=t.ya,h=t.subplot,d=[],m=l+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=h.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),b=e-v;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-f.c2p([b,a]),c=o.y-p.c2p([n,r]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var x=o[t.index],_=x.lonlat,w=[i.modHalf(_[0],360)+v,_[1]],A=f.c2p(w),k=p.c2p(w),T=x.mrc||1;t.x0=A-T,t.x1=A+T,t.y0=k-T,t.y1=k+T;var M={};M[u.subplot]={_subplot:h};var S=u._module.formatLabels(x,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=a(u,x),t.extraText=c(u,x,o[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:c}},{"../../components/fx":403,"../../constants/numerical":487,"../../lib":525,"../../plots/mapbox/constants":630,"../scatter/get_trace_color":958}],1022:[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("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":632,"../scatter/marker_colorbar":966,"../scattergeo/calc":991,"./attributes":1016,"./defaults":1018,"./event_data":1019,"./format_labels":1020,"./hover":1021,"./plot":1023,"./select":1024}],1023:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(t,e,r,n){this.type="scattermapbox",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol",cluster:a+e+"-cluster",clusterCount:a+e+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(t,e,r){var i={type:"geojson",data:e.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom}),this.subplot.map.addSource(this.sourceIds[t],i)},l.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},l.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter),this.subplot.addLayer(n,r)},l.update=function(t){var e=t[0].trace,r=this.subplot,n=r.map,a=i(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),c=!!this.clusterEnabled,u=this;function f(t){c?function(t){for(var e=o.cluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(u.layerIds[i])}t||n.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=o.nonCluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(u.layerIds[i]),t||n.removeSource(u.sourceIds[i])}}(t)}function p(t){l?function(t){t||u.addSource("circle",a.circle,e.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,n,a,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,f=new s(t,l.uid,c,u),p=i(t.gd,e),h=f.below=t.belowLookup["trace-"+l.uid];if(c)for(f.addSource("circle",p.circle,l.cluster),r=0;r")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":959}],1030:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":641,"../scatter/marker_colorbar":966,"../scatter/select":970,"../scatter/style":972,"./attributes":1025,"./calc":1026,"./defaults":1027,"./format_labels":1028,"./hover":1029,"./plot":1031}],1031:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),o=e.xaxis,s=e.yaxis,l={xaxis:o,yaxis:s,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},c=e.radialAxis,u=e.angularAxis,f=0;f=c&&(v.marker.cluster=d.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=_),v.line&&_.length>1&&l.extendFlat(v.line,s.linePositions(t,h,_)),v.text&&(l.extendFlat(v.text,{positions:_},s.textPosition(t,h,v.text,v.marker)),l.extendFlat(v.textSel,{positions:_},s.textPosition(t,h,v.text,v.markerSel)),l.extendFlat(v.textUnsel,{positions:_},s.textPosition(t,h,v.text,v.markerUnsel))),v.fill&&!p.fill2d&&(p.fill2d=!0),v.marker&&!p.scatter2d&&(p.scatter2d=!0),v.line&&!p.line2d&&(p.line2d=!0),v.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(v.line),p.fillOptions.push(v.fill),p.markerOptions.push(v.marker),p.markerSelectedOptions.push(v.markerSel),p.markerUnselectedOptions.push(v.markerUnsel),p.textOptions.push(v.text),p.textSelectedOptions.push(v.textSel),p.textUnselectedOptions.push(v.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),d.x=w,d.y=A,d.rawx=w,d.rawy=A,d.r=g,d.theta=y,d.positions=_,d._scene=p,d.index=p.count,p.count++}})),a(t,e,r)}},e.exports.reglPrecompiled={}},{"../../lib":525,"../scattergl/constants":1003,"../scattergl/convert":1004,"../scattergl/plot":1010,"../scattergl/scene_update":1013,"@plotly/point-cluster":55,"fast-isnumeric":186}],1039:[function(t,e,r){"use strict";var n=t("./plot"),i=t("./regl_precompiled"),a=t("../scattergl/regl_precompiled");Object.assign(n.reglPrecompiled,i),Object.assign(n.reglPrecompiled,a),e.exports=n},{"../scattergl/regl_precompiled":1012,"./plot":1038,"./regl_precompiled":1040}],1040:[function(t,e,r){arguments[4][1012][0].apply(r,arguments)},{"../../generated/regl-codegen/3e771157d23b4793771f65d83e6387262ed73d488209157f19a7fa027bddd71b":492,"../../generated/regl-codegen/49e82bba439f1d9d441c17ba252d05640bc63fefdf22d1219993633af7730210":495,"../../generated/regl-codegen/6a5d6bd29c15cf7614221b94c3f384df47c2c46fbe4456e8c57b5cd14c84d923":496,"../../generated/regl-codegen/8902aff2b23b600f8103bcc84a8af2999d28795208aedadc2db06f921f9c7034":497,"../../generated/regl-codegen/8fad2284703471df7c0e0d0a7b96d983e8c53f6d707dd55d5921c1eab71f6623":498,"../../generated/regl-codegen/bfc540da96a87fcc039073cb37b45e6b81ef5ee6ef3529d726ceed8336354019":500,"../../generated/regl-codegen/cbf700f001fff25b649fba9c37fa0dc6631c1cdee318ad49473d28ec10dcee81":501,"../../generated/regl-codegen/db1b82c68771e7f5012fad1fbdae7ff23b526e58d2995bf6dd2cf30024e0f41d":502,"../../generated/regl-codegen/dbd1cc9126a137a605df67dc0706e55116f04e33b4545a80042031752de5aef5":503,"../../generated/regl-codegen/fe5b6844077cde1bdd7273f4495969fad93500c26a69b62e74ec2664c447bcc7":504,dup:1012}],1041:[function(t,e,r){arguments[4][1015][0].apply(r,arguments)},{"./base_index":1033,"./plot_strict":1039,dup:1015}],1042:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("../scatter/attributes"),s=t("../../plots/attributes"),l=o.line;e.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:i({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:a({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:a({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:a({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o.fillcolor,hoverinfo:a({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../lib/extend":515,"../../plots/attributes":572,"../../plots/template_attributes":652,"../scatter/attributes":948}],1043:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../scatter/colorscale_calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection"),l=t("../scatter/calc").calcMarkerSize;e.exports=function(t,e){for(var r=t._fullLayout,c=e.subplot,u=r[c].realaxis,f=r[c].imaginaryaxis,p=u.makeCalcdata(e,"real"),h=f.makeCalcdata(e,"imag"),d=e._length,m=new Array(d),g=0;g")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":959}],1047:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:t("../../plots/smith"),categories:["smith","symbols","showLegend","scatter-like"],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").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/smith":648,"../scatter/marker_colorbar":966,"../scatter/select":970,"../scatter/style":972,"./attributes":1042,"./calc":1043,"./defaults":1044,"./format_labels":1045,"./hover":1046,"./plot":1048}],1048:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM,a=t("../../plots/smith/helpers").smith;e.exports=function(t,e,r){for(var o=e.layers.frontplot.select("g.scatterlayer"),s=e.xaxis,l=e.yaxis,c={xaxis:s,yaxis:l,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},u=0;u"),o.hovertemplate=p.hovertemplate,a}function b(t,e){y.push(t._hovertitle+": "+e)}}},{"../scatter/hover":959}],1055:[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":653,"../scatter/marker_colorbar":966,"../scatter/select":970,"../scatter/style":972,"./attributes":1049,"./calc":1050,"./defaults":1051,"./event_data":1052,"./format_labels":1053,"./hover":1054,"./plot":1056}],1056:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=e.xaxis,o=e.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},l=e.layers.frontplot.select("g.scatterlayer"),c=0;cp?x.sizeAvg||Math.max(x.size,3):a(e,b),h=0;ha&&l||i-1,C=!0;if(o(b)||!!h.selectedpoints||L){var P=h._length;if(h.selectedpoints){m.selectBatch=h.selectedpoints;var O=h.selectedpoints,I={};for(l=0;l1&&(u=m[v-1],p=g[v-1],d=y[v-1]),e=0;eu?"-":"+")+"x")).replace("y",(f>p?"-":"+")+"y")).replace("z",(h>d?"-":"+")+"z");var E=function(){v=0,M=[],S=[],z=[]};(!v||v2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function h(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,f={};function d(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),y=d(e._Zs,"zaxis");if(f.meshgrid=[m,g,y],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var v=g[0],b=p(m),x=p(y),_=new Array(b.length*x.length),w=0,A=0;A=0};y?(r=Math.min(g.length,b.length),l=function(t){return T(g[t])&&M(t)},f=function(t){return String(g[t])}):(r=Math.min(v.length,b.length),l=function(t){return T(v[t])&&M(t)},f=function(t){return String(v[t])}),_&&(r=Math.min(r,x.length));for(var S=0;S1){for(var C=a.randstr(),P=0;P"),name:T||I("name")?v.name:void 0,color:k("hoverlabel.bgcolor")||b.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:T,hovertemplateLabels:C,eventData:l};g&&(F.x0=z-i.rInscribed*i.rpx1,F.x1=z+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),y&&(F.x=z,F.idealAlign=z<0?"left":"right");var B=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:B}),l[0].bbox=B[0],d._hasHoverLabel=!0}if(y){var N=t.select("path.surface");p.styleOne(N,i,v,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,v,p.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var i=r._fullLayout,a=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,p.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=t.select("path.surface");p.styleOne(l,s,a,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,a=r._fullData[d.index],s=g&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),h=c.isEntry(t)?c.findEntryWithChild(m,u):c.findEntryWithLevel(m,u),y=c.getPtId(h),v={points:[f(t,a,p.eventDataKeys)],event:n.event};s||(v.nextLevel=y);var b=l.triggerHandler(r,"plotly_"+d.type+"click",v);if(!1!==b&&e.hovermode&&(r._hoverdata=[f(t,a,p.eventDataKeys)],o.click(r,n.event)),!s&&!1!==b&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,e._tracePreGUI[a.uid],{level:a.level});var x={data:[{level:y}],traces:[d.index]},_={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),i.call("animate",r,x,_)}}))}},{"../../components/fx":403,"../../components/fx/helpers":399,"../../lib":525,"../../lib/events":514,"../../registry":657,"../pie/helpers":927,"./helpers":1082,"@plotly/d3":54}],1082:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var i=e?[n.data[e]]:[n];return r.listPath(n,e).concat(i)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":363,"../../lib":525,"../../lib/setcursor":546,"../pie/helpers":927}],1083:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":966,"./attributes":1076,"./base_plot":1077,"./calc":1078,"./defaults":1080,"./layout_attributes":1084,"./layout_defaults":1085,"./plot":1086,"./style":1087}],1084:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1085:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":525,"./layout_attributes":1084}],1086:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-hierarchy"),a=t("d3-interpolate").interpolate,o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../bar/uniform_text"),u=c.recordMinTextSize,f=c.clearMinTextSize,p=t("../pie/plot"),h=t("../pie/helpers").getRotationAngle,d=p.computeTransform,m=p.transformInsideText,g=t("./style").styleOne,y=t("../bar/style").resizeText,v=t("./fx"),b=t("./constants"),x=t("./helpers");function _(t,e,c,f){var p=t._context.staticPlot,y=t._fullLayout,_=!y.uniformtext.mode&&x.hasTransition(f),A=n.select(c).selectAll("g.slice"),k=e[0],T=k.trace,M=k.hierarchy,S=x.findEntryWithLevel(M,T.level),z=x.getMaxDepth(T),E=y._size,L=T.domain,C=E.w*(L.x[1]-L.x[0]),P=E.h*(L.y[1]-L.y[0]),O=.5*Math.min(C,P),I=k.cx=E.l+E.w*(L.x[1]+L.x[0])/2,D=k.cy=E.t+E.h*(1-L.y[0])-P/2;if(!S)return A.remove();var R=null,F={};_&&A.each((function(t){F[x.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&x.isEntry(t)&&(R=t)}));var B=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),N=S.height+1,j=0,V=z;k.hasMultipleRoots&&x.isHierarchyRoot(S)&&(B=B.slice(1),N-=1,j=1,V+=1),B=B.filter((function(t){return t.y1<=V}));var U=h(T.rotation);U&&B.forEach((function(t){t.x0+=U,t.x1+=U}));var H=Math.min(N,z),q=function(t){return(t-j)/H*O},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},W=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,I,D)},Y=function(t){return I+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Z=function(t){return D+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(A=A.data(B,x.getPtId)).enter().append("g").classed("slice",!0),_?A.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=x.getPtId(t),n=F[r],i=F[x.getPtId(S)];if(i){var o=(t.x1>i.x1?2*Math.PI:0)+U;e=t.rpx1X?2*Math.PI:0)+U;e={x0:i,x1:i}}else e={rpx0:O,rpx1:O},s.extendFlat(e,Q(t));else e={rpx0:0,rpx1:0};else e={x0:U,x1:U};return a(e,n)}(t);return function(t){return W(e(t))}})):f.attr("d",W),c.call(v,S,t,e,{eventDataKeys:b.eventDataKeys,transitionTime:b.CLICK_TRANSITION_TIME,transitionEasing:b.CLICK_TRANSITION_EASING}).call(x.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),f.call(g,i,T);var h=s.ensureSingle(c,"g","slicetext"),w=s.ensureSingle(h,"text","",(function(t){t.attr("data-notex",1)})),A=s.ensureUniformFontSize(t,x.determineTextFont(T,i,y.font));w.text(r.formatSliceLabel(i,S,T,e,y)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,A).call(l.convertToTspans,t);var M=o.bBox(w.node());i.transform=m(M,i,k),i.transform.targetX=Y(i),i.transform.targetY=Z(i);var z=function(t,e){var r=t.transform;return d(r,e),r.fontSize=A.size,u(T.type,r,y),s.getTextTransform(r)};_?w.transition().attrTween("transform",(function(t){var e=function(t){var e,r=F[x.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},R)if(t.parent)if(X){var i=t.x1>X?2*Math.PI:0;e.x0=e.x1=i}else s.extendFlat(e,Q(t));else e.x0=e.x1=U;else e.x0=e.x1=U;var o=a(e.transform.textPosAngle,t.transform.textPosAngle),l=a(e.rpx1,t.rpx1),c=a(e.x0,t.x0),f=a(e.x1,t.x1),p=a(e.transform.scale,n.scale),h=a(e.transform.rotate,n.rotate),d=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,m=a(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=c(t),i=f(t),a=function(t){return m(Math.pow(t,d))}(t),s={pxmid:G(e,(r+i)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:a,x:n.x,y:n.y}};return u(T.type,n,y),{transform:{targetX:Y(s),targetY:Z(s),scale:p(t),rotate:h(t),rCenter:a}}}}(t);return function(t){return z(e(t),M)}})):w.attr("transform",z(i,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&x.hasTransition(r);(f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),u)?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){_(t,e,this,r)}))}))):(a.each((function(e){_(t,e,this,r)})),s.uniformtext.mode&&y(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&a.exit().remove()},r.formatSliceLabel=function(t,e,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!(a||o&&"none"!==o))return"";var l=i.separators,c=n[0],u=t.data.data,f=c.hierarchy,p=x.isHierarchyRoot(t),h=x.getParent(f,t),d=x.getValue(t);if(!a){var m,g=o.split("+"),y=function(t){return-1!==g.indexOf(t)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(x.formatValue(u.v,l)),!p){y("current path")&&v.push(x.getPath(t.data));var b=0;y("percent parent")&&b++,y("percent entry")&&b++,y("percent root")&&b++;var _=b>1;if(b){var w,A=function(t){m=x.formatPercent(w,l),_&&(m+=" of "+t),v.push(m)};y("percent parent")&&!p&&(w=d/x.getValue(h),A("parent")),y("percent entry")&&(w=d/x.getValue(e),A("entry")),y("percent root")&&(w=d/x.getValue(f),A("root"))}}return y("text")&&(m=s.castOption(r,u.i,"text"),s.isValidTextValue(m)&&v.push(m)),v.join("
")}var k=s.castOption(r,u.i,"texttemplate");if(!k)return"";var T={};u.label&&(T.label=u.label),u.hasOwnProperty("v")&&(T.value=u.v,T.valueLabel=x.formatValue(u.v,l)),T.currentPath=x.getPath(t.data),p||(T.percentParent=d/x.getValue(h),T.percentParentLabel=x.formatPercent(T.percentParent,l),T.parent=x.getPtLabel(h)),T.percentEntry=d/x.getValue(e),T.percentEntryLabel=x.formatPercent(T.percentEntry,l),T.entry=x.getPtLabel(e),T.percentRoot=d/x.getValue(f),T.percentRootLabel=x.formatPercent(T.percentRoot,l),T.root=x.getPtLabel(f),u.hasOwnProperty("color")&&(T.color=u.color);var M=s.castOption(r,u.i,"text");return(s.isValidTextValue(M)||""===M)&&(T.text=M),T.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(k,T,i._d3locale,T,r._meta||{})}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../bar/style":681,"../bar/uniform_text":683,"../pie/helpers":927,"../pie/plot":931,"./constants":1079,"./fx":1081,"./helpers":1082,"./style":1087,"@plotly/d3":54,"d3-hierarchy":111,"d3-interpolate":112}],1087:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":363,"../../lib":525,"../bar/uniform_text":683,"@plotly/d3":54}],1088:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=e.exports=c(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},{"../../components/color":363,"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plot_api/edit_types":558,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652}],1089:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":371}],1090:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_surface3d,i=t("../../../stackgl_modules").ndarray,a=t("../../../stackgl_modules").ndarray_linear_interpolate.d2,o=t("../heatmap/interp2d"),s=t("../heatmap/find_empties"),l=t("../../lib").isArrayOrTypedArray,c=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),f=t("../../components/colorscale").extractOpts;function p(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var h=p.prototype;h.getXat=function(t,e,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},h.getYat=function(t,e,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},h.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},h.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!=o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?t.textLabel=s[i][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var d=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(t,e){if(t0){r=d[n];break}return r}function v(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=y(r),++r1?n:1},h.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),f=[1/e,0,0,0,1/r,0,0,0,1],p=0;p0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1097:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),h=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var m=d.concat(h(r).map((function(){return c((d[0]||[""]).length)}))),g=e.domain,y=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),v=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),b=e.header.values.length?m[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],x=r.length?r[0].map((function(){return e.cells.height})):[],_=b.reduce(s,0),w=p(x,v-_+n.uplift),A=f(p(b,_),[]),k=f(w,A),T={},M=e._fullInput.columnorder.concat(h(r.map((function(t,e){return e})))),S=m.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1})),z=S.reduce(s,0);S=S.map((function(t){return t/z*y}));var E=Math.max(o(e.header.line.width),o(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:y,maxLineWidth:E,height:v,columnOrder:M,groupHeight:v,rowBlocks:k,headerRowBlocks:A,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:m}),gdColumns:m.map((function(t){return t[0]})),gdColumnsOriginalOrder:m.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(t,e){var r=T[t];return T[t]=(r||0)+1,{key:t+"__"+T[t],label:t,specIndex:e,xIndex:M[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return L.columns.forEach((function(t){t.calcdata=L,t.x=u(t)})),L}},{"../../lib/extend":515,"./constants":1096,"fast-isnumeric":186}],1098:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":515}],1099:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var f,p,h=u?"":A(t.calcdata.cells.prefix,e,r)||"",d=u?"":A(t.calcdata.cells.suffix,e,r)||"",m=u?null:A(t.calcdata.cells.format,e,r)||null,g=h+(m?a(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(f=w(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===f?w(g):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var y=(" "===n.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=D(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(L(t,r,e,c,n.prevPages,n,0),L(t,r,e,c,n.prevPages,n,1),b(r,t))}}function E(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(T);return z(t,f,l),s.scrollY===u}}function L(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));x(t,e,a,r),i[o]=n[o]})))}function C(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+a)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(I)}}function P(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=B(o),c=o.key-l.firstRowIndex,f=l.rows[c].rowHeight,p=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:f,h=Math.max(p,f);h-l.rows[c].rowHeight&&(l.rows[c].rowHeight=h,t.selectAll("."+n.cn.columnCell).call(I),z(null,t.filter(T),0),b(r,a,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return u(O(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),a)})),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function I(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+R(e,1/0)}),0),r=R(B(t),t.key);return u(0,r+e)})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function D(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/domain":603,"../../plots/template_attributes":652,"../pie/attributes":922,"../sunburst/attributes":1076,"./constants":1105}],1103:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":638}],1104:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1078}],1105:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1106:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,f=c.handleDefaults;e.exports=function(t,e,r,c){function p(r,a){return n.coerce(t,e,i,r,a)}var h=p("labels"),d=p("parents");if(h&&h.length&&d&&d.length){var m=p("values");m&&m.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var g=p("text");p("texttemplate"),e.texttemplate||p("textinfo",Array.isArray(g)?"text+label":"label"),p("hovertext"),p("hovertemplate");var y=p("pathbar.visible");s(t,e,c,p,"auto",{hasPathbar:y,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var v=-1!==e.textposition.indexOf("bottom");p("marker.line.width")&&p("marker.line.color",c.paper_bgcolor);var b=p("marker.colors");(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?f(t,e,c,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(b||[]).length);var x=2*e.textfont.size;p("marker.pad.t",v?x/4:x),p("marker.pad.l",x/4),p("marker.pad.r",x/4),p("marker.pad.b",v?x:x/4),e._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},y&&(p("pathbar.thickness",e.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(e,c,p),e._length=null}else e.visible=!1}},{"../../components/color":363,"../../components/colorscale":375,"../../lib":525,"../../plots/domain":603,"../bar/constants":669,"../bar/defaults":671,"./attributes":1102}],1107:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../sunburst/helpers"),a=t("../bar/uniform_text").clearMinTextSize,o=t("../bar/style").resizeText,s=t("./plot_one");e.exports=function(t,e,r,l,c){var u,f,p=c.type,h=c.drawDescendants,d=t._fullLayout,m=d["_"+p+"layer"],g=!r;(a(p,d),(u=m.selectAll("g.trace."+p).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(p,!0),u.order(),!d.uniformtext.mode&&i.hasTransition(r))?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){m.selectAll("g.trace").each((function(e){s(t,e,this,r,h)}))}))):(u.each((function(e){s(t,e,this,r,h)})),d.uniformtext.mode&&o(t,m.selectAll(".trace"),p));g&&u.exit().remove()}},{"../bar/style":681,"../bar/uniform_text":683,"../sunburst/helpers":1082,"./plot_one":1116,"@plotly/d3":54}],1108:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx");e.exports=function(t,e,r,p,h){var d=h.barDifY,m=h.width,g=h.height,y=h.viewX,v=h.viewY,b=h.pathSlice,x=h.toMoveInsideSlice,_=h.strTransform,w=h.hasTransition,A=h.handleSlicesExit,k=h.makeUpdateSliceInterpolator,T=h.makeUpdateTextInterpolator,M={},S=t._context.staticPlot,z=t._fullLayout,E=e[0],L=E.trace,C=E.hierarchy,P=m/L._entryDepth,O=u.listPath(r.data,"id"),I=s(C.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(I=I.filter((function(t){var e=O.indexOf(t.data.id);return-1!==e&&(t.x0=P*e,t.x1=P*(e+1),t.y0=d,t.y1=d+g,t.onPathbar=!0,!0)}))).reverse(),(p=p.data(I,u.getPtId)).enter().append("g").classed("pathbar",!0),A(p,!0,M,[m,g],b),p.order();var D=p;w&&(D=D.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),D.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-Math.min(m,g)/2),s._hoverY=v(s.y1-g/2);var p=n.select(this),h=i.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?h.transition().attrTween("d",(function(t){var e=k(t,!0,M,[m,g]);return function(t){return b(e(t))}})):h.attr("d",b),p.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),h.call(l,s,L,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(p,"g","slicetext"),A=i.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),E=i.ensureUniformFontSize(t,u.determineTextFont(L,s,z.font,{onPathbar:!0}));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,E).call(o.convertToTspans,t),s.textBB=a.bBox(A.node()),s.transform=x(s,{fontSize:E.size,onPathbar:!0}),s.transform.fontSize=E.size,w?A.transition().attrTween("transform",(function(t){var e=T(t,!0,M,[m,g]);return function(t){return _(e(t))}})):A.attr("transform",_(s))}))}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../sunburst/fx":1081,"../sunburst/helpers":1082,"./constants":1105,"./partition":1114,"./style":1117,"@plotly/d3":54}],1109:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx"),p=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,h,d){var m=d.width,g=d.height,y=d.viewX,v=d.viewY,b=d.pathSlice,x=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,A=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,T=d.makeUpdateTextInterpolator,M=d.prevEntry,S=t._context.staticPlot,z=t._fullLayout,E=e[0].trace,L=-1!==E.textposition.indexOf("left"),C=-1!==E.textposition.indexOf("right"),P=-1!==E.textposition.indexOf("bottom"),O=!P&&!E.marker.pad.t||P&&!E.marker.pad.b,I=s(r,[m,g],{packing:E.tiling.packing,squarifyratio:E.tiling.squarifyratio,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1,pad:{inner:E.tiling.pad,top:E.marker.pad.t,left:E.marker.pad.l,right:E.marker.pad.r,bottom:E.marker.pad.b}}).descendants(),D=1/0,R=-1/0;I.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(D=Math.min(D,e),R=Math.max(R,e))})),h=h.data(I,u.getPtId),E._maxVisibleLayers=isFinite(R)?R-D+1:0,h.enter().append("g").classed("slice",!0),A(h,!1,{},[m,g],b),h.order();var F=null;if(w&&M){var B=u.getPtId(M);h.each((function(t){null===F&&u.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return F||{x0:0,x1:m,y0:0,y1:g}},j=h;return w&&(j=j.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),j.each((function(s){var h=u.isHeader(s,E);s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-E.marker.pad.r),s._hoverY=v(P?s.y1-E.marker.pad.b/2:s.y0+E.marker.pad.t/2);var d=n.select(this),A=i.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?A.transition().attrTween("d",(function(t){var e=k(t,!1,N(),[m,g]);return function(t){return b(e(t))}})):A.attr("d",b),d.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),A.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?O?"":u.getPtLabel(s)||"":p(s,r,E,e,z)||"";var M=i.ensureSingle(d,"g","slicetext"),I=i.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)})),D=i.ensureUniformFontSize(t,u.determineTextFont(E,s,z.font));I.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L||h?"start":"middle").call(a.font,D).call(o.convertToTspans,t),s.textBB=a.bBox(I.node()),s.transform=x(s,{fontSize:D.size,isHeader:h}),s.transform.fontSize=D.size,w?I.transition().attrTween("transform",(function(t){var e=T(t,!1,N(),[m,g]);return function(t){return _(e(t))}})):I.attr("transform",_(s))})),F}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../sunburst/fx":1081,"../sunburst/helpers":1082,"../sunburst/plot":1086,"./constants":1105,"./partition":1114,"./style":1117,"@plotly/d3":54}],1110:[function(t,e,r){"use strict";e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o-1?L+O:-(P+O):0,D={x0:C,x1:C,y0:I,y1:I+P},R=function(t,e,r){var n=y.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},N={},j=null,V=function(t,e){return e?B[p(t)]:N[p(t)]},U=function(t,e,r,n){if(e)return B[p(b)]||D;var i=N[y.level]||r;return function(t){return t.data.depth-x.data.depth=(n-=(v?g:g.r)-s)){var b=(r+n)/2;r=b,n=b}var x;f?i<(x=a-(v?g:g.b))&&x"===tt?(l.x-=a,c.x-=a,u.x-=a,f.x-=a):"/"===tt?(u.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),$(l),$(f),$(o),$(c),$(u),$(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(f.x,f.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:et,makeUpdateSliceInterpolator:nt,makeUpdateTextInterpolator:it,handleSlicesExit:at,hasTransition:T,strTransform:ot}):w.remove()}},{"../../lib":525,"../bar/constants":669,"../bar/plot":678,"../bar/uniform_text":683,"../sunburst/helpers":1082,"./constants":1105,"./draw_ancestors":1108,"@plotly/d3":54,"d3-interpolate":112}],1117:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,f=u.i,p=u.color,h=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(h&&p===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=a.castOption(r,f,"marker.line.color")||i.defaultLine,l=a.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var m=r.marker.depthfade;if(m){var g,y=i.combine(i.addOpacity(r._backgroundColor,.75),p);if(!0===m){var v=o.getMaxDepth(r);g=isFinite(v)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else g=e.data.depth-r._entryDepth,r._atRootLevel||g++;if(g>0)for(var b=0;b0){var x,_,w,A,k,T=t.xa,M=t.ya;"h"===d.orientation?(k=e,x="y",w=M,_="x",A=T):(k=r,x="x",w=T,_="y",A=M);var S=h[t.index];if(k>=S.span[0]&&k<=S.span[1]){var z=i.extendFlat({},t),E=A.c2p(k,!0),L=s.getKdeValue(S,d,k),C=s.getPositionOnKdePath(S,d,E),P=w._offset,O=w._length;z[x+"0"]=C[0],z[x+"1"]=C[1],z[_+"0"]=z[_+"1"]=E,z[_+"Label"]=_+": "+a.hoverLabelText(A,k,d[_+"hoverformat"])+", "+h[0].t.labels.kde+" "+L.toFixed(3);for(var I=0,D=0;D")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;if(i(n))return n;if(i(a)&&o)return a}(p,g),[u]}function k(t){return n(m,t,p[d+"hoverformat"])}}},{"../../components/color":363,"../../constants/delta.js":481,"../../plots/cartesian/axes":576,"../bar/hover":674}],1140:[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"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":588,"../bar/select":679,"./attributes":1133,"./calc":1134,"./cross_trace_calc":1136,"./defaults":1137,"./event_data":1138,"./hover":1139,"./layout_attributes":1141,"./layout_defaults":1142,"./plot":1143,"./style":1144}],1141:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1142:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0&&(g+=p?"M"+f[0]+","+d[1]+"V"+d[0]:"M"+f[1]+","+d[0]+"H"+f[0]),"between"!==h&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":363,"../../components/drawing":385,"../../constants/interactions":486,"../bar/style":681,"../bar/uniform_text":683,"@plotly/d3":54}],1145:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return f;case"first":return p;case"last":return h;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return p(t)>s};case">=":return function(t){return p(t)>=s};case"[]":return function(t){var e=p(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=p(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=p(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=p(t);return es[1]};case"](":return function(t){var e=p(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=p(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(p(t))};case"}{":return function(t){return-1===s.indexOf(p(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),p),b={},x={},_=0;d?(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},y=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},y=function(t,e){var r=b[t.astr][e];t.get().push(r)}),k(g);for(var w=o(e.transforms,r),A=0;A1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)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 i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){(function(){ +var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=a();function p(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=i():!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:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(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 p(t,e,n.selectUnion)},intersect:function(t,e){return p(t,e,n.selectIntersect)},difference:function(t,e){return p(t,e,n.selectDifference)},differenceRev:function(t,e){return p(t,e,n.selectDifferenceRev)},xor:function(t,e){return p(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":252,"./lib/epsilon":253,"./lib/geojson":254,"./lib/intersecter":255,"./lib/segment-chainer":257,"./lib/segment-selector":258}],252:[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")}}}},{}],253:[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 i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],254:[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]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var p=e.pointsSame(o,c),h=e.pointsSame(s,u);if(p&&h)return n;var d=!p&&e.pointBetween(o,c,u),m=!h&&e.pointBetween(s,c,u);if(p)return m?l(n,s):l(t,u),n;d&&(h||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var p=a.getHead();if(r&&r.vert(p.pt[0]),p.isStart){r&&r.segmentNew(p.seg,p.primary);var h=c(p),d=h.before?h.before.ev:null,m=h.after?h.after.ev:null;function g(){if(d){var t=u(p,d);if(t)return t}return!!m&&u(p,m)}r&&r.tempStatus(p.seg,!!d&&d.seg,!!m&&m.seg);var y,v=g();if(v){var b;if(t)(b=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above);else v.seg.otherFill=p.seg.myFill;r&&r.segmentUpdate(v.seg),p.other.remove(),p.remove()}if(a.getHead()!==p){r&&r.rewind(p.seg);continue}if(t)b=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:i,p.seg.myFill.above=b?!p.seg.myFill.below:p.seg.myFill.below;else if(null===p.seg.otherFill)y=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?o:i,p.seg.otherFill={above:y,below:y};r&&r.status(p.seg,!!d&&d.seg,!!m&&m.seg),p.other.status=h.insert(n.node({ev:p}))}else{var x=p.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!p.primary){var _=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=_}f.push(p.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},a.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));case 5:case 10:case 11:case 12:case 7:default:return null}},a.prototype.scan_ifd=function(t,e,r){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],m=p,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),h=!0),!1===r({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:f,data_offset:p+this.start,value:d,is_subifd_link:h}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=a,e.exports.get_orientation=function(t){var e=0;try{return new a(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}},{}],261:[function(t,e,r){"use strict";var n=t("./common").readUInt16BE,i=t("./common").readUInt32BE;function a(t,e){if(t.length<4+e)return null;var r=i(t,e);return t.length>4&15,i=15&t[4],a=t[5]>>4&15,o=n(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),i=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>i.height||n.width===i.height&&n.height>i.width?n:i),s=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n1&&(p.variants=f.variants),f.orientation&&(p.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=t.length){var h=a(t,f.exif_location.offset),d=t.slice(f.exif_location.offset+h+4,f.exif_location.offset+f.exif_location.length),m=s.get_orientation(d);m>0&&(p.orientation=m)}return p}}}}}}},{"../common":259,"../exif_utils":260,"../miaf_utils":261}],263:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("BM");e.exports=function(t){if(!(t.length<26)&&i(t,0,o))return{width:a(t,18),height:a(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":259}],264:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");e.exports=function(t){if(!(t.length<10)&&(i(t,0,o)||i(t,0,s)))return{width:a(t,6),height:a(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":259}],265:[function(t,e,r){"use strict";var n=t("../common").readUInt16LE;e.exports=function(t){var e=n(t,0),r=n(t,2),i=n(t,4);if(0===e&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":259}],266:[function(t,e,r){"use strict";var n=t("../common").readUInt16BE,i=t("../common").str2arr,a=t("../common").sliceEq,o=t("../exif_utils"),s=i("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var r,i,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;r=n(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(t,e,s)&&(i=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=i),c}e+=r}}},{"../common":259,"../exif_utils":260}],267:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(t){if(!(t.length<24)&&i(t,0,o)&&i(t,12,s))return{width:a(t,16),height:a(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":259}],268:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&i(t,0,o))return{width:a(t,18),height:a(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":259}],269:[function(t,e,r){"use strict";function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function p(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||u(t,e+8):"VP8L"===h&&d>=9?r=r||f(t,e+8):"VP8X"===h&&d>=10?r=r||p(t,e+8):"EXIF"===h&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":259,"../exif_utils":260}],272:[function(t,e,r){"use strict";e.exports={avif:t("./parse_sync/avif"),bmp:t("./parse_sync/bmp"),gif:t("./parse_sync/gif"),ico:t("./parse_sync/ico"),jpeg:t("./parse_sync/jpeg"),png:t("./parse_sync/png"),psd:t("./parse_sync/psd"),svg:t("./parse_sync/svg"),tiff:t("./parse_sync/tiff"),webp:t("./parse_sync/webp")}},{"./parse_sync/avif":262,"./parse_sync/bmp":263,"./parse_sync/gif":264,"./parse_sync/ico":265,"./parse_sync/jpeg":266,"./parse_sync/png":267,"./parse_sync/psd":268,"./parse_sync/svg":269,"./parse_sync/tiff":270,"./parse_sync/webp":271}],273:[function(t,e,r){"use strict";var n=t("./lib/parsers_sync");e.exports=function(t){return function(t){for(var e=Object.keys(n),r=0;r1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function A(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(x.groups=b=t.map((function(t,c){var u=b[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(b[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},v,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},y.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},y.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},y.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>y.precisionThreshold||e.scale[1]*e.viewport.height>y.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=y.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},y.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var d=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),d||(e.passes[f]=d={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},y.defaults,t)),null!=t.thickness&&(d.thickness=parseFloat(t.thickness)),null!=t.opacity&&(d.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(d.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(d.overlay=!!t.overlay,f=D}));(P=P.slice(0,R)).push(D)}for(var F=function(t){var e=k.slice(2*I,2*P[t]).concat(D?k.slice(2*D):[]),r=(d.hole||[]).map((function(e){return e-D+(P[t]-I)})),n=c(e,r);n=n.map((function(e){return e+I+(e+It.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=p(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),g&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=u(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var p={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(p):e.elements=o.elements(p)}var h=y.float32(t);return i({data:h,usage:"dynamic"}),a({data:y.fract32(t,h),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function h(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},u.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nk))&&(s.lower||!(A>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||J(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,p=0;Array.isArray(t)||J(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=et[t.usage]),"primitive"in t&&(n=at[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(p=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===p||5122===p?o*=2:5125!==p&&5124!==p||(o*=4))),a(f,e,r,n,i,o,p)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){K(s).forEach(o)}}}function m(t){for(var e=Z.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,h(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(vt).forEach((function(e){t+=vt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;C.call(r);var a=E();return"number"==typeof t?M(a,0|t,"number"==typeof e?0|e:0|t):t?(P(r,t),S(a,t)):M(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),z(a,3553),O(r,3553),R(),L(a),o.profile&&(i.stats.size=A(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new I(3553);return vt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=y();return c(o,i),o.width=0,o.height=0,h(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,D(i),d(o,3553,e,r,a),R(),k(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l=0;i.mipmask>>l;++l){var c=a>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return R(),o.profile&&(i.stats.size=A(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=p.texInfo;for(C.call(l),s=0;6>s;++s)m[s]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(m[0],t),S(m[1],e),S(m[2],r),S(m[3],n),S(m[4],i),S(m[5],a);else if(P(l,t),u(p,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(m[s],p),S(m[s],t[s]);else for(s=0;6>s;++s)S(m[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(m[s],t,t);for(c(p,m[0]),p.mipmask=l.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,p.internalformat=m[0].internalformat,f.width=m[0].width,f.height=m[0].height,D(p),s=0;6>s;++s)z(m[s],34069+s);for(O(l,34067),R(),o.profile&&(p.stats.size=A(p.internalformat,p.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[p.internalformat],f.type=et[p.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)L(m[s]);return f}var p=new I(34067);vt[p.id]=p,a.cubeCount++;var m=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=y();return c(a,p),a.width=0,a.height=0,h(a,e),a.width=a.width||(p.width>>i)-r,a.height=a.height||(p.height>>i)-n,D(p),d(a,34069+t,r,n,i),R(),k(a),f},f.resize=function(e){if((e|=0)!==p.width){f.width=p.width=e,f.height=p.height=e,D(p);for(var r=0;6>r;++r)for(var n=0;p.mipmask>>n;++n)t.texImage2D(34069+r,n,p.format,e>>n,e>>n,0,p.format,p.type,null);return R(),o.profile&&(p.stats.size=A(p.internalformat,p.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=p,o.profile&&(f.stats=p.stats),f.destroy=function(){p.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);O(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){K(k).forEach(g)},restore:function(){b.cur=null,b.next=null,b.dirty=!0,K(k).forEach((function(e){e.framebuffer=t.createFramebuffer(),y(e)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,p[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r=p.byteLength?c.subdata(p):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=i.create(u,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else i.getBuffer(u)?(f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(u.buffer)?(f.buffer=i.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?tt[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;ct&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return p.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);K(c).forEach(e),c={},K(u).forEach(e),u={},p.forEach((function(e){t.deleteProgram(e.program)})),p.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var h=o[e];if(h&&(h.refCount++,!a))return h;var d=new s(n,e);return r.shaderCount++,l(d,i,a),h||(o[e]=d),p.push(d),H(d,{destroy:function(){if(d.refCount--,0>=d.refCount){t.deleteProgram(d.program);var e=p.indexOf(d);p.splice(e,1),r.shaderCount--}0>=o[d.vertId].refCount&&(t.deleteShader(u[d.vertId]),delete u[d.vertId],delete f[d.fragId][d.vertId]),Object.keys(f[d.fragId]).length||(t.deleteShader(c[d.fragId]),delete c[d.fragId],delete f[d.fragId])}})},restore:function(){c={},u={};for(var t=0;t>>e|t<<32-e}function C(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function P(t){return Array.prototype.slice.call(t)}function O(t){return P(t).join("")}function I(t){function e(){var t=[],e=[];return H((function(){t.push.apply(t,P(arguments))}),{def:function(){var r="v"+i++;return e.push(r),0>>4&15)+"0123456789abcdef".charAt(15&e);return r}(function(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,c,u,f,p,h,d=8*t.length;for(t=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),e[d>>5]|=128<<24-d%32,e[15+(d+64>>9<<4)]=d,u=0;uf;f++){var m;if(16>f)r[f]=e[f+u];else p=f,h=C(h=L(h=r[f-2],17)^L(h,19)^h>>>10,r[f-7]),m=L(m=r[f-15],7)^L(m,18)^m>>>3,r[p]=C(C(h,m),r[f-16]);p=C(C(C(C(c,p=L(p=o,6)^L(p,11)^L(p,25)),o&s^~o&l),kt[f]),r[f]),h=C(c=L(c=d,2)^L(c,13)^L(c,22),d&n^d&i^n&i),c=l,l=s,s=o,o=C(a,p),a=i,i=n,n=d,d=C(p,h)}t[0]=C(d,t[0]),t[1]=C(n,t[1]),t[2]=C(i,t[2]),t[3]=C(a,t[3]),t[4]=C(o,t[4]),t[5]=C(s,t[5]),t[6]=C(l,t[6]),t[7]=C(c,t[7])}for(e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t){for(var e,r,n="",i=-1;++i=e&&56320<=r&&57343>=r&&(e=65536+((1023&e)<<10)+(1023&r),i++),127>=e?n+=String.fromCharCode(e):2047>=e?n+=String.fromCharCode(192|e>>>6&31,128|63&e):65535>=e?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):2097151>=e&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(r))),n[e])?n[e].apply(null,o):(r=Function.apply(null,a.concat(r)),n&&(n[e]=r),r.apply(null,o))}}}function D(t){return Array.isArray(t)||J(t)||l(t)}function R(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",a,".createStream(",34962,",",i,".buffer);","}else{",u,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",u,");","}"),l}))})),o}function M(t,e,n,i,o){function s(t){var e=c[t];e&&(p[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,m,g,s],");")}h&&"null"!==h?v?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[d,g,y,m+"<<(("+y+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[d,m,g]+");")}h&&"null"!==h?v?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,p=n.draw,h=function(){var i=p.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),p.elementsActive&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",rt?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),d=i("primitive"),m=i("offset"),g=function(){var i=p.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");$&&(s=i("instances"),l=t.instancing);var y=h+".type",v=p.elements&&B(p.elements)&&!p.vaoActive;$&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function q(t,e,r,n,i){return i=(e=_()).proc("body",i),$&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function W(t,e,r,n){C(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),O(t,e,r,n.attributes,(function(){return!0}))),V(t,e,r,n.uniforms,(function(){return!0}),!1),U(t,e,e,r)}function Y(t,e,r,n){function i(){return!0}t.batchId="a1",C(t,e),O(t,e,r,n.attributes,i),V(t,e,r,n.uniforms,i,!1),U(t,e,e,r)}function Z(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}C(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&S(t,u,r.context),r.needsFramebuffer&&z(t,u,r.framebuffer),L(t,u,r.state,i),r.profile&&i(r.profile)&&P(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),O(t,c,r,n.attributes,a),O(t,u,r,n.attributes,i)),V(t,c,r,n.uniforms,a,!1),V(t,u,r,n.uniforms,i,!0),U(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return q(Y,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function X(t,r){function n(e){var n=r.shader[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.shader,"."+e,n):i.set(a.shader,"."+e,t.link(n,{stable:!0})))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;if(S(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),R(Object.keys(r.state)).forEach((function(e){var n=r.state[e],o=n.append(t,i);g(o)?o.forEach((function(r,n){isNaN(r)?i.set(t.next[e],"["+n+"]",r):i.set(t.next[e],"["+n+"]",t.link(r,{stable:!0}))})):B(n)?i.set(a.next,"."+e,t.link(o,{stable:!0})):i.set(a.next,"."+e,o)})),P(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.draw,"."+e,n):i.set(a.draw,"."+e,t.link(n),{stable:!0}))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.map((function(e){return isNaN(e)?e:t.link(e,{stable:!0})}))+"]"),i.set(a.uniforms,"["+t.link(e.id(n),{stable:!0})+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new K).forEach((function(t){i.set(a,"."+t,n[t])}))})),r.scopeVAO){var s=r.scopeVAO.append(t,i);isNaN(s)?i.set(a.vao,".targetVAO",s):i.set(a.vao,".targetVAO",t.link(s,{stable:!0}))}n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=xt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height||(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=xt[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){K(u).forEach(o)},restore:function(){K(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},wt=[];wt[6408]=4,wt[6407]=3;var At=[];At[5121]=1,At[5126]=4,At[36193]=2;var kt=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Tt=["x","y","z","w"],Mt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),St={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},zt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Et={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Lt={cw:2304,ccw:2305},Ct=new F(!1,!1,!1,(function(){}));return function(t){function e(){if(0===K.length)A&&A.update(),et=null;else{et=W.next(e),f();for(var t=K.length-1;0<=t;--t){var r=K[t];r&&r(P,null,0)}g.flush(),A&&A.update()}}function r(){!et&&0=K.length&&n()}}}}function u(){var t=Z.viewport,e=Z.scissor_box;t[0]=t[1]=e[0]=e[1]=0,P.viewportWidth=P.framebufferWidth=P.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,P.viewportHeight=P.framebufferHeight=P.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){P.tick+=1,P.time=m(),u(),q.procs.poll()}function p(){B.refresh(),u(),q.procs.refresh(),A&&A.update()}function m(){return(Y()-M)/1e3}if(!(t=i(t)))return null;var g=t.gl,y=g.getContextAttributes();g.isContextLost();var v=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)rt(H({framebuffer:t.framebuffer.faces[e]},t),l);else rt(t,l);else l(0,t)},prop:G.define.bind(null,1),context:G.define.bind(null,2),this:G.define.bind(null,3),draw:s({}),buffer:function(t){return I.create(t,34962,!1,!1)},elements:function(t){return D.create(t,!1)},texture:B.create2D,cube:B.createCube,renderbuffer:N.create,framebuffer:j.create,framebufferCube:j.createCube,vao:R.createVAO,attributes:y,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=Q;break;case"restore":r=$;break;case"destroy":r=tt}return r.push(e),{cancel:function(){for(var t=0;t2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(a(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(a(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],284:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),a=t("./_stream_writable");t("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)o.endEmitted?w(t,new _):S(t,o,e,!0);else if(o.ended)w(t,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?S(t,o,e,!1):C(t,o)):S(t,o,e,!1)}else n||(o.reading=!1,C(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(L,t))}function L(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function C(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(P,t,e))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(N,e,t))}function N(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):E(this),null;if(0===(t=z(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(t){w(this,new x("_read()"))},T.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",g),n.removeListener("data",p),f=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function l(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",u);var f=!1;function p(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==j(i.pipes,t))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(e){c("onerror",e),g(),t.removeListener("error",h),0===a(t,"error")&&w(t,e)}function d(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",h),t.once("close",d),t.once("finish",m),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?E(this):i.reading||r.nextTick(I,this))),n},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(O,this),n},T.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(O,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new m("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,C(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":283,"./_stream_duplex":284,"./internal/streams/destroy":291,"./internal/streams/state":295,"./internal/streams/stream":296,_process:274,buffer:81,inherits:227,"util-deprecate":327}],289:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=t("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function h(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[p].read();null!==r&&(t[u]=null,t[o]=null,t[s]=null,e(h(r,!1)))}}function m(t){r.nextTick(d,t)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[p]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(h(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(h(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var a=this[p].read();if(null!==a)return Promise.resolve(h(a,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(h(void 0,!0))}))}))})),n),g);e.exports=function(t){var e,r=Object.create(y,(i(e={},p,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[p].read();n?(r[u]=null,r[o]=null,r[s]=null,t(h(n,!1))):(r[o]=t,r[s]=e)},writable:!0}),e));return r[u]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[o]=null,r[s]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":292,_process:274}],290:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0==(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&o.forEach(c),a||(o.forEach(c),i(n))}))}));return e.reduce(u)}},{"../../../errors":283,"./end-of-stream":292}],295:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},{"../../../errors":283}],296:[function(t,e,r){e.exports=t("events").EventEmitter},{events:80}],297:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=f,e=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":281}],298:[function(t,e,r){(function(r,n){(function(){var r=t("assert"),i=t("debug")("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),t._bytes=o,t._skipBytes=s,e&&(t._passthrough=l);e?t._transform=u:t._write=c};function a(t){i("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||a(this),i("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function s(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function l(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function c(t,e,r){this._parserInit||a(this),i("write(%o bytes)",t.length),"function"==typeof e&&(r=e),p(this,t,null,r)}function u(t,e,r){this._parserInit||a(this),i("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),p(this,t,e,r)}function f(t,e,r,a){if(t._parserBytesLeft-=e.length,i("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return a;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(e=n.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];e&&s.push(e),r&&s.push(r);var l=o.length>s.length;l&&s.push(h(a));var c=o.apply(t,s);if(!l||a===c)return a}}var p=h((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return f(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return f(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function h(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:274,assert:71,buffer:81,debug:299}],299:[function(t,e,r){(function(n){(function(){function i(){var t;try{t=r.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(r=e.exports=t("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))})),t.splice(a,0,n)},r.save=function(t){try{null==t?r.storage.removeItem("debug"):r.storage.debug=t}catch(t){}},r.load=i,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(i())}).call(this)}).call(this,t("_process"))},{"./debug":300,_process:274}],300:[function(t,e,r){var n;function i(t){function e(){if(e.enabled){var t=e,i=+new Date,a=i-(n||i);t.diff=a,t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===l&&!1===isNaN(t))return e.long?s(r=t,o,"day")||s(r,a,"hour")||s(r,i,"minute")||s(r,n,"second")||r+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=a)return Math.round(t/a)+"h";if(t>=i)return Math.round(t/i)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],302:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var h=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],y=[],v=0;for(d=l.length-1;d>=0;--d){var b=l[d];if(i[b]=!1,g.push(b),y.push(s[b]),v+=s[b].length,o[b]=f.length,b===e){l.length=d;break}}f.push(g);var x=new Array(v);for(d=0;d1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,p=t.xAxisRotation,h=void 0===p?0:p,d=t.largeArcFlag,m=void 0===d?0:d,g=t.sweepFlag,y=void 0===g?0:g,v=[];if(0===u||0===f)return[];var b=Math.sin(h*i/360),x=Math.cos(h*i/360),_=x*(e-l)/2+b*(r-c)/2,w=-b*(e-l)/2+x*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var A=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);A>1&&(u*=Math.sqrt(A),f*=Math.sqrt(A));var k=function(t,e,r,n,a,o,l,c,u,f,p,h){var d=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(p,2),y=Math.pow(h,2),v=d*m-d*y-m*g;v<0&&(v=0),v/=d*y+m*g;var b=(v=Math.sqrt(v)*(l===c?-1:1))*a/o*h,x=v*-o/a*p,_=f*b-u*x+(t+r)/2,w=u*b+f*x+(e+n)/2,A=(p-b)/a,k=(h-x)/o,T=(-p-b)/a,M=(-h-x)/o,S=s(1,0,A,k),z=s(A,k,T,M);return 0===c&&z>0&&(z-=i),1===c&&z<0&&(z+=i),[_,w,S,z]}(e,r,l,c,u,f,m,y,b,x,_,w),T=n(k,4),M=T[0],S=T[1],z=T[2],E=T[3],L=Math.abs(E)/(i/4);Math.abs(1-L)<1e-7&&(L=1);var C=Math.max(Math.ceil(L),1);E/=C;for(var P=0;Pe[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":66,assert:71,"is-svg-path":234,"normalize-svg-path":306,"parse-svg-path":246}],306:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,p=0,h=0,d=0,m=t.length;d4?(o=g[g.length-4],s=g[g.length-3]):(o=p,s=h),r.push(g)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":304}],307:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=c.width=e.w||e.width||200,f=c.height=e.h||e.height||200);var p=Math.min(r,f),h=e.stroke||0,d=e.viewbox||e.viewBox||i(t),m=[r/(d[2]-d[0]),f/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",h&&("number"!=typeof h&&(h=1),u.strokeStyle=h>0?"white":"black",u.lineWidth=Math.abs(h));if(u.translate(.5*r,.5*f),u.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var y=new Path2D(t);u.fill(y),h&&u.stroke(y)}else{var v=a(t);o(u,v),u.fill(),h&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*p})}},{"bitmap-sdf":78,"draw-svg-path":122,"is-svg-path":234,"parse-svg-path":246,"svg-path-bounds":305}],308:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},l=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":274,timers:308}],309:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,p=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:P(e[1]),g:P(e[2]),b:P(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:P(e[1]),g:P(e[2]),b:P(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:P(e[1]+""+e[1]),g:P(e[2]+""+e[2]),b:P(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(V(e.r)&&V(e.g)&&V(e.b)?(h=e.r,d=e.g,m=e.b,i={r:255*L(h,255),g:255*L(d,255),b:255*L(m,255)},f=!0,p="%"===String(e.r).substr(-1)?"prgb":"rgb"):V(e.h)&&V(e.s)&&V(e.v)?(l=I(e.s),c=I(e.v),i=function(e,r,n){e=6*L(e,360),r=L(r,100),n=L(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,p="hsv"):V(e.h)&&V(e.s)&&V(e.l)&&(l=I(e.s),u=I(e.l),i=function(t,e,r){var n,i,a;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=L(t,360),e=L(e,100),r=L(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,p="hsl"),e.hasOwnProperty("a")&&(a=e.a));var h,d,m;return a=E(a),{ok:f,format:e.format||p,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=L(t,255),e=L(e,255),r=L(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%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,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=E(t),this._roundA=a(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=a(360*t.h),r=a(100*t.s),n=a(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=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return p(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[O(a(t).toString(16)),O(a(e).toString(16)),O(a(r).toString(16)),O(D(n))];if(i&&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:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*L(this._r,255))+"%",g:a(100*L(this._g,255))+"%",b:a(100*L(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%)":"rgba("+a(100*L(this._r,255))+"%, "+a(100*L(this._g,255))+"%, "+a(100*L(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(z[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+h(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=c(t);r="#"+h(i._r,i._g,i._b,i._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(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(A,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]:I(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:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!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":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=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"},z=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function E(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function L(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function C(t){return o(1,s(0,t))}function P(t){return parseInt(t,16)}function O(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return P(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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 V(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],310:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=i(t));for(var r=0,n=e.length;ro&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=l(t,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,u=f(e),p=t.objects,h={};function d(t){return u(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in p)h[c]=m(p[c]);return{type:"Topology",bbox:l,transform:e,objects:h,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=u(t[0],0);++r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":315}],317:[function(t,e,r){"use strict";var n=t("../value/is"),i={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},{"../value/is":323}],318:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":314,"./is":319}],319:[function(t,e,r){"use strict";var n=t("../function/is"),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!i.test(a.call(t))}},{"../function/is":313}],320:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":317}],321:[function(t,e,r){"use strict";var n=t("../value/is"),i=t("../object/is"),a=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},{"../object/is":317,"../value/is":323}],322:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":314,"./is":323}],323:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],324:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),i=t("dup"),a=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,f=c.BUFFER;function p(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function h(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(h(t),0,t)}function m(t){return new Uint16Array(h(2*t),0,t)}function g(t){return new Uint32Array(h(4*t),0,t)}function y(t){return new Int8Array(h(t),0,t)}function v(t){return new Int16Array(h(2*t),0,t)}function b(t){return new Int32Array(h(4*t),0,t)}function x(t){return new Float32Array(h(4*t),0,t)}function _(t){return new Float64Array(h(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(h(t),0,t):d(t)}function A(t){return s?new BigUint64Array(h(8*t),0,t):null}function k(t){return l?new BigInt64Array(h(8*t),0,t):null}function T(t){return new DataView(h(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){p(t.buffer)},r.freeArrayBuffer=p,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return h(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return y(t);case"int16":return v(t);case"int32":return b(t);case"float":case"float32":return x(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return A(t);case"buffer":return M(t);case"data":case"dataview":return T(t);default:return null}return null},r.mallocArrayBuffer=h,r.mallocUint8=d,r.mallocUint16=m,r.mallocUint32=g,r.mallocInt8=y,r.mallocInt16=v,r.mallocInt32=b,r.mallocFloat32=r.mallocFloat=x,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=A,r.mallocBigInt64=k,r.mallocDataView=T,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":77,buffer:81,dup:124}],325:[function(t,e,r){var n=/[\'\"]/;e.exports=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},{}],326:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=p[o-p[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],h=u>>13;c=h&&(o.month>h||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=p[i.year-p[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=p[a.year-p[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var h,d=f[a.year-f[0]];for(h=0;h<13;h++){var m=d&1<<12-h?30:29;if(l>13;!g||h=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":343,"object-assign":243}],332:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":343,"object-assign":243}],333:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":343,"object-assign":243}],334:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":343,"object-assign":243}],335:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":343,"object-assign":243}],336:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":343,"object-assign":243}],337:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":343,"object-assign":243}],338:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":343,"object-assign":243}],340:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":343,"object-assign":243}],341:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":343,"object-assign":243}],342:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":343,"object-assign":243}],343:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":243}],344:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,p=r.monthNames||this.local.monthNames,h=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(h(t,n))for(;i.length1},b=function(t,r){var n=v(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(T).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){v("m");var t=l.call(x,e.substring(T));return T+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=v(t,a)?n:r,s=0;s-1){h=1,d=m;for(var z=this.daysInMonth(p,h);d>z;z=this.daysInMonth(p,h))h++,d-=z}return f>-1?this.fromJD(f):this.newDate(p,h,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":343,"object-assign":243}],345:[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}]},{}],346:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=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:i({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",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.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",a.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:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":480,"../../plot_api/plot_template":565,"../../plots/cartesian/constants":583,"../../plots/font_attributes":604,"./arrow_paths":345}],347:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],p={x:1,y:-1}[a]*t[a+"shift"],h=3*t.arrowsize*t.arrowwidth||0,d=h+p,m=h-p,g=3*t.startarrowsize*t.arrowwidth||0,y=g+p,v=g-p;if(c===l){var b=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),x=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,y),ppadminus:Math.max(f,v)});r={min:[b.min[0],x.min[0]],max:[b.max[0],x.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,y),ppadminus:Math.max(f,m,v)});t._extremes[n]=r}e.exports=function(t){var e=t._fullLayout;if(n.filterVisible(e.annotations).length&&t._fullData.length)return n.syncOrAsync([a,o],t)}},{"../../lib":525,"../../plots/cartesian/axes":576,"./draw":352}],348:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],p=[],h=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},p=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var Y=!1,Z=["x","y"],X=0;X1)&&(nt===rt?((ht=it.r2fraction(e["a"+et]))<0||ht>1)&&(Y=!0):Y=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var dt="domain"===pt;"x"===et?(Q=e[et],J=dt?it._offset+it._length*Q:J=A.l+A.w*Q):(Q=1-e[et],J=dt?it._offset+it._length*Q:J=A.t+A.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var mt=e["a"+et];if(tt=ot*q(.5,e.xanchor)-st*q(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ft.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ft.tail=A.t+A.h*mt):ft.tail=A.l+A.w*mt:ft.tail=it._offset+it.r2p(mt),K=tt}else ft.tail=J+mt,K=tt+mt;ft.text=ft.tail+tt;var yt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,yt-1)),"pixel"===nt){var vt=-Math.max(ft.tail-3,ft.text),bt=Math.min(ft.tail+3,ft.text)-yt;vt>0?(ft.tail+=vt,ft.text+=vt):bt>0&&(ft.tail-=bt,ft.text-=bt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*q($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(Y)R.remove();else{var xt=0,_t=0;if("left"!==e.align&&(xt=(T-x)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(D-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:N+xt-1,y:N+_t}).call(u.setClipUrl,V?E:null,t);else{var wt=N+_t-m.top,At=N+xt-m.left;G.call(p.positionText,At,wt).call(u.setClipUrl,V?E:null,t)}U.select("rect").call(u.setRect,N,N,T,D),j.call(u.setRect,F/2,F/2,B-F,H-F),R.call(u.setTranslate,Math.round(L.x.text-B/2),Math.round(L.y.text-H/2)),O.attr({transform:"rotate("+C+","+L.x.text+","+L.y.text+")"});var kt,Tt=function(r,n){P.selectAll(".annotation-arrow-g").remove();var l=L.x.head,f=L.y.head,p=L.x.tail+r,h=L.y.tail+n,m=L.x.text+r,x=L.y.text+n,_=o.rotationXYMatrix(C,m,x),w=o.apply2DTransform(_),T=o.apply2DTransform2(_),E=+j.attr("width"),I=+j.attr("height"),D=m-.5*E,F=D+E,B=x-.5*I,N=B+I,V=[[D,B,D,N],[D,N,F,N],[F,N,F,B],[F,B,D,B]].map(T);if(!V.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){V.forEach((function(t){var e=o.segmentsIntersect(p,h,l,f,t[0],t[1],t[2],t[3]);e&&(p=e.x,h=e.y)}));var U=e.arrowwidth,H=e.arrowcolor,q=e.arrowside,G=P.append("g").style({opacity:c.opacity(H)}).classed("annotation-arrow-g",!0),W=G.append("path").attr("d","M"+p+","+h+"L"+l+","+f).style("stroke-width",U+"px").call(c.stroke,c.rgb(H));if(g(W,q,e),k.annotationPosition&&W.node().parentNode&&!a){var Y=l,Z=f;if(e.standoff){var X=Math.sqrt(Math.pow(l-p,2)+Math.pow(f-h,2));Y+=e.standoff*(p-l)/X,Z+=e.standoff*(h-f)/X}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(p-Y)+","+(h-Z),transform:s(Y,Z)}).style("stroke-width",U+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);J=t.x,K=t.y,y&&y.autorange&&M(y._name+".autorange",!0),b&&b.autorange&&M(b._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S("x",v(y,t,"x",A,e)),S("y",v(b,r,"y",A,e)),e.axref===e.xref&&S("ax",v(y,t,"ax",A,e)),e.ayref===e.yref&&S("ay",v(b,r,"ay",A,e)),G.attr("transform",s(t,r)),O.attr({transform:"rotate("+C+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,z());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&Tt(0,0),I)d.init({element:R.node(),gd:t,prepFn:function(){kt=O.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",v(y,t,"ax",A,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",v(b,r,"ay",A.w,e)):S("ay",e.ay+r),Tt(t,r);else{if(a)return;var i,o;if(y)i=v(y,t,"x",A,e);else{var l=e._xsize/A.w,c=e.x+(e._xshift-e.xshift)/A.w-l/2;i=d.align(c+t/A.w,l,0,1,e.xanchor)}if(b)o=v(b,r,"y",A,e);else{var u=e._ysize/A.h,f=e.y-(e._yshift+e.yshift)/A.h-u/2;o=d.align(f-r/A.h,u,0,1,e.yanchor)}S("x",i),S("y",o),y&&b||(n=d.getCursor(y?.5:i,b?.5:o,e.xanchor,e.yanchor))}O.attr({transform:s(t,r)+kt}),h(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",W(n))},doneFn:function(){h(R),i.call("_guiRelayout",t,z());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=0,b=e.indexOf("end")>=0,x=d.backoff*g+r.standoff,_=m.backoff*y+r.startstandoff;if("line"===h.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,A=o.y-u.y;if(p=(f=Math.atan2(A,w))+Math.PI,x&&_&&x+_>Math.sqrt(w*w+A*A))return void I();if(x){if(x*x>w*w+A*A)return void I();var k=x*Math.cos(f),T=x*Math.sin(f);u.x+=k,u.y+=T,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+A*A)return void I();var M=_*Math.cos(f),S=_*Math.sin(f);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===h.nodeName){var z=h.getTotalLength(),E="";if(z1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":626,"../annotations/draw":352}],359:[function(t,e,r){"use strict";var n=t("../../registry"),i=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 a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ct=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ct*c.roundUp(lt/ct,[2,5,10]),(Math.abs(q.start)/q.size+1e-6)%1<2e-6&&(it.tick0=0)}it.dtick=ot}it.domain=o?[rt+P/R.h,rt+K-P/R.h]:[rt+C/R.w,rt+K-C/R.w],it.setScale(),t.attr("transform",u(Math.round(R.l),Math.round(R.t)));var ut,ft=t.select("."+T.cbtitleunshift).attr("transform",u(-Math.round(R.l),-Math.round(R.t))),pt=it.ticklabelposition,ht=it.title.font.size,dt=t.select("."+T.cbaxis),mt=0,gt=0;function yt(n,i){var a={propContainer:it,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:D._dfltTitle.colorbar,containerGroup:t.select("."+T.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&at||!o&&!at)&&("top"===j&&(t=C+R.l+R.w*O,e=P+R.t+R.h*(1-rt-K)+3+.75*ht),"bottom"===j&&(t=C+R.l+R.w*O,e=P+R.t+R.h*(1-rt)-3-.25*ht),"right"===j&&(e=P+R.t+R.h*I+3+.75*ht,t=C+R.l+R.w*rt),yt(it._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!at||o&&at){var a,l=t.select("."+T.cbtitle),f=l.select("text"),p=[-M/2,M/2],d=l.select(".h"+it._id+"title-math-group").node(),m=15.6;if(f.node()&&(m=parseInt(f.node().style.fontSize,10)*w),d?(a=h.bBox(d),gt=a.width,(mt=a.height)>m&&(p[1]-=(mt-m)/2)):f.node()&&!f.classed(T.jsPlaceholder)&&(a=h.bBox(f.node()),gt=a.width,mt=a.height),o){if(mt){if(mt+=5,"top"===j)it.domain[1]-=mt/R.h,p[1]*=-1;else{it.domain[0]+=mt/R.h;var y=g.lineCount(f);p[1]+=(1-y)*m}l.attr("transform",u(p[0],p[1])),it.setScale()}}else gt&&("right"===j&&(it.domain[0]+=(gt+ht/2)/R.w),l.attr("transform",u(p[0],p[1])),it.setScale())}t.selectAll("."+T.cbfills+",."+T.cblines).attr("transform",o?u(0,Math.round(R.h*(1-it.domain[1]))):u(Math.round(R.w*it.domain[0]),0)),dt.attr("transform",o?u(0,Math.round(-R.t)):u(Math.round(-R.l),0));var v=t.select("."+T.cbfills).selectAll("rect."+T.cbfill).attr("style","").data(W);v.enter().append("rect").classed(T.cbfill,!0).style("stroke","none"),v.exit().remove();var b=V.map(it.c2p).map(Math.round).sort((function(t,e){return t-e}));v.each((function(t,a){var s=[0===a?V[0]:(W[a]+W[a-1])/2,a===W.length-1?V[1]:(W[a]+W[a+1])/2].map(it.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,b[0],b[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(Z,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)h.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=H(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var x=t.select("."+T.cblines).selectAll("path."+T.cbline).data(B.color&&B.width?Y:[]);x.enter().append("path").classed(T.cbline,!0),x.exit().remove(),x.each((function(t){var e=Q,r=Math.round(it.c2p(t))+B.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+Z).call(h.lineGroupStyle,B.width,U(t),B.dash)})),dt.selectAll("g."+it._id+"tick,path").remove();var _=Q+Z+(M||0)/2-("outside"===e.ticks?1:0),A=s.calcTicks(it),k=s.getTickSigns(it)[2];return s.drawTicks(r,it,{vals:"inside"===it.ticks?s.clipEnds(it,A):A,layer:dt,path:s.makeTickPath(it,_,k),transFn:s.makeTransTickFn(it)}),s.drawLabels(r,it,{vals:A,layer:dt,transFn:s.makeTransTickLabelFn(it),labelFns:s.makeLabelFns(it,_)})},function(){if(o&&!at||!o&&at){var t,i,a=it.position||0,s=it._offset+it._length/2;if("right"===j)i=s,t=R.l+R.w*a+10+ht*(it.showticklabels?1:.5);else if(t=s,"bottom"===j&&(i=R.t+R.h*a+10+(-1===pt.indexOf("inside")?it.tickfont.size:0)+("intside"!==it.ticks&&e.ticklen||0)),"top"===j){var l=N.text.split("
").length;i=R.t+R.h*a+10-Z-w*ht*l}yt((o?"h":"v")+it._id+"title",{avoid:{selection:n.select(r).selectAll("g."+it._id+"tick"),side:j,offsetTop:o?0:R.t,offsetLeft:o?R.l:0,maxShift:o?D.width:D.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=Z+M/2;-1===pt.indexOf("inside")&&(n=h.bBox(dt.node()),s+=o?n.width:n.height),ut=ft.select("text");var c=0,f=o&&"top"===j,m=!o&&"right"===j,g=0;if(ut.node()&&!ut.classed(T.jsPlaceholder)){var v,b=ft.select(".h"+it._id+"title-math-group").node();b&&(o&&at||!o&&!at)?(c=(n=h.bBox(b)).width,v=n.height):(c=(n=h.bBox(ft.node())).right-R.l-(o?Q:nt),v=n.bottom-R.t-(o?nt:Q),o||"top"!==j||(s+=n.height,g=n.height)),m&&(ut.attr("transform",u(c/2+ht/2,0)),c*=2),s=Math.max(s,o?c:v)}var x=2*(o?C:P)+s+S+M/2,w=0;!o&&N.text&&"bottom"===L&&I<=0&&(x+=w=x/2,g+=w),D._hColorbarMoveTitle=w,D._hColorbarMoveCBTitle=g;var F=S+M;t.select("."+T.cbbg).attr("x",(o?Q:nt)-F/2-(o?C:0)).attr("y",(o?nt:Q)-(o?J:P+g-w)).attr(o?"width":"height",Math.max(x-w,2)).attr(o?"height":"width",Math.max(J+F,2)).call(d.fill,z).call(d.stroke,e.bordercolor).style("stroke-width",S);var B=m?Math.max(c-10,0):0;if(t.selectAll("."+T.cboutline).attr("x",(o?Q:nt+C)+B).attr("y",(o?nt+P-J:Q)+(f?mt:0)).attr(o?"width":"height",Math.max(Z,2)).attr(o?"height":"width",Math.max(J-(o?2*P+mt:2*C+B),2)).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":M}),t.attr("transform",u(R.l-(o?$*x:0),R.t-(o?0:(1-tt)*x-g))),!o&&(S||i(z).getAlpha()&&!i.equals(D.paper_bgcolor,z))){var V=dt.selectAll("text"),U=V[0].length,H=t.select("."+T.cbbg).node(),q=h.bBox(H),G=h.getTranslate(t);V.each((function(t,e){var r=U-1;if(0===e||e===r){var n,i=h.bBox(this),a=h.getTranslate(this);if(e===r){var o=i.right+a.x;(n=q.right+G.x+nt-S-2+O-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=q.left+G.x+nt+S+2-s)<0&&(n=0)}n&&(U<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var W={},Y=A[E],X=k[E],K=A[L],et=k[L],rt=x-Z;o?("pixels"===p?(W.y=I,W.t=J*K,W.b=J*et):(W.t=W.b=0,W.yt=I+l*K,W.yb=I-l*et),"pixels"===_?(W.x=O,W.l=x*Y,W.r=x*X):(W.l=rt*Y,W.r=rt*X,W.xl=O-y*Y,W.xr=O+y*X)):("pixels"===p?(W.x=O,W.l=J*Y,W.r=J*X):(W.l=W.r=0,W.xl=O+l*Y,W.xr=O-l*X),"pixels"===_?(W.y=1-I,W.t=x*K,W.b=x*et):(W.t=rt*K,W.b=rt*et,W.yt=I-y*K,W.yb=I+y*et)),a.autoMargin(r,e._id,W)}],r)}(r,e,t);y&&y.then&&(t._promises||[]).push(y),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),p(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);p(t,f)},doneFn:function(){if(p(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":479,"../../lib":525,"../../lib/extend":515,"../../lib/setcursor":546,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"../../plots/cartesian/axis_defaults":578,"../../plots/cartesian/layout_attributes":589,"../../plots/cartesian/position_defaults":592,"../../plots/plots":638,"../../registry":657,"../color":363,"../colorscale/helpers":374,"../dragelement":382,"../drawing":385,"../titles":472,"./constants":365,"@plotly/d3":54,tinycolor2:309}],368:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":525}],369:[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":364,"./defaults":366,"./draw":367,"./has_colorbar":368}],370:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",p=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(p+(r={z:"z",c:"color"}[a]));var h=a+"auto",d=a+"min",m=a+"max",g=a+"mid",y=(s(p+h),s(p+d),s(p+m),{});y[d]=y[m]=void 0;var v={};v[h]=!1;var b={};return"color"===r&&(b.color={valType:"color",arrayOk:!0,editType:f||"style"},e.anim&&(b.color.anim=!0)),b[h]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},b[d]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},b[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:v},b[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},b.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},b.autocolorscale={valType:"boolean",dflt:!1!==e.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},b.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(b.showscale={valType:"boolean",dflt:c,editType:"calc"},b.colorbar=n),e.noColorAxis||(b.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),b}},{"../../lib/regex":542,"../../lib/sort_object_keys":548,"../colorbar/attributes":364,"./scales.js":378}],371:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),p=!1!==f.auto,h=f.min,d=f.max,m=f.mid,g=function(){return i.aggNums(Math.min,null,l)},y=function(){return i.aggNums(Math.max,null,l)};(void 0===h?h=g():p&&(h=u._colorAx&&n(h)?Math.min(h,g()):g()),void 0===d?d=y():p&&(d=u._colorAx&&n(d)?Math.max(d,y()):y()),p&&void 0!==m&&(d-m>m-h?h=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":525,"./helpers":374,"fast-isnumeric":186}],372:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=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,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],380:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":525}],381:[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)}},{}],382:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var 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)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,p,h,d,m,g=t.gd,y=1,v=g._context.doubleClickDelay,b=t.element;g._mouseDownTime||(g._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=_,a?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=_,b.addEventListener("touchstart",_,{passive:!1})):b.ontouchstart=_;var x=t.clampFn||function(t,e,r){return Math.abs(t)v&&(y=Math.max(y-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(y,h),!m){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)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":525,"../../plots/cartesian/constants":583,"./align":379,"./cursor":380,"./unhover":383,"has-hover":224,"has-passive-events":225,"mouse-event-offset":238}],383:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":513,"../../lib/events":514,"../../lib/throttle":552,"../fx/constants":397}],384:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],385:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,p=t("../../lib/svg_text_utils"),h=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),y=t("../../traces/scatter/make_bubble_size_func"),v=t("../../components/fx/helpers").appendArrayPointValue,b=e.exports={};function x(t,e,r){var n=e.fillpattern,i=n&&b.getPatternAttr(n.shape,0,"");if(i){var a=b.getPatternAttr(n.bgcolor,0,null),o=b.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=b.getPatternAttr(n.size,0,8),u=b.getPatternAttr(n.solidity,0,.3),f=e.uid;b.pattern(t,"point",r,f,i,l,u,void 0,n.fillmode,a,o,s)}else e.fillcolor&&t.call(c.fill,e.fillcolor)}b.font=function(t,e,r,n){i.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(c.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,i){t.call(b.setPosition,e,r).call(b.setSize,n,i)},b.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},b.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);b.translatePoint(t,i,e,r)}))},b.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){b.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},b.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(b.dashLine,s,o)}))},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.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},b.singleFillStyle=function(t,e){var r=n.select(t.node());x(t,((r.data()[0]||[])[0]||{}).trace||{},e)},b.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&x(r,t[0].trace,e)}))};var _=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolBackOffs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolNoFill={},b.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;b.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),b.symbolNames[r]=t,b.symbolFuncs[r]=e.f,b.symbolBackOffs[r]=e.backoff||0,e.needLine&&(b.symbolNeedLines[r]=!0),e.noDot?b.symbolNoDot[r]=!0:b.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(b.symbolNoFill[r]=!0)}));var w=b.symbolNames.length;function A(t,e,r,n){var i=t%100;return b.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}b.symbolNumber=function(t){if(o(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=b.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var k={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0},M=a("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:T},verticalreversed:{node:"linearGradient",attrs:T,reversed:!0}};b.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=S[a],p=new Array(u),h=0;h=100;var f=rt(t,r),p=G(t,r);e.attr("d",A(u,l,f,p))}var h,d,m,g=!1;if(t.so)m=s.outlierwidth,d=s.outliercolor,h=o.outliercolor;else{var y=(s||{}).width;m=(t.mlw+1||y+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(h=c.defaultLine,g=!0),h="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(h=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,h).style({"stroke-width":(m||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:m)+"px");var v=o.gradient,x=t.mgt;x?g=!0:x=v&&v.type,i.isArrayOrTypedArray(x)&&(x=x[0],S[x]||(x=0));var _=o.pattern,w=_&&b.getPatternAttr(_.shape,t.i,"");if(x&&"none"!==x){var k=t.mgc;k?g=!0:k=v.color;var T=r.uid;g&&(T+="-"+t.i),b.gradient(e,a,T,x,[[0,k],[1,h]],"fill")}else if(w){var M=b.getPatternAttr(_.bgcolor,t.i,null),z=b.getPatternAttr(_.fgcolor,t.i,null),E=_.fgopacity,L=b.getPatternAttr(_.size,t.i,8),C=b.getPatternAttr(_.solidity,t.i,.3),P=t.mcc||i.isArrayOrTypedArray(_.shape)||i.isArrayOrTypedArray(_.bgcolor)||i.isArrayOrTypedArray(_.size)||i.isArrayOrTypedArray(_.solidity),O=r.uid;P&&(O+="-"+t.i),b.pattern(e,"point",a,O,w,L,C,t.mcc,_.fillmode,M,z,E)}else c.fill(e,h);m&&c.stroke(e,d)}},b.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=b.tryColorscale(r,""),e.lineScale=b.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?y(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,b.makeSelectedPointStyleFns(t)),e},b.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,p=void 0!==u,h=void 0!==f;(i.isArrayOrTypedArray(c)||p||h)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?p?u:e:h?f:m*e});var d=a.color,g=o.color,y=s.color;(g||y)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?g||e:y||e});var v=a.size,b=o.size,x=s.size,_=void 0!==b,w=void 0!==x;return l.traceIs(t,"symbols")&&(_||w)&&(e.selectedSizeFn=function(t){var e=t.mrc||v/2;return t.selected?_?b/2:e:w?x/2:e}),e},b.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},b.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",A(b.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}b.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=b.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},h={};v(h,e,t.i);var d=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,h,t,d)}var m=t.tp||e.textposition,g=L(t,e),y=a?a(t):t.tc||e.textfont.color;o.call(b.font,t.tf||e.textfont.family,g,y).text(c).call(p.convertToTspans,r).call(E,m,g,t.mrc)}else o.remove()}))}},b.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=b.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=L(t,e);c.fill(i,a);var u=l.traceIs(e,"bar-like");E(i,o,s,t.mrc2||t.mrc,u)}))}};var C,P;function O(t,e,r){return r&&(t=N(t)),e?D(t[1]):I(t[0])}function I(t){var e=n.round(t,2);return C=e,e}function D(t){var e=n.round(t,2);return P=e,e}function R(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,p=3*c*(l+c),h=3*l*(l+c);return[[I(e[0]+(p&&u/p)),D(e[1]+(p&&f/p))],[I(e[0]-(h&&u/h)),D(e[1]-(h&&f/h))]]}b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||x>=f&&x<=c)&&(_<=p&&_>=u||_>=p&&_<=u)&&(t=[x,_])}return t}b.steps=function(t){var e=F[t]||B;return function(t){for(var r="M"+I(t[0][0])+","+D(t[0][1]),n=t.length,i=1;i=1e4&&(b.savedBBoxes={},j=0),r&&(b.savedBBoxes[r]=g),j++,i.extendFlat({},g)},b.setClipUrl=function(t,e,r){t.attr("clip-path",U(e,r))},b.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}},b.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},b.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}},b.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var H=/\s*sc.*/;b.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(H,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var q=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}b.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(q);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},b.getMarkerStandoff=G;var W,Y,Z,X,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,c=e._yA;if(!l||!c)return 90;r=l.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var u,f=t.lonlat[0],p=t.lonlat[1],h=e._geo.project([f,p+1e-5]),d=e._geo.project([f+1e-5,p]),m=Q(d[1]-n,d[0]-r),g=Q(h[1]-n,h[0]-r);if("north"===a)u=i/180*Math.PI;else if("previous"===a){var y=f/180*Math.PI,v=p/180*Math.PI,b=W/180*Math.PI,x=Y/180*Math.PI,_=b-y,w=$(x)*tt(_),A=tt(x)*$(v)-$(x)*tt(v)*$(_);u=-Q(w,A)-Math.PI,W=f,Y=p}var k=et(m,[$(u),0]),T=et(g,[tt(u),0]);i=Q(k[1]+T[1],k[0]+T[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var M=r-Z,S=n-X,z=e.line&&e.line.shape||"",E=z.slice(z.length-1);"h"===E&&(S=0),"v"===E&&(M=0),i+=Q(S,M)/Math.PI*180+90}else i=null}return Z=r,X=n,J=t.i,K=e.uid,i}b.getMarkerAngle=rt},{"../../components/fx/helpers":399,"../../constants/alignment":479,"../../constants/interactions":486,"../../constants/xmlns_namespaces":488,"../../lib":525,"../../lib/svg_text_utils":551,"../../registry":657,"../../traces/scatter/make_bubble_size_func":965,"../../traces/scatter/subtypes":973,"../color":363,"../colorscale":375,"./symbol_defs":386,"@plotly/d3":54,"fast-isnumeric":186,tinycolor2:309}],386:[function(t,e,r){"use strict";var n,i,a,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,p=Math.cos,h=Math.sin;function d(t){return null===t}function m(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=p(t),i=h(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,d=0,m=s(r),g="",y=0;y0;e.each((function(e){var f,p=e[0].trace,h=p.error_x||{},d=p.error_y||{};p.ids&&(f=function(t){return t.id});var m=o.hasMarkers(p)&&p.marker.maxdisplayed>0;d.visible||h.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,f);if(g.exit().remove(),e.length){h.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);u&&y.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=d.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="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(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var p=e.select("path.xerror");if(h.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(h.copy_ystyle?d:h).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!p.size()?p=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(p=p.transition().duration(s.duration).ease(s.easing)),p.attr("d",a)}else p.remove()}}))}}))}},{"../../traces/scatter/subtypes":973,"../drawing":385,"@plotly/d3":54,"fast-isnumeric":186}],393:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":363,"@plotly/d3":54}],394:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":515,"../../plots/font_attributes":604,"./layout_attributes":404}],395:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||ot<0||ot>w[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=ot+w[0]._offset,U="xval"in e?y.flat(l,e.xval):y.p2c(_,at),H="yval"in e?y.flat(l,e.yval):y.p2c(w,ot),!i(U[0])||!i(H[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(G=0;Gtt&&(et.splice(0,tt),ct=et[0].distance),v&&0!==B&&0===et.length){$.distance=B,$.index=!1;var f=Y._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=B}))),f&&f.length){var p,d=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];i(m.x0)&&i(m.y0)&&(p=pt(m),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>p.spikeDistance)&&(nt.vLinePoint=p))}var g=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(g.length){var b=g[0];i(b.x0)&&i(b.y0)&&(p=pt(b),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>p.spikeDistance)&&(nt.hLinePoint=p))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)At-1;Mt--)Lt(et[Mt]);et=St,gt()}var Ct=t._hoverdata,Pt=[],Ot=j(t),It=V(t);for(q=0;q1||et.length>1)||"closest"===C&&it&&et.length>1,Yt=h.combine(u.plot_bgcolor||h.background,u.paper_bgcolor),Zt=P(et,{gd:t,hovermode:C,rotateLabels:Wt,bgColor:Yt,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});y.isUnifiedHover(C)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,p=t.size(),h=new Array(p),d=0;function m(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(f=-1),h[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?A:1)/2,pmin:0,pmax:i?r.width:r.height}]})),h.sort((function(t,e){return t[0].posref-e[0].posref||f*(e[0].traceIndex-t[0].traceIndex)}));for(;!n&&u<=p;){for(u++,n=!0,o=0;o.01&&v.pmin===b.pmin&&v.pmax===b.pmax){for(s=y.length-1;s>=0;s--)y[s].dp+=i;for(g.push.apply(g,y),h.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(a=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}h.forEach(m)}for(o=h.length-1;o>=0;o--){var x=h[o];for(s=x.length-1;s>=0;s--){var _=x[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Zt,Wt?"xa":"ya",u),I(Zt,Wt,u._invScaleX,u._invScaleY));if(s&&s.tagName){var Xt=g.getComponentMethod("annotations","hasClickToShow")(t,Pt);f(n.select(s),Xt?"pointer":"")}if(!s||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Ct))return;Ct&&t.emit("plotly_unhover",{event:e,points:Ct});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:U,yvals:H})}(t,e,r,a,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=V(i),s=P(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),p=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,b=y.offsetTop;u+=v,f+=v,p+=b,d+=b}c.bbox={x0:u+o,x1:f+o,y0:p+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;return{color:t.color||h.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,nameLength:t.nameLength,textAlign:t.textAlign,trace:t.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:t.hovertemplate||!1,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||h.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function P(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var A=e.fontFamily||v.HOVERFONT,k=e.fontSize||v.HOVERFONTSIZE,T=t[0],z=T.xa,E=T.ya,C=a.charAt(0),P=C+"Label",I=T[P];if(void 0===I&&"multicategory"===z.type)for(var D=0;Di.width-x?(g=i.width-x,e.attr("d","M"+(x-M)+",0L"+x+","+b+M+"v"+b+(2*S+v.height)+"H-"+x+"V"+b+M+"H"+(x-2*M)+"Z")):e.attr("d","M0,0L"+M+","+b+M+"H"+(S+v.width/2)+"v"+b+(2*S+v.height)+"H-"+(S+v.width/2)+"V"+b+M+"H-"+M+"Z")}else{var _,L,C;"right"===E.side?(_="start",L=1,C="",g=z._offset+z._length):(_="end",L=-1,C="-",g=z._offset),y=E._offset+(T.y0+T.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+C+M+","+M+"V"+(S+v.height/2)+"h"+C+(2*S+v.width)+"V-"+(S+v.height/2)+"H"+C+M+"V-"+M+"Z");var P,O=v.height/2,D=F-v.top-O,R="clip"+i._uid+"commonlabel"+E._id;if(g=0?st:lt+ft=0?lt:bt+ft=0?at:ot+pt=0?ot:xt+pt=0,"top"!==t.idealAlign&&G||!W?G?(P+=R/2,t.anchor="start"):t.anchor="middle":(P-=R/2,t.anchor="end");else if(t.pos=P,G=C+D/2+Y<=B,W=C-D/2-Y>=0,"left"!==t.idealAlign&&G||!W)if(G)C+=D/2,t.anchor="start";else{t.anchor="middle";var Z=Y/2,X=C+Z-B,J=C-Z;X>0&&(C-=X),J<0&&(C+=-J)}else C-=D/2,t.anchor="end";w.attr("text-anchor",t.anchor),z&&T.attr("text-anchor",t.anchor),e.attr("transform",s(C,P)+(c?l(_):""))})),_t}function O(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var p=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(p[c+"other"]=p[c+"Val"],p[c+"otherLabel"]=p[c+"Label"]),l=(l=o.hovertemplateString(f,p,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(C,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}function I(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(M+S),h=f+c*(t.txwidth+S),d=0,m=t.offset,g="middle"===s;g&&(f-=t.tx2width/2,h+=t.txwidth/2+S),e&&(m*=-T,d=t.offset*k),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*M+d)+","+o(M+m)+"v"+o(t.by/2-M)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*M+d)+"V"+o(m-M)+"Z");var y=d+f,v=m+t.ty0-t.by/2+S,b=t.textAlign||"auto";"auto"!==b&&("left"===b&&"start"!==s?(i.attr("text-anchor","start"),y=g?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===b&&"end"!==s&&(i.attr("text-anchor","end"),y=g?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(y),o(v)),t.tx2width&&(r.select("text.name").call(u.positionText,a(h+c*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(p.setRect,a(h+(c-1)*t.tx2width/2+d),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function D(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}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:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+m.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 p=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+p+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+p,"y"===e&&(t.distance+=1)}var h=t.hoverinfo||t.trace.hoverinfo;return h&&"all"!==h&&(-1===(h=Array.isArray(h)?h:h.split("+")).indexOf("x")&&(t.xLabel=void 0),-1===h.indexOf("y")&&(t.yLabel=void 0),-1===h.indexOf("z")&&(t.zLabel=void 0),-1===h.indexOf("text")&&(t.text=void 0),-1===h.indexOf("name")&&(t.name=void 0)),t}function R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var d=h.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=e.hLinePoint;n=v&&v.xa,"cursor"===(i=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=n._offset+v.x,y=i._offset+v.y);var b,x,_=a.readability(v.color,d)<1.5?h.contrast(d):v.color,w=i.spikemode,A=i.spikethickness,k=i.spikecolor||_,T=m.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(b=T,x=g),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),b=l.l+M*l.w,x=l.l+S*l.w}o.insert("line",":first-child").attr({x1:b,x2:x,y1:y,y2:y,"stroke-width":A,stroke:k,"stroke-dasharray":p.dashStyle(i.spikedash,A)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:b,x2:x,y1:y,y2:y,"stroke-width":A+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:T+("right"!==i.side?A:-A),cy:y,r:A,fill:k}).classed("spikeline",!0)}if(f){var z,E,L=e.vLinePoint;n=L&&L.xa,i=L&&L.ya,"cursor"===n.spikesnap?(z=c.pointerX,E=c.pointerY):(z=n._offset+L.x,E=i._offset+L.y);var C,P,O=a.readability(L.color,d)<1.5?h.contrast(d):L.color,I=n.spikemode,D=n.spikethickness,R=n.spikecolor||O,F=m.getPxPosition(t,n);if(-1!==I.indexOf("toaxis")||-1!==I.indexOf("across")){if(-1!==I.indexOf("toaxis")&&(C=F,P=E),-1!==I.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),C=l.t+(1-N)*l.h,P=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:z,x2:z,y1:C,y2:P,"stroke-width":D,stroke:R,"stroke-dasharray":p.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:z,x2:z,y1:C,y2:P,"stroke-width":D+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==I.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:z,cy:F-("top"!==n.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function V(t){return t.offsetLeft+t.clientLeft}function U(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],p=c[1],h=u[0],d=u[1];return{x:f,y:p,width:h-f,height:d-p,top:Math.min(p,d),left:Math.min(f,h),right:Math.max(f,h),bottom:Math.max(p,d)}}},{"../../lib":525,"../../lib/events":514,"../../lib/override_cursor":536,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"../../registry":657,"../color":363,"../dragelement":382,"../drawing":385,"../legend/defaults":415,"../legend/draw":416,"./constants":397,"./helpers":399,"@plotly/d3":54,"fast-isnumeric":186,tinycolor2:309}],401:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.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":525,"../color":363,"./helpers":399}],402:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":525,"./layout_attributes":404}],403:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":525,"../dragelement":382,"./attributes":394,"./calc":395,"./click":396,"./constants":397,"./defaults":398,"./helpers":399,"./hover":400,"./layout_attributes":404,"./layout_defaults":405,"./layout_global_defaults":406,"@plotly/d3":54}],404:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes"),a=i({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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),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":604,"./constants":397}],405:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":525,"./hoverlabel_defaults":401,"./hovermode_defaults":402,"./layout_attributes":404}],406:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":525,"./hoverlabel_defaults":401,"./layout_attributes":404}],407:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("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:a({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"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),p=0;p1){if(!p&&!h&&!d)"independent"===k("pattern")&&(p=!0);g._hasSubplotGrid=p;var b,x,_="top to bottom"===k("roworder"),w=p?.2:.1,A=p?.3:.1;m&&e._splomGridDflt&&(b=e._splomGridDflt.xside,x=e._splomGridDflt.yside),g._domains={x:u("x",k,w,b,v),y:u("y",k,A,x,y,_)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,p=t.grid||{},h=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(d){var b=p.subplots||[];l=r.subplots=new Array(m);var x=1;for(n=0;n1);if(!1===_&&(e.legend=void 0),(!1!==_||f.uirevision)&&(h("uirevision",e.uirevision),!1!==_)){h("bgcolor",e.paper_bgcolor),h("bordercolor"),h("borderwidth");var w,A,k,T=i.coerceFont(h,"font",e.font),M="h"===h("orientation");if(M?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(A=1.1,k="bottom"):(A=-.1,k="top")):(w=1.02,A=1,k="auto"),h("traceorder",b),c.isGrouped(e.legend)&&h("tracegroupgap"),h("entrywidth"),h("entrywidthmode"),h("itemsizing"),h("itemwidth"),h("itemclick"),h("itemdoubleclick"),h("groupclick"),h("x",w),h("xanchor"),h("y",A),h("yanchor",k),h("valign"),i.noneOrAll(f,p,["x","y"]),h("title.text")){h("title.side",M?"left":"top");var S=i.extendFlat({},T,{size:i.bigFont(T.size)});i.coerceFont(h,"title.font",S)}}}},{"../../lib":525,"../../plot_api/plot_template":565,"../../plots/attributes":572,"../../plots/layout_attributes":629,"../../registry":657,"./attributes":413,"./helpers":419}],416:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),p=t("./handle_click"),h=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,g=d.FROM_TL,y=d.FROM_BR,v=t("./get_legend_data"),b=t("./style"),x=t("./helpers");function _(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function w(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&p(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&p(r,t,n)}}function A(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),p=!r._inHover&&e._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(c.font,a).text(p?k(n,d):n);var g=r.itemwidth+2*h.itemGap;f.positionText(m,g,0),p?m.call(f.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(k(n,d)).call(M,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],p=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");p.set(s.trace._group,n),c=p.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):M(m,t,e,r)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function T(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.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||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function M(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,p,d=s.size*m;if(o){var g=c.bBox(o);u=g.height,p=g.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var y=t.select(1===n?".legendtitletext":".legendtext"),v=f.lineCount(y),b=y.node();if(u=d*v,p=b?c.bBox(b).width:0,1===n)"left"===r.title.side&&(p+=2*h.itemGap),f.positionText(y,l+h.titlePad,l+d);else{var x=2*h.itemGap+r.itemwidth;i.groupTitle&&(x=h.itemGap,p-=r.itemwidth),f.positionText(y,x,-d*((v-1)/2-.3))}}1===n?(r._titleWidth=p,r._titleHeight=u):(i.lineHeight=d,i.height=Math.max(u,16)+3,i.width=p)}(e,r,n,i)}))}function S(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function z(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,p="legend"+f._uid,d=e._inHover;d?(r=e.layer,p+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=v(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&v(t.calcdata,e)}var m=f.hiddenlabels||[];if(!(d||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+p).remove(),a.autoMargin(t,"legend");var k=i.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),E=i.ensureSingleById(f._topdefs,"clipPath",p,(function(t){t.append("rect")})),L=i.ensureSingle(k,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));L.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var C=i.ensureSingle(k,"g","scrollbox"),P=e.title;if(e._titleWidth=0,e._titleHeight=0,P.text){var O=i.ensureSingle(C,"text","legendtitletext");O.attr("text-anchor","start").call(c.font,P.font).text(P.text),M(O,C,t,e,1)}else C.selectAll(".legendtitletext").remove();var I=i.ensureSingle(k,"rect","scrollbar",(function(t){t.attr(h.scrollBarEnterAttrs).call(u.fill,h.scrollBarColor)})),D=C.selectAll("g.groups").data(s);D.enter().append("g").attr("class","groups"),D.exit().remove();var R=D.selectAll("g.traces").data(i.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(A,t,e)})).call(b,t,e).each((function(){d||n.select(this).call(T,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=x.isVertical(i),l=x.isGrouped(i),u="fraction"===i.entrywidthmode,f=i.borderwidth,p=2*f,d=h.itemGap,m=i.itemwidth+2*d,g=2*(f+d),y=z(i),v=i.y<0||0===i.y&&"top"===y,b=i.y>1||1===i.y&&"bottom"===y,w=i.tracegroupgap,A={};i._maxHeight=Math.max(v||b?a.height/2:o.h,30);var k=0;i._width=0,i._height=0;var T=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+T[0],f+T[1]+i._height+e/2+d),i._height+=e,i._width=Math.max(i._width,t[0].width)})),k=m+i._width,i._width+=d+m+p,i._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var M=S(i),E=i.x<0||0===i.x&&"right"===M,L=i.x>1||1===i.x&&"left"===M,C=b||v,P=a.width/2;i._maxWidth=Math.max(E?C&&"left"===M?o.l+o.w:P:L?C&&"right"===M?o.r+o.w:P:o.w,2*m);var O=0,I=0;r.each((function(t){var e=_(t,i,m);O=Math.max(O,e),I+=e})),k=null;var D=0;if(l){var R=0,F=0,B=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,i,m),a=r[0].height;c.setTranslate(this,T[0],T[1]+f+d+a/2+e),e+=a,t=Math.max(t,n),A[r[0].trace.legendgroup]=t}));var r=t+d;F>0&&r+f+F>i._maxWidth?(D=Math.max(D,F),F=0,B+=R+w,R=e):R=Math.max(R,e),c.setTranslate(this,F,B),F+=r})),i._width=Math.max(D,F)+f,i._height=B+R+g}else{var N=r.size(),j=I+p+(N-1)*d=i._maxWidth&&(D=Math.max(D,q),U=0,H+=V,i._height+=V,V=0),c.setTranslate(this,T[0]+f+U,T[1]+f+H+e/2+d),q=U+r+d,U+=n,V=Math.max(V,e)})),j?(i._width=U+p,i._height=V+g):(i._width=Math.max(D,q)+p,i._height+=V+g)}}i._width=Math.ceil(Math.max(i._width+T[0],i._titleWidth+2*(f+h.titlePad))),i._height=Math.ceil(Math.max(i._height+T[1],i._titleHeight+2*(f+h.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,W=G.legendText||G.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=t[0].trace.legendgroup,o=_(t,i,m);l&&""!==a&&(o=A[a]);var f=W?m:k||o;s||u||(f+=d/2),c.setRect(e,0,-r/2,f,r)}))}(t,D,R,e)},function(){var s,u,m,v,b=f._size,x=e.borderwidth;if(!d){if(function(t){var e=t._fullLayout.legend,r=S(e),n=z(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*y[r],b:e._effHeight*y[n],t:e._effHeight*g[n]})}(t))return;var _=b.l+b.w*e.x-g[S(e)]*e._width,A=b.t+b.h*(1-e.y)-g[z(e)]*e._effHeight;if(f.margin.autoexpand){var T=_,M=A;_=i.constrain(_,0,f.width-e._width),A=i.constrain(A,0,f.height-e._effHeight),_!==T&&i.log("Constrain legend.x to make legend fit inside graph"),A!==M&&i.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(k,_,A)}if(I.on(".drag",null),k.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var P=e._effHeight;d&&(P=e._height),L.attr({width:e._width-x,height:P-x,x:x/2,y:x/2}),c.setTranslate(C,0,0),E.select("rect").attr({width:e._width-2*x,height:P-2*x,x:x,y:x}),c.setClipUrl(C,p,t),c.setRect(I,0,0,0,0),delete e._scrollY}else{var O,D,R,F=Math.max(h.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*h.scrollBarMargin,N=e._height-e._effHeight,j=B/N,V=Math.min(e._scrollY||0,N);L.attr({width:e._width-2*x+h.scrollBarWidth+h.scrollBarMargin,height:e._effHeight-x,x:x/2,y:x/2}),E.select("rect").attr({width:e._width-2*x+h.scrollBarWidth+h.scrollBarMargin,height:e._effHeight-2*x,x:x,y:x+V}),c.setClipUrl(C,p,t),q(V,F,j),k.on("wheel",(function(){q(V=i.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==V&&V!==N&&n.event.preventDefault()}));var U=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;O="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=V})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(V=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,N)}(R,O,D),F,j))}));I.call(U);var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(O=t.changedTouches[0].clientY,R=V)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,q(V=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,N)}(R,O,D),F,j))}));C.call(H)}function q(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(C,0,-r),c.setRect(I,e._width,h.scrollBarMargin+r*i,h.scrollBarWidth,n),E.select("rect").attr("y",x+r)}t._context.edits.legendPosition&&(k.classed("cursor-move",!0),l.init({element:k.node(),gd:t,prepFn:function(){var t=c.getTranslate(k);m=t.x,v=t.y},moveFn:function(t,r){var n=m+t,i=v+r;c.setTranslate(k,n,i),s=l.align(n,0,b.l,b.l+b.w,e.xanchor),u=l.align(i,0,b.t+b.h,b.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=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}));i.size()>0&&w(t,k,i,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":479,"../../lib":525,"../../lib/events":514,"../../lib/svg_text_utils":551,"../../plots/plots":638,"../../registry":657,"../color":363,"../dragelement":382,"../drawing":385,"./constants":414,"./get_legend_data":417,"./handle_click":418,"./helpers":419,"./style":421,"@plotly/d3":54}],417:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,p={},h=0,d=0;function m(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+h;u.push(n),c[n]=[r],h++}}for(r=0;rT&&(k=T)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var M=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var y=e._fullLayout;r||(r=y.legend);var v="constant"===r.itemsizing,b=r.itemwidth,x=(b+2*h.itemGap)/2,_=o(x,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return v?n:Math.min(i,r)};function A(t,a,o){var u=t[0].trace,f=u.marker||{},p=f.line||{},h=o?u.visible&&u.type===o:i.traceIs(u,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(h?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var h=a.mcc;if(!r._inHover&&"mc"in a){var d=c(f),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),h=s.tryColorscale(f,"")(m)}var y=h||a.mc||f.color,v=f.pattern,b=v&&s.getPatternAttr(v.shape,0,"");if(b){var x=s.getPatternAttr(v.bgcolor,0,null),_=s.getPatternAttr(v.fgcolor,0,null),A=v.fgopacity,k=g(v.size,8,10),T=g(v.solidity,.5,1),M="legend-"+u.uid;i.call(s.pattern,"legend",e,M,b,k,T,h,v.fillmode,x,_,A)}else i.call(l.fill,y);o&&l.stroke(i,a.mlc||p.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,h=w(p(u.width,o.pts),u,5,2),d=a.minExtend(s,{marker:{line:{width:h}}});d.marker.line.color=u.color;var m=a.minExtend(o,{trace:d});f(c,m,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.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,i=t[0].trace,o=[];if(i.visible)switch(i.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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),p=c(i),h=p.colorscale,m=p.reversescale;if(h){if(!r){var g=h.length;u=0===o?h[m?g-1:0][1]:1===o?h[m?0:g-1][1]:h[Math.floor((g-1)/2)][1]}}else{var y=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(y)?y[o]||y[0]:y}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(m,"radial"===r),h,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,A(t,this,"waterfall")}var a=[];e.visible&&r&&(a=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(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){A(t,this,"funnel")})).each((function(t){A(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:v?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,i,o=m(t),l=o.showFill,f=o.showLine,p=o.showGradientLine,h=o.showGradientFill,g=o.anyFill,y=o.anyLine,v=t[0],x=v.trace,_=c(x),A=_.colorscale,k=_.reversescale,T=u.hasMarkers(x)||!g?"M5,0":y?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(l||h?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",T+"h"+b+"v6h-"+b+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+x.uid;s.gradient(t,e,r,d(k),A,"fill")}})),f||p){var z=w(void 0,x.line,10,5);i=a.minExtend(x,{line:{width:z}}),r=[a.minExtend(v,{trace:i})]}var E=M.select(".legendlines").selectAll("path").data(f||p?[r]:[]);E.enter().append("path").classed("js-line",!0),E.exit().remove(),E.attr("d",T+(p?"l"+b+",0.0001":"h"+b)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+x.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),A,"stroke")}})})).each((function(t){var r,i,o=m(t),l=o.anyFill,c=o.anyLine,f=o.showLine,p=o.showMarker,h=t[0],d=h.trace,g=!p&&!c&&!l&&u.hasText(d);function y(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function b(t){return h._distinct&&h.index&&t[h.index]?t[h.index]:t[0]}if(p||g||f){var x={},w={};if(p){x.mc=y("marker.color",b),x.mx=y("marker.symbol",b),x.mo=y("marker.opacity",a.mean,[.2,1]),x.mlc=y("marker.line.color",b),x.mlw=y("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var A=y("marker.size",a.mean,[2,16],12);x.ms=A,w.marker.size=A}f&&(w.line={width:y("line.width",b,[0,10],5)}),g&&(x.tx="Aa",x.tp=y("textposition",b),x.ts=10,x.tc=y("textfont.color",b),x.tf=y("textfont.family",b)),r=[a.minExtend(h,x)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var k=n.select(this).select("g.legendpoints"),T=k.selectAll("path.scatterpts").data(p?r:[]);T.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),T.exit().remove(),T.call(s.pointStyle,i,e),p&&(r[0].mrc=3);var M=k.selectAll("g.pointtext").data(g?r:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),M.exit().remove(),M.selectAll("text").call(s.textPointStyle,i,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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":525,"../../registry":657,"../../traces/pie/helpers":927,"../../traces/pie/style_one":933,"../../traces/scatter/subtypes":973,"../color":363,"../colorscale/helpers":374,"../drawing":385,"./constants":414,"@plotly/d3":54}],422:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":424}],423:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),p=c._cartesianSpikesEnabled;if("zoom"===s){var h,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(i=0;i1?(P=["toggleHover"],O=["resetViews"]):y?(C=["zoomInGeo","zoomOutGeo"],P=["hoverClosestGeo"],O=["resetGeo"]):g?(P=["hoverClosest3d"],O=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(C=["zoomInMapbox","zoomOutMapbox"],P=["toggleHover"],O=["resetViewMapbox"]):x?P=["hoverClosestGl2d"]:v?P=["hoverClosestPie"]:T?(P=["hoverClosestCartesian","hoverCompareCartesian"],O=["resetViewSankey"]):P=["toggleHover"];m&&(P=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t=0;k--){var T=r.append("path").attr(g).style("opacity",k?.1:y).call(o.stroke,b).call(o.fill,v).call(s.dashLine,k?"solid":_,k?4+x:x);if(d(T,t,a),w){var M=l(t.layout,"selections",a);T.style({cursor:"move"});var S={element:T.node(),plotinfo:h,gd:t,editHelpers:M,isActiveSelection:!0},z=n(c,t);i(z,T,S)}else T.style("pointer-events",k?"all":"none");A[k]=T}var E=A[0];A[1].node().addEventListener("click",(function(){return function(t,e){if(!p(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void m(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=m,f(t)}}(t,E)}))}(t._fullLayout._selectionLayer)}function d(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function m(t){p(t)&&(t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t)))}e.exports={draw:f,drawOne:h,activateLastSelection:function(t){if(!p(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=m,f(t)}}},{"../../plot_api/plot_template":565,"../color":363,"../drawing":385,"../shapes/display_outlines":457,"../shapes/draw_newshape/helpers":462,"../shapes/handle_outline":464,"../shapes/helpers":465}],447:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":515,"../../drawing/attributes":384}],448:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],449:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,i=t("../../shapes/handle_outline").clearOutline,a=t("../../shapes/draw_newshape/helpers"),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,f=e.plotinfo,p=f.xaxis,h=f.yaxis,d=e.isActiveSelection,m=e.dragmode,g=(c.layout||{}).selections||[];if(!n(m)&&void 0!==d){var y=c._fullLayout._activeSelectionIndex;if(y-1,x=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(y)){W(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(p=K(_))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=h(r),l=m(r);if(s||l){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&i._fullLayout._outlining)s&&(c=A(f,t)),c&&a.call("_guiRelayout",i,{shapes:c}),l&&!V(t)&&(u=k(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:u}).then((function(){e&&T(i)}))),i._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Z(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Z),c=r.map(Z);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,ht=et[0].yref;if(nt&&ht){var dt=ct(et);ut([L(t,nt,"x"),L(t,ht,"y")])($,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),p._reselect=!1}if(!a&&p._deselect){var mt=p._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!b){var r=T.clickmode;E.done(Tt).then((function(){if(E.clear(Tt),2===t){for(xt.remove(),K=0;K-1&&U(e,k,n.xaxes,n.yaxes,n.subplot,n,xt),"event"===r&&ft(k,void 0);l.click(k,e)})).catch(M.error)}},n.doneFn=function(){kt.remove(),E.done(Tt).then((function(){E.clear(Tt),!S&&J&&n.selectionDefs&&(J.subtract=bt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Z)),(S||b)&&Y(n,S),n.doneFnCompleted&&n.doneFnCompleted(Mt),x&&ft(k,at)})).catch(M.error)}},clearOutline:b,clearSelectionsCache:Y,selectOnClick:U}},{"../../lib":525,"../../lib/clear_gl_canvases":509,"../../lib/polygon":537,"../../lib/throttle":552,"../../plot_api/subroutines":566,"../../plots/cartesian/axis_ids":580,"../../registry":657,"../color":363,"../dragelement/helpers":381,"../drawing":385,"../fx":403,"../fx/helpers":399,"../shapes/constants":455,"../shapes/display_outlines":457,"../shapes/draw_newshape/helpers":462,"../shapes/draw_newshape/newshapes":463,"../shapes/handle_outline":464,"../shapes/helpers":465,"./constants":444,"./draw":446,"./draw_newselection/newselections":449,"./helpers":450,"point-in-polygon/nested":250,polybooljs:251}],453:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{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":480,"../../lib/extend":515,"../../plot_api/plot_template":565,"../../traces/scatter/attributes":948,"../annotations/attributes":346,"../drawing/attributes":384}],454:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],p=n.aggNums(Math.max,null,f),h=n.aggNums(Math.min,null,f),d=h<0?Math.abs(h)+c:c,m=p>0?p+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,p=1/0,h=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lh&&(h=f)));return h>=p?[p,h]: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;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===z&&(t[0][0]="M"),e[S]=t,A(),k())}}()}}function B(t,r){!function(t,r){if(e.length)for(var n=0;nb?(k=f,z="y0",T=b,E="y1"):(k=b,z="y1",T=f,E="y0");X(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),Z.moveFn="move"===O?J:K,Z.altKey=n.altKey},doneFn:function(){if(v(t))return;h(e),$(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(v(t))return;$(s)}};function X(r){if(v(t))O=null;else if(R)O="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?p.getCursor(o/i,1-s/a):"move";h(e,l),O=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;I?B("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=W(A+i)):(l=function(t){return W(q(t)+i)},V&&"date"===V.type&&(l=m.encodeDate(l))),B("path",r.path=w(P,o,l))}else I?B("xanchor",r.xanchor=G(x+n)):(B("x0",r.x0=G(c+n)),B("x1",r.x1=G(y+n))),D?B("yanchor",r.yanchor=W(A+i)):(B("y0",r.y0=W(f+i)),B("y1",r.y1=W(b+i)));e.attr("d",g(t,r)),Q(s,r)}function K(n,i){if(F){var a=function(t){return t},o=a,l=a;I?B("xanchor",r.xanchor=G(x+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=W(A+i)):(l=function(t){return W(q(t)+i)},V&&"date"===V.type&&(l=m.encodeDate(l))),B("path",r.path=w(P,o,l))}else if(R){if("resize-over-start-point"===O){var u=c+n,p=D?f-i:f+i;B("x0",r.x0=I?u:G(u)),B("y0",r.y0=D?p:W(p))}else if("resize-over-end-point"===O){var h=y+n,d=D?b-i:b+i;B("x1",r.x1=I?h:G(h)),B("y1",r.y1=D?d:W(d))}}else{var v=function(t){return-1!==O.indexOf(t)},_=v("n"),j=v("s"),U=v("w"),Y=v("e"),Z=_?k+i:k,X=j?T+i:T,J=U?M+n:M,K=Y?S+n:S;D&&(_&&(Z=k-i),j&&(X=T-i)),(!D&&X-Z>10||D&&Z-X>10)&&(B(z,r[z]=D?Z:W(Z)),B(E,r[E]=D?X:W(X))),K-J>10&&(B(L,r[L]=I?J:G(J)),B(C,r[C]=I?K:G(K)))}e.attr("d",g(t,r)),Q(s,r)}function Q(t,e){(I||D)&&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 a=H(I?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=q(D?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),I&&D){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(I){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}p.init(Z),Y.node().onmousemove=X}(t,I,l,e,r,O):!0===l.editable&&I.style("pointer-events",C||c.opacity(S)*M<=.5?"stroke":"all");I.node().addEventListener("click",(function(){return function(t,e){if(!b(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeShapeIndex)return void A(t);t._fullLayout._activeShapeIndex=r,t._fullLayout._deactivateShape=A,y(t)}}(t,I)}))}}function _(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 w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function A(t){b(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,y(t)))}e.exports={draw:y,drawOne:x,eraseActiveShape:function(t){if(!b(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&lh&&(t="X"),t}));return a>h&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d}))}(e,s,c);if("pixel"===e.xsizemode){var x=s(e.xanchor);u=x+e.x0,f=x+e.x1}else u=s(e.x0),f=s(e.x1);if("pixel"===e.ysizemode){var _=c(e.yanchor);p=_-e.y0,h=_-e.y1}else p=c(e.y0),h=c(e.y1);if("line"===d)return"M"+u+","+p+"L"+f+","+h;if("rect"===d)return"M"+u+","+p+"H"+f+"V"+h+"H"+u+"Z";var w=(u+f)/2,A=(p+h)/2,k=Math.abs(w-u),T=Math.abs(A-p),M="A"+k+","+T,S=w+k+","+A;return"M"+S+M+" 0 1,1 "+(w+","+(A-T))+M+" 0 0,1 "+S+"Z"}},{"../../lib":525,"../../plots/cartesian/axes":576,"./constants":455}],466:[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":587,"./attributes":453,"./calc_autorange":454,"./defaults":456,"./draw":458,"./draw_newshape/defaults":461}],467:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps: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:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt: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":515,"../../plot_api/edit_types":558,"../../plot_api/plot_template":565,"../../plots/animation_attributes":570,"../../plots/font_attributes":604,"../../plots/pad_attributes":637,"./constants":468}],468:[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}},{}],469:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function z(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function E(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 L(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(T,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function C(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,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=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,y);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||p<0){var y={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[x.side];e.attr("transform",l(y[0],y[1]))}}}return R.call(F),O&&(z?R.on(".opacity",null):(T=0,M=!0,R.text(v).on("mouseover.opacity",(function(){n.select(this).transition().duration(p.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(p.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==b?o.call("_guiRestyle",t,y,e,b):o.call("_guiRelayout",t,y,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),R.classed("js-placeholder",M),A}}},{"../../constants/alignment":479,"../../constants/interactions":486,"../../lib":525,"../../lib/svg_text_utils":551,"../../plots/plots":638,"../../registry":657,"../color":363,"../drawing":385,"@plotly/d3":54,"fast-isnumeric":186}],473:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":515,"../../plot_api/edit_types":558,"../../plot_api/plot_template":565,"../../plots/font_attributes":604,"../../plots/pad_attributes":637,"../color/attributes":362}],474:[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"}}},{}],475:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(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,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":525,"../../plots/array_container_defaults":571,"./attributes":473,"./constants":474}],476:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),p=t("./scrollbox");function h(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?y(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||y(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,p={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},h={width:l.headerWidth,height:l.headerHeight};a.call(v,i,u,t).call(M,i,p,h),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),y(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(A,i)})),o.setTranslate(e,l.lx,l.ly)}function y(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=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(s.filterVisible(l)),p=u.enter().append("g").classed(c,!0),h=u.exit();"dropdown"===o.type?(p.attr("opacity","0").transition().attr("opacity","1"),h.transition().attr("opacity","0").remove()):h.remove();var d=0,g=0,y=o._dims,b=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(b?g=y.headerHeight+f.gapButtonHeader:d=y.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-y.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-y.openWidth);var x={x:y.lx+d+o.pad.l,y:y.ly+g+o.pad.t,yPad:f.gapButton,xPad:f.gapButton,index:0},k={l:x.x+o.borderwidth,t:x.y+o.borderwidth};u.each((function(s,l){var c=n.select(this);c.call(v,o,s,t).call(M,o,x),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,active:o.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(A,o),u.call(_,o)}))})),u.call(_,o),b?(k.w=Math.max(y.openWidth,y.headerWidth),k.h=x.y-k.t):(k.w=x.x-k.l,k.h=Math.max(y.openHeight,y.headerHeight)),k.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,p=i._dims,h=i.active;if(u)for(s=0,l=0;l0?[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(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,h);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,T=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,z=g+y;z+M>c&&(z=c-M);var E=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);E.exit().on(".drag",null).remove(),E.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=E.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:z,width:T,height:M}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=y>A,C=s.barWidth+2*s.barPad,P=s.barLength+2*s.barPad,O=d+m,I=g;O+C>l&&(O=l-C);var D=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),L?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:O,y:I,width:C,height:P}),this._vbarYMin=I+P/2,this._vbarTranslateMax=A-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=L?f+C+.5:f+.5,N=p-.5,j=k?h+M+.5:h+.5,V=o._topdefs.selectAll("#"+R).data(k||L?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",R).append("rect"),k||L?(this._clipRect=V.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||L){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 H=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(H),L&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":525,"../color":363,"../drawing":385,"@plotly/d3":54}],479:[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"}}},{}],480:[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(" ")}}},{}],481:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],482:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],483:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],484:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],485:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],486:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],487:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],488:[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}},{}],489:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],491:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s){"use strict";var l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j;return l=t.gl,c=t.context,t.strings,u=t.next,f=t.current,t.draw,t.elements,t.buffer,p=t.shader,t.attributes,h=t.vao,t.uniforms,d=t.framebuffer,t.extensions,t.timer,t.isBufferArgs,m=u.blend_color,g=f.blend_color,y=u.blend_equation,v=f.blend_equation,b=u.blend_func,x=f.blend_func,_=u.depth_range,w=f.depth_range,A=u.colorMask,k=f.colorMask,T=u.polygonOffset_offset,M=f.polygonOffset_offset,S=u.sample_coverage,z=f.sample_coverage,E=u.stencil_func,L=f.stencil_func,C=u.stencil_opFront,P=f.stencil_opFront,O=u.stencil_opBack,I=f.stencil_opBack,D=u.scissor_box,R=f.scissor_box,F=u.viewport,B=f.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},N={},j={},{draw:function(t){var n,i,a,o,s,D,F,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut;(n=t.framebuffer,i=d.getFramebuffer(n),a=d.next,d.next=i,o=c.framebufferWidth,c.framebufferWidth=i?i.width:c.drawingBufferWidth,s=c.framebufferHeight,c.framebufferHeight=i?i.height:c.drawingBufferHeight,i!==d.cur&&(i?l.bindFramebuffer(36160,i.framebuffer):l.bindFramebuffer(36160,null),d.cur=i),f.dirty)&&((K=u.dither)!==f.dither&&(K?l.enable(3024):l.disable(3024),f.dither=K),(Q=u.blend_enable)!==f.blend_enable&&(Q?l.enable(3042):l.disable(3042),f.blend_enable=Q),$=m[0],tt=m[1],et=m[2],rt=m[3],$===g[0]&&tt===g[1]&&et===g[2]&&rt===g[3]||(l.blendColor($,tt,et,rt),g[0]=$,g[1]=tt,g[2]=et,g[3]=rt),nt=y[0],it=y[1],nt===v[0]&&it===v[1]||(l.blendEquationSeparate(nt,it),v[0]=nt,v[1]=it),at=b[0],ot=b[1],st=b[2],lt=b[3],at===x[0]&&ot===x[1]&&st===x[2]&<===x[3]||(l.blendFuncSeparate(at,ot,st,lt),x[0]=at,x[1]=ot,x[2]=st,x[3]=lt),(ct=u.depth_enable)!==f.depth_enable&&(ct?l.enable(2929):l.disable(2929),f.depth_enable=ct),(ut=u.depth_func)!==f.depth_func&&(l.depthFunc(ut),f.depth_func=ut),ft=_[0],pt=_[1],ft===w[0]&&pt===w[1]||(l.depthRange(ft,pt),w[0]=ft,w[1]=pt),(ht=u.depth_mask)!==f.depth_mask&&(l.depthMask(ht),f.depth_mask=ht),dt=A[0],mt=A[1],gt=A[2],yt=A[3],dt===k[0]&&mt===k[1]&>===k[2]&&yt===k[3]||(l.colorMask(dt,mt,gt,yt),k[0]=dt,k[1]=mt,k[2]=gt,k[3]=yt),(vt=u.cull_enable)!==f.cull_enable&&(vt?l.enable(2884):l.disable(2884),f.cull_enable=vt),(bt=u.cull_face)!==f.cull_face&&(l.cullFace(bt),f.cull_face=bt),(xt=u.frontFace)!==f.frontFace&&(l.frontFace(xt),f.frontFace=xt),(_t=u.lineWidth)!==f.lineWidth&&(l.lineWidth(_t),f.lineWidth=_t),(wt=u.polygonOffset_enable)!==f.polygonOffset_enable&&(wt?l.enable(32823):l.disable(32823),f.polygonOffset_enable=wt),At=T[0],kt=T[1],At===M[0]&&kt===M[1]||(l.polygonOffset(At,kt),M[0]=At,M[1]=kt),(Tt=u.sample_alpha)!==f.sample_alpha&&(Tt?l.enable(32926):l.disable(32926),f.sample_alpha=Tt),(Mt=u.sample_enable)!==f.sample_enable&&(Mt?l.enable(32928):l.disable(32928),f.sample_enable=Mt),St=S[0],zt=S[1],St===z[0]&&zt===z[1]||(l.sampleCoverage(St,zt),z[0]=St,z[1]=zt),(Et=u.stencil_enable)!==f.stencil_enable&&(Et?l.enable(2960):l.disable(2960),f.stencil_enable=Et),(Lt=u.stencil_mask)!==f.stencil_mask&&(l.stencilMask(Lt),f.stencil_mask=Lt),Ct=E[0],Pt=E[1],Ot=E[2],Ct===L[0]&&Pt===L[1]&&Ot===L[2]||(l.stencilFunc(Ct,Pt,Ot),L[0]=Ct,L[1]=Pt,L[2]=Ot),It=C[0],Dt=C[1],Rt=C[2],Ft=C[3],It===P[0]&&Dt===P[1]&&Rt===P[2]&&Ft===P[3]||(l.stencilOpSeparate(It,Dt,Rt,Ft),P[0]=It,P[1]=Dt,P[2]=Rt,P[3]=Ft),Bt=O[0],Nt=O[1],jt=O[2],Vt=O[3],Bt===I[0]&&Nt===I[1]&&jt===I[2]&&Vt===I[3]||(l.stencilOpSeparate(Bt,Nt,jt,Vt),I[0]=Bt,I[1]=Nt,I[2]=jt,I[3]=Vt),(Ut=u.scissor_enable)!==f.scissor_enable&&(Ut?l.enable(3089):l.disable(3089),f.scissor_enable=Ut));D=c.framebufferWidth,F=c.framebufferHeight,j=c.viewportWidth,c.viewportWidth=D,V=c.viewportHeight,c.viewportHeight=F,l.viewport(0,0,D,F),B[0]=0,B[1]=0,B[2]=D,B[3]=F,U=c.framebufferWidth,H=c.framebufferHeight,l.scissor(0,0,U,H),R[0]=0,R[1]=0,R[2]=U,R[3]=H,(q=f.profile)&&(G=performance.now(),e.count++),W=p.frag,Y=p.vert,Z=p.program(Y,W),l.useProgram(Z.program),h.setVAO(null),X=Z.id,(J=N[X])?J.call(this,t):(J=N[X]=r(Z)).call(this,t),f.dirty=!0,h.setVAO(null),d.next=a,c.framebufferWidth=o,c.framebufferHeight=s,c.viewportWidth=j,c.viewportHeight=V,q&&(e.cpuTime+=performance.now()-G)},scope:function(t,r,s){var l,u,p,h,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C;l=t.framebuffer,u=d.getFramebuffer(l),p=d.next,d.next=u,h=c.framebufferWidth,c.framebufferWidth=u?u.width:c.drawingBufferWidth,m=c.framebufferHeight,c.framebufferHeight=u?u.height:c.drawingBufferHeight,g=c.framebufferWidth,y=c.framebufferHeight,v=c.viewportWidth,c.viewportWidth=g,b=c.viewportHeight,c.viewportHeight=y,x=F[0],F[0]=n,_=F[1],F[1]=i,w=F[2],F[2]=g,A=F[3],F[3]=y,k=c.framebufferWidth,T=c.framebufferHeight,M=D[0],D[0]=a,S=D[1],D[1]=o,z=D[2],D[2]=k,E=D[3],D[3]=T,(L=f.profile)&&(C=performance.now(),e.count++),f.dirty=!0,r(c,t,s),d.next=p,c.framebufferWidth=h,c.framebufferHeight=m,c.viewportWidth=v,c.viewportHeight=b,F[0]=x,F[1]=_,F[2]=w,F[3]=A,D[0]=M,D[1]=S,D[2]=z,D[3]=E,L&&(e.cpuTime+=performance.now()-C),f.dirty=!0},batch:function(t,r){var n,i,a,o,c,d,D,R,F,B,N,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt;f.dirty&&((R=u.dither)!==f.dither&&(R?l.enable(3024):l.disable(3024),f.dither=R),(F=u.blend_enable)!==f.blend_enable&&(F?l.enable(3042):l.disable(3042),f.blend_enable=F),B=m[0],N=m[1],V=m[2],U=m[3],B===g[0]&&N===g[1]&&V===g[2]&&U===g[3]||(l.blendColor(B,N,V,U),g[0]=B,g[1]=N,g[2]=V,g[3]=U),H=y[0],q=y[1],H===v[0]&&q===v[1]||(l.blendEquationSeparate(H,q),v[0]=H,v[1]=q),G=b[0],W=b[1],Y=b[2],Z=b[3],G===x[0]&&W===x[1]&&Y===x[2]&&Z===x[3]||(l.blendFuncSeparate(G,W,Y,Z),x[0]=G,x[1]=W,x[2]=Y,x[3]=Z),(X=u.depth_enable)!==f.depth_enable&&(X?l.enable(2929):l.disable(2929),f.depth_enable=X),(J=u.depth_func)!==f.depth_func&&(l.depthFunc(J),f.depth_func=J),K=_[0],Q=_[1],K===w[0]&&Q===w[1]||(l.depthRange(K,Q),w[0]=K,w[1]=Q),($=u.depth_mask)!==f.depth_mask&&(l.depthMask($),f.depth_mask=$),tt=A[0],et=A[1],rt=A[2],nt=A[3],tt===k[0]&&et===k[1]&&rt===k[2]&&nt===k[3]||(l.colorMask(tt,et,rt,nt),k[0]=tt,k[1]=et,k[2]=rt,k[3]=nt),(it=u.cull_enable)!==f.cull_enable&&(it?l.enable(2884):l.disable(2884),f.cull_enable=it),(at=u.cull_face)!==f.cull_face&&(l.cullFace(at),f.cull_face=at),(ot=u.frontFace)!==f.frontFace&&(l.frontFace(ot),f.frontFace=ot),(st=u.lineWidth)!==f.lineWidth&&(l.lineWidth(st),f.lineWidth=st),(lt=u.polygonOffset_enable)!==f.polygonOffset_enable&&(lt?l.enable(32823):l.disable(32823),f.polygonOffset_enable=lt),ct=T[0],ut=T[1],ct===M[0]&&ut===M[1]||(l.polygonOffset(ct,ut),M[0]=ct,M[1]=ut),(ft=u.sample_alpha)!==f.sample_alpha&&(ft?l.enable(32926):l.disable(32926),f.sample_alpha=ft),(pt=u.sample_enable)!==f.sample_enable&&(pt?l.enable(32928):l.disable(32928),f.sample_enable=pt),ht=S[0],dt=S[1],ht===z[0]&&dt===z[1]||(l.sampleCoverage(ht,dt),z[0]=ht,z[1]=dt),(mt=u.stencil_enable)!==f.stencil_enable&&(mt?l.enable(2960):l.disable(2960),f.stencil_enable=mt),(gt=u.stencil_mask)!==f.stencil_mask&&(l.stencilMask(gt),f.stencil_mask=gt),yt=E[0],vt=E[1],bt=E[2],yt===L[0]&&vt===L[1]&&bt===L[2]||(l.stencilFunc(yt,vt,bt),L[0]=yt,L[1]=vt,L[2]=bt),xt=C[0],_t=C[1],wt=C[2],At=C[3],xt===P[0]&&_t===P[1]&&wt===P[2]&&At===P[3]||(l.stencilOpSeparate(xt,_t,wt,At),P[0]=xt,P[1]=_t,P[2]=wt,P[3]=At),kt=O[0],Tt=O[1],Mt=O[2],St=O[3],kt===I[0]&&Tt===I[1]&&Mt===I[2]&&St===I[3]||(l.stencilOpSeparate(kt,Tt,Mt,St),I[0]=kt,I[1]=Tt,I[2]=Mt,I[3]=St),(zt=u.scissor_enable)!==f.scissor_enable&&(zt?l.enable(3089):l.disable(3089),f.scissor_enable=zt));(n=f.profile)&&(i=performance.now(),e.count+=r),a=p.frag,o=p.vert,c=p.program(o,a),l.useProgram(c.program),h.setVAO(null),d=c.id,(D=j[d])?D.call(this,t,r):(D=j[d]=s(c)).call(this,t,r),f.dirty=!0,h.setVAO(null),n&&(e.cpuTime+=performance.now()-i)}}}},{}],492:[function(t,e,r){e.exports=function(t,e,r){"use strict";var n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P;return n=t.gl,t.context,t.strings,i=t.next,a=t.current,t.draw,t.elements,t.buffer,t.shader,o=t.attributes,s=t.vao,t.uniforms,l=t.framebuffer,t.extensions,t.timer,t.isBufferArgs,i.blend_color,a.blend_color,i.blend_equation,a.blend_equation,i.blend_func,a.blend_func,i.depth_range,a.depth_range,i.colorMask,a.colorMask,i.polygonOffset_offset,a.polygonOffset_offset,i.sample_coverage,a.sample_coverage,i.stencil_func,a.stencil_func,i.stencil_opFront,a.stencil_opFront,i.stencil_opBack,a.stencil_opBack,i.scissor_box,a.scissor_box,i.viewport,a.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},c=i.blend_color,u=a.blend_color,f=i.blend_equation,p=a.blend_equation,h=i.blend_func,d=a.blend_func,m=i.depth_range,g=a.depth_range,y=i.colorMask,v=a.colorMask,b=i.polygonOffset_offset,x=a.polygonOffset_offset,_=i.sample_coverage,w=a.sample_coverage,A=i.stencil_func,k=a.stencil_func,T=i.stencil_opFront,M=a.stencil_opFront,S=i.stencil_opBack,z=a.stencil_opBack,E=i.scissor_box,L=a.scissor_box,C=i.viewport,P=a.viewport,{poll:function(){var t,e,r,o,s,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X;a.dirty=!1,e=i.dither,r=i.blend_enable,o=i.depth_enable,s=i.cull_enable,O=i.polygonOffset_enable,I=i.sample_alpha,D=i.sample_enable,R=i.stencil_enable,F=i.scissor_enable,B=i.depth_func,N=a.depth_func,j=i.depth_mask,V=a.depth_mask,U=i.cull_face,H=a.cull_face,q=i.frontFace,G=a.frontFace,W=i.lineWidth,Y=a.lineWidth,Z=i.stencil_mask,X=a.stencil_mask,(t=l.next)!==l.cur&&(t?n.bindFramebuffer(36160,t.framebuffer):n.bindFramebuffer(36160,null),l.cur=t),e!==a.dither&&(e?n.enable(3024):n.disable(3024),a.dither=e),r!==a.blend_enable&&(r?n.enable(3042):n.disable(3042),a.blend_enable=r),o!==a.depth_enable&&(o?n.enable(2929):n.disable(2929),a.depth_enable=o),s!==a.cull_enable&&(s?n.enable(2884):n.disable(2884),a.cull_enable=s),O!==a.polygonOffset_enable&&(O?n.enable(32823):n.disable(32823),a.polygonOffset_enable=O),I!==a.sample_alpha&&(I?n.enable(32926):n.disable(32926),a.sample_alpha=I),D!==a.sample_enable&&(D?n.enable(32928):n.disable(32928),a.sample_enable=D),R!==a.stencil_enable&&(R?n.enable(2960):n.disable(2960),a.stencil_enable=R),F!==a.scissor_enable&&(F?n.enable(3089):n.disable(3089),a.scissor_enable=F),c[0]===u[0]&&c[1]===u[1]&&c[2]===u[2]&&c[3]===u[3]||(n.blendColor(c[0],c[1],c[2],c[3]),u[0]=c[0],u[1]=c[1],u[2]=c[2],u[3]=c[3]),f[0]===p[0]&&f[1]===p[1]||(n.blendEquationSeparate(f[0],f[1]),p[0]=f[0],p[1]=f[1]),h[0]===d[0]&&h[1]===d[1]&&h[2]===d[2]&&h[3]===d[3]||(n.blendFuncSeparate(h[0],h[1],h[2],h[3]),d[0]=h[0],d[1]=h[1],d[2]=h[2],d[3]=h[3]),B!==N&&(n.depthFunc(B),a.depth_func=B),m[0]===g[0]&&m[1]===g[1]||(n.depthRange(m[0],m[1]),g[0]=m[0],g[1]=m[1]),j!==V&&(n.depthMask(j),a.depth_mask=j),y[0]===v[0]&&y[1]===v[1]&&y[2]===v[2]&&y[3]===v[3]||(n.colorMask(y[0],y[1],y[2],y[3]),v[0]=y[0],v[1]=y[1],v[2]=y[2],v[3]=y[3]),U!==H&&(n.cullFace(U),a.cull_face=U),q!==G&&(n.frontFace(q),a.frontFace=q),W!==Y&&(n.lineWidth(W),a.lineWidth=W),b[0]===x[0]&&b[1]===x[1]||(n.polygonOffset(b[0],b[1]),x[0]=b[0],x[1]=b[1]),_[0]===w[0]&&_[1]===w[1]||(n.sampleCoverage(_[0],_[1]),w[0]=_[0],w[1]=_[1]),Z!==X&&(n.stencilMask(Z),a.stencil_mask=Z),A[0]===k[0]&&A[1]===k[1]&&A[2]===k[2]||(n.stencilFunc(A[0],A[1],A[2]),k[0]=A[0],k[1]=A[1],k[2]=A[2]),T[0]===M[0]&&T[1]===M[1]&&T[2]===M[2]&&T[3]===M[3]||(n.stencilOpSeparate(T[0],T[1],T[2],T[3]),M[0]=T[0],M[1]=T[1],M[2]=T[2],M[3]=T[3]),S[0]===z[0]&&S[1]===z[1]&&S[2]===z[2]&&S[3]===z[3]||(n.stencilOpSeparate(S[0],S[1],S[2],S[3]),z[0]=S[0],z[1]=S[1],z[2]=S[2],z[3]=S[3]),E[0]===L[0]&&E[1]===L[1]&&E[2]===L[2]&&E[3]===L[3]||(n.scissor(E[0],E[1],E[2],E[3]),L[0]=E[0],L[1]=E[1],L[2]=E[2],L[3]=E[3]),C[0]===P[0]&&C[1]===P[1]&&C[2]===P[2]&&C[3]===P[3]||(n.viewport(C[0],C[1],C[2],C[3]),P[0]=C[0],P[1]=C[1],P[2]=C[2],P[3]=C[3])},refresh:function(){var t,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X;a.dirty=!1,D=i.dither,R=i.blend_enable,F=i.depth_enable,B=i.cull_enable,N=i.polygonOffset_enable,j=i.sample_alpha,V=i.sample_enable,U=i.stencil_enable,H=i.scissor_enable,q=i.depth_func,a.depth_func,G=i.depth_mask,a.depth_mask,W=i.cull_face,a.cull_face,Y=i.frontFace,a.frontFace,Z=i.lineWidth,a.lineWidth,X=i.stencil_mask,a.stencil_mask,(t=l.next)?n.bindFramebuffer(36160,t.framebuffer):n.bindFramebuffer(36160,null),l.cur=t,O=o,I=0;for(var J=0;J":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},gr={},yr={},vr=new Float32Array(16),br=new Float32Array(16),xr=new Float32Array(16),_r=new Float32Array(16),wr=new Float32Array(16),Ar=new Float32Array(16),kr=new Float32Array(16),Tr=new Float32Array(16),Mr=new Float32Array(16),Sr=new Float32Array(16),zr=new Float32Array(16),Er=new Float32Array(16),Lr=new Float32Array(16),Cr=new Float32Array(16),Pr=new Float32Array(16),Or=new Float32Array(16),Ir=new Float32Array(16),Dr=new Float32Array(16),Rr=new Float32Array(16),Fr=new Float32Array(16),Br=new Float32Array(16),Nr=new Float32Array(16),jr=new Float32Array(16),Vr=new Float32Array(16),Ur=new Float32Array(16),Hr=new Float32Array(16),qr=new Float32Array(16),Gr=new Float32Array(16),Wr=new Float32Array(16),Yr=new Float32Array(16),Zr=new Float32Array(16),Xr=new Float32Array(16),{draw:function(t){var e,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,Ve,qe,We,Ze,Je,Qe,pr,dr,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn;((e=Ge.next)!==Ge.cur&&(e?De.bindFramebuffer(36160,e.framebuffer):De.bindFramebuffer(36160,null),Ge.cur=e),Be.dirty)&&(jr=tr[0],Vr=tr[1],Ur=tr[2],Hr=tr[3],jr===er[0]&&Vr===er[1]&&Ur===er[2]&&Hr===er[3]||(De.colorMask(jr,Vr,Ur,Hr),er[0]=jr,er[1]=Vr,er[2]=Ur,er[3]=Hr),(qr=Fe.frontFace)!==Be.frontFace&&(De.frontFace(qr),Be.frontFace=qr),(Gr=Fe.polygonOffset_enable)!==Be.polygonOffset_enable&&(Gr?De.enable(32823):De.disable(32823),Be.polygonOffset_enable=Gr),Wr=rr[0],Yr=rr[1],Wr===nr[0]&&Yr===nr[1]||(De.polygonOffset(Wr,Yr),nr[0]=Wr,nr[1]=Yr),(Zr=Fe.sample_alpha)!==Be.sample_alpha&&(Zr?De.enable(32926):De.disable(32926),Be.sample_alpha=Zr),(Xr=Fe.sample_enable)!==Be.sample_enable&&(Xr?De.enable(32928):De.disable(32928),Be.sample_enable=Xr),Jr=ir[0],Kr=ir[1],Jr===ar[0]&&Kr===ar[1]||(De.sampleCoverage(Jr,Kr),ar[0]=Jr,ar[1]=Kr),(Qr=Fe.stencil_enable)!==Be.stencil_enable&&(Qr?De.enable(2960):De.disable(2960),Be.stencil_enable=Qr),($r=Fe.stencil_mask)!==Be.stencil_mask&&(De.stencilMask($r),Be.stencil_mask=$r),tn=or[0],en=or[1],rn=or[2],tn===sr[0]&&en===sr[1]&&rn===sr[2]||(De.stencilFunc(tn,en,rn),sr[0]=tn,sr[1]=en,sr[2]=rn),nn=lr[0],an=lr[1],on=lr[2],sn=lr[3],nn===cr[0]&&an===cr[1]&&on===cr[2]&&sn===cr[3]||(De.stencilOpSeparate(nn,an,on,sn),cr[0]=nn,cr[1]=an,cr[2]=on,cr[3]=sn),ln=ur[0],cn=ur[1],un=ur[2],fn=ur[3],ln===fr[0]&&cn===fr[1]&&un===fr[2]&&fn===fr[3]||(De.stencilOpSeparate(ln,cn,un,fn),fr[0]=ln,fr[1]=cn,fr[2]=un,fr[3]=fn));mt=t.viewportX,gr.x=mt,gt=t.viewportY,gr.y=gt,yt=t.viewportWidth,gr.width=yt,vt=t.viewportHeight,gr.height=vt,bt=0|gr.x,xt=0|gr.y,_t="width"in gr?0|gr.width:Re.framebufferWidth-bt,wt="height"in gr?0|gr.height:Re.framebufferHeight-xt,At=Re.viewportWidth,Re.viewportWidth=_t,kt=Re.viewportHeight,Re.viewportHeight=wt,De.viewport(bt,xt,_t,wt),mr[0]=bt,mr[1]=xt,mr[2]=_t,mr[3]=wt,De.blendColor(0,0,0,0),Ye[0]=0,Ye[1]=0,Ye[2]=0,Ye[3]=0,r?De.enable(3042):De.disable(3042),Be.blend_enable=r,De.blendEquationSeparate(32774,32774),Xe[0]=32774,Xe[1]=32774,De.blendFuncSeparate(770,771,1,1),Ke[0]=770,Ke[1]=771,Ke[2]=1,Ke[3]=1,n?De.enable(2884):De.disable(2884),Be.cull_enable=n,De.cullFace(i),Be.cull_face=i,a?De.enable(2929):De.disable(2929),Be.depth_enable=a,De.depthFunc(o),Be.depth_func=o,De.depthMask(s),Be.depth_mask=s,De.depthRange(0,1),$e[0]=0,$e[1]=1,l?De.enable(3024):De.disable(3024),Be.dither=l,De.lineWidth(c),Be.lineWidth=c,Tt=t.scissorX,yr.x=Tt,Mt=t.scissorY,yr.y=Mt,St=t.scissorWidth,yr.width=St,zt=t.scissorHeight,yr.height=zt,Et=0|yr.x,Lt=0|yr.y,Ct="width"in yr?0|yr.width:Re.framebufferWidth-Et,Pt="height"in yr?0|yr.height:Re.framebufferHeight-Lt,De.scissor(Et,Lt,Ct,Pt),hr[0]=Et,hr[1]=Lt,hr[2]=Ct,hr[3]=Pt,u?De.enable(3089):De.disable(3089),Be.scissor_enable=u,Ot=Be.profile,Be.profile=!1,De.useProgram(f.program),He.setVAO(null),It=h.location,(Dt=Ue[It]).buffer||De.enableVertexAttribArray(It),Dt.type===p.dtype&&4===Dt.size&&Dt.buffer===p&&!1===Dt.normalized&&0===Dt.offset&&0===Dt.stride||(De.bindBuffer(34962,p.buffer),De.vertexAttribPointer(It,4,p.dtype,!1,0,0),Dt.type=p.dtype,Dt.size=4,Dt.buffer=p,Dt.normalized=!1,Dt.offset=0,Dt.stride=0),Rt=m.location,(Ft=Ue[Rt]).buffer||De.enableVertexAttribArray(Rt),Ft.type===d.dtype&&4===Ft.size&&Ft.buffer===d&&!1===Ft.normalized&&0===Ft.offset&&0===Ft.stride||(De.bindBuffer(34962,d.buffer),De.vertexAttribPointer(Rt,4,d.dtype,!1,0,0),Ft.type=d.dtype,Ft.size=4,Ft.buffer=d,Ft.normalized=!1,Ft.offset=0,Ft.stride=0),Bt=y.location,(Nt=Ue[Bt]).buffer||De.enableVertexAttribArray(Bt),Nt.type===g.dtype&&4===Nt.size&&Nt.buffer===g&&!1===Nt.normalized&&0===Nt.offset&&0===Nt.stride||(De.bindBuffer(34962,g.buffer),De.vertexAttribPointer(Bt,4,g.dtype,!1,0,0),Nt.type=g.dtype,Nt.size=4,Nt.buffer=g,Nt.normalized=!1,Nt.offset=0,Nt.stride=0),jt=b.location,(Vt=Ue[jt]).buffer||De.enableVertexAttribArray(jt),Vt.type===v.dtype&&4===Vt.size&&Vt.buffer===v&&!1===Vt.normalized&&0===Vt.offset&&0===Vt.stride||(De.bindBuffer(34962,v.buffer),De.vertexAttribPointer(jt,4,v.dtype,!1,0,0),Vt.type=v.dtype,Vt.size=4,Vt.buffer=v,Vt.normalized=!1,Vt.offset=0,Vt.stride=0),Ut=_.location,(Ht=Ue[Ut]).buffer||De.enableVertexAttribArray(Ut),Ht.type===x.dtype&&4===Ht.size&&Ht.buffer===x&&!1===Ht.normalized&&0===Ht.offset&&0===Ht.stride||(De.bindBuffer(34962,x.buffer),De.vertexAttribPointer(Ut,4,x.dtype,!1,0,0),Ht.type=x.dtype,Ht.size=4,Ht.buffer=x,Ht.normalized=!1,Ht.offset=0,Ht.stride=0),qt=A.location,(Gt=Ue[qt]).buffer||De.enableVertexAttribArray(qt),Gt.type===w.dtype&&4===Gt.size&&Gt.buffer===w&&!1===Gt.normalized&&0===Gt.offset&&0===Gt.stride||(De.bindBuffer(34962,w.buffer),De.vertexAttribPointer(qt,4,w.dtype,!1,0,0),Gt.type=w.dtype,Gt.size=4,Gt.buffer=w,Gt.normalized=!1,Gt.offset=0,Gt.stride=0),Wt=T.location,(Yt=Ue[Wt]).buffer||De.enableVertexAttribArray(Wt),Yt.type===k.dtype&&4===Yt.size&&Yt.buffer===k&&!1===Yt.normalized&&0===Yt.offset&&0===Yt.stride||(De.bindBuffer(34962,k.buffer),De.vertexAttribPointer(Wt,4,k.dtype,!1,0,0),Yt.type=k.dtype,Yt.size=4,Yt.buffer=k,Yt.normalized=!1,Yt.offset=0,Yt.stride=0),Zt=S.location,(Xt=Ue[Zt]).buffer||De.enableVertexAttribArray(Zt),Xt.type===M.dtype&&4===Xt.size&&Xt.buffer===M&&!1===Xt.normalized&&0===Xt.offset&&0===Xt.stride||(De.bindBuffer(34962,M.buffer),De.vertexAttribPointer(Zt,4,M.dtype,!1,0,0),Xt.type=M.dtype,Xt.size=4,Xt.buffer=M,Xt.normalized=!1,Xt.offset=0,Xt.stride=0),Jt=E.location,(Kt=Ue[Jt]).buffer||De.enableVertexAttribArray(Jt),Kt.type===z.dtype&&4===Kt.size&&Kt.buffer===z&&!1===Kt.normalized&&0===Kt.offset&&0===Kt.stride||(De.bindBuffer(34962,z.buffer),De.vertexAttribPointer(Jt,4,z.dtype,!1,0,0),Kt.type=z.dtype,Kt.size=4,Kt.buffer=z,Kt.normalized=!1,Kt.offset=0,Kt.stride=0),Qt=C.location,($t=Ue[Qt]).buffer||De.enableVertexAttribArray(Qt),$t.type===L.dtype&&4===$t.size&&$t.buffer===L&&!1===$t.normalized&&0===$t.offset&&0===$t.stride||(De.bindBuffer(34962,L.buffer),De.vertexAttribPointer(Qt,4,L.dtype,!1,0,0),$t.type=L.dtype,$t.size=4,$t.buffer=L,$t.normalized=!1,$t.offset=0,$t.stride=0),te=O.location,(ee=Ue[te]).buffer||De.enableVertexAttribArray(te),ee.type===P.dtype&&4===ee.size&&ee.buffer===P&&!1===ee.normalized&&0===ee.offset&&0===ee.stride||(De.bindBuffer(34962,P.buffer),De.vertexAttribPointer(te,4,P.dtype,!1,0,0),ee.type=P.dtype,ee.size=4,ee.buffer=P,ee.normalized=!1,ee.offset=0,ee.stride=0),re=D.location,(ne=Ue[re]).buffer||De.enableVertexAttribArray(re),ne.type===I.dtype&&4===ne.size&&ne.buffer===I&&!1===ne.normalized&&0===ne.offset&&0===ne.stride||(De.bindBuffer(34962,I.buffer),De.vertexAttribPointer(re,4,I.dtype,!1,0,0),ne.type=I.dtype,ne.size=4,ne.buffer=I,ne.normalized=!1,ne.offset=0,ne.stride=0),ie=F.location,(ae=Ue[ie]).buffer||De.enableVertexAttribArray(ie),ae.type===R.dtype&&4===ae.size&&ae.buffer===R&&!1===ae.normalized&&0===ae.offset&&0===ae.stride||(De.bindBuffer(34962,R.buffer),De.vertexAttribPointer(ie,4,R.dtype,!1,0,0),ae.type=R.dtype,ae.size=4,ae.buffer=R,ae.normalized=!1,ae.offset=0,ae.stride=0),oe=N.location,(se=Ue[oe]).buffer||De.enableVertexAttribArray(oe),se.type===B.dtype&&4===se.size&&se.buffer===B&&!1===se.normalized&&0===se.offset&&0===se.stride||(De.bindBuffer(34962,B.buffer),De.vertexAttribPointer(oe,4,B.dtype,!1,0,0),se.type=B.dtype,se.size=4,se.buffer=B,se.normalized=!1,se.offset=0,se.stride=0),le=V.location,(ce=Ue[le]).buffer||De.enableVertexAttribArray(le),ce.type===j.dtype&&4===ce.size&&ce.buffer===j&&!1===ce.normalized&&0===ce.offset&&0===ce.stride||(De.bindBuffer(34962,j.buffer),De.vertexAttribPointer(le,4,j.dtype,!1,0,0),ce.type=j.dtype,ce.size=4,ce.buffer=j,ce.normalized=!1,ce.offset=0,ce.stride=0),ue=H.location,(fe=Ue[ue]).buffer||De.enableVertexAttribArray(ue),fe.type===U.dtype&&4===fe.size&&fe.buffer===U&&!1===fe.normalized&&0===fe.offset&&0===fe.stride||(De.bindBuffer(34962,U.buffer),De.vertexAttribPointer(ue,4,U.dtype,!1,0,0),fe.type=U.dtype,fe.size=4,fe.buffer=U,fe.normalized=!1,fe.offset=0,fe.stride=0),he=(pe=t.contextColor)[0],de=pe[1],me=pe[2],ge=pe[3],De.uniform4f(q.location,he,de,me,ge),ye=t.dim0A,De.uniformMatrix4fv(G.location,!1,Array.isArray(ye)||ye instanceof Float32Array?ye:(vr[0]=ye[0],vr[1]=ye[1],vr[2]=ye[2],vr[3]=ye[3],vr[4]=ye[4],vr[5]=ye[5],vr[6]=ye[6],vr[7]=ye[7],vr[8]=ye[8],vr[9]=ye[9],vr[10]=ye[10],vr[11]=ye[11],vr[12]=ye[12],vr[13]=ye[13],vr[14]=ye[14],vr[15]=ye[15],vr)),ve=t.dim0B,De.uniformMatrix4fv(W.location,!1,Array.isArray(ve)||ve instanceof Float32Array?ve:(br[0]=ve[0],br[1]=ve[1],br[2]=ve[2],br[3]=ve[3],br[4]=ve[4],br[5]=ve[5],br[6]=ve[6],br[7]=ve[7],br[8]=ve[8],br[9]=ve[9],br[10]=ve[10],br[11]=ve[11],br[12]=ve[12],br[13]=ve[13],br[14]=ve[14],br[15]=ve[15],br)),be=t.dim0C,De.uniformMatrix4fv(Y.location,!1,Array.isArray(be)||be instanceof Float32Array?be:(xr[0]=be[0],xr[1]=be[1],xr[2]=be[2],xr[3]=be[3],xr[4]=be[4],xr[5]=be[5],xr[6]=be[6],xr[7]=be[7],xr[8]=be[8],xr[9]=be[9],xr[10]=be[10],xr[11]=be[11],xr[12]=be[12],xr[13]=be[13],xr[14]=be[14],xr[15]=be[15],xr)),xe=t.dim0D,De.uniformMatrix4fv(Z.location,!1,Array.isArray(xe)||xe instanceof Float32Array?xe:(_r[0]=xe[0],_r[1]=xe[1],_r[2]=xe[2],_r[3]=xe[3],_r[4]=xe[4],_r[5]=xe[5],_r[6]=xe[6],_r[7]=xe[7],_r[8]=xe[8],_r[9]=xe[9],_r[10]=xe[10],_r[11]=xe[11],_r[12]=xe[12],_r[13]=xe[13],_r[14]=xe[14],_r[15]=xe[15],_r)),_e=t.dim1A,De.uniformMatrix4fv(X.location,!1,Array.isArray(_e)||_e instanceof Float32Array?_e:(wr[0]=_e[0],wr[1]=_e[1],wr[2]=_e[2],wr[3]=_e[3],wr[4]=_e[4],wr[5]=_e[5],wr[6]=_e[6],wr[7]=_e[7],wr[8]=_e[8],wr[9]=_e[9],wr[10]=_e[10],wr[11]=_e[11],wr[12]=_e[12],wr[13]=_e[13],wr[14]=_e[14],wr[15]=_e[15],wr)),we=t.dim1B,De.uniformMatrix4fv(J.location,!1,Array.isArray(we)||we instanceof Float32Array?we:(Ar[0]=we[0],Ar[1]=we[1],Ar[2]=we[2],Ar[3]=we[3],Ar[4]=we[4],Ar[5]=we[5],Ar[6]=we[6],Ar[7]=we[7],Ar[8]=we[8],Ar[9]=we[9],Ar[10]=we[10],Ar[11]=we[11],Ar[12]=we[12],Ar[13]=we[13],Ar[14]=we[14],Ar[15]=we[15],Ar)),Ae=t.dim1C,De.uniformMatrix4fv(K.location,!1,Array.isArray(Ae)||Ae instanceof Float32Array?Ae:(kr[0]=Ae[0],kr[1]=Ae[1],kr[2]=Ae[2],kr[3]=Ae[3],kr[4]=Ae[4],kr[5]=Ae[5],kr[6]=Ae[6],kr[7]=Ae[7],kr[8]=Ae[8],kr[9]=Ae[9],kr[10]=Ae[10],kr[11]=Ae[11],kr[12]=Ae[12],kr[13]=Ae[13],kr[14]=Ae[14],kr[15]=Ae[15],kr)),ke=t.dim1D,De.uniformMatrix4fv(Q.location,!1,Array.isArray(ke)||ke instanceof Float32Array?ke:(Tr[0]=ke[0],Tr[1]=ke[1],Tr[2]=ke[2],Tr[3]=ke[3],Tr[4]=ke[4],Tr[5]=ke[5],Tr[6]=ke[6],Tr[7]=ke[7],Tr[8]=ke[8],Tr[9]=ke[9],Tr[10]=ke[10],Tr[11]=ke[11],Tr[12]=ke[12],Tr[13]=ke[13],Tr[14]=ke[14],Tr[15]=ke[15],Tr)),Te=t.drwLayer,De.uniform1f($.location,Te),Me=t.hiA,De.uniformMatrix4fv(tt.location,!1,Array.isArray(Me)||Me instanceof Float32Array?Me:(Mr[0]=Me[0],Mr[1]=Me[1],Mr[2]=Me[2],Mr[3]=Me[3],Mr[4]=Me[4],Mr[5]=Me[5],Mr[6]=Me[6],Mr[7]=Me[7],Mr[8]=Me[8],Mr[9]=Me[9],Mr[10]=Me[10],Mr[11]=Me[11],Mr[12]=Me[12],Mr[13]=Me[13],Mr[14]=Me[14],Mr[15]=Me[15],Mr)),Se=t.hiB,De.uniformMatrix4fv(et.location,!1,Array.isArray(Se)||Se instanceof Float32Array?Se:(Sr[0]=Se[0],Sr[1]=Se[1],Sr[2]=Se[2],Sr[3]=Se[3],Sr[4]=Se[4],Sr[5]=Se[5],Sr[6]=Se[6],Sr[7]=Se[7],Sr[8]=Se[8],Sr[9]=Se[9],Sr[10]=Se[10],Sr[11]=Se[11],Sr[12]=Se[12],Sr[13]=Se[13],Sr[14]=Se[14],Sr[15]=Se[15],Sr)),ze=t.hiC,De.uniformMatrix4fv(rt.location,!1,Array.isArray(ze)||ze instanceof Float32Array?ze:(zr[0]=ze[0],zr[1]=ze[1],zr[2]=ze[2],zr[3]=ze[3],zr[4]=ze[4],zr[5]=ze[5],zr[6]=ze[6],zr[7]=ze[7],zr[8]=ze[8],zr[9]=ze[9],zr[10]=ze[10],zr[11]=ze[11],zr[12]=ze[12],zr[13]=ze[13],zr[14]=ze[14],zr[15]=ze[15],zr)),Ee=t.hiD,De.uniformMatrix4fv(nt.location,!1,Array.isArray(Ee)||Ee instanceof Float32Array?Ee:(Er[0]=Ee[0],Er[1]=Ee[1],Er[2]=Ee[2],Er[3]=Ee[3],Er[4]=Ee[4],Er[5]=Ee[5],Er[6]=Ee[6],Er[7]=Ee[7],Er[8]=Ee[8],Er[9]=Ee[9],Er[10]=Ee[10],Er[11]=Ee[11],Er[12]=Ee[12],Er[13]=Ee[13],Er[14]=Ee[14],Er[15]=Ee[15],Er)),Le=t.loA,De.uniformMatrix4fv(it.location,!1,Array.isArray(Le)||Le instanceof Float32Array?Le:(Lr[0]=Le[0],Lr[1]=Le[1],Lr[2]=Le[2],Lr[3]=Le[3],Lr[4]=Le[4],Lr[5]=Le[5],Lr[6]=Le[6],Lr[7]=Le[7],Lr[8]=Le[8],Lr[9]=Le[9],Lr[10]=Le[10],Lr[11]=Le[11],Lr[12]=Le[12],Lr[13]=Le[13],Lr[14]=Le[14],Lr[15]=Le[15],Lr)),Ce=t.loB,De.uniformMatrix4fv(at.location,!1,Array.isArray(Ce)||Ce instanceof Float32Array?Ce:(Cr[0]=Ce[0],Cr[1]=Ce[1],Cr[2]=Ce[2],Cr[3]=Ce[3],Cr[4]=Ce[4],Cr[5]=Ce[5],Cr[6]=Ce[6],Cr[7]=Ce[7],Cr[8]=Ce[8],Cr[9]=Ce[9],Cr[10]=Ce[10],Cr[11]=Ce[11],Cr[12]=Ce[12],Cr[13]=Ce[13],Cr[14]=Ce[14],Cr[15]=Ce[15],Cr)),Pe=t.loC,De.uniformMatrix4fv(ot.location,!1,Array.isArray(Pe)||Pe instanceof Float32Array?Pe:(Pr[0]=Pe[0],Pr[1]=Pe[1],Pr[2]=Pe[2],Pr[3]=Pe[3],Pr[4]=Pe[4],Pr[5]=Pe[5],Pr[6]=Pe[6],Pr[7]=Pe[7],Pr[8]=Pe[8],Pr[9]=Pe[9],Pr[10]=Pe[10],Pr[11]=Pe[11],Pr[12]=Pe[12],Pr[13]=Pe[13],Pr[14]=Pe[14],Pr[15]=Pe[15],Pr)),Oe=t.loD,De.uniformMatrix4fv(st.location,!1,Array.isArray(Oe)||Oe instanceof Float32Array?Oe:(Or[0]=Oe[0],Or[1]=Oe[1],Or[2]=Oe[2],Or[3]=Oe[3],Or[4]=Oe[4],Or[5]=Oe[5],Or[6]=Oe[6],Or[7]=Oe[7],Or[8]=Oe[8],Or[9]=Oe[9],Or[10]=Oe[10],Or[11]=Oe[11],Or[12]=Oe[12],Or[13]=Oe[13],Or[14]=Oe[14],Or[15]=Oe[15],Or)),Ie=t.maskHeight,De.uniform1f(lt.location,Ie),(Ve=t.maskTexture)&&"framebuffer"===Ve._reglType&&(Ve=Ve.color[0]),qe=Ve._texture,De.uniform1i(ct.location,qe.bind()),De.uniform1i(ut.location,ft.bind()),Ze=(We=t.resolution)[0],Je=We[1],De.uniform2f(pt.location,Ze,Je),pr=(Qe=t.viewBoxPos)[0],dr=Qe[1],De.uniform2f(ht.location,pr,dr),Dr=(Ir=t.viewBoxSize)[0],Rr=Ir[1],De.uniform2f(dt.location,Dr,Rr),((Fr=Ne.elements)||He.currentVAO&&(Fr=je.getElements(He.currentVAO.elements)))&&De.bindBuffer(34963,Fr.buffer.buffer),Br=t.offset,(Nr=t.count)&&(Fr?De.drawElements(1,Nr,Fr.type,Br<<(Fr.type-5121>>1)):De.drawArrays(1,Br,Nr),Be.dirty=!0,He.setVAO(null),Re.viewportWidth=At,Re.viewportHeight=kt,Be.profile=Ot,qe.unbind(),ft.unbind())},scope:function(t,e,r){var n,i,a,o,s,l,c,u,f,h,m,y,b,_,A,T,S,E,C,O,D,F,N,V,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,je,Ue,He,Ge,Ye,Xe,Ke,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,hr,mr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi,Ei,Li,Ci,Pi,Oi,Ii,Di,Ri,Fi,Bi,Ni,ji,Vi,Ui,Hi,qi,Gi,Wi,Yi,Zi,Xi,Ji,Ki,Qi,$i,ta,ea,ra,na,ia,aa,oa,sa,la,ca,ua,fa,pa,ha,da,ma,ga,ya,va,ba,xa,_a,wa,Aa,ka,Ta,Ma,Sa,za,Ea,La,Ca,Pa,Oa,Ia,Da,Ra,Fa,Ba,Na,ja,Va,Ua,Ha,qa,Ga,Wa,Ya,Za,Xa,Ja,Ka,Qa,$a,to,eo,ro,no,io,ao,oo,so,lo,co,uo,fo,po,ho,mo;n=t.viewportX,gr.x=n,i=t.viewportY,gr.y=i,a=t.viewportWidth,gr.width=a,o=t.viewportHeight,gr.height=o,s=0|gr.x,l=0|gr.y,c="width"in gr?0|gr.width:Re.framebufferWidth-s,u="height"in gr?0|gr.height:Re.framebufferHeight-l,f=Re.viewportWidth,Re.viewportWidth=c,h=Re.viewportHeight,Re.viewportHeight=u,m=dr[0],dr[0]=s,y=dr[1],dr[1]=l,b=dr[2],dr[2]=c,_=dr[3],dr[3]=u,A=We[0],We[0]=mt,T=We[1],We[1]=gt,S=We[2],We[2]=yt,E=We[3],We[3]=vt,C=Fe.blend_enable,Fe.blend_enable=bt,O=Ze[0],Ze[0]=xt,D=Ze[1],Ze[1]=_t,F=Je[0],Je[0]=wt,N=Je[1],Je[1]=At,V=Je[2],Je[2]=kt,H=Je[3],Je[3]=Tt,q=Fe.cull_enable,Fe.cull_enable=Mt,G=Fe.cull_face,Fe.cull_face=St,W=Fe.depth_enable,Fe.depth_enable=zt,Y=Fe.depth_func,Fe.depth_func=Et,Z=Fe.depth_mask,Fe.depth_mask=Lt,X=Qe[0],Qe[0]=Ct,J=Qe[1],Qe[1]=Pt,K=Fe.dither,Fe.dither=Ot,Q=Fe.lineWidth,Fe.lineWidth=It,$=t.scissorX,yr.x=$,tt=t.scissorY,yr.y=tt,et=t.scissorWidth,yr.width=et,rt=t.scissorHeight,yr.height=rt,nt=0|yr.x,it=0|yr.y,at="width"in yr?0|yr.width:Re.framebufferWidth-nt,ot="height"in yr?0|yr.height:Re.framebufferHeight-it,st=pr[0],pr[0]=nt,lt=pr[1],pr[1]=it,ct=pr[2],pr[2]=at,ut=pr[3],pr[3]=ot,ft=Fe.scissor_enable,Fe.scissor_enable=Dt,pt=Be.profile,Be.profile=!1,ht=t.offset,dt=Ne.offset,Ne.offset=ht,Me=t.count,Se=Ne.count,Ne.count=Me,ze=Ne.primitive,Ne.primitive=Rt,Ee=qe[Bt],qe[Bt]=Ft,Le=t.resolution,Ce=qe[Nt],qe[Nt]=Le,Pe=t.viewBoxPos,Oe=qe[jt],qe[jt]=Pe,Ie=t.viewBoxSize,De=qe[Vt],qe[Vt]=Ie,je=t.dim0A,Ue=qe[Ut],qe[Ut]=je,He=t.dim1A,Ge=qe[Ht],qe[Ht]=He,Ye=t.dim0B,Xe=qe[qt],qe[qt]=Ye,Ke=t.dim1B,$e=qe[Gt],qe[Gt]=Ke,tr=t.dim0C,er=qe[Wt],qe[Wt]=tr,rr=t.dim1C,nr=qe[Yt],qe[Yt]=rr,ir=t.dim0D,ar=qe[Zt],qe[Zt]=ir,or=t.dim1D,sr=qe[Xt],qe[Xt]=or,lr=t.loA,cr=qe[Jt],qe[Jt]=lr,ur=t.hiA,fr=qe[Kt],qe[Kt]=ur,hr=t.loB,mr=qe[Qt],qe[Qt]=hr,vr=t.hiB,br=qe[$t],qe[$t]=vr,xr=t.loC,_r=qe[te],qe[te]=xr,wr=t.hiC,Ar=qe[ee],qe[ee]=wr,kr=t.loD,Tr=qe[re],qe[re]=kr,Mr=t.hiD,Sr=qe[ne],qe[ne]=Mr,zr=t.contextColor,Er=qe[ie],qe[ie]=zr,Lr=t.maskTexture,Cr=qe[ae],qe[ae]=Lr,Pr=t.drwLayer,Or=qe[oe],qe[oe]=Pr,Ir=t.maskHeight,Dr=qe[se],qe[se]=Ir,Rr=le.state,le.state=1,Fr=le.x,le.x=0,Br=le.y,le.y=0,Nr=le.z,le.z=0,jr=le.w,le.w=0,Vr=le.buffer,le.buffer=d,Ur=le.size,le.size=0,Hr=le.normalized,le.normalized=!1,qr=le.type,le.type=d.dtype,Gr=le.offset,le.offset=0,Wr=le.stride,le.stride=0,Yr=le.divisor,le.divisor=0,Zr=ce.state,ce.state=1,Xr=ce.x,ce.x=0,Jr=ce.y,ce.y=0,Kr=ce.z,ce.z=0,Qr=ce.w,ce.w=0,$r=ce.buffer,ce.buffer=g,tn=ce.size,ce.size=0,en=ce.normalized,ce.normalized=!1,rn=ce.type,ce.type=g.dtype,nn=ce.offset,ce.offset=0,an=ce.stride,ce.stride=0,on=ce.divisor,ce.divisor=0,sn=ue.state,ue.state=1,ln=ue.x,ue.x=0,cn=ue.y,ue.y=0,un=ue.z,ue.z=0,fn=ue.w,ue.w=0,pn=ue.buffer,ue.buffer=v,hn=ue.size,ue.size=0,dn=ue.normalized,ue.normalized=!1,mn=ue.type,ue.type=v.dtype,gn=ue.offset,ue.offset=0,yn=ue.stride,ue.stride=0,vn=ue.divisor,ue.divisor=0,bn=fe.state,fe.state=1,xn=fe.x,fe.x=0,_n=fe.y,fe.y=0,wn=fe.z,fe.z=0,An=fe.w,fe.w=0,kn=fe.buffer,fe.buffer=x,Tn=fe.size,fe.size=0,Mn=fe.normalized,fe.normalized=!1,Sn=fe.type,fe.type=x.dtype,zn=fe.offset,fe.offset=0,En=fe.stride,fe.stride=0,Ln=fe.divisor,fe.divisor=0,Cn=pe.state,pe.state=1,Pn=pe.x,pe.x=0,On=pe.y,pe.y=0,In=pe.z,pe.z=0,Dn=pe.w,pe.w=0,Rn=pe.buffer,pe.buffer=w,Fn=pe.size,pe.size=0,Bn=pe.normalized,pe.normalized=!1,Nn=pe.type,pe.type=w.dtype,jn=pe.offset,pe.offset=0,Vn=pe.stride,pe.stride=0,Un=pe.divisor,pe.divisor=0,Hn=he.state,he.state=1,qn=he.x,he.x=0,Gn=he.y,he.y=0,Wn=he.z,he.z=0,Yn=he.w,he.w=0,Zn=he.buffer,he.buffer=k,Xn=he.size,he.size=0,Jn=he.normalized,he.normalized=!1,Kn=he.type,he.type=k.dtype,Qn=he.offset,he.offset=0,$n=he.stride,he.stride=0,ti=he.divisor,he.divisor=0,ei=de.state,de.state=1,ri=de.x,de.x=0,ni=de.y,de.y=0,ii=de.z,de.z=0,ai=de.w,de.w=0,oi=de.buffer,de.buffer=M,si=de.size,de.size=0,li=de.normalized,de.normalized=!1,ci=de.type,de.type=M.dtype,ui=de.offset,de.offset=0,fi=de.stride,de.stride=0,pi=de.divisor,de.divisor=0,hi=me.state,me.state=1,di=me.x,me.x=0,mi=me.y,me.y=0,gi=me.z,me.z=0,yi=me.w,me.w=0,vi=me.buffer,me.buffer=z,bi=me.size,me.size=0,xi=me.normalized,me.normalized=!1,_i=me.type,me.type=z.dtype,wi=me.offset,me.offset=0,Ai=me.stride,me.stride=0,ki=me.divisor,me.divisor=0,Ti=ge.state,ge.state=1,Mi=ge.x,ge.x=0,Si=ge.y,ge.y=0,zi=ge.z,ge.z=0,Ei=ge.w,ge.w=0,Li=ge.buffer,ge.buffer=L,Ci=ge.size,ge.size=0,Pi=ge.normalized,ge.normalized=!1,Oi=ge.type,ge.type=L.dtype,Ii=ge.offset,ge.offset=0,Di=ge.stride,ge.stride=0,Ri=ge.divisor,ge.divisor=0,Fi=ye.state,ye.state=1,Bi=ye.x,ye.x=0,Ni=ye.y,ye.y=0,ji=ye.z,ye.z=0,Vi=ye.w,ye.w=0,Ui=ye.buffer,ye.buffer=P,Hi=ye.size,ye.size=0,qi=ye.normalized,ye.normalized=!1,Gi=ye.type,ye.type=P.dtype,Wi=ye.offset,ye.offset=0,Yi=ye.stride,ye.stride=0,Zi=ye.divisor,ye.divisor=0,Xi=ve.state,ve.state=1,Ji=ve.x,ve.x=0,Ki=ve.y,ve.y=0,Qi=ve.z,ve.z=0,$i=ve.w,ve.w=0,ta=ve.buffer,ve.buffer=I,ea=ve.size,ve.size=0,ra=ve.normalized,ve.normalized=!1,na=ve.type,ve.type=I.dtype,ia=ve.offset,ve.offset=0,aa=ve.stride,ve.stride=0,oa=ve.divisor,ve.divisor=0,sa=be.state,be.state=1,la=be.x,be.x=0,ca=be.y,be.y=0,ua=be.z,be.z=0,fa=be.w,be.w=0,pa=be.buffer,be.buffer=R,ha=be.size,be.size=0,da=be.normalized,be.normalized=!1,ma=be.type,be.type=R.dtype,ga=be.offset,be.offset=0,ya=be.stride,be.stride=0,va=be.divisor,be.divisor=0,ba=xe.state,xe.state=1,xa=xe.x,xe.x=0,_a=xe.y,xe.y=0,wa=xe.z,xe.z=0,Aa=xe.w,xe.w=0,ka=xe.buffer,xe.buffer=B,Ta=xe.size,xe.size=0,Ma=xe.normalized,xe.normalized=!1,Sa=xe.type,xe.type=B.dtype,za=xe.offset,xe.offset=0,Ea=xe.stride,xe.stride=0,La=xe.divisor,xe.divisor=0,Ca=_e.state,_e.state=1,Pa=_e.x,_e.x=0,Oa=_e.y,_e.y=0,Ia=_e.z,_e.z=0,Da=_e.w,_e.w=0,Ra=_e.buffer,_e.buffer=j,Fa=_e.size,_e.size=0,Ba=_e.normalized,_e.normalized=!1,Na=_e.type,_e.type=j.dtype,ja=_e.offset,_e.offset=0,Va=_e.stride,_e.stride=0,Ua=_e.divisor,_e.divisor=0,Ha=we.state,we.state=1,qa=we.x,we.x=0,Ga=we.y,we.y=0,Wa=we.z,we.z=0,Ya=we.w,we.w=0,Za=we.buffer,we.buffer=U,Xa=we.size,we.size=0,Ja=we.normalized,we.normalized=!1,Ka=we.type,we.type=U.dtype,Qa=we.offset,we.offset=0,$a=we.stride,we.stride=0,to=we.divisor,we.divisor=0,eo=Ae.state,Ae.state=1,ro=Ae.x,Ae.x=0,no=Ae.y,Ae.y=0,io=Ae.z,Ae.z=0,ao=Ae.w,Ae.w=0,oo=Ae.buffer,Ae.buffer=p,so=Ae.size,Ae.size=0,lo=Ae.normalized,Ae.normalized=!1,co=Ae.type,Ae.type=p.dtype,uo=Ae.offset,Ae.offset=0,fo=Ae.stride,Ae.stride=0,po=Ae.divisor,Ae.divisor=0,ho=Ve.vert,Ve.vert=ke,mo=Ve.frag,Ve.frag=Te,Be.dirty=!0,e(Re,t,r),Re.viewportWidth=f,Re.viewportHeight=h,dr[0]=m,dr[1]=y,dr[2]=b,dr[3]=_,We[0]=A,We[1]=T,We[2]=S,We[3]=E,Fe.blend_enable=C,Ze[0]=O,Ze[1]=D,Je[0]=F,Je[1]=N,Je[2]=V,Je[3]=H,Fe.cull_enable=q,Fe.cull_face=G,Fe.depth_enable=W,Fe.depth_func=Y,Fe.depth_mask=Z,Qe[0]=X,Qe[1]=J,Fe.dither=K,Fe.lineWidth=Q,pr[0]=st,pr[1]=lt,pr[2]=ct,pr[3]=ut,Fe.scissor_enable=ft,Be.profile=pt,Ne.offset=dt,Ne.count=Se,Ne.primitive=ze,qe[Bt]=Ee,qe[Nt]=Ce,qe[jt]=Oe,qe[Vt]=De,qe[Ut]=Ue,qe[Ht]=Ge,qe[qt]=Xe,qe[Gt]=$e,qe[Wt]=er,qe[Yt]=nr,qe[Zt]=ar,qe[Xt]=sr,qe[Jt]=cr,qe[Kt]=fr,qe[Qt]=mr,qe[$t]=br,qe[te]=_r,qe[ee]=Ar,qe[re]=Tr,qe[ne]=Sr,qe[ie]=Er,qe[ae]=Cr,qe[oe]=Or,qe[se]=Dr,le.state=Rr,le.x=Fr,le.y=Br,le.z=Nr,le.w=jr,le.buffer=Vr,le.size=Ur,le.normalized=Hr,le.type=qr,le.offset=Gr,le.stride=Wr,le.divisor=Yr,ce.state=Zr,ce.x=Xr,ce.y=Jr,ce.z=Kr,ce.w=Qr,ce.buffer=$r,ce.size=tn,ce.normalized=en,ce.type=rn,ce.offset=nn,ce.stride=an,ce.divisor=on,ue.state=sn,ue.x=ln,ue.y=cn,ue.z=un,ue.w=fn,ue.buffer=pn,ue.size=hn,ue.normalized=dn,ue.type=mn,ue.offset=gn,ue.stride=yn,ue.divisor=vn,fe.state=bn,fe.x=xn,fe.y=_n,fe.z=wn,fe.w=An,fe.buffer=kn,fe.size=Tn,fe.normalized=Mn,fe.type=Sn,fe.offset=zn,fe.stride=En,fe.divisor=Ln,pe.state=Cn,pe.x=Pn,pe.y=On,pe.z=In,pe.w=Dn,pe.buffer=Rn,pe.size=Fn,pe.normalized=Bn,pe.type=Nn,pe.offset=jn,pe.stride=Vn,pe.divisor=Un,he.state=Hn,he.x=qn,he.y=Gn,he.z=Wn,he.w=Yn,he.buffer=Zn,he.size=Xn,he.normalized=Jn,he.type=Kn,he.offset=Qn,he.stride=$n,he.divisor=ti,de.state=ei,de.x=ri,de.y=ni,de.z=ii,de.w=ai,de.buffer=oi,de.size=si,de.normalized=li,de.type=ci,de.offset=ui,de.stride=fi,de.divisor=pi,me.state=hi,me.x=di,me.y=mi,me.z=gi,me.w=yi,me.buffer=vi,me.size=bi,me.normalized=xi,me.type=_i,me.offset=wi,me.stride=Ai,me.divisor=ki,ge.state=Ti,ge.x=Mi,ge.y=Si,ge.z=zi,ge.w=Ei,ge.buffer=Li,ge.size=Ci,ge.normalized=Pi,ge.type=Oi,ge.offset=Ii,ge.stride=Di,ge.divisor=Ri,ye.state=Fi,ye.x=Bi,ye.y=Ni,ye.z=ji,ye.w=Vi,ye.buffer=Ui,ye.size=Hi,ye.normalized=qi,ye.type=Gi,ye.offset=Wi,ye.stride=Yi,ye.divisor=Zi,ve.state=Xi,ve.x=Ji,ve.y=Ki,ve.z=Qi,ve.w=$i,ve.buffer=ta,ve.size=ea,ve.normalized=ra,ve.type=na,ve.offset=ia,ve.stride=aa,ve.divisor=oa,be.state=sa,be.x=la,be.y=ca,be.z=ua,be.w=fa,be.buffer=pa,be.size=ha,be.normalized=da,be.type=ma,be.offset=ga,be.stride=ya,be.divisor=va,xe.state=ba,xe.x=xa,xe.y=_a,xe.z=wa,xe.w=Aa,xe.buffer=ka,xe.size=Ta,xe.normalized=Ma,xe.type=Sa,xe.offset=za,xe.stride=Ea,xe.divisor=La,_e.state=Ca,_e.x=Pa,_e.y=Oa,_e.z=Ia,_e.w=Da,_e.buffer=Ra,_e.size=Fa,_e.normalized=Ba,_e.type=Na,_e.offset=ja,_e.stride=Va,_e.divisor=Ua,we.state=Ha,we.x=qa,we.y=Ga,we.z=Wa,we.w=Ya,we.buffer=Za,we.size=Xa,we.normalized=Ja,we.type=Ka,we.offset=Qa,we.stride=$a,we.divisor=to,Ae.state=eo,Ae.x=ro,Ae.y=no,Ae.z=io;Ae.w=ao,Ae.buffer=oo,Ae.size=so,Ae.normalized=lo,Ae.type=co,Ae.offset=uo,Ae.stride=fo,Ae.divisor=po,Ve.vert=ho,Ve.frag=mo,Be.dirty=!0},batch:function(t,e){var r,n,i,a,o,s,l,c,u,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he;((r=Ge.next)!==Ge.cur&&(r?De.bindFramebuffer(36160,r.framebuffer):De.bindFramebuffer(36160,null),Ge.cur=r),Be.dirty)&&(o=tr[0],s=tr[1],l=tr[2],c=tr[3],o===er[0]&&s===er[1]&&l===er[2]&&c===er[3]||(De.colorMask(o,s,l,c),er[0]=o,er[1]=s,er[2]=l,er[3]=c),(u=Fe.frontFace)!==Be.frontFace&&(De.frontFace(u),Be.frontFace=u),(mt=Fe.polygonOffset_enable)!==Be.polygonOffset_enable&&(mt?De.enable(32823):De.disable(32823),Be.polygonOffset_enable=mt),gt=rr[0],yt=rr[1],gt===nr[0]&&yt===nr[1]||(De.polygonOffset(gt,yt),nr[0]=gt,nr[1]=yt),(vt=Fe.sample_alpha)!==Be.sample_alpha&&(vt?De.enable(32926):De.disable(32926),Be.sample_alpha=vt),(bt=Fe.sample_enable)!==Be.sample_enable&&(bt?De.enable(32928):De.disable(32928),Be.sample_enable=bt),xt=ir[0],_t=ir[1],xt===ar[0]&&_t===ar[1]||(De.sampleCoverage(xt,_t),ar[0]=xt,ar[1]=_t),(wt=Fe.stencil_enable)!==Be.stencil_enable&&(wt?De.enable(2960):De.disable(2960),Be.stencil_enable=wt),(At=Fe.stencil_mask)!==Be.stencil_mask&&(De.stencilMask(At),Be.stencil_mask=At),kt=or[0],Tt=or[1],Mt=or[2],kt===sr[0]&&Tt===sr[1]&&Mt===sr[2]||(De.stencilFunc(kt,Tt,Mt),sr[0]=kt,sr[1]=Tt,sr[2]=Mt),St=lr[0],zt=lr[1],Et=lr[2],Lt=lr[3],St===cr[0]&&zt===cr[1]&&Et===cr[2]&&Lt===cr[3]||(De.stencilOpSeparate(St,zt,Et,Lt),cr[0]=St,cr[1]=zt,cr[2]=Et,cr[3]=Lt),Ct=ur[0],Pt=ur[1],Ot=ur[2],It=ur[3],Ct===fr[0]&&Pt===fr[1]&&Ot===fr[2]&&It===fr[3]||(De.stencilOpSeparate(Ct,Pt,Ot,It),fr[0]=Ct,fr[1]=Pt,fr[2]=Ot,fr[3]=It));for(De.blendColor(0,0,0,0),Ye[0]=0,Ye[1]=0,Ye[2]=0,Ye[3]=0,Me?De.enable(3042):De.disable(3042),Be.blend_enable=Me,De.blendEquationSeparate(32774,32774),Xe[0]=32774,Xe[1]=32774,De.blendFuncSeparate(770,771,1,1),Ke[0]=770,Ke[1]=771,Ke[2]=1,Ke[3]=1,Se?De.enable(2884):De.disable(2884),Be.cull_enable=Se,De.cullFace(ze),Be.cull_face=ze,Ee?De.enable(2929):De.disable(2929),Be.depth_enable=Ee,De.depthFunc(Le),Be.depth_func=Le,De.depthMask(Ce),Be.depth_mask=Ce,De.depthRange(0,1),$e[0]=0,$e[1]=1,Pe?De.enable(3024):De.disable(3024),Be.dither=Pe,De.lineWidth(Oe),Be.lineWidth=Oe,Ie?De.enable(3089):De.disable(3089),Be.scissor_enable=Ie,n=Be.profile,Be.profile=!1,De.useProgram(f.program),He.setVAO(null),Dt=h.location,(Rt=Ue[Dt]).buffer||De.enableVertexAttribArray(Dt),Rt.type===p.dtype&&4===Rt.size&&Rt.buffer===p&&!1===Rt.normalized&&0===Rt.offset&&0===Rt.stride||(De.bindBuffer(34962,p.buffer),De.vertexAttribPointer(Dt,4,p.dtype,!1,0,0),Rt.type=p.dtype,Rt.size=4,Rt.buffer=p,Rt.normalized=!1,Rt.offset=0,Rt.stride=0),Ft=m.location,(Bt=Ue[Ft]).buffer||De.enableVertexAttribArray(Ft),Bt.type===d.dtype&&4===Bt.size&&Bt.buffer===d&&!1===Bt.normalized&&0===Bt.offset&&0===Bt.stride||(De.bindBuffer(34962,d.buffer),De.vertexAttribPointer(Ft,4,d.dtype,!1,0,0),Bt.type=d.dtype,Bt.size=4,Bt.buffer=d,Bt.normalized=!1,Bt.offset=0,Bt.stride=0),Nt=y.location,(jt=Ue[Nt]).buffer||De.enableVertexAttribArray(Nt),jt.type===g.dtype&&4===jt.size&&jt.buffer===g&&!1===jt.normalized&&0===jt.offset&&0===jt.stride||(De.bindBuffer(34962,g.buffer),De.vertexAttribPointer(Nt,4,g.dtype,!1,0,0),jt.type=g.dtype,jt.size=4,jt.buffer=g,jt.normalized=!1,jt.offset=0,jt.stride=0),Vt=b.location,(Ut=Ue[Vt]).buffer||De.enableVertexAttribArray(Vt),Ut.type===v.dtype&&4===Ut.size&&Ut.buffer===v&&!1===Ut.normalized&&0===Ut.offset&&0===Ut.stride||(De.bindBuffer(34962,v.buffer),De.vertexAttribPointer(Vt,4,v.dtype,!1,0,0),Ut.type=v.dtype,Ut.size=4,Ut.buffer=v,Ut.normalized=!1,Ut.offset=0,Ut.stride=0),Ht=_.location,(qt=Ue[Ht]).buffer||De.enableVertexAttribArray(Ht),qt.type===x.dtype&&4===qt.size&&qt.buffer===x&&!1===qt.normalized&&0===qt.offset&&0===qt.stride||(De.bindBuffer(34962,x.buffer),De.vertexAttribPointer(Ht,4,x.dtype,!1,0,0),qt.type=x.dtype,qt.size=4,qt.buffer=x,qt.normalized=!1,qt.offset=0,qt.stride=0),Gt=A.location,(Wt=Ue[Gt]).buffer||De.enableVertexAttribArray(Gt),Wt.type===w.dtype&&4===Wt.size&&Wt.buffer===w&&!1===Wt.normalized&&0===Wt.offset&&0===Wt.stride||(De.bindBuffer(34962,w.buffer),De.vertexAttribPointer(Gt,4,w.dtype,!1,0,0),Wt.type=w.dtype,Wt.size=4,Wt.buffer=w,Wt.normalized=!1,Wt.offset=0,Wt.stride=0),Yt=T.location,(Zt=Ue[Yt]).buffer||De.enableVertexAttribArray(Yt),Zt.type===k.dtype&&4===Zt.size&&Zt.buffer===k&&!1===Zt.normalized&&0===Zt.offset&&0===Zt.stride||(De.bindBuffer(34962,k.buffer),De.vertexAttribPointer(Yt,4,k.dtype,!1,0,0),Zt.type=k.dtype,Zt.size=4,Zt.buffer=k,Zt.normalized=!1,Zt.offset=0,Zt.stride=0),Xt=S.location,(Jt=Ue[Xt]).buffer||De.enableVertexAttribArray(Xt),Jt.type===M.dtype&&4===Jt.size&&Jt.buffer===M&&!1===Jt.normalized&&0===Jt.offset&&0===Jt.stride||(De.bindBuffer(34962,M.buffer),De.vertexAttribPointer(Xt,4,M.dtype,!1,0,0),Jt.type=M.dtype,Jt.size=4,Jt.buffer=M,Jt.normalized=!1,Jt.offset=0,Jt.stride=0),Kt=E.location,(Qt=Ue[Kt]).buffer||De.enableVertexAttribArray(Kt),Qt.type===z.dtype&&4===Qt.size&&Qt.buffer===z&&!1===Qt.normalized&&0===Qt.offset&&0===Qt.stride||(De.bindBuffer(34962,z.buffer),De.vertexAttribPointer(Kt,4,z.dtype,!1,0,0),Qt.type=z.dtype,Qt.size=4,Qt.buffer=z,Qt.normalized=!1,Qt.offset=0,Qt.stride=0),$t=C.location,(te=Ue[$t]).buffer||De.enableVertexAttribArray($t),te.type===L.dtype&&4===te.size&&te.buffer===L&&!1===te.normalized&&0===te.offset&&0===te.stride||(De.bindBuffer(34962,L.buffer),De.vertexAttribPointer($t,4,L.dtype,!1,0,0),te.type=L.dtype,te.size=4,te.buffer=L,te.normalized=!1,te.offset=0,te.stride=0),ee=O.location,(re=Ue[ee]).buffer||De.enableVertexAttribArray(ee),re.type===P.dtype&&4===re.size&&re.buffer===P&&!1===re.normalized&&0===re.offset&&0===re.stride||(De.bindBuffer(34962,P.buffer),De.vertexAttribPointer(ee,4,P.dtype,!1,0,0),re.type=P.dtype,re.size=4,re.buffer=P,re.normalized=!1,re.offset=0,re.stride=0),ne=D.location,(ie=Ue[ne]).buffer||De.enableVertexAttribArray(ne),ie.type===I.dtype&&4===ie.size&&ie.buffer===I&&!1===ie.normalized&&0===ie.offset&&0===ie.stride||(De.bindBuffer(34962,I.buffer),De.vertexAttribPointer(ne,4,I.dtype,!1,0,0),ie.type=I.dtype,ie.size=4,ie.buffer=I,ie.normalized=!1,ie.offset=0,ie.stride=0),ae=F.location,(oe=Ue[ae]).buffer||De.enableVertexAttribArray(ae),oe.type===R.dtype&&4===oe.size&&oe.buffer===R&&!1===oe.normalized&&0===oe.offset&&0===oe.stride||(De.bindBuffer(34962,R.buffer),De.vertexAttribPointer(ae,4,R.dtype,!1,0,0),oe.type=R.dtype,oe.size=4,oe.buffer=R,oe.normalized=!1,oe.offset=0,oe.stride=0),se=N.location,(le=Ue[se]).buffer||De.enableVertexAttribArray(se),le.type===B.dtype&&4===le.size&&le.buffer===B&&!1===le.normalized&&0===le.offset&&0===le.stride||(De.bindBuffer(34962,B.buffer),De.vertexAttribPointer(se,4,B.dtype,!1,0,0),le.type=B.dtype,le.size=4,le.buffer=B,le.normalized=!1,le.offset=0,le.stride=0),ce=V.location,(ue=Ue[ce]).buffer||De.enableVertexAttribArray(ce),ue.type===j.dtype&&4===ue.size&&ue.buffer===j&&!1===ue.normalized&&0===ue.offset&&0===ue.stride||(De.bindBuffer(34962,j.buffer),De.vertexAttribPointer(ce,4,j.dtype,!1,0,0),ue.type=j.dtype,ue.size=4,ue.buffer=j,ue.normalized=!1,ue.offset=0,ue.stride=0),fe=H.location,(pe=Ue[fe]).buffer||De.enableVertexAttribArray(fe),pe.type===U.dtype&&4===pe.size&&pe.buffer===U&&!1===pe.normalized&&0===pe.offset&&0===pe.stride||(De.bindBuffer(34962,U.buffer),De.vertexAttribPointer(fe,4,U.dtype,!1,0,0),pe.type=U.dtype,pe.size=4,pe.buffer=U,pe.normalized=!1,pe.offset=0,pe.stride=0),De.uniform1i(ut.location,ft.bind()),((he=Ne.elements)||He.currentVAO&&(he=je.getElements(He.currentVAO.elements)))&&De.bindBuffer(34963,he.buffer.buffer),i=0;i>1)):De.drawArrays(1,Tn,Mn),Re.viewportWidth=we,Re.viewportHeight=Ae,cn.unbind())}ft.unbind(),Be.dirty=!0,He.setVAO(null),Be.profile=n}}}},{}],494:[function(t,e,r){e.exports=function(t,e){"use strict";var r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C;return r=t.gl,t.context,t.strings,n=t.next,i=t.current,t.draw,t.elements,t.buffer,t.shader,a=t.attributes,o=t.vao,t.uniforms,s=t.framebuffer,t.extensions,t.timer,t.isBufferArgs,n.blend_color,i.blend_color,n.blend_equation,i.blend_equation,n.blend_func,i.blend_func,n.depth_range,i.depth_range,n.colorMask,i.colorMask,n.polygonOffset_offset,i.polygonOffset_offset,n.sample_coverage,i.sample_coverage,n.stencil_func,i.stencil_func,n.stencil_opFront,i.stencil_opFront,n.stencil_opBack,i.stencil_opBack,n.scissor_box,i.scissor_box,n.viewport,i.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},l=n.blend_color,c=i.blend_color,u=n.blend_equation,f=i.blend_equation,p=n.blend_func,h=i.blend_func,d=n.depth_range,m=i.depth_range,g=n.colorMask,y=i.colorMask,v=n.polygonOffset_offset,b=i.polygonOffset_offset,x=n.sample_coverage,_=i.sample_coverage,w=n.stencil_func,A=i.stencil_func,k=n.stencil_opFront,T=i.stencil_opFront,M=n.stencil_opBack,S=i.stencil_opBack,z=n.scissor_box,E=i.scissor_box,L=n.viewport,C=i.viewport,{poll:function(){var t,e,a,o,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X;i.dirty=!1,e=n.dither,a=n.blend_enable,o=n.depth_enable,P=n.cull_enable,O=n.polygonOffset_enable,I=n.sample_alpha,D=n.sample_enable,R=n.stencil_enable,F=n.scissor_enable,B=n.depth_func,N=i.depth_func,j=n.depth_mask,V=i.depth_mask,U=n.cull_face,H=i.cull_face,q=n.frontFace,G=i.frontFace,W=n.lineWidth,Y=i.lineWidth,Z=n.stencil_mask,X=i.stencil_mask,(t=s.next)!==s.cur&&(t?r.bindFramebuffer(36160,t.framebuffer):r.bindFramebuffer(36160,null),s.cur=t),e!==i.dither&&(e?r.enable(3024):r.disable(3024),i.dither=e),a!==i.blend_enable&&(a?r.enable(3042):r.disable(3042),i.blend_enable=a),o!==i.depth_enable&&(o?r.enable(2929):r.disable(2929),i.depth_enable=o),P!==i.cull_enable&&(P?r.enable(2884):r.disable(2884),i.cull_enable=P),O!==i.polygonOffset_enable&&(O?r.enable(32823):r.disable(32823),i.polygonOffset_enable=O),I!==i.sample_alpha&&(I?r.enable(32926):r.disable(32926),i.sample_alpha=I),D!==i.sample_enable&&(D?r.enable(32928):r.disable(32928),i.sample_enable=D),R!==i.stencil_enable&&(R?r.enable(2960):r.disable(2960),i.stencil_enable=R),F!==i.scissor_enable&&(F?r.enable(3089):r.disable(3089),i.scissor_enable=F),l[0]===c[0]&&l[1]===c[1]&&l[2]===c[2]&&l[3]===c[3]||(r.blendColor(l[0],l[1],l[2],l[3]),c[0]=l[0],c[1]=l[1],c[2]=l[2],c[3]=l[3]),u[0]===f[0]&&u[1]===f[1]||(r.blendEquationSeparate(u[0],u[1]),f[0]=u[0],f[1]=u[1]),p[0]===h[0]&&p[1]===h[1]&&p[2]===h[2]&&p[3]===h[3]||(r.blendFuncSeparate(p[0],p[1],p[2],p[3]),h[0]=p[0],h[1]=p[1],h[2]=p[2],h[3]=p[3]),B!==N&&(r.depthFunc(B),i.depth_func=B),d[0]===m[0]&&d[1]===m[1]||(r.depthRange(d[0],d[1]),m[0]=d[0],m[1]=d[1]),j!==V&&(r.depthMask(j),i.depth_mask=j),g[0]===y[0]&&g[1]===y[1]&&g[2]===y[2]&&g[3]===y[3]||(r.colorMask(g[0],g[1],g[2],g[3]),y[0]=g[0],y[1]=g[1],y[2]=g[2],y[3]=g[3]),U!==H&&(r.cullFace(U),i.cull_face=U),q!==G&&(r.frontFace(q),i.frontFace=q),W!==Y&&(r.lineWidth(W),i.lineWidth=W),v[0]===b[0]&&v[1]===b[1]||(r.polygonOffset(v[0],v[1]),b[0]=v[0],b[1]=v[1]),x[0]===_[0]&&x[1]===_[1]||(r.sampleCoverage(x[0],x[1]),_[0]=x[0],_[1]=x[1]),Z!==X&&(r.stencilMask(Z),i.stencil_mask=Z),w[0]===A[0]&&w[1]===A[1]&&w[2]===A[2]||(r.stencilFunc(w[0],w[1],w[2]),A[0]=w[0],A[1]=w[1],A[2]=w[2]),k[0]===T[0]&&k[1]===T[1]&&k[2]===T[2]&&k[3]===T[3]||(r.stencilOpSeparate(k[0],k[1],k[2],k[3]),T[0]=k[0],T[1]=k[1],T[2]=k[2],T[3]=k[3]),M[0]===S[0]&&M[1]===S[1]&&M[2]===S[2]&&M[3]===S[3]||(r.stencilOpSeparate(M[0],M[1],M[2],M[3]),S[0]=M[0],S[1]=M[1],S[2]=M[2],S[3]=M[3]),z[0]===E[0]&&z[1]===E[1]&&z[2]===E[2]&&z[3]===E[3]||(r.scissor(z[0],z[1],z[2],z[3]),E[0]=z[0],E[1]=z[1],E[2]=z[2],E[3]=z[3]),L[0]===C[0]&&L[1]===C[1]&&L[2]===C[2]&&L[3]===C[3]||(r.viewport(L[0],L[1],L[2],L[3]),C[0]=L[0],C[1]=L[1],C[2]=L[2],C[3]=L[3])},refresh:function(){var t,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z;i.dirty=!1,I=n.dither,D=n.blend_enable,R=n.depth_enable,F=n.cull_enable,B=n.polygonOffset_enable,N=n.sample_alpha,j=n.sample_enable,V=n.stencil_enable,U=n.scissor_enable,H=n.depth_func,i.depth_func,q=n.depth_mask,i.depth_mask,G=n.cull_face,i.cull_face,W=n.frontFace,i.frontFace,Y=n.lineWidth,i.lineWidth,Z=n.stencil_mask,i.stencil_mask,(t=s.next)?r.bindFramebuffer(36160,t.framebuffer):r.bindFramebuffer(36160,null),s.cur=t,P=a,O=0;for(var X=0;X":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Dt={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(Rt={}).stride=8,Rt.offset=8,(Ft={}).stride=8,Ft.offset=8,{draw:function(t){var y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,it,st,ft,ht,mt,Ct,Ot,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze;(ct.angle_instanced_arrays,(y=lt.next)!==lt.cur&&(y?K.bindFramebuffer(36160,y.framebuffer):K.bindFramebuffer(36160,null),lt.cur=y),tt.dirty)&&((ye=$.dither)!==tt.dither&&(ye?K.enable(3024):K.disable(3024),tt.dither=ye),(ve=$.depth_func)!==tt.depth_func&&(K.depthFunc(ve),tt.depth_func=ve),be=yt[0],xe=yt[1],be===vt[0]&&xe===vt[1]||(K.depthRange(be,xe),vt[0]=be,vt[1]=xe),(_e=$.depth_mask)!==tt.depth_mask&&(K.depthMask(_e),tt.depth_mask=_e),we=bt[0],Ae=bt[1],ke=bt[2],Te=bt[3],we===xt[0]&&Ae===xt[1]&&ke===xt[2]&&Te===xt[3]||(K.colorMask(we,Ae,ke,Te),xt[0]=we,xt[1]=Ae,xt[2]=ke,xt[3]=Te),(Me=$.cull_enable)!==tt.cull_enable&&(Me?K.enable(2884):K.disable(2884),tt.cull_enable=Me),(Se=$.cull_face)!==tt.cull_face&&(K.cullFace(Se),tt.cull_face=Se),(ze=$.frontFace)!==tt.frontFace&&(K.frontFace(ze),tt.frontFace=ze),(Ee=$.lineWidth)!==tt.lineWidth&&(K.lineWidth(Ee),tt.lineWidth=Ee),(Le=$.polygonOffset_enable)!==tt.polygonOffset_enable&&(Le?K.enable(32823):K.disable(32823),tt.polygonOffset_enable=Le),Ce=_t[0],Pe=_t[1],Ce===wt[0]&&Pe===wt[1]||(K.polygonOffset(Ce,Pe),wt[0]=Ce,wt[1]=Pe),(Oe=$.sample_alpha)!==tt.sample_alpha&&(Oe?K.enable(32926):K.disable(32926),tt.sample_alpha=Oe),(Ie=$.sample_enable)!==tt.sample_enable&&(Ie?K.enable(32928):K.disable(32928),tt.sample_enable=Ie),De=At[0],Re=At[1],De===kt[0]&&Re===kt[1]||(K.sampleCoverage(De,Re),kt[0]=De,kt[1]=Re),(Fe=$.stencil_mask)!==tt.stencil_mask&&(K.stencilMask(Fe),tt.stencil_mask=Fe),Be=Tt[0],Ne=Tt[1],je=Tt[2],Be===Mt[0]&&Ne===Mt[1]&&je===Mt[2]||(K.stencilFunc(Be,Ne,je),Mt[0]=Be,Mt[1]=Ne,Mt[2]=je),Ve=St[0],Ue=St[1],He=St[2],qe=St[3],Ve===zt[0]&&Ue===zt[1]&&He===zt[2]&&qe===zt[3]||(K.stencilOpSeparate(Ve,Ue,He,qe),zt[0]=Ve,zt[1]=Ue,zt[2]=He,zt[3]=qe),Ge=Et[0],We=Et[1],Ye=Et[2],Ze=Et[3],Ge===Lt[0]&&We===Lt[1]&&Ye===Lt[2]&&Ze===Lt[3]||(K.stencilOpSeparate(Ge,We,Ye,Ze),Lt[0]=Ge,Lt[1]=We,Lt[2]=Ye,Lt[3]=Ze));b=0|(v=t.viewport).x,x=0|v.y,_="width"in v?0|v.width:Q.framebufferWidth-b,w="height"in v?0|v.height:Q.framebufferHeight-x,A=Q.viewportWidth,Q.viewportWidth=_,k=Q.viewportHeight,Q.viewportHeight=w,K.viewport(b,x,_,w),It[0]=b,It[1]=x,It[2]=_,It[3]=w,K.blendColor(0,0,0,0),pt[0]=0,pt[1]=0,pt[2]=0,pt[3]=0,r?K.enable(3042):K.disable(3042),tt.blend_enable=r,K.blendEquationSeparate(32774,32774),dt[0]=32774,dt[1]=32774,K.blendFuncSeparate(770,771,773,1),gt[0]=770,gt[1]=771,gt[2]=773,gt[3]=1,n?K.enable(2929):K.disable(2929),tt.depth_enable=n,M=0|(T=t.viewport).x,S=0|T.y,z="width"in T?0|T.width:Q.framebufferWidth-M,E="height"in T?0|T.height:Q.framebufferHeight-S,K.scissor(M,S,z,E),Pt[0]=M,Pt[1]=S,Pt[2]=z,Pt[3]=E,i?K.enable(3089):K.disable(3089),tt.scissor_enable=i,a?K.enable(2960):K.disable(2960),tt.stencil_enable=a,(L=tt.profile)&&(C=performance.now(),e.count++),K.useProgram(o.program),P=ct.angle_instanced_arrays,ot.setVAO(null),O=t.positionBuffer,Rt.buffer=O,I=!1,D=1,R=0,F=0,B=0,N=0,j=null,V=0,U=!1,H=5126,q=0,G=0,W=0,ut(Rt)?(I=!0,H=(j=nt.createStream(34962,Rt)).dtype):(j=nt.getBuffer(Rt))?H=j.dtype:"constant"in Rt?(D=2,"number"==typeof Rt.constant?(R=Rt.constant,F=B=N=0):(R=Rt.constant.length>0?Rt.constant[0]:0,F=Rt.constant.length>1?Rt.constant[1]:0,B=Rt.constant.length>2?Rt.constant[2]:0,N=Rt.constant.length>3?Rt.constant[3]:0)):(j=ut(Rt.buffer)?nt.createStream(34962,Rt.buffer):nt.getBuffer(Rt.buffer),H="type"in Rt?Dt[Rt.type]:j.dtype,U=!!Rt.normalized,V=0|Rt.size,q=0|Rt.offset,G=0|Rt.stride,W=0|Rt.divisor),Y=s.location,Z=at[Y],1===D?(Z.buffer||K.enableVertexAttribArray(Y),X=V||2,Z.type===H&&Z.size===X&&Z.buffer===j&&Z.normalized===U&&Z.offset===q&&Z.stride===G||(K.bindBuffer(34962,j.buffer),K.vertexAttribPointer(Y,X,H,U,G,q),Z.type=H,Z.size=X,Z.buffer=j,Z.normalized=U,Z.offset=q,Z.stride=G),Z.divisor!==W&&(P.vertexAttribDivisorANGLE(Y,W),Z.divisor=W)):(Z.buffer&&(K.disableVertexAttribArray(Y),Z.buffer=null),Z.x===R&&Z.y===F&&Z.z===B&&Z.w===N||(K.vertexAttrib4f(Y,R,F,B,N),Z.x=R,Z.y=F,Z.z=B,Z.w=N)),J=t.positionFractBuffer,Ft.buffer=J,it=!1,st=1,ft=0,ht=0,mt=0,Ct=0,Ot=null,Bt=0,Nt=!1,jt=5126,Vt=0,Ut=0,Ht=0,ut(Ft)?(it=!0,jt=(Ot=nt.createStream(34962,Ft)).dtype):(Ot=nt.getBuffer(Ft))?jt=Ot.dtype:"constant"in Ft?(st=2,"number"==typeof Ft.constant?(ft=Ft.constant,ht=mt=Ct=0):(ft=Ft.constant.length>0?Ft.constant[0]:0,ht=Ft.constant.length>1?Ft.constant[1]:0,mt=Ft.constant.length>2?Ft.constant[2]:0,Ct=Ft.constant.length>3?Ft.constant[3]:0)):(Ot=ut(Ft.buffer)?nt.createStream(34962,Ft.buffer):nt.getBuffer(Ft.buffer),jt="type"in Ft?Dt[Ft.type]:Ot.dtype,Nt=!!Ft.normalized,Bt=0|Ft.size,Vt=0|Ft.offset,Ut=0|Ft.stride,Ht=0|Ft.divisor),qt=l.location,Gt=at[qt],1===st?(Gt.buffer||K.enableVertexAttribArray(qt),Wt=Bt||2,Gt.type===jt&&Gt.size===Wt&&Gt.buffer===Ot&&Gt.normalized===Nt&&Gt.offset===Vt&&Gt.stride===Ut||(K.bindBuffer(34962,Ot.buffer),K.vertexAttribPointer(qt,Wt,jt,Nt,Ut,Vt),Gt.type=jt,Gt.size=Wt,Gt.buffer=Ot,Gt.normalized=Nt,Gt.offset=Vt,Gt.stride=Ut),Gt.divisor!==Ht&&(P.vertexAttribDivisorANGLE(qt,Ht),Gt.divisor=Ht)):(Gt.buffer&&(K.disableVertexAttribArray(qt),Gt.buffer=null),Gt.x===ft&&Gt.y===ht&&Gt.z===mt&&Gt.w===Ct||(K.vertexAttrib4f(qt,ft,ht,mt,Ct),Gt.x=ft,Gt.y=ht,Gt.z=mt,Gt.w=Ct)),Zt=(Yt=t.fill)[0],Xt=Yt[1],Jt=Yt[2],Kt=Yt[3],K.uniform4f(c.location,Zt,Xt,Jt,Kt),Qt=t.id,K.uniform1f(u.location,Qt),$t=t.opacity,K.uniform1f(f.location,$t),ee=(te=t.scale)[0],re=te[1],K.uniform2f(p.location,ee,re),ie=(ne=t.scaleFract)[0],ae=ne[1],K.uniform2f(h.location,ie,ae),se=(oe=t.translate)[0],le=oe[1],K.uniform2f(d.location,se,le),ue=(ce=t.translateFract)[0],fe=ce[1],K.uniform2f(m.location,ue,fe),pe=g.call(this,Q,t,0),he=null,(he=(de=ut(pe))?rt.createStream(pe):rt.getElements(pe))&&K.bindBuffer(34963,he.buffer.buffer),(me=he?he.vertCount:-1)&&((ge=et.instances)>0?he?P.drawElementsInstancedANGLE(4,me,he.type,0<<(he.type-5121>>1),ge):P.drawArraysInstancedANGLE(4,0,me,ge):ge<0&&(he?K.drawElements(4,me,he.type,0<<(he.type-5121>>1)):K.drawArrays(4,0,me)),tt.dirty=!0,ot.setVAO(null),Q.viewportWidth=A,Q.viewportHeight=k,L&&(e.cpuTime+=performance.now()-C),I&&nt.destroyStream(j),it&&nt.destroyStream(Ot),de&&rt.destroyStream(he))},scope:function(t,r,n){var i,a,o,s,l,c,u,f,p,h,d,m,Y,Z,X,J,K,at,ot,lt,ct,pt,dt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Pt,It,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar;a=0|(i=t.viewport).x,o=0|i.y,s="width"in i?0|i.width:Q.framebufferWidth-a,l="height"in i?0|i.height:Q.framebufferHeight-o,c=Q.viewportWidth,Q.viewportWidth=s,u=Q.viewportHeight,Q.viewportHeight=l,f=Ot[0],Ot[0]=a,p=Ot[1],Ot[1]=o,h=Ot[2],Ot[2]=s,d=Ot[3],Ot[3]=l,m=ft[0],ft[0]=y,Y=ft[1],ft[1]=v,Z=ft[2],ft[2]=b,X=ft[3],ft[3]=x,J=$.blend_enable,$.blend_enable=_,K=ht[0],ht[0]=w,at=ht[1],ht[1]=A,ot=mt[0],mt[0]=k,lt=mt[1],mt[1]=T,ct=mt[2],mt[2]=M,pt=mt[3],mt[3]=S,dt=$.depth_enable,$.depth_enable=z,yt=0|(gt=t.viewport).x,vt=0|gt.y,bt="width"in gt?0|gt.width:Q.framebufferWidth-yt,xt="height"in gt?0|gt.height:Q.framebufferHeight-vt,_t=Ct[0],Ct[0]=yt,wt=Ct[1],Ct[1]=vt,At=Ct[2],Ct[2]=bt,kt=Ct[3],Ct[3]=xt,Tt=$.scissor_enable,$.scissor_enable=E,Mt=$.stencil_enable,$.stencil_enable=L,(St=tt.profile)&&(zt=performance.now(),e.count++),Et=g.call(this,Q,t,n),Lt=null,Lt=(Pt=ut(Et))?rt.createStream(Et):rt.getElements(Et),It=et.elements,et.elements=Lt,Bt=et.offset,et.offset=C,Nt=Lt?Lt.vertCount:-1,jt=et.count,et.count=Nt,Vt=et.primitive,et.primitive=P,Ut=t.scale,Ht=st[O],st[O]=Ut,qt=t.fill,Gt=st[I],st[I]=qt,Wt=t.scaleFract,Yt=st[D],st[D]=Wt,Zt=t.translateFract,Xt=st[R],st[R]=Zt,Jt=t.translate,Kt=st[F],st[F]=Jt,Qt=t.opacity,$t=st[B],st[B]=Qt,te=Q.pixelRatio,ee=st[N],st[N]=te,re=t.id,ne=st[j],st[j]=re,ie=V.call(this,Q,t,n),ae=st[U],st[U]=ie,oe=t.positionBuffer,Rt.buffer=oe,se=!1,le=1,ce=0,ue=0,fe=0,pe=0,he=null,de=0,me=!1,ge=5126,ye=0,ve=0,be=0,ut(Rt)?(se=!0,ge=(he=nt.createStream(34962,Rt)).dtype):(he=nt.getBuffer(Rt))?ge=he.dtype:"constant"in Rt?(le=2,"number"==typeof Rt.constant?(ce=Rt.constant,ue=fe=pe=0):(ce=Rt.constant.length>0?Rt.constant[0]:0,ue=Rt.constant.length>1?Rt.constant[1]:0,fe=Rt.constant.length>2?Rt.constant[2]:0,pe=Rt.constant.length>3?Rt.constant[3]:0)):(he=ut(Rt.buffer)?nt.createStream(34962,Rt.buffer):nt.getBuffer(Rt.buffer),ge="type"in Rt?Dt[Rt.type]:he.dtype,me=!!Rt.normalized,de=0|Rt.size,ye=0|Rt.offset,ve=0|Rt.stride,be=0|Rt.divisor),xe=H.state,H.state=le,_e=H.x,H.x=ce,we=H.y,H.y=ue,Ae=H.z,H.z=fe,ke=H.w,H.w=pe,Te=H.buffer,H.buffer=he,Me=H.size,H.size=de,Se=H.normalized,H.normalized=me,ze=H.type,H.type=ge,Ee=H.offset,H.offset=ye,Le=H.stride,H.stride=ve,Ce=H.divisor,H.divisor=be,Pe=t.positionFractBuffer,Ft.buffer=Pe,Oe=!1,Ie=1,De=0,Re=0,Fe=0,Be=0,Ne=null,je=0,Ve=!1,Ue=5126,He=0,qe=0,Ge=0,ut(Ft)?(Oe=!0,Ue=(Ne=nt.createStream(34962,Ft)).dtype):(Ne=nt.getBuffer(Ft))?Ue=Ne.dtype:"constant"in Ft?(Ie=2,"number"==typeof Ft.constant?(De=Ft.constant,Re=Fe=Be=0):(De=Ft.constant.length>0?Ft.constant[0]:0,Re=Ft.constant.length>1?Ft.constant[1]:0,Fe=Ft.constant.length>2?Ft.constant[2]:0,Be=Ft.constant.length>3?Ft.constant[3]:0)):(Ne=ut(Ft.buffer)?nt.createStream(34962,Ft.buffer):nt.getBuffer(Ft.buffer),Ue="type"in Ft?Dt[Ft.type]:Ne.dtype,Ve=!!Ft.normalized,je=0|Ft.size,He=0|Ft.offset,qe=0|Ft.stride,Ge=0|Ft.divisor),We=q.state,q.state=Ie,Ye=q.x,q.x=De,Ze=q.y,q.y=Re,Xe=q.z,q.z=Fe,Je=q.w,q.w=Be,Ke=q.buffer,q.buffer=Ne,Qe=q.size,q.size=je,$e=q.normalized,q.normalized=Ve,tr=q.type,q.type=Ue,er=q.offset,q.offset=He,rr=q.stride,q.stride=qe,nr=q.divisor,q.divisor=Ge,ir=it.vert,it.vert=G,ar=it.frag,it.frag=W,tt.dirty=!0,r(Q,t,n),Q.viewportWidth=c,Q.viewportHeight=u,Ot[0]=f,Ot[1]=p,Ot[2]=h,Ot[3]=d,ft[0]=m,ft[1]=Y,ft[2]=Z,ft[3]=X,$.blend_enable=J,ht[0]=K,ht[1]=at,mt[0]=ot,mt[1]=lt,mt[2]=ct,mt[3]=pt,$.depth_enable=dt,Ct[0]=_t,Ct[1]=wt,Ct[2]=At,Ct[3]=kt,$.scissor_enable=Tt,$.stencil_enable=Mt,St&&(e.cpuTime+=performance.now()-zt),Pt&&rt.destroyStream(Lt),et.elements=It,et.offset=Bt,et.count=jt,et.primitive=Vt,st[O]=Ht,st[I]=Gt,st[D]=Yt,st[R]=Xt,st[F]=Kt,st[B]=$t,st[N]=ee,st[j]=ne,st[U]=ae,se&&nt.destroyStream(he),H.state=xe,H.x=_e,H.y=we,H.z=Ae,H.w=ke,H.buffer=Te,H.size=Me,H.normalized=Se,H.type=ze,H.offset=Ee,H.stride=Le,H.divisor=Ce,Oe&&nt.destroyStream(Ne),q.state=We,q.x=Ye,q.y=Ze,q.z=Xe,q.w=Je,q.buffer=Ke,q.size=Qe,q.normalized=$e,q.type=tr,q.offset=er,q.stride=rr,q.divisor=nr,it.vert=ir,it.frag=ar,tt.dirty=!0},batch:function(t,r){var n,i,a,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,it,st,ft,ht,mt,Ct;(ct.angle_instanced_arrays,(n=lt.next)!==lt.cur&&(n?K.bindFramebuffer(36160,n.framebuffer):K.bindFramebuffer(36160,null),lt.cur=n),tt.dirty)&&((x=$.dither)!==tt.dither&&(x?K.enable(3024):K.disable(3024),tt.dither=x),(_=$.depth_func)!==tt.depth_func&&(K.depthFunc(_),tt.depth_func=_),w=yt[0],A=yt[1],w===vt[0]&&A===vt[1]||(K.depthRange(w,A),vt[0]=w,vt[1]=A),(k=$.depth_mask)!==tt.depth_mask&&(K.depthMask(k),tt.depth_mask=k),T=bt[0],M=bt[1],S=bt[2],z=bt[3],T===xt[0]&&M===xt[1]&&S===xt[2]&&z===xt[3]||(K.colorMask(T,M,S,z),xt[0]=T,xt[1]=M,xt[2]=S,xt[3]=z),(E=$.cull_enable)!==tt.cull_enable&&(E?K.enable(2884):K.disable(2884),tt.cull_enable=E),(L=$.cull_face)!==tt.cull_face&&(K.cullFace(L),tt.cull_face=L),(C=$.frontFace)!==tt.frontFace&&(K.frontFace(C),tt.frontFace=C),(P=$.lineWidth)!==tt.lineWidth&&(K.lineWidth(P),tt.lineWidth=P),(O=$.polygonOffset_enable)!==tt.polygonOffset_enable&&(O?K.enable(32823):K.disable(32823),tt.polygonOffset_enable=O),I=_t[0],D=_t[1],I===wt[0]&&D===wt[1]||(K.polygonOffset(I,D),wt[0]=I,wt[1]=D),(R=$.sample_alpha)!==tt.sample_alpha&&(R?K.enable(32926):K.disable(32926),tt.sample_alpha=R),(F=$.sample_enable)!==tt.sample_enable&&(F?K.enable(32928):K.disable(32928),tt.sample_enable=F),B=At[0],N=At[1],B===kt[0]&&N===kt[1]||(K.sampleCoverage(B,N),kt[0]=B,kt[1]=N),(j=$.stencil_mask)!==tt.stencil_mask&&(K.stencilMask(j),tt.stencil_mask=j),V=Tt[0],U=Tt[1],H=Tt[2],V===Mt[0]&&U===Mt[1]&&H===Mt[2]||(K.stencilFunc(V,U,H),Mt[0]=V,Mt[1]=U,Mt[2]=H),q=St[0],G=St[1],W=St[2],it=St[3],q===zt[0]&&G===zt[1]&&W===zt[2]&&it===zt[3]||(K.stencilOpSeparate(q,G,W,it),zt[0]=q,zt[1]=G,zt[2]=W,zt[3]=it),st=Et[0],ft=Et[1],ht=Et[2],mt=Et[3],st===Lt[0]&&ft===Lt[1]&&ht===Lt[2]&&mt===Lt[3]||(K.stencilOpSeparate(st,ft,ht,mt),Lt[0]=st,Lt[1]=ft,Lt[2]=ht,Lt[3]=mt));for(K.blendColor(0,0,0,0),pt[0]=0,pt[1]=0,pt[2]=0,pt[3]=0,Y?K.enable(3042):K.disable(3042),tt.blend_enable=Y,K.blendEquationSeparate(32774,32774),dt[0]=32774,dt[1]=32774,K.blendFuncSeparate(770,771,773,1),gt[0]=770,gt[1]=771,gt[2]=773,gt[3]=1,Z?K.enable(2929):K.disable(2929),tt.depth_enable=Z,X?K.enable(3089):K.disable(3089),tt.scissor_enable=X,J?K.enable(2960):K.disable(2960),tt.stencil_enable=J,(i=tt.profile)&&(a=performance.now(),e.count+=r),K.useProgram(o.program),y=ct.angle_instanced_arrays,ot.setVAO(null),Ct=et.instances,v=0;v0?Rt.constant[0]:0,$t=Rt.constant.length>1?Rt.constant[1]:0,te=Rt.constant.length>2?Rt.constant[2]:0,ee=Rt.constant.length>3?Rt.constant[3]:0)):(re=ut(Rt.buffer)?nt.createStream(34962,Rt.buffer):nt.getBuffer(Rt.buffer),ae="type"in Rt?Dt[Rt.type]:re.dtype,ie=!!Rt.normalized,ne=0|Rt.size,oe=0|Rt.offset,se=0|Rt.stride,le=0|Rt.divisor),ce=s.location,ue=at[ce],1===Kt?(ue.buffer||K.enableVertexAttribArray(ce),fe=ne||2,ue.type===ae&&ue.size===fe&&ue.buffer===re&&ue.normalized===ie&&ue.offset===oe&&ue.stride===se||(K.bindBuffer(34962,re.buffer),K.vertexAttribPointer(ce,fe,ae,ie,se,oe),ue.type=ae,ue.size=fe,ue.buffer=re,ue.normalized=ie,ue.offset=oe,ue.stride=se),ue.divisor!==le&&(y.vertexAttribDivisorANGLE(ce,le),ue.divisor=le)):(ue.buffer&&(K.disableVertexAttribArray(ce),ue.buffer=null),ue.x===Qt&&ue.y===$t&&ue.z===te&&ue.w===ee||(K.vertexAttrib4f(ce,Qt,$t,te,ee),ue.x=Qt,ue.y=$t,ue.z=te,ue.w=ee)),pe=b.positionFractBuffer,Ft.buffer=pe,he=!1,de=1,me=0,ge=0,ye=0,ve=0,be=null,xe=0,_e=!1,we=5126,Ae=0,ke=0,Te=0,ut(Ft)?(he=!0,we=(be=nt.createStream(34962,Ft)).dtype):(be=nt.getBuffer(Ft))?we=be.dtype:"constant"in Ft?(de=2,"number"==typeof Ft.constant?(me=Ft.constant,ge=ye=ve=0):(me=Ft.constant.length>0?Ft.constant[0]:0,ge=Ft.constant.length>1?Ft.constant[1]:0,ye=Ft.constant.length>2?Ft.constant[2]:0,ve=Ft.constant.length>3?Ft.constant[3]:0)):(be=ut(Ft.buffer)?nt.createStream(34962,Ft.buffer):nt.getBuffer(Ft.buffer),we="type"in Ft?Dt[Ft.type]:be.dtype,_e=!!Ft.normalized,xe=0|Ft.size,Ae=0|Ft.offset,ke=0|Ft.stride,Te=0|Ft.divisor),Me=l.location,Se=at[Me],1===de?(Se.buffer||K.enableVertexAttribArray(Me),ze=xe||2,Se.type===we&&Se.size===ze&&Se.buffer===be&&Se.normalized===_e&&Se.offset===Ae&&Se.stride===ke||(K.bindBuffer(34962,be.buffer),K.vertexAttribPointer(Me,ze,we,_e,ke,Ae),Se.type=we,Se.size=ze,Se.buffer=be,Se.normalized=_e,Se.offset=Ae,Se.stride=ke),Se.divisor!==Te&&(y.vertexAttribDivisorANGLE(Me,Te),Se.divisor=Te)):(Se.buffer&&(K.disableVertexAttribArray(Me),Se.buffer=null),Se.x===me&&Se.y===ge&&Se.z===ye&&Se.w===ve||(K.vertexAttrib4f(Me,me,ge,ye,ve),Se.x=me,Se.y=ge,Se.z=ye,Se.w=ve)),Le=(Ee=b.fill)[0],Pe=Ee[1],Ie=Ee[2],Re=Ee[3],v&&Ce===Le&&Oe===Pe&&De===Ie&&Fe===Re||(Ce=Le,Oe=Pe,De=Ie,Fe=Re,K.uniform4f(c.location,Le,Pe,Ie,Re)),Be=b.id,v&&Ne===Be||(Ne=Be,K.uniform1f(u.location,Be)),je=b.opacity,v&&Ve===je||(Ve=je,K.uniform1f(f.location,je)),He=(Ue=b.scale)[0],Ge=Ue[1],v&&qe===He&&We===Ge||(qe=He,We=Ge,K.uniform2f(p.location,He,Ge)),Ze=(Ye=b.scaleFract)[0],Je=Ye[1],v&&Xe===Ze&&Ke===Je||(Xe=Ze,Ke=Je,K.uniform2f(h.location,Ze,Je)),$e=(Qe=b.translate)[0],er=Qe[1],v&&tr===$e&&rr===er||(tr=$e,rr=er,K.uniform2f(d.location,$e,er)),ir=(nr=b.translateFract)[0],or=nr[1],v&&ar===ir&&sr===or||(ar=ir,sr=or,K.uniform2f(m.location,ir,or)),lr=g.call(this,Q,b,v),cr=null,(cr=(ur=ut(lr))?rt.createStream(lr):rt.getElements(lr))&&K.bindBuffer(34963,cr.buffer.buffer),(fr=cr?cr.vertCount:-1)&&(Ct>0?cr?y.drawElementsInstancedANGLE(4,fr,cr.type,0<<(cr.type-5121>>1),Ct):y.drawArraysInstancedANGLE(4,0,fr,Ct):Ct<0&&(cr?K.drawElements(4,fr,cr.type,0<<(cr.type-5121>>1)):K.drawArrays(4,0,fr)),Q.viewportWidth=Ut,Q.viewportHeight=Ht,Jt&&nt.destroyStream(re),he&&nt.destroyStream(be),ur&&rt.destroyStream(cr))}tt.dirty=!0,ot.setVAO(null),i&&(e.cpuTime+=performance.now()-a)}}}},{}],496:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt){"use strict";var ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee;return ht=t.gl,dt=t.context,t.strings,mt=t.next,gt=t.current,yt=t.draw,vt=t.elements,bt=t.buffer,xt=t.shader,_t=t.attributes,wt=t.vao,At=t.uniforms,kt=t.framebuffer,Tt=t.extensions,t.timer,Mt=t.isBufferArgs,St=mt.blend_color,zt=gt.blend_color,Et=mt.blend_equation,Lt=gt.blend_equation,Ct=mt.blend_func,Pt=gt.blend_func,Ot=mt.depth_range,It=gt.depth_range,Dt=mt.colorMask,Rt=gt.colorMask,Ft=mt.polygonOffset_offset,Bt=gt.polygonOffset_offset,Nt=mt.sample_coverage,jt=gt.sample_coverage,Vt=mt.stencil_func,Ut=gt.stencil_func,Ht=mt.stencil_opFront,qt=gt.stencil_opFront,Gt=mt.stencil_opBack,Wt=gt.stencil_opBack,Yt=mt.scissor_box,Zt=gt.scissor_box,Xt=mt.viewport,Jt=gt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Kt={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(Qt={}).buffer=r,Qt.divisor=1,($t={}).buffer=n,$t.divisor=1,(te={}).buffer=i,te.divisor=1,(ee={}).buffer=a,ee.divisor=1,{draw:function(t){var r,n,i,a,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,xt,At,St,Et,Ct,Yt,Xt,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr;(Tt.angle_instanced_arrays,(r=kt.next)!==kt.cur&&(r?ht.bindFramebuffer(36160,r.framebuffer):ht.bindFramebuffer(36160,null),kt.cur=r),gt.dirty)&&((dr=mt.dither)!==gt.dither&&(dr?ht.enable(3024):ht.disable(3024),gt.dither=dr),(mr=mt.depth_func)!==gt.depth_func&&(ht.depthFunc(mr),gt.depth_func=mr),gr=Ot[0],yr=Ot[1],gr===It[0]&&yr===It[1]||(ht.depthRange(gr,yr),It[0]=gr,It[1]=yr),(vr=mt.depth_mask)!==gt.depth_mask&&(ht.depthMask(vr),gt.depth_mask=vr),br=Dt[0],xr=Dt[1],_r=Dt[2],wr=Dt[3],br===Rt[0]&&xr===Rt[1]&&_r===Rt[2]&&wr===Rt[3]||(ht.colorMask(br,xr,_r,wr),Rt[0]=br,Rt[1]=xr,Rt[2]=_r,Rt[3]=wr),(Ar=mt.cull_enable)!==gt.cull_enable&&(Ar?ht.enable(2884):ht.disable(2884),gt.cull_enable=Ar),(kr=mt.cull_face)!==gt.cull_face&&(ht.cullFace(kr),gt.cull_face=kr),(Tr=mt.frontFace)!==gt.frontFace&&(ht.frontFace(Tr),gt.frontFace=Tr),(Mr=mt.lineWidth)!==gt.lineWidth&&(ht.lineWidth(Mr),gt.lineWidth=Mr),(Sr=mt.polygonOffset_enable)!==gt.polygonOffset_enable&&(Sr?ht.enable(32823):ht.disable(32823),gt.polygonOffset_enable=Sr),zr=Ft[0],Er=Ft[1],zr===Bt[0]&&Er===Bt[1]||(ht.polygonOffset(zr,Er),Bt[0]=zr,Bt[1]=Er),(Lr=mt.sample_alpha)!==gt.sample_alpha&&(Lr?ht.enable(32926):ht.disable(32926),gt.sample_alpha=Lr),(Cr=mt.sample_enable)!==gt.sample_enable&&(Cr?ht.enable(32928):ht.disable(32928),gt.sample_enable=Cr),Pr=Nt[0],Or=Nt[1],Pr===jt[0]&&Or===jt[1]||(ht.sampleCoverage(Pr,Or),jt[0]=Pr,jt[1]=Or),(Ir=mt.stencil_enable)!==gt.stencil_enable&&(Ir?ht.enable(2960):ht.disable(2960),gt.stencil_enable=Ir),(Dr=mt.stencil_mask)!==gt.stencil_mask&&(ht.stencilMask(Dr),gt.stencil_mask=Dr),Rr=Vt[0],Fr=Vt[1],Br=Vt[2],Rr===Ut[0]&&Fr===Ut[1]&&Br===Ut[2]||(ht.stencilFunc(Rr,Fr,Br),Ut[0]=Rr,Ut[1]=Fr,Ut[2]=Br),Nr=Ht[0],jr=Ht[1],Vr=Ht[2],Ur=Ht[3],Nr===qt[0]&&jr===qt[1]&&Vr===qt[2]&&Ur===qt[3]||(ht.stencilOpSeparate(Nr,jr,Vr,Ur),qt[0]=Nr,qt[1]=jr,qt[2]=Vr,qt[3]=Ur),Hr=Gt[0],qr=Gt[1],Gr=Gt[2],Wr=Gt[3],Hr===Wt[0]&&qr===Wt[1]&&Gr===Wt[2]&&Wr===Wt[3]||(ht.stencilOpSeparate(Hr,qr,Gr,Wr),Wt[0]=Hr,Wt[1]=qr,Wt[2]=Gr,Wt[3]=Wr));i=0|(n=t.viewport).x,a=0|n.y,C="width"in n?0|n.width:dt.framebufferWidth-i,P="height"in n?0|n.height:dt.framebufferHeight-a,O=dt.viewportWidth,dt.viewportWidth=C,I=dt.viewportHeight,dt.viewportHeight=P,ht.viewport(i,a,C,P),Jt[0]=i,Jt[1]=a,Jt[2]=C,Jt[3]=P,ht.blendColor(0,0,0,0),zt[0]=0,zt[1]=0,zt[2]=0,zt[3]=0,o?ht.enable(3042):ht.disable(3042),gt.blend_enable=o,ht.blendEquationSeparate(32774,32774),Lt[0]=32774,Lt[1]=32774,ht.blendFuncSeparate(770,771,773,1),Pt[0]=770,Pt[1]=771,Pt[2]=773,Pt[3]=1,s?ht.enable(2929):ht.disable(2929),gt.depth_enable=s,R=0|(D=t.viewport).x,F=0|D.y,B="width"in D?0|D.width:dt.framebufferWidth-R,N="height"in D?0|D.height:dt.framebufferHeight-F,ht.scissor(R,F,B,N),Zt[0]=R,Zt[1]=F,Zt[2]=B,Zt[3]=N,l?ht.enable(3089):ht.disable(3089),gt.scissor_enable=l,(j=gt.profile)&&(V=performance.now(),e.count++),ht.useProgram(c.program),U=Tt.angle_instanced_arrays,wt.setVAO(null),H=f.location,(q=_t[H]).buffer||ht.enableVertexAttribArray(H),5126===q.type&&2===q.size&&q.buffer===u&&!1===q.normalized&&16===q.offset&&24===q.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(H,2,5126,!1,24,16),q.type=5126,q.size=2,q.buffer=u,q.normalized=!1,q.offset=16,q.stride=24),0!==q.divisor&&(U.vertexAttribDivisorANGLE(H,0),q.divisor=0),G=p.call(this,dt,t,0),Qt.offset=G,W=!1,Y=1,Z=0,X=0,J=0,K=0,Q=null,$=0,tt=!1,et=5126,rt=0,nt=0,it=0,Mt(Qt)?(W=!0,et=(Q=bt.createStream(34962,Qt)).dtype):(Q=bt.getBuffer(Qt))?et=Q.dtype:"constant"in Qt?(Y=2,"number"==typeof Qt.constant?(Z=Qt.constant,X=J=K=0):(Z=Qt.constant.length>0?Qt.constant[0]:0,X=Qt.constant.length>1?Qt.constant[1]:0,J=Qt.constant.length>2?Qt.constant[2]:0,K=Qt.constant.length>3?Qt.constant[3]:0)):(Q=Mt(Qt.buffer)?bt.createStream(34962,Qt.buffer):bt.getBuffer(Qt.buffer),et="type"in Qt?Kt[Qt.type]:Q.dtype,tt=!!Qt.normalized,$=0|Qt.size,rt=0|Qt.offset,nt=0|Qt.stride,it=0|Qt.divisor),at=h.location,ot=_t[at],1===Y?(ot.buffer||ht.enableVertexAttribArray(at),st=$||4,ot.type===et&&ot.size===st&&ot.buffer===Q&&ot.normalized===tt&&ot.offset===rt&&ot.stride===nt||(ht.bindBuffer(34962,Q.buffer),ht.vertexAttribPointer(at,st,et,tt,nt,rt),ot.type=et,ot.size=st,ot.buffer=Q,ot.normalized=tt,ot.offset=rt,ot.stride=nt),ot.divisor!==it&&(U.vertexAttribDivisorANGLE(at,it),ot.divisor=it)):(ot.buffer&&(ht.disableVertexAttribArray(at),ot.buffer=null),ot.x===Z&&ot.y===X&&ot.z===J&&ot.w===K||(ht.vertexAttrib4f(at,Z,X,J,K),ot.x=Z,ot.y=X,ot.z=J,ot.w=K)),lt=d.location,(ct=_t[lt]).buffer||ht.enableVertexAttribArray(lt),5126===ct.type&&2===ct.size&&ct.buffer===u&&!1===ct.normalized&&0===ct.offset&&24===ct.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(lt,2,5126,!1,24,0),ct.type=5126,ct.size=2,ct.buffer=u,ct.normalized=!1,ct.offset=0,ct.stride=24),0!==ct.divisor&&(U.vertexAttribDivisorANGLE(lt,0),ct.divisor=0),ut=m.call(this,dt,t,0),ee.offset=ut,ft=!1,pt=1,xt=0,At=0,St=0,Et=0,Ct=null,Yt=0,Xt=!1,re=5126,ne=0,ie=0,ae=0,Mt(ee)?(ft=!0,re=(Ct=bt.createStream(34962,ee)).dtype):(Ct=bt.getBuffer(ee))?re=Ct.dtype:"constant"in ee?(pt=2,"number"==typeof ee.constant?(xt=ee.constant,At=St=Et=0):(xt=ee.constant.length>0?ee.constant[0]:0,At=ee.constant.length>1?ee.constant[1]:0,St=ee.constant.length>2?ee.constant[2]:0,Et=ee.constant.length>3?ee.constant[3]:0)):(Ct=Mt(ee.buffer)?bt.createStream(34962,ee.buffer):bt.getBuffer(ee.buffer),re="type"in ee?Kt[ee.type]:Ct.dtype,Xt=!!ee.normalized,Yt=0|ee.size,ne=0|ee.offset,ie=0|ee.stride,ae=0|ee.divisor),oe=g.location,se=_t[oe],1===pt?(se.buffer||ht.enableVertexAttribArray(oe),le=Yt||4,se.type===re&&se.size===le&&se.buffer===Ct&&se.normalized===Xt&&se.offset===ne&&se.stride===ie||(ht.bindBuffer(34962,Ct.buffer),ht.vertexAttribPointer(oe,le,re,Xt,ie,ne),se.type=re,se.size=le,se.buffer=Ct,se.normalized=Xt,se.offset=ne,se.stride=ie),se.divisor!==ae&&(U.vertexAttribDivisorANGLE(oe,ae),se.divisor=ae)):(se.buffer&&(ht.disableVertexAttribArray(oe),se.buffer=null),se.x===xt&&se.y===At&&se.z===St&&se.w===Et||(ht.vertexAttrib4f(oe,xt,At,St,Et),se.x=xt,se.y=At,se.z=St,se.w=Et)),ce=y.location,(ue=_t[ce]).buffer||ht.enableVertexAttribArray(ce),5126===ue.type&&2===ue.size&&ue.buffer===u&&!1===ue.normalized&&8===ue.offset&&24===ue.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(ce,2,5126,!1,24,8),ue.type=5126,ue.size=2,ue.buffer=u,ue.normalized=!1,ue.offset=8,ue.stride=24),0!==ue.divisor&&(U.vertexAttribDivisorANGLE(ce,0),ue.divisor=0),fe=v.call(this,dt,t,0),$t.offset=fe,pe=!1,he=1,de=0,me=0,ge=0,ye=0,ve=null,be=0,xe=!1,_e=5126,we=0,Ae=0,ke=0,Mt($t)?(pe=!0,_e=(ve=bt.createStream(34962,$t)).dtype):(ve=bt.getBuffer($t))?_e=ve.dtype:"constant"in $t?(he=2,"number"==typeof $t.constant?(de=$t.constant,me=ge=ye=0):(de=$t.constant.length>0?$t.constant[0]:0,me=$t.constant.length>1?$t.constant[1]:0,ge=$t.constant.length>2?$t.constant[2]:0,ye=$t.constant.length>3?$t.constant[3]:0)):(ve=Mt($t.buffer)?bt.createStream(34962,$t.buffer):bt.getBuffer($t.buffer),_e="type"in $t?Kt[$t.type]:ve.dtype,xe=!!$t.normalized,be=0|$t.size,we=0|$t.offset,Ae=0|$t.stride,ke=0|$t.divisor),Te=b.location,Me=_t[Te],1===he?(Me.buffer||ht.enableVertexAttribArray(Te),Se=be||2,Me.type===_e&&Me.size===Se&&Me.buffer===ve&&Me.normalized===xe&&Me.offset===we&&Me.stride===Ae||(ht.bindBuffer(34962,ve.buffer),ht.vertexAttribPointer(Te,Se,_e,xe,Ae,we),Me.type=_e,Me.size=Se,Me.buffer=ve,Me.normalized=xe,Me.offset=we,Me.stride=Ae),Me.divisor!==ke&&(U.vertexAttribDivisorANGLE(Te,ke),Me.divisor=ke)):(Me.buffer&&(ht.disableVertexAttribArray(Te),Me.buffer=null),Me.x===de&&Me.y===me&&Me.z===ge&&Me.w===ye||(ht.vertexAttrib4f(Te,de,me,ge,ye),Me.x=de,Me.y=me,Me.z=ge,Me.w=ye)),ze=x.call(this,dt,t,0),te.offset=ze,Ee=!1,Le=1,Ce=0,Pe=0,Oe=0,Ie=0,De=null,Re=0,Fe=!1,Be=5126,Ne=0,je=0,Ve=0,Mt(te)?(Ee=!0,Be=(De=bt.createStream(34962,te)).dtype):(De=bt.getBuffer(te))?Be=De.dtype:"constant"in te?(Le=2,"number"==typeof te.constant?(Ce=te.constant,Pe=Oe=Ie=0):(Ce=te.constant.length>0?te.constant[0]:0,Pe=te.constant.length>1?te.constant[1]:0,Oe=te.constant.length>2?te.constant[2]:0,Ie=te.constant.length>3?te.constant[3]:0)):(De=Mt(te.buffer)?bt.createStream(34962,te.buffer):bt.getBuffer(te.buffer),Be="type"in te?Kt[te.type]:De.dtype,Fe=!!te.normalized,Re=0|te.size,Ne=0|te.offset,je=0|te.stride,Ve=0|te.divisor),Ue=_.location,He=_t[Ue],1===Le?(He.buffer||ht.enableVertexAttribArray(Ue),qe=Re||2,He.type===Be&&He.size===qe&&He.buffer===De&&He.normalized===Fe&&He.offset===Ne&&He.stride===je||(ht.bindBuffer(34962,De.buffer),ht.vertexAttribPointer(Ue,qe,Be,Fe,je,Ne),He.type=Be,He.size=qe,He.buffer=De,He.normalized=Fe,He.offset=Ne,He.stride=je),He.divisor!==Ve&&(U.vertexAttribDivisorANGLE(Ue,Ve),He.divisor=Ve)):(He.buffer&&(ht.disableVertexAttribArray(Ue),He.buffer=null),He.x===Ce&&He.y===Pe&&He.z===Oe&&He.w===Ie||(ht.vertexAttrib4f(Ue,Ce,Pe,Oe,Ie),He.x=Ce,He.y=Pe,He.z=Oe,He.w=Ie)),Ge=t.capSize,ht.uniform1f(w.location,Ge),We=t.lineWidth,ht.uniform1f(A.location,We),Ye=t.opacity,ht.uniform1f(k.location,Ye),Xe=(Ze=t.scale)[0],Je=Ze[1],ht.uniform2f(T.location,Xe,Je),Qe=(Ke=t.scaleFract)[0],$e=Ke[1],ht.uniform2f(M.location,Qe,$e),er=(tr=t.translate)[0],rr=tr[1],ht.uniform2f(S.location,er,rr),ir=(nr=t.translateFract)[0],ar=nr[1],ht.uniform2f(z.location,ir,ar),sr=(or=L.call(this,dt,t,0))[0],lr=or[1],cr=or[2],ur=or[3],ht.uniform4f(E.location,sr,lr,cr,ur),((fr=yt.elements)||wt.currentVAO&&(fr=vt.getElements(wt.currentVAO.elements)))&&ht.bindBuffer(34963,fr.buffer.buffer),pr=yt.offset,(hr=t.count)>0?fr?U.drawElementsInstancedANGLE(4,36,fr.type,pr<<(fr.type-5121>>1),hr):U.drawArraysInstancedANGLE(4,pr,36,hr):hr<0&&(fr?ht.drawElements(4,36,fr.type,pr<<(fr.type-5121>>1)):ht.drawArrays(4,pr,36)),gt.dirty=!0,wt.setVAO(null),dt.viewportWidth=O,dt.viewportHeight=I,j&&(e.cpuTime+=performance.now()-V),W&&bt.destroyStream(Q),ft&&bt.destroyStream(Ct),pe&&bt.destroyStream(ve),Ee&&bt.destroyStream(De)},scope:function(t,r,n){var i,a,o,s,l,c,f,h,d,g,y,b,_,w,A,k,T,M,S,z,E,ut,ft,pt,ht,vt,_t,wt,kt,Tt,zt,Lt,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Zt,Jt,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn;a=0|(i=t.viewport).x,o=0|i.y,s="width"in i?0|i.width:dt.framebufferWidth-a,l="height"in i?0|i.height:dt.framebufferHeight-o,c=dt.viewportWidth,dt.viewportWidth=s,f=dt.viewportHeight,dt.viewportHeight=l,h=Xt[0],Xt[0]=a,d=Xt[1],Xt[1]=o,g=Xt[2],Xt[2]=s,y=Xt[3],Xt[3]=l,b=St[0],St[0]=C,_=St[1],St[1]=P,w=St[2],St[2]=O,A=St[3],St[3]=I,k=mt.blend_enable,mt.blend_enable=D,T=Et[0],Et[0]=R,M=Et[1],Et[1]=F,S=Ct[0],Ct[0]=B,z=Ct[1],Ct[1]=N,E=Ct[2],Ct[2]=j,ut=Ct[3],Ct[3]=V,ft=mt.depth_enable,mt.depth_enable=U,ht=0|(pt=t.viewport).x,vt=0|pt.y,_t="width"in pt?0|pt.width:dt.framebufferWidth-ht,wt="height"in pt?0|pt.height:dt.framebufferHeight-vt,kt=Yt[0],Yt[0]=ht,Tt=Yt[1],Yt[1]=vt,zt=Yt[2],Yt[2]=_t,Lt=Yt[3],Yt[3]=wt,Pt=mt.scissor_enable,mt.scissor_enable=H,(Ot=gt.profile)&&(It=performance.now(),e.count++),Dt=yt.count,yt.count=q,Rt=t.count,Ft=yt.instances,yt.instances=Rt,Bt=yt.primitive,yt.primitive=G,Nt=t.range,jt=At[W],At[W]=Nt,Vt=t.lineWidth,Ut=At[Y],At[Y]=Vt,Ht=t.capSize,qt=At[Z],At[Z]=Ht,Gt=t.opacity,Wt=At[X],At[X]=Gt,Zt=t.scale,Jt=At[J],At[J]=Zt,re=t.translate,ne=At[K],At[K]=re,ie=t.scaleFract,ae=At[Q],At[Q]=ie,oe=t.translateFract,se=At[$],At[$]=oe,le=L.call(this,dt,t,n),ce=At[tt],At[tt]=le,ue=et.state,et.state=1,fe=et.x,et.x=0,pe=et.y,et.y=0,he=et.z,et.z=0,de=et.w,et.w=0,me=et.buffer,et.buffer=u,ge=et.size,et.size=0,ye=et.normalized,et.normalized=!1,ve=et.type,et.type=5126,be=et.offset,et.offset=0,xe=et.stride,et.stride=24,_e=et.divisor,et.divisor=0,we=rt.state,rt.state=1,Ae=rt.x,rt.x=0,ke=rt.y,rt.y=0,Te=rt.z,rt.z=0,Me=rt.w,rt.w=0,Se=rt.buffer,rt.buffer=u,ze=rt.size,rt.size=0,Ee=rt.normalized,rt.normalized=!1,Le=rt.type,rt.type=5126,Ce=rt.offset,rt.offset=8,Pe=rt.stride,rt.stride=24,Oe=rt.divisor,rt.divisor=0,Ie=nt.state,nt.state=1,De=nt.x,nt.x=0,Re=nt.y,nt.y=0,Fe=nt.z,nt.z=0,Be=nt.w,nt.w=0,Ne=nt.buffer,nt.buffer=u,je=nt.size,nt.size=0,Ve=nt.normalized,nt.normalized=!1,Ue=nt.type,nt.type=5126,He=nt.offset,nt.offset=16,qe=nt.stride,nt.stride=24,Ge=nt.divisor,nt.divisor=0,We=p.call(this,dt,t,n),Qt.offset=We,Ye=!1,Ze=1,Xe=0,Je=0,Ke=0,Qe=0,$e=null,tr=0,er=!1,rr=5126,nr=0,ir=0,ar=0,Mt(Qt)?(Ye=!0,rr=($e=bt.createStream(34962,Qt)).dtype):($e=bt.getBuffer(Qt))?rr=$e.dtype:"constant"in Qt?(Ze=2,"number"==typeof Qt.constant?(Xe=Qt.constant,Je=Ke=Qe=0):(Xe=Qt.constant.length>0?Qt.constant[0]:0,Je=Qt.constant.length>1?Qt.constant[1]:0,Ke=Qt.constant.length>2?Qt.constant[2]:0,Qe=Qt.constant.length>3?Qt.constant[3]:0)):($e=Mt(Qt.buffer)?bt.createStream(34962,Qt.buffer):bt.getBuffer(Qt.buffer),rr="type"in Qt?Kt[Qt.type]:$e.dtype,er=!!Qt.normalized,tr=0|Qt.size,nr=0|Qt.offset,ir=0|Qt.stride,ar=0|Qt.divisor),or=it.state,it.state=Ze,sr=it.x,it.x=Xe,lr=it.y,it.y=Je,cr=it.z,it.z=Ke,ur=it.w,it.w=Qe,fr=it.buffer,it.buffer=$e,pr=it.size,it.size=tr,hr=it.normalized,it.normalized=er,dr=it.type,it.type=rr,mr=it.offset,it.offset=nr,gr=it.stride,it.stride=ir,yr=it.divisor,it.divisor=ar,vr=v.call(this,dt,t,n),$t.offset=vr,br=!1,xr=1,_r=0,wr=0,Ar=0,kr=0,Tr=null,Mr=0,Sr=!1,zr=5126,Er=0,Lr=0,Cr=0,Mt($t)?(br=!0,zr=(Tr=bt.createStream(34962,$t)).dtype):(Tr=bt.getBuffer($t))?zr=Tr.dtype:"constant"in $t?(xr=2,"number"==typeof $t.constant?(_r=$t.constant,wr=Ar=kr=0):(_r=$t.constant.length>0?$t.constant[0]:0,wr=$t.constant.length>1?$t.constant[1]:0,Ar=$t.constant.length>2?$t.constant[2]:0,kr=$t.constant.length>3?$t.constant[3]:0)):(Tr=Mt($t.buffer)?bt.createStream(34962,$t.buffer):bt.getBuffer($t.buffer),zr="type"in $t?Kt[$t.type]:Tr.dtype,Sr=!!$t.normalized,Mr=0|$t.size,Er=0|$t.offset,Lr=0|$t.stride,Cr=0|$t.divisor),Pr=at.state,at.state=xr,Or=at.x,at.x=_r,Ir=at.y,at.y=wr,Dr=at.z,at.z=Ar,Rr=at.w,at.w=kr,Fr=at.buffer,at.buffer=Tr,Br=at.size,at.size=Mr,Nr=at.normalized,at.normalized=Sr,jr=at.type,at.type=zr,Vr=at.offset,at.offset=Er,Ur=at.stride,at.stride=Lr,Hr=at.divisor,at.divisor=Cr,qr=x.call(this,dt,t,n),te.offset=qr,Gr=!1,Wr=1,Yr=0,Zr=0,Xr=0,Jr=0,Kr=null,Qr=0,$r=!1,tn=5126,en=0,rn=0,nn=0,Mt(te)?(Gr=!0,tn=(Kr=bt.createStream(34962,te)).dtype):(Kr=bt.getBuffer(te))?tn=Kr.dtype:"constant"in te?(Wr=2,"number"==typeof te.constant?(Yr=te.constant,Zr=Xr=Jr=0):(Yr=te.constant.length>0?te.constant[0]:0,Zr=te.constant.length>1?te.constant[1]:0,Xr=te.constant.length>2?te.constant[2]:0,Jr=te.constant.length>3?te.constant[3]:0)):(Kr=Mt(te.buffer)?bt.createStream(34962,te.buffer):bt.getBuffer(te.buffer),tn="type"in te?Kt[te.type]:Kr.dtype,$r=!!te.normalized,Qr=0|te.size,en=0|te.offset,rn=0|te.stride,nn=0|te.divisor),an=ot.state,ot.state=Wr,on=ot.x,ot.x=Yr,sn=ot.y,ot.y=Zr,ln=ot.z,ot.z=Xr,cn=ot.w,ot.w=Jr,un=ot.buffer,ot.buffer=Kr,fn=ot.size,ot.size=Qr,pn=ot.normalized,ot.normalized=$r,hn=ot.type,ot.type=tn,dn=ot.offset,ot.offset=en,mn=ot.stride,ot.stride=rn,gn=ot.divisor,ot.divisor=nn,yn=m.call(this,dt,t,n),ee.offset=yn,vn=!1,bn=1,xn=0,_n=0,wn=0,An=0,kn=null,Tn=0,Mn=!1,Sn=5126,zn=0,En=0,Ln=0,Mt(ee)?(vn=!0,Sn=(kn=bt.createStream(34962,ee)).dtype):(kn=bt.getBuffer(ee))?Sn=kn.dtype:"constant"in ee?(bn=2,"number"==typeof ee.constant?(xn=ee.constant,_n=wn=An=0):(xn=ee.constant.length>0?ee.constant[0]:0,_n=ee.constant.length>1?ee.constant[1]:0,wn=ee.constant.length>2?ee.constant[2]:0,An=ee.constant.length>3?ee.constant[3]:0)):(kn=Mt(ee.buffer)?bt.createStream(34962,ee.buffer):bt.getBuffer(ee.buffer),Sn="type"in ee?Kt[ee.type]:kn.dtype,Mn=!!ee.normalized,Tn=0|ee.size,zn=0|ee.offset,En=0|ee.stride,Ln=0|ee.divisor),Cn=st.state,st.state=bn,Pn=st.x,st.x=xn,On=st.y,st.y=_n,In=st.z,st.z=wn,Dn=st.w,st.w=An,Rn=st.buffer,st.buffer=kn,Fn=st.size,st.size=Tn,Bn=st.normalized,st.normalized=Mn,Nn=st.type,st.type=Sn,jn=st.offset,st.offset=zn,Vn=st.stride,st.stride=En,Un=st.divisor,st.divisor=Ln,Hn=xt.vert,xt.vert=lt,qn=xt.frag,xt.frag=ct,gt.dirty=!0,r(dt,t,n),dt.viewportWidth=c,dt.viewportHeight=f,Xt[0]=h,Xt[1]=d,Xt[2]=g,Xt[3]=y,St[0]=b,St[1]=_,St[2]=w,St[3]=A,mt.blend_enable=k,Et[0]=T,Et[1]=M,Ct[0]=S,Ct[1]=z,Ct[2]=E,Ct[3]=ut,mt.depth_enable=ft,Yt[0]=kt,Yt[1]=Tt,Yt[2]=zt,Yt[3]=Lt,mt.scissor_enable=Pt,Ot&&(e.cpuTime+=performance.now()-It),yt.count=Dt,yt.instances=Ft,yt.primitive=Bt,At[W]=jt,At[Y]=Ut,At[Z]=qt,At[X]=Wt,At[J]=Jt,At[K]=ne,At[Q]=ae,At[$]=se,At[tt]=ce,et.state=ue,et.x=fe,et.y=pe,et.z=he,et.w=de,et.buffer=me,et.size=ge,et.normalized=ye,et.type=ve,et.offset=be,et.stride=xe,et.divisor=_e,rt.state=we,rt.x=Ae,rt.y=ke,rt.z=Te,rt.w=Me,rt.buffer=Se,rt.size=ze,rt.normalized=Ee,rt.type=Le,rt.offset=Ce,rt.stride=Pe,rt.divisor=Oe,nt.state=Ie,nt.x=De,nt.y=Re,nt.z=Fe,nt.w=Be,nt.buffer=Ne,nt.size=je,nt.normalized=Ve,nt.type=Ue,nt.offset=He,nt.stride=qe,nt.divisor=Ge,Ye&&bt.destroyStream($e),it.state=or,it.x=sr,it.y=lr,it.z=cr,it.w=ur,it.buffer=fr,it.size=pr,it.normalized=hr,it.type=dr,it.offset=mr,it.stride=gr,it.divisor=yr,br&&bt.destroyStream(Tr),at.state=Pr,at.x=Or,at.y=Ir,at.z=Dr,at.w=Rr,at.buffer=Fr,at.size=Br,at.normalized=Nr,at.type=jr,at.offset=Vr,at.stride=Ur,at.divisor=Hr,Gr&&bt.destroyStream(Kr),ot.state=an,ot.x=on,ot.y=sn,ot.z=ln,ot.w=cn,ot.buffer=un,ot.size=fn,ot.normalized=pn,ot.type=hn,ot.offset=dn,ot.stride=mn,ot.divisor=gn,vn&&bt.destroyStream(kn),st.state=Cn,st.x=Pn,st.y=On,st.z=In,st.w=Dn,st.buffer=Rn,st.size=Fn,st.normalized=Bn,st.type=Nn,st.offset=jn,st.stride=Vn,st.divisor=Un,xt.vert=Hn,xt.frag=qn,gt.dirty=!0},batch:function(t,r){var n,i,a,o,s,l,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,xt,At,St,Et,Ct,Yt,Xt,re;(Tt.angle_instanced_arrays,(n=kt.next)!==kt.cur&&(n?ht.bindFramebuffer(36160,n.framebuffer):ht.bindFramebuffer(36160,null),kt.cur=n),gt.dirty)&&((C=mt.dither)!==gt.dither&&(C?ht.enable(3024):ht.disable(3024),gt.dither=C),(P=mt.depth_func)!==gt.depth_func&&(ht.depthFunc(P),gt.depth_func=P),O=Ot[0],I=Ot[1],O===It[0]&&I===It[1]||(ht.depthRange(O,I),It[0]=O,It[1]=I),(D=mt.depth_mask)!==gt.depth_mask&&(ht.depthMask(D),gt.depth_mask=D),R=Dt[0],F=Dt[1],B=Dt[2],N=Dt[3],R===Rt[0]&&F===Rt[1]&&B===Rt[2]&&N===Rt[3]||(ht.colorMask(R,F,B,N),Rt[0]=R,Rt[1]=F,Rt[2]=B,Rt[3]=N),(j=mt.cull_enable)!==gt.cull_enable&&(j?ht.enable(2884):ht.disable(2884),gt.cull_enable=j),(V=mt.cull_face)!==gt.cull_face&&(ht.cullFace(V),gt.cull_face=V),(U=mt.frontFace)!==gt.frontFace&&(ht.frontFace(U),gt.frontFace=U),(H=mt.lineWidth)!==gt.lineWidth&&(ht.lineWidth(H),gt.lineWidth=H),(q=mt.polygonOffset_enable)!==gt.polygonOffset_enable&&(q?ht.enable(32823):ht.disable(32823),gt.polygonOffset_enable=q),G=Ft[0],W=Ft[1],G===Bt[0]&&W===Bt[1]||(ht.polygonOffset(G,W),Bt[0]=G,Bt[1]=W),(Y=mt.sample_alpha)!==gt.sample_alpha&&(Y?ht.enable(32926):ht.disable(32926),gt.sample_alpha=Y),(Z=mt.sample_enable)!==gt.sample_enable&&(Z?ht.enable(32928):ht.disable(32928),gt.sample_enable=Z),X=Nt[0],J=Nt[1],X===jt[0]&&J===jt[1]||(ht.sampleCoverage(X,J),jt[0]=X,jt[1]=J),(K=mt.stencil_enable)!==gt.stencil_enable&&(K?ht.enable(2960):ht.disable(2960),gt.stencil_enable=K),(Q=mt.stencil_mask)!==gt.stencil_mask&&(ht.stencilMask(Q),gt.stencil_mask=Q),$=Vt[0],tt=Vt[1],et=Vt[2],$===Ut[0]&&tt===Ut[1]&&et===Ut[2]||(ht.stencilFunc($,tt,et),Ut[0]=$,Ut[1]=tt,Ut[2]=et),rt=Ht[0],nt=Ht[1],it=Ht[2],at=Ht[3],rt===qt[0]&&nt===qt[1]&&it===qt[2]&&at===qt[3]||(ht.stencilOpSeparate(rt,nt,it,at),qt[0]=rt,qt[1]=nt,qt[2]=it,qt[3]=at),ot=Gt[0],st=Gt[1],lt=Gt[2],ct=Gt[3],ot===Wt[0]&&st===Wt[1]&<===Wt[2]&&ct===Wt[3]||(ht.stencilOpSeparate(ot,st,lt,ct),Wt[0]=ot,Wt[1]=st,Wt[2]=lt,Wt[3]=ct));for(ht.blendColor(0,0,0,0),zt[0]=0,zt[1]=0,zt[2]=0,zt[3]=0,ut?ht.enable(3042):ht.disable(3042),gt.blend_enable=ut,ht.blendEquationSeparate(32774,32774),Lt[0]=32774,Lt[1]=32774,ht.blendFuncSeparate(770,771,773,1),Pt[0]=770,Pt[1]=771,Pt[2]=773,Pt[3]=1,ft?ht.enable(2929):ht.disable(2929),gt.depth_enable=ft,pt?ht.enable(3089):ht.disable(3089),gt.scissor_enable=pt,(i=gt.profile)&&(a=performance.now(),e.count+=r),ht.useProgram(c.program),o=Tt.angle_instanced_arrays,wt.setVAO(null),xt=f.location,(At=_t[xt]).buffer||ht.enableVertexAttribArray(xt),5126===At.type&&2===At.size&&At.buffer===u&&!1===At.normalized&&16===At.offset&&24===At.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(xt,2,5126,!1,24,16),At.type=5126,At.size=2,At.buffer=u,At.normalized=!1,At.offset=16,At.stride=24),0!==At.divisor&&(o.vertexAttribDivisorANGLE(xt,0),At.divisor=0),St=d.location,(Et=_t[St]).buffer||ht.enableVertexAttribArray(St),5126===Et.type&&2===Et.size&&Et.buffer===u&&!1===Et.normalized&&0===Et.offset&&24===Et.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(St,2,5126,!1,24,0),Et.type=5126,Et.size=2,Et.buffer=u,Et.normalized=!1,Et.offset=0,Et.stride=24),0!==Et.divisor&&(o.vertexAttribDivisorANGLE(St,0),Et.divisor=0),Ct=y.location,(Yt=_t[Ct]).buffer||ht.enableVertexAttribArray(Ct),5126===Yt.type&&2===Yt.size&&Yt.buffer===u&&!1===Yt.normalized&&8===Yt.offset&&24===Yt.stride||(ht.bindBuffer(34962,u.buffer),ht.vertexAttribPointer(Ct,2,5126,!1,24,8),Yt.type=5126,Yt.size=2,Yt.buffer=u,Yt.normalized=!1,Yt.offset=8,Yt.stride=24),0!==Yt.divisor&&(o.vertexAttribDivisorANGLE(Ct,0),Yt.divisor=0),((Xt=yt.elements)||wt.currentVAO&&(Xt=vt.getElements(wt.currentVAO.elements)))&&ht.bindBuffer(34963,Xt.buffer.buffer),re=yt.offset,s=0;s0?Qt.constant[0]:0,be=Qt.constant.length>1?Qt.constant[1]:0,xe=Qt.constant.length>2?Qt.constant[2]:0,_e=Qt.constant.length>3?Qt.constant[3]:0)):(we=Mt(Qt.buffer)?bt.createStream(34962,Qt.buffer):bt.getBuffer(Qt.buffer),Te="type"in Qt?Kt[Qt.type]:we.dtype,ke=!!Qt.normalized,Ae=0|Qt.size,Me=0|Qt.offset,Se=0|Qt.stride,ze=0|Qt.divisor),Ee=h.location,Le=_t[Ee],1===ye?(Le.buffer||ht.enableVertexAttribArray(Ee),Ce=Ae||4,Le.type===Te&&Le.size===Ce&&Le.buffer===we&&Le.normalized===ke&&Le.offset===Me&&Le.stride===Se||(ht.bindBuffer(34962,we.buffer),ht.vertexAttribPointer(Ee,Ce,Te,ke,Se,Me),Le.type=Te,Le.size=Ce,Le.buffer=we,Le.normalized=ke,Le.offset=Me,Le.stride=Se),Le.divisor!==ze&&(o.vertexAttribDivisorANGLE(Ee,ze),Le.divisor=ze)):(Le.buffer&&(ht.disableVertexAttribArray(Ee),Le.buffer=null),Le.x===ve&&Le.y===be&&Le.z===xe&&Le.w===_e||(ht.vertexAttrib4f(Ee,ve,be,xe,_e),Le.x=ve,Le.y=be,Le.z=xe,Le.w=_e)),Pe=m.call(this,dt,l,s),ee.offset=Pe,Oe=!1,Ie=1,De=0,Re=0,Fe=0,Be=0,Ne=null,je=0,Ve=!1,Ue=5126,He=0,qe=0,Ge=0,Mt(ee)?(Oe=!0,Ue=(Ne=bt.createStream(34962,ee)).dtype):(Ne=bt.getBuffer(ee))?Ue=Ne.dtype:"constant"in ee?(Ie=2,"number"==typeof ee.constant?(De=ee.constant,Re=Fe=Be=0):(De=ee.constant.length>0?ee.constant[0]:0,Re=ee.constant.length>1?ee.constant[1]:0,Fe=ee.constant.length>2?ee.constant[2]:0,Be=ee.constant.length>3?ee.constant[3]:0)):(Ne=Mt(ee.buffer)?bt.createStream(34962,ee.buffer):bt.getBuffer(ee.buffer),Ue="type"in ee?Kt[ee.type]:Ne.dtype,Ve=!!ee.normalized,je=0|ee.size,He=0|ee.offset,qe=0|ee.stride,Ge=0|ee.divisor),We=g.location,Ye=_t[We],1===Ie?(Ye.buffer||ht.enableVertexAttribArray(We),Ze=je||4,Ye.type===Ue&&Ye.size===Ze&&Ye.buffer===Ne&&Ye.normalized===Ve&&Ye.offset===He&&Ye.stride===qe||(ht.bindBuffer(34962,Ne.buffer),ht.vertexAttribPointer(We,Ze,Ue,Ve,qe,He),Ye.type=Ue,Ye.size=Ze,Ye.buffer=Ne,Ye.normalized=Ve,Ye.offset=He,Ye.stride=qe),Ye.divisor!==Ge&&(o.vertexAttribDivisorANGLE(We,Ge),Ye.divisor=Ge)):(Ye.buffer&&(ht.disableVertexAttribArray(We),Ye.buffer=null),Ye.x===De&&Ye.y===Re&&Ye.z===Fe&&Ye.w===Be||(ht.vertexAttrib4f(We,De,Re,Fe,Be),Ye.x=De,Ye.y=Re,Ye.z=Fe,Ye.w=Be)),Xe=v.call(this,dt,l,s),$t.offset=Xe,Je=!1,Ke=1,Qe=0,$e=0,tr=0,er=0,rr=null,nr=0,ir=!1,ar=5126,or=0,sr=0,lr=0,Mt($t)?(Je=!0,ar=(rr=bt.createStream(34962,$t)).dtype):(rr=bt.getBuffer($t))?ar=rr.dtype:"constant"in $t?(Ke=2,"number"==typeof $t.constant?(Qe=$t.constant,$e=tr=er=0):(Qe=$t.constant.length>0?$t.constant[0]:0,$e=$t.constant.length>1?$t.constant[1]:0,tr=$t.constant.length>2?$t.constant[2]:0,er=$t.constant.length>3?$t.constant[3]:0)):(rr=Mt($t.buffer)?bt.createStream(34962,$t.buffer):bt.getBuffer($t.buffer),ar="type"in $t?Kt[$t.type]:rr.dtype,ir=!!$t.normalized,nr=0|$t.size,or=0|$t.offset,sr=0|$t.stride,lr=0|$t.divisor),cr=b.location,ur=_t[cr],1===Ke?(ur.buffer||ht.enableVertexAttribArray(cr),fr=nr||2,ur.type===ar&&ur.size===fr&&ur.buffer===rr&&ur.normalized===ir&&ur.offset===or&&ur.stride===sr||(ht.bindBuffer(34962,rr.buffer),ht.vertexAttribPointer(cr,fr,ar,ir,sr,or),ur.type=ar,ur.size=fr,ur.buffer=rr,ur.normalized=ir,ur.offset=or,ur.stride=sr),ur.divisor!==lr&&(o.vertexAttribDivisorANGLE(cr,lr),ur.divisor=lr)):(ur.buffer&&(ht.disableVertexAttribArray(cr),ur.buffer=null),ur.x===Qe&&ur.y===$e&&ur.z===tr&&ur.w===er||(ht.vertexAttrib4f(cr,Qe,$e,tr,er),ur.x=Qe,ur.y=$e,ur.z=tr,ur.w=er)),pr=x.call(this,dt,l,s),te.offset=pr,hr=!1,dr=1,mr=0,gr=0,yr=0,vr=0,br=null,xr=0,_r=!1,wr=5126,Ar=0,kr=0,Tr=0,Mt(te)?(hr=!0,wr=(br=bt.createStream(34962,te)).dtype):(br=bt.getBuffer(te))?wr=br.dtype:"constant"in te?(dr=2,"number"==typeof te.constant?(mr=te.constant,gr=yr=vr=0):(mr=te.constant.length>0?te.constant[0]:0,gr=te.constant.length>1?te.constant[1]:0,yr=te.constant.length>2?te.constant[2]:0,vr=te.constant.length>3?te.constant[3]:0)):(br=Mt(te.buffer)?bt.createStream(34962,te.buffer):bt.getBuffer(te.buffer),wr="type"in te?Kt[te.type]:br.dtype,_r=!!te.normalized,xr=0|te.size,Ar=0|te.offset,kr=0|te.stride,Tr=0|te.divisor),Mr=_.location,Sr=_t[Mr],1===dr?(Sr.buffer||ht.enableVertexAttribArray(Mr),zr=xr||2,Sr.type===wr&&Sr.size===zr&&Sr.buffer===br&&Sr.normalized===_r&&Sr.offset===Ar&&Sr.stride===kr||(ht.bindBuffer(34962,br.buffer),ht.vertexAttribPointer(Mr,zr,wr,_r,kr,Ar),Sr.type=wr,Sr.size=zr,Sr.buffer=br,Sr.normalized=_r,Sr.offset=Ar,Sr.stride=kr),Sr.divisor!==Tr&&(o.vertexAttribDivisorANGLE(Mr,Tr),Sr.divisor=Tr)):(Sr.buffer&&(ht.disableVertexAttribArray(Mr),Sr.buffer=null),Sr.x===mr&&Sr.y===gr&&Sr.z===yr&&Sr.w===vr||(ht.vertexAttrib4f(Mr,mr,gr,yr,vr),Sr.x=mr,Sr.y=gr,Sr.z=yr,Sr.w=vr)),Er=l.capSize,s&&Lr===Er||(Lr=Er,ht.uniform1f(w.location,Er)),Cr=l.lineWidth,s&&Pr===Cr||(Pr=Cr,ht.uniform1f(A.location,Cr)),Or=l.opacity,s&&Ir===Or||(Ir=Or,ht.uniform1f(k.location,Or)),Rr=(Dr=l.scale)[0],Br=Dr[1],s&&Fr===Rr&&Nr===Br||(Fr=Rr,Nr=Br,ht.uniform2f(T.location,Rr,Br)),Vr=(jr=l.scaleFract)[0],Hr=jr[1],s&&Ur===Vr&&qr===Hr||(Ur=Vr,qr=Hr,ht.uniform2f(M.location,Vr,Hr)),Wr=(Gr=l.translate)[0],Zr=Gr[1],s&&Yr===Wr&&Xr===Zr||(Yr=Wr,Xr=Zr,ht.uniform2f(S.location,Wr,Zr)),Kr=(Jr=l.translateFract)[0],$r=Jr[1],s&&Qr===Kr&&tn===$r||(Qr=Kr,tn=$r,ht.uniform2f(z.location,Kr,$r)),rn=(en=L.call(this,dt,l,s))[0],an=en[1],sn=en[2],cn=en[3],s&&nn===rn&&on===an&&ln===sn&&un===cn||(nn=rn,on=an,ln=sn,un=cn,ht.uniform4f(E.location,rn,an,sn,cn)),(fn=l.count)>0?Xt?o.drawElementsInstancedANGLE(4,36,Xt.type,re<<(Xt.type-5121>>1),fn):o.drawArraysInstancedANGLE(4,re,36,fn):fn<0&&(Xt?ht.drawElements(4,36,Xt.type,re<<(Xt.type-5121>>1)):ht.drawArrays(4,re,36)),dt.viewportWidth=le,dt.viewportHeight=ce,ge&&bt.destroyStream(we),Oe&&bt.destroyStream(Ne),Je&&bt.destroyStream(rr),hr&&bt.destroyStream(br)}gt.dirty=!0,wt.setVAO(null),i&&(e.cpuTime+=performance.now()-a)}}}},{}],497:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st){"use strict";var lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt;return lt=t.gl,ct=t.context,t.strings,ut=t.next,ft=t.current,pt=t.draw,ht=t.elements,dt=t.buffer,mt=t.shader,gt=t.attributes,yt=t.vao,vt=t.uniforms,bt=t.framebuffer,xt=t.extensions,t.timer,_t=t.isBufferArgs,wt=ut.blend_color,At=ft.blend_color,kt=ut.blend_equation,Tt=ft.blend_equation,Mt=ut.blend_func,St=ft.blend_func,zt=ut.depth_range,Et=ft.depth_range,Lt=ut.colorMask,Ct=ft.colorMask,Pt=ut.polygonOffset_offset,Ot=ft.polygonOffset_offset,It=ut.sample_coverage,Dt=ft.sample_coverage,Rt=ut.stencil_func,Ft=ft.stencil_func,Bt=ut.stencil_opFront,Nt=ft.stencil_opFront,jt=ut.stencil_opBack,Vt=ft.stencil_opBack,Ut=ut.scissor_box,Ht=ft.scissor_box,qt=ut.viewport,Gt=ft.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Wt={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(Yt={}).offset=4,Yt.stride=8,(Zt={}).offset=0,Zt.stride=8,{draw:function(t){var z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,mt,vt,wt,Mt,qt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en;(xt.angle_instanced_arrays,(z=bt.next)!==bt.cur&&(z?lt.bindFramebuffer(36160,z.framebuffer):lt.bindFramebuffer(36160,null),bt.cur=z),ft.dirty)&&((yr=ut.dither)!==ft.dither&&(yr?lt.enable(3024):lt.disable(3024),ft.dither=yr),vr=kt[0],br=kt[1],vr===Tt[0]&&br===Tt[1]||(lt.blendEquationSeparate(vr,br),Tt[0]=vr,Tt[1]=br),(xr=ut.depth_func)!==ft.depth_func&&(lt.depthFunc(xr),ft.depth_func=xr),_r=zt[0],wr=zt[1],_r===Et[0]&&wr===Et[1]||(lt.depthRange(_r,wr),Et[0]=_r,Et[1]=wr),(Ar=ut.depth_mask)!==ft.depth_mask&&(lt.depthMask(Ar),ft.depth_mask=Ar),kr=Lt[0],Tr=Lt[1],Mr=Lt[2],Sr=Lt[3],kr===Ct[0]&&Tr===Ct[1]&&Mr===Ct[2]&&Sr===Ct[3]||(lt.colorMask(kr,Tr,Mr,Sr),Ct[0]=kr,Ct[1]=Tr,Ct[2]=Mr,Ct[3]=Sr),(zr=ut.cull_enable)!==ft.cull_enable&&(zr?lt.enable(2884):lt.disable(2884),ft.cull_enable=zr),(Er=ut.cull_face)!==ft.cull_face&&(lt.cullFace(Er),ft.cull_face=Er),(Lr=ut.frontFace)!==ft.frontFace&&(lt.frontFace(Lr),ft.frontFace=Lr),(Cr=ut.lineWidth)!==ft.lineWidth&&(lt.lineWidth(Cr),ft.lineWidth=Cr),(Pr=ut.polygonOffset_enable)!==ft.polygonOffset_enable&&(Pr?lt.enable(32823):lt.disable(32823),ft.polygonOffset_enable=Pr),Or=Pt[0],Ir=Pt[1],Or===Ot[0]&&Ir===Ot[1]||(lt.polygonOffset(Or,Ir),Ot[0]=Or,Ot[1]=Ir),(Dr=ut.sample_alpha)!==ft.sample_alpha&&(Dr?lt.enable(32926):lt.disable(32926),ft.sample_alpha=Dr),(Rr=ut.sample_enable)!==ft.sample_enable&&(Rr?lt.enable(32928):lt.disable(32928),ft.sample_enable=Rr),Fr=It[0],Br=It[1],Fr===Dt[0]&&Br===Dt[1]||(lt.sampleCoverage(Fr,Br),Dt[0]=Fr,Dt[1]=Br),(Nr=ut.stencil_mask)!==ft.stencil_mask&&(lt.stencilMask(Nr),ft.stencil_mask=Nr),jr=Rt[0],Vr=Rt[1],Ur=Rt[2],jr===Ft[0]&&Vr===Ft[1]&&Ur===Ft[2]||(lt.stencilFunc(jr,Vr,Ur),Ft[0]=jr,Ft[1]=Vr,Ft[2]=Ur),Hr=Bt[0],qr=Bt[1],Gr=Bt[2],Wr=Bt[3],Hr===Nt[0]&&qr===Nt[1]&&Gr===Nt[2]&&Wr===Nt[3]||(lt.stencilOpSeparate(Hr,qr,Gr,Wr),Nt[0]=Hr,Nt[1]=qr,Nt[2]=Gr,Nt[3]=Wr),Yr=jt[0],Zr=jt[1],Xr=jt[2],Jr=jt[3],Yr===Vt[0]&&Zr===Vt[1]&&Xr===Vt[2]&&Jr===Vt[3]||(lt.stencilOpSeparate(Yr,Zr,Xr,Jr),Vt[0]=Yr,Vt[1]=Zr,Vt[2]=Xr,Vt[3]=Jr),(Kr=ut.scissor_enable)!==ft.scissor_enable&&(Kr?lt.enable(3089):lt.disable(3089),ft.scissor_enable=Kr),Qr=Ut[0],$r=Ut[1],tn=Ut[2],en=Ut[3],Qr===Ht[0]&&$r===Ht[1]&&tn===Ht[2]&&en===Ht[3]||(lt.scissor(Qr,$r,tn,en),Ht[0]=Qr,Ht[1]=$r,Ht[2]=tn,Ht[3]=en));L=0|(E=this.viewport).x,C=0|E.y,P="width"in E?0|E.width:ct.framebufferWidth-L,O="height"in E?0|E.height:ct.framebufferHeight-C,I=ct.viewportWidth,ct.viewportWidth=P,D=ct.viewportHeight,ct.viewportHeight=O,lt.viewport(L,C,P,O),Gt[0]=L,Gt[1]=C,Gt[2]=P,Gt[3]=O,lt.blendColor(0,0,0,1),At[0]=0,At[1]=0,At[2]=0,At[3]=1,r?lt.enable(3042):lt.disable(3042),ft.blend_enable=r,lt.blendFuncSeparate(770,771,773,1),St[0]=770,St[1]=771,St[2]=773,St[3]=1,n?lt.enable(2929):lt.disable(2929),ft.depth_enable=n,i?lt.enable(2960):lt.disable(2960),ft.stencil_enable=i,(R=ft.profile)&&(F=performance.now(),e.count++),lt.useProgram(a.program),B=xt.angle_instanced_arrays,yt.setVAO(null),N=this.charBuffer,j=!1,V=1,U=0,H=0,q=0,G=0,W=null,Y=0,Z=!1,X=5126,J=0,K=0,Q=0,_t(N)?(j=!0,X=(W=dt.createStream(34962,N)).dtype):(W=dt.getBuffer(N))?X=W.dtype:"constant"in N?(V=2,"number"==typeof N.constant?(U=N.constant,H=q=G=0):(U=N.constant.length>0?N.constant[0]:0,H=N.constant.length>1?N.constant[1]:0,q=N.constant.length>2?N.constant[2]:0,G=N.constant.length>3?N.constant[3]:0)):(W=_t(N.buffer)?dt.createStream(34962,N.buffer):dt.getBuffer(N.buffer),X="type"in N?Wt[N.type]:W.dtype,Z=!!N.normalized,Y=0|N.size,J=0|N.offset,K=0|N.stride,Q=0|N.divisor),$=o.location,tt=gt[$],1===V?(tt.buffer||lt.enableVertexAttribArray($),et=Y||1,tt.type===X&&tt.size===et&&tt.buffer===W&&tt.normalized===Z&&tt.offset===J&&tt.stride===K||(lt.bindBuffer(34962,W.buffer),lt.vertexAttribPointer($,et,X,Z,K,J),tt.type=X,tt.size=et,tt.buffer=W,tt.normalized=Z,tt.offset=J,tt.stride=K),tt.divisor!==Q&&(B.vertexAttribDivisorANGLE($,Q),tt.divisor=Q)):(tt.buffer&&(lt.disableVertexAttribArray($),tt.buffer=null),tt.x===U&&tt.y===H&&tt.z===q&&tt.w===G||(lt.vertexAttrib4f($,U,H,q,G),tt.x=U,tt.y=H,tt.z=q,tt.w=G)),rt=this.sizeBuffer,Yt.buffer=rt,nt=!1,it=1,at=0,ot=0,st=0,mt=0,vt=null,wt=0,Mt=!1,qt=5126,Xt=0,Jt=0,Kt=0,_t(Yt)?(nt=!0,qt=(vt=dt.createStream(34962,Yt)).dtype):(vt=dt.getBuffer(Yt))?qt=vt.dtype:"constant"in Yt?(it=2,"number"==typeof Yt.constant?(at=Yt.constant,ot=st=mt=0):(at=Yt.constant.length>0?Yt.constant[0]:0,ot=Yt.constant.length>1?Yt.constant[1]:0,st=Yt.constant.length>2?Yt.constant[2]:0,mt=Yt.constant.length>3?Yt.constant[3]:0)):(vt=_t(Yt.buffer)?dt.createStream(34962,Yt.buffer):dt.getBuffer(Yt.buffer),qt="type"in Yt?Wt[Yt.type]:vt.dtype,Mt=!!Yt.normalized,wt=0|Yt.size,Xt=0|Yt.offset,Jt=0|Yt.stride,Kt=0|Yt.divisor),Qt=s.location,$t=gt[Qt],1===it?($t.buffer||lt.enableVertexAttribArray(Qt),te=wt||1,$t.type===qt&&$t.size===te&&$t.buffer===vt&&$t.normalized===Mt&&$t.offset===Xt&&$t.stride===Jt||(lt.bindBuffer(34962,vt.buffer),lt.vertexAttribPointer(Qt,te,qt,Mt,Jt,Xt),$t.type=qt,$t.size=te,$t.buffer=vt,$t.normalized=Mt,$t.offset=Xt,$t.stride=Jt),$t.divisor!==Kt&&(B.vertexAttribDivisorANGLE(Qt,Kt),$t.divisor=Kt)):($t.buffer&&(lt.disableVertexAttribArray(Qt),$t.buffer=null),$t.x===at&&$t.y===ot&&$t.z===st&&$t.w===mt||(lt.vertexAttrib4f(Qt,at,ot,st,mt),$t.x=at,$t.y=ot,$t.z=st,$t.w=mt)),ee=this.position,re=!1,ne=1,ie=0,ae=0,oe=0,se=0,le=null,ce=0,ue=!1,fe=5126,pe=0,he=0,de=0,_t(ee)?(re=!0,fe=(le=dt.createStream(34962,ee)).dtype):(le=dt.getBuffer(ee))?fe=le.dtype:"constant"in ee?(ne=2,"number"==typeof ee.constant?(ie=ee.constant,ae=oe=se=0):(ie=ee.constant.length>0?ee.constant[0]:0,ae=ee.constant.length>1?ee.constant[1]:0,oe=ee.constant.length>2?ee.constant[2]:0,se=ee.constant.length>3?ee.constant[3]:0)):(le=_t(ee.buffer)?dt.createStream(34962,ee.buffer):dt.getBuffer(ee.buffer),fe="type"in ee?Wt[ee.type]:le.dtype,ue=!!ee.normalized,ce=0|ee.size,pe=0|ee.offset,he=0|ee.stride,de=0|ee.divisor),me=l.location,ge=gt[me],1===ne?(ge.buffer||lt.enableVertexAttribArray(me),ye=ce||2,ge.type===fe&&ge.size===ye&&ge.buffer===le&&ge.normalized===ue&&ge.offset===pe&&ge.stride===he||(lt.bindBuffer(34962,le.buffer),lt.vertexAttribPointer(me,ye,fe,ue,he,pe),ge.type=fe,ge.size=ye,ge.buffer=le,ge.normalized=ue,ge.offset=pe,ge.stride=he),ge.divisor!==de&&(B.vertexAttribDivisorANGLE(me,de),ge.divisor=de)):(ge.buffer&&(lt.disableVertexAttribArray(me),ge.buffer=null),ge.x===ie&&ge.y===ae&&ge.z===oe&&ge.w===se||(lt.vertexAttrib4f(me,ie,ae,oe,se),ge.x=ie,ge.y=ae,ge.z=oe,ge.w=se)),ve=this.sizeBuffer,Zt.buffer=ve,be=!1,xe=1,_e=0,we=0,Ae=0,ke=0,Te=null,Me=0,Se=!1,ze=5126,Ee=0,Le=0,Ce=0,_t(Zt)?(be=!0,ze=(Te=dt.createStream(34962,Zt)).dtype):(Te=dt.getBuffer(Zt))?ze=Te.dtype:"constant"in Zt?(xe=2,"number"==typeof Zt.constant?(_e=Zt.constant,we=Ae=ke=0):(_e=Zt.constant.length>0?Zt.constant[0]:0,we=Zt.constant.length>1?Zt.constant[1]:0,Ae=Zt.constant.length>2?Zt.constant[2]:0,ke=Zt.constant.length>3?Zt.constant[3]:0)):(Te=_t(Zt.buffer)?dt.createStream(34962,Zt.buffer):dt.getBuffer(Zt.buffer),ze="type"in Zt?Wt[Zt.type]:Te.dtype,Se=!!Zt.normalized,Me=0|Zt.size,Ee=0|Zt.offset,Le=0|Zt.stride,Ce=0|Zt.divisor),Pe=c.location,Oe=gt[Pe],1===xe?(Oe.buffer||lt.enableVertexAttribArray(Pe),Ie=Me||1,Oe.type===ze&&Oe.size===Ie&&Oe.buffer===Te&&Oe.normalized===Se&&Oe.offset===Ee&&Oe.stride===Le||(lt.bindBuffer(34962,Te.buffer),lt.vertexAttribPointer(Pe,Ie,ze,Se,Le,Ee),Oe.type=ze,Oe.size=Ie,Oe.buffer=Te,Oe.normalized=Se,Oe.offset=Ee,Oe.stride=Le),Oe.divisor!==Ce&&(B.vertexAttribDivisorANGLE(Pe,Ce),Oe.divisor=Ce)):(Oe.buffer&&(lt.disableVertexAttribArray(Pe),Oe.buffer=null),Oe.x===_e&&Oe.y===we&&Oe.z===Ae&&Oe.w===ke||(lt.vertexAttrib4f(Pe,_e,we,Ae,ke),Oe.x=_e,Oe.y=we,Oe.z=Ae,Oe.w=ke)),De=t.align,lt.uniform1f(u.location,De),(Re=p.call(this,ct,t,0))&&"framebuffer"===Re._reglType&&(Re=Re.color[0]),Fe=Re._texture,lt.uniform1i(f.location,Fe.bind()),Ne=(Be=d.call(this,ct,t,0))[0],je=Be[1],lt.uniform2f(h.location,Ne,je),Ue=(Ve=g.call(this,ct,t,0))[0],He=Ve[1],lt.uniform2f(m.location,Ue,He),qe=t.baseline,lt.uniform1f(y.location,qe),Ge=b.call(this,ct,t,0),lt.uniform1f(v.location,Ge),Ye=(We=t.color)[0],Ze=We[1],Xe=We[2],Je=We[3],lt.uniform4f(x.location,Ye,Ze,Xe,Je),Ke=w.call(this,ct,t,0),lt.uniform1f(_.location,Ke),Qe=t.opacity,lt.uniform1f(A.location,Qe),tr=($e=t.positionOffset)[0],er=$e[1],lt.uniform2f(k.location,tr,er),nr=(rr=this.scale)[0],ir=rr[1],lt.uniform2f(T.location,nr,ir),or=(ar=this.translate)[0],sr=ar[1],lt.uniform2f(M.location,or,sr),cr=(lr=this.viewportArray)[0],ur=lr[1],fr=lr[2],pr=lr[3],lt.uniform4f(S.location,cr,ur,fr,pr),((hr=pt.elements)||yt.currentVAO&&(hr=ht.getElements(yt.currentVAO.elements)))&<.bindBuffer(34963,hr.buffer.buffer),dr=t.offset,(mr=t.count)&&((gr=pt.instances)>0?hr?B.drawElementsInstancedANGLE(0,mr,hr.type,dr<<(hr.type-5121>>1),gr):B.drawArraysInstancedANGLE(0,dr,mr,gr):gr<0&&(hr?lt.drawElements(0,mr,hr.type,dr<<(hr.type-5121>>1)):lt.drawArrays(0,dr,mr)),ft.dirty=!0,yt.setVAO(null),ct.viewportWidth=I,ct.viewportHeight=D,R&&(e.cpuTime+=performance.now()-F),j&&dt.destroyStream(W),nt&&dt.destroyStream(vt),re&&dt.destroyStream(le),be&&dt.destroyStream(Te),Fe.unbind())},scope:function(t,r,n){var i,a,o,s,l,c,u,f,h,m,y,v,x,_,A,k,T,M,S,at,ot,st,lt,ht,gt,yt,bt,xt,At,kt,Tt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,Gt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr;a=0|(i=this.viewport).x,o=0|i.y,s="width"in i?0|i.width:ct.framebufferWidth-a,l="height"in i?0|i.height:ct.framebufferHeight-o,c=ct.viewportWidth,ct.viewportWidth=s,u=ct.viewportHeight,ct.viewportHeight=l,f=qt[0],qt[0]=a,h=qt[1],qt[1]=o,m=qt[2],qt[2]=s,y=qt[3],qt[3]=l,v=wt[0],wt[0]=z,x=wt[1],wt[1]=E,_=wt[2],wt[2]=L,A=wt[3],wt[3]=C,k=ut.blend_enable,ut.blend_enable=P,T=Mt[0],Mt[0]=O,M=Mt[1],Mt[1]=I,S=Mt[2],Mt[2]=D,at=Mt[3],Mt[3]=R,ot=ut.depth_enable,ut.depth_enable=F,st=ut.stencil_enable,ut.stencil_enable=B,(lt=ft.profile)&&(ht=performance.now(),e.count++),gt=t.offset,yt=pt.offset,pt.offset=gt,bt=t.count,xt=pt.count,pt.count=bt,At=pt.primitive,pt.primitive=N,kt=g.call(this,ct,t,n),Tt=vt[j],vt[j]=kt,St=d.call(this,ct,t,n),zt=vt[V],vt[V]=St,Et=p.call(this,ct,t,n),Lt=vt[U],vt[U]=Et,Ct=b.call(this,ct,t,n),Pt=vt[H],vt[H]=Ct,Ot=w.call(this,ct,t,n),It=vt[q],vt[q]=Ot,Dt=t.color,Rt=vt[G],vt[G]=Dt,Ft=t.opacity,Bt=vt[W],vt[W]=Ft,Nt=this.viewportArray,jt=vt[Y],vt[Y]=Nt,Vt=this.scale,Ut=vt[Z],vt[Z]=Vt,Ht=t.align,Gt=vt[X],vt[X]=Ht,Xt=t.baseline,Jt=vt[J],vt[J]=Xt,Kt=this.translate,Qt=vt[K],vt[K]=Kt,$t=t.positionOffset,te=vt[Q],vt[Q]=$t,ee=this.charBuffer,re=!1,ne=1,ie=0,ae=0,oe=0,se=0,le=null,ce=0,ue=!1,fe=5126,pe=0,he=0,de=0,_t(ee)?(re=!0,fe=(le=dt.createStream(34962,ee)).dtype):(le=dt.getBuffer(ee))?fe=le.dtype:"constant"in ee?(ne=2,"number"==typeof ee.constant?(ie=ee.constant,ae=oe=se=0):(ie=ee.constant.length>0?ee.constant[0]:0,ae=ee.constant.length>1?ee.constant[1]:0,oe=ee.constant.length>2?ee.constant[2]:0,se=ee.constant.length>3?ee.constant[3]:0)):(le=_t(ee.buffer)?dt.createStream(34962,ee.buffer):dt.getBuffer(ee.buffer),fe="type"in ee?Wt[ee.type]:le.dtype,ue=!!ee.normalized,ce=0|ee.size,pe=0|ee.offset,he=0|ee.stride,de=0|ee.divisor),me=$.state,$.state=ne,ge=$.x,$.x=ie,ye=$.y,$.y=ae,ve=$.z,$.z=oe,be=$.w,$.w=se,xe=$.buffer,$.buffer=le,_e=$.size,$.size=ce,we=$.normalized,$.normalized=ue,Ae=$.type,$.type=fe,ke=$.offset,$.offset=pe,Te=$.stride,$.stride=he,Me=$.divisor,$.divisor=de,Se=this.position,ze=!1,Ee=1,Le=0,Ce=0,Pe=0,Oe=0,Ie=null,De=0,Re=!1,Fe=5126,Be=0,Ne=0,je=0,_t(Se)?(ze=!0,Fe=(Ie=dt.createStream(34962,Se)).dtype):(Ie=dt.getBuffer(Se))?Fe=Ie.dtype:"constant"in Se?(Ee=2,"number"==typeof Se.constant?(Le=Se.constant,Ce=Pe=Oe=0):(Le=Se.constant.length>0?Se.constant[0]:0,Ce=Se.constant.length>1?Se.constant[1]:0,Pe=Se.constant.length>2?Se.constant[2]:0,Oe=Se.constant.length>3?Se.constant[3]:0)):(Ie=_t(Se.buffer)?dt.createStream(34962,Se.buffer):dt.getBuffer(Se.buffer),Fe="type"in Se?Wt[Se.type]:Ie.dtype,Re=!!Se.normalized,De=0|Se.size,Be=0|Se.offset,Ne=0|Se.stride,je=0|Se.divisor),Ve=tt.state,tt.state=Ee,Ue=tt.x,tt.x=Le,He=tt.y,tt.y=Ce,qe=tt.z,tt.z=Pe,Ge=tt.w,tt.w=Oe,We=tt.buffer,tt.buffer=Ie,Ye=tt.size,tt.size=De,Ze=tt.normalized,tt.normalized=Re,Xe=tt.type,tt.type=Fe,Je=tt.offset,tt.offset=Be,Ke=tt.stride,tt.stride=Ne,Qe=tt.divisor,tt.divisor=je,$e=this.sizeBuffer,Yt.buffer=$e,tr=!1,er=1,rr=0,nr=0,ir=0,ar=0,or=null,sr=0,lr=!1,cr=5126,ur=0,fr=0,pr=0,_t(Yt)?(tr=!0,cr=(or=dt.createStream(34962,Yt)).dtype):(or=dt.getBuffer(Yt))?cr=or.dtype:"constant"in Yt?(er=2,"number"==typeof Yt.constant?(rr=Yt.constant,nr=ir=ar=0):(rr=Yt.constant.length>0?Yt.constant[0]:0,nr=Yt.constant.length>1?Yt.constant[1]:0,ir=Yt.constant.length>2?Yt.constant[2]:0,ar=Yt.constant.length>3?Yt.constant[3]:0)):(or=_t(Yt.buffer)?dt.createStream(34962,Yt.buffer):dt.getBuffer(Yt.buffer),cr="type"in Yt?Wt[Yt.type]:or.dtype,lr=!!Yt.normalized,sr=0|Yt.size,ur=0|Yt.offset,fr=0|Yt.stride,pr=0|Yt.divisor),hr=et.state,et.state=er,dr=et.x,et.x=rr,mr=et.y,et.y=nr,gr=et.z,et.z=ir,yr=et.w,et.w=ar,vr=et.buffer,et.buffer=or,br=et.size,et.size=sr,xr=et.normalized,et.normalized=lr,_r=et.type,et.type=cr,wr=et.offset,et.offset=ur,Ar=et.stride,et.stride=fr,kr=et.divisor,et.divisor=pr,Tr=this.sizeBuffer,Zt.buffer=Tr,Mr=!1,Sr=1,zr=0,Er=0,Lr=0,Cr=0,Pr=null,Or=0,Ir=!1,Dr=5126,Rr=0,Fr=0,Br=0,_t(Zt)?(Mr=!0,Dr=(Pr=dt.createStream(34962,Zt)).dtype):(Pr=dt.getBuffer(Zt))?Dr=Pr.dtype:"constant"in Zt?(Sr=2,"number"==typeof Zt.constant?(zr=Zt.constant,Er=Lr=Cr=0):(zr=Zt.constant.length>0?Zt.constant[0]:0,Er=Zt.constant.length>1?Zt.constant[1]:0,Lr=Zt.constant.length>2?Zt.constant[2]:0,Cr=Zt.constant.length>3?Zt.constant[3]:0)):(Pr=_t(Zt.buffer)?dt.createStream(34962,Zt.buffer):dt.getBuffer(Zt.buffer),Dr="type"in Zt?Wt[Zt.type]:Pr.dtype,Ir=!!Zt.normalized,Or=0|Zt.size,Rr=0|Zt.offset,Fr=0|Zt.stride,Br=0|Zt.divisor),Nr=rt.state,rt.state=Sr,jr=rt.x,rt.x=zr,Vr=rt.y,rt.y=Er,Ur=rt.z,rt.z=Lr,Hr=rt.w,rt.w=Cr,qr=rt.buffer,rt.buffer=Pr,Gr=rt.size,rt.size=Or,Wr=rt.normalized,rt.normalized=Ir,Yr=rt.type,rt.type=Dr,Zr=rt.offset,rt.offset=Rr,Xr=rt.stride,rt.stride=Fr,Jr=rt.divisor,rt.divisor=Br,Kr=mt.vert,mt.vert=nt,Qr=mt.frag,mt.frag=it,ft.dirty=!0,r(ct,t,n),ct.viewportWidth=c,ct.viewportHeight=u,qt[0]=f,qt[1]=h,qt[2]=m,qt[3]=y,wt[0]=v,wt[1]=x,wt[2]=_,wt[3]=A,ut.blend_enable=k,Mt[0]=T,Mt[1]=M,Mt[2]=S,Mt[3]=at,ut.depth_enable=ot,ut.stencil_enable=st,lt&&(e.cpuTime+=performance.now()-ht),pt.offset=yt,pt.count=xt,pt.primitive=At,vt[j]=Tt,vt[V]=zt,vt[U]=Lt,vt[H]=Pt,vt[q]=It,vt[G]=Rt,vt[W]=Bt,vt[Y]=jt,vt[Z]=Ut,vt[X]=Gt,vt[J]=Jt,vt[K]=Qt,vt[Q]=te,re&&dt.destroyStream(le),$.state=me,$.x=ge,$.y=ye,$.z=ve,$.w=be,$.buffer=xe,$.size=_e,$.normalized=we,$.type=Ae,$.offset=ke,$.stride=Te,$.divisor=Me,ze&&dt.destroyStream(Ie),tt.state=Ve,tt.x=Ue,tt.y=He,tt.z=qe,tt.w=Ge,tt.buffer=We,tt.size=Ye,tt.normalized=Ze,tt.type=Xe,tt.offset=Je,tt.stride=Ke,tt.divisor=Qe,tr&&dt.destroyStream(or),et.state=hr,et.x=dr,et.y=mr,et.z=gr,et.w=yr,et.buffer=vr,et.size=br,et.normalized=xr,et.type=_r,et.offset=wr,et.stride=Ar,et.divisor=kr,Mr&&dt.destroyStream(Pr),rt.state=Nr,rt.x=jr,rt.y=Vr,rt.z=Ur,rt.w=Hr,rt.buffer=qr,rt.size=Gr,rt.normalized=Wr,rt.type=Yr,rt.offset=Zr,rt.stride=Xr,rt.divisor=Jr,mt.vert=Kr,mt.frag=Qr,ft.dirty=!0},batch:function(t,r){var n,i,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,mt,vt,wt,Mt,qt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr;(xt.angle_instanced_arrays,(n=bt.next)!==bt.cur&&(n?lt.bindFramebuffer(36160,n.framebuffer):lt.bindFramebuffer(36160,null),bt.cur=n),ft.dirty)&&((N=ut.dither)!==ft.dither&&(N?lt.enable(3024):lt.disable(3024),ft.dither=N),j=kt[0],V=kt[1],j===Tt[0]&&V===Tt[1]||(lt.blendEquationSeparate(j,V),Tt[0]=j,Tt[1]=V),(U=ut.depth_func)!==ft.depth_func&&(lt.depthFunc(U),ft.depth_func=U),H=zt[0],q=zt[1],H===Et[0]&&q===Et[1]||(lt.depthRange(H,q),Et[0]=H,Et[1]=q),(G=ut.depth_mask)!==ft.depth_mask&&(lt.depthMask(G),ft.depth_mask=G),W=Lt[0],Y=Lt[1],Z=Lt[2],X=Lt[3],W===Ct[0]&&Y===Ct[1]&&Z===Ct[2]&&X===Ct[3]||(lt.colorMask(W,Y,Z,X),Ct[0]=W,Ct[1]=Y,Ct[2]=Z,Ct[3]=X),(J=ut.cull_enable)!==ft.cull_enable&&(J?lt.enable(2884):lt.disable(2884),ft.cull_enable=J),(K=ut.cull_face)!==ft.cull_face&&(lt.cullFace(K),ft.cull_face=K),(Q=ut.frontFace)!==ft.frontFace&&(lt.frontFace(Q),ft.frontFace=Q),($=ut.lineWidth)!==ft.lineWidth&&(lt.lineWidth($),ft.lineWidth=$),(tt=ut.polygonOffset_enable)!==ft.polygonOffset_enable&&(tt?lt.enable(32823):lt.disable(32823),ft.polygonOffset_enable=tt),et=Pt[0],rt=Pt[1],et===Ot[0]&&rt===Ot[1]||(lt.polygonOffset(et,rt),Ot[0]=et,Ot[1]=rt),(nt=ut.sample_alpha)!==ft.sample_alpha&&(nt?lt.enable(32926):lt.disable(32926),ft.sample_alpha=nt),(it=ut.sample_enable)!==ft.sample_enable&&(it?lt.enable(32928):lt.disable(32928),ft.sample_enable=it),mt=It[0],vt=It[1],mt===Dt[0]&&vt===Dt[1]||(lt.sampleCoverage(mt,vt),Dt[0]=mt,Dt[1]=vt),(wt=ut.stencil_mask)!==ft.stencil_mask&&(lt.stencilMask(wt),ft.stencil_mask=wt),Mt=Rt[0],qt=Rt[1],Xt=Rt[2],Mt===Ft[0]&&qt===Ft[1]&&Xt===Ft[2]||(lt.stencilFunc(Mt,qt,Xt),Ft[0]=Mt,Ft[1]=qt,Ft[2]=Xt),Jt=Bt[0],Kt=Bt[1],Qt=Bt[2],$t=Bt[3],Jt===Nt[0]&&Kt===Nt[1]&&Qt===Nt[2]&&$t===Nt[3]||(lt.stencilOpSeparate(Jt,Kt,Qt,$t),Nt[0]=Jt,Nt[1]=Kt,Nt[2]=Qt,Nt[3]=$t),te=jt[0],ee=jt[1],re=jt[2],ne=jt[3],te===Vt[0]&&ee===Vt[1]&&re===Vt[2]&&ne===Vt[3]||(lt.stencilOpSeparate(te,ee,re,ne),Vt[0]=te,Vt[1]=ee,Vt[2]=re,Vt[3]=ne),(ie=ut.scissor_enable)!==ft.scissor_enable&&(ie?lt.enable(3089):lt.disable(3089),ft.scissor_enable=ie),ae=Ut[0],oe=Ut[1],se=Ut[2],le=Ut[3],ae===Ht[0]&&oe===Ht[1]&&se===Ht[2]&&le===Ht[3]||(lt.scissor(ae,oe,se,le),Ht[0]=ae,Ht[1]=oe,Ht[2]=se,Ht[3]=le));z=0|(i=this.viewport).x,E=0|i.y,L="width"in i?0|i.width:ct.framebufferWidth-z,C="height"in i?0|i.height:ct.framebufferHeight-E,P=ct.viewportWidth,ct.viewportWidth=L,O=ct.viewportHeight,ct.viewportHeight=C,lt.viewport(z,E,L,C),Gt[0]=z,Gt[1]=E,Gt[2]=L,Gt[3]=C,lt.blendColor(0,0,0,1),At[0]=0,At[1]=0,At[2]=0,At[3]=1,at?lt.enable(3042):lt.disable(3042),ft.blend_enable=at,lt.blendFuncSeparate(770,771,773,1),St[0]=770,St[1]=771,St[2]=773,St[3]=1,ot?lt.enable(2929):lt.disable(2929),ft.depth_enable=ot,st?lt.enable(2960):lt.disable(2960),ft.stencil_enable=st,(I=ft.profile)&&(D=performance.now(),e.count+=r),lt.useProgram(a.program),R=xt.angle_instanced_arrays,yt.setVAO(null),ce=this.charBuffer,ue=!1,fe=1,pe=0,he=0,de=0,me=0,ge=null,ye=0,ve=!1,be=5126,xe=0,_e=0,we=0,_t(ce)?(ue=!0,be=(ge=dt.createStream(34962,ce)).dtype):(ge=dt.getBuffer(ce))?be=ge.dtype:"constant"in ce?(fe=2,"number"==typeof ce.constant?(pe=ce.constant,he=de=me=0):(pe=ce.constant.length>0?ce.constant[0]:0,he=ce.constant.length>1?ce.constant[1]:0,de=ce.constant.length>2?ce.constant[2]:0,me=ce.constant.length>3?ce.constant[3]:0)):(ge=_t(ce.buffer)?dt.createStream(34962,ce.buffer):dt.getBuffer(ce.buffer),be="type"in ce?Wt[ce.type]:ge.dtype,ve=!!ce.normalized,ye=0|ce.size,xe=0|ce.offset,_e=0|ce.stride,we=0|ce.divisor),Ae=o.location,ke=gt[Ae],1===fe?(ke.buffer||lt.enableVertexAttribArray(Ae),Te=ye||1,ke.type===be&&ke.size===Te&&ke.buffer===ge&&ke.normalized===ve&&ke.offset===xe&&ke.stride===_e||(lt.bindBuffer(34962,ge.buffer),lt.vertexAttribPointer(Ae,Te,be,ve,_e,xe),ke.type=be,ke.size=Te,ke.buffer=ge,ke.normalized=ve,ke.offset=xe,ke.stride=_e),ke.divisor!==we&&(R.vertexAttribDivisorANGLE(Ae,we),ke.divisor=we)):(ke.buffer&&(lt.disableVertexAttribArray(Ae),ke.buffer=null),ke.x===pe&&ke.y===he&&ke.z===de&&ke.w===me||(lt.vertexAttrib4f(Ae,pe,he,de,me),ke.x=pe,ke.y=he,ke.z=de,ke.w=me)),Me=this.sizeBuffer,Yt.buffer=Me,Se=!1,ze=1,Ee=0,Le=0,Ce=0,Pe=0,Oe=null,Ie=0,De=!1,Re=5126,Fe=0,Be=0,Ne=0,_t(Yt)?(Se=!0,Re=(Oe=dt.createStream(34962,Yt)).dtype):(Oe=dt.getBuffer(Yt))?Re=Oe.dtype:"constant"in Yt?(ze=2,"number"==typeof Yt.constant?(Ee=Yt.constant,Le=Ce=Pe=0):(Ee=Yt.constant.length>0?Yt.constant[0]:0,Le=Yt.constant.length>1?Yt.constant[1]:0,Ce=Yt.constant.length>2?Yt.constant[2]:0,Pe=Yt.constant.length>3?Yt.constant[3]:0)):(Oe=_t(Yt.buffer)?dt.createStream(34962,Yt.buffer):dt.getBuffer(Yt.buffer),Re="type"in Yt?Wt[Yt.type]:Oe.dtype,De=!!Yt.normalized,Ie=0|Yt.size,Fe=0|Yt.offset,Be=0|Yt.stride,Ne=0|Yt.divisor),je=s.location,Ve=gt[je],1===ze?(Ve.buffer||lt.enableVertexAttribArray(je),Ue=Ie||1,Ve.type===Re&&Ve.size===Ue&&Ve.buffer===Oe&&Ve.normalized===De&&Ve.offset===Fe&&Ve.stride===Be||(lt.bindBuffer(34962,Oe.buffer),lt.vertexAttribPointer(je,Ue,Re,De,Be,Fe),Ve.type=Re,Ve.size=Ue,Ve.buffer=Oe,Ve.normalized=De,Ve.offset=Fe,Ve.stride=Be),Ve.divisor!==Ne&&(R.vertexAttribDivisorANGLE(je,Ne),Ve.divisor=Ne)):(Ve.buffer&&(lt.disableVertexAttribArray(je),Ve.buffer=null),Ve.x===Ee&&Ve.y===Le&&Ve.z===Ce&&Ve.w===Pe||(lt.vertexAttrib4f(je,Ee,Le,Ce,Pe),Ve.x=Ee,Ve.y=Le,Ve.z=Ce,Ve.w=Pe)),He=this.position,qe=!1,Ge=1,We=0,Ye=0,Ze=0,Xe=0,Je=null,Ke=0,Qe=!1,$e=5126,tr=0,er=0,rr=0,_t(He)?(qe=!0,$e=(Je=dt.createStream(34962,He)).dtype):(Je=dt.getBuffer(He))?$e=Je.dtype:"constant"in He?(Ge=2,"number"==typeof He.constant?(We=He.constant,Ye=Ze=Xe=0):(We=He.constant.length>0?He.constant[0]:0,Ye=He.constant.length>1?He.constant[1]:0,Ze=He.constant.length>2?He.constant[2]:0,Xe=He.constant.length>3?He.constant[3]:0)):(Je=_t(He.buffer)?dt.createStream(34962,He.buffer):dt.getBuffer(He.buffer),$e="type"in He?Wt[He.type]:Je.dtype,Qe=!!He.normalized,Ke=0|He.size,tr=0|He.offset,er=0|He.stride,rr=0|He.divisor),nr=l.location,ir=gt[nr],1===Ge?(ir.buffer||lt.enableVertexAttribArray(nr),ar=Ke||2,ir.type===$e&&ir.size===ar&&ir.buffer===Je&&ir.normalized===Qe&&ir.offset===tr&&ir.stride===er||(lt.bindBuffer(34962,Je.buffer),lt.vertexAttribPointer(nr,ar,$e,Qe,er,tr),ir.type=$e,ir.size=ar,ir.buffer=Je,ir.normalized=Qe,ir.offset=tr,ir.stride=er),ir.divisor!==rr&&(R.vertexAttribDivisorANGLE(nr,rr),ir.divisor=rr)):(ir.buffer&&(lt.disableVertexAttribArray(nr),ir.buffer=null),ir.x===We&&ir.y===Ye&&ir.z===Ze&&ir.w===Xe||(lt.vertexAttrib4f(nr,We,Ye,Ze,Xe),ir.x=We,ir.y=Ye,ir.z=Ze,ir.w=Xe)),or=this.sizeBuffer,Zt.buffer=or,sr=!1,lr=1,cr=0,ur=0,fr=0,pr=0,hr=null,dr=0,mr=!1,gr=5126,yr=0,vr=0,br=0,_t(Zt)?(sr=!0,gr=(hr=dt.createStream(34962,Zt)).dtype):(hr=dt.getBuffer(Zt))?gr=hr.dtype:"constant"in Zt?(lr=2,"number"==typeof Zt.constant?(cr=Zt.constant,ur=fr=pr=0):(cr=Zt.constant.length>0?Zt.constant[0]:0,ur=Zt.constant.length>1?Zt.constant[1]:0,fr=Zt.constant.length>2?Zt.constant[2]:0,pr=Zt.constant.length>3?Zt.constant[3]:0)):(hr=_t(Zt.buffer)?dt.createStream(34962,Zt.buffer):dt.getBuffer(Zt.buffer),gr="type"in Zt?Wt[Zt.type]:hr.dtype,mr=!!Zt.normalized,dr=0|Zt.size,yr=0|Zt.offset,vr=0|Zt.stride,br=0|Zt.divisor),xr=c.location,_r=gt[xr],1===lr?(_r.buffer||lt.enableVertexAttribArray(xr),wr=dr||1,_r.type===gr&&_r.size===wr&&_r.buffer===hr&&_r.normalized===mr&&_r.offset===yr&&_r.stride===vr||(lt.bindBuffer(34962,hr.buffer),lt.vertexAttribPointer(xr,wr,gr,mr,vr,yr),_r.type=gr,_r.size=wr,_r.buffer=hr,_r.normalized=mr,_r.offset=yr,_r.stride=vr),_r.divisor!==br&&(R.vertexAttribDivisorANGLE(xr,br),_r.divisor=br)):(_r.buffer&&(lt.disableVertexAttribArray(xr),_r.buffer=null),_r.x===cr&&_r.y===ur&&_r.z===fr&&_r.w===pr||(lt.vertexAttrib4f(xr,cr,ur,fr,pr),_r.x=cr,_r.y=ur,_r.z=fr,_r.w=pr)),kr=(Ar=this.scale)[0],Tr=Ar[1],lt.uniform2f(T.location,kr,Tr),Sr=(Mr=this.translate)[0],zr=Mr[1],lt.uniform2f(M.location,Sr,zr),Lr=(Er=this.viewportArray)[0],Cr=Er[1],Pr=Er[2],Or=Er[3],lt.uniform4f(S.location,Lr,Cr,Pr,Or),((Ir=pt.elements)||yt.currentVAO&&(Ir=ht.getElements(yt.currentVAO.elements)))&<.bindBuffer(34963,Ir.buffer.buffer),Dr=pt.instances;for(F=0;F0?Ir?R.drawElementsInstancedANGLE(0,xn,Ir.type,bn<<(Ir.type-5121>>1),Dr):R.drawArraysInstancedANGLE(0,bn,xn,Dr):Dr<0&&(Ir?lt.drawElements(0,xn,Ir.type,bn<<(Ir.type-5121>>1)):lt.drawArrays(0,bn,xn)),Nr.unbind())}ue&&dt.destroyStream(ge),Se&&dt.destroyStream(Oe),qe&&dt.destroyStream(Je),sr&&dt.destroyStream(hr),ft.dirty=!0,yt.setVAO(null),ct.viewportWidth=P,ct.viewportHeight=O,I&&(e.cpuTime+=performance.now()-D)}}}},{}],498:[function(t,e,r){e.exports=function(t,e,r,n){"use strict";var i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F;return i=t.gl,a=t.context,t.strings,o=t.next,s=t.current,t.draw,t.elements,t.buffer,l=t.shader,t.attributes,c=t.vao,t.uniforms,u=t.framebuffer,f=t.extensions,t.timer,t.isBufferArgs,p=o.blend_color,h=s.blend_color,d=o.blend_equation,m=s.blend_equation,g=o.blend_func,y=s.blend_func,v=o.depth_range,b=s.depth_range,x=o.colorMask,_=s.colorMask,w=o.polygonOffset_offset,A=s.polygonOffset_offset,k=o.sample_coverage,T=s.sample_coverage,M=o.stencil_func,S=s.stencil_func,z=o.stencil_opFront,E=s.stencil_opFront,L=o.stencil_opBack,C=s.stencil_opBack,P=o.scissor_box,O=s.scissor_box,I=o.viewport,D=s.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},R={},F={},{draw:function(t){var n,a,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut;(f.angle_instanced_arrays,(n=u.next)!==u.cur&&(n?i.bindFramebuffer(36160,n.framebuffer):i.bindFramebuffer(36160,null),u.cur=n),s.dirty)&&((H=o.dither)!==s.dither&&(H?i.enable(3024):i.disable(3024),s.dither=H),(q=o.blend_enable)!==s.blend_enable&&(q?i.enable(3042):i.disable(3042),s.blend_enable=q),G=p[0],W=p[1],Y=p[2],Z=p[3],G===h[0]&&W===h[1]&&Y===h[2]&&Z===h[3]||(i.blendColor(G,W,Y,Z),h[0]=G,h[1]=W,h[2]=Y,h[3]=Z),X=d[0],J=d[1],X===m[0]&&J===m[1]||(i.blendEquationSeparate(X,J),m[0]=X,m[1]=J),K=g[0],Q=g[1],$=g[2],tt=g[3],K===y[0]&&Q===y[1]&&$===y[2]&&tt===y[3]||(i.blendFuncSeparate(K,Q,$,tt),y[0]=K,y[1]=Q,y[2]=$,y[3]=tt),(et=o.depth_enable)!==s.depth_enable&&(et?i.enable(2929):i.disable(2929),s.depth_enable=et),(rt=o.depth_func)!==s.depth_func&&(i.depthFunc(rt),s.depth_func=rt),nt=v[0],it=v[1],nt===b[0]&&it===b[1]||(i.depthRange(nt,it),b[0]=nt,b[1]=it),(at=o.depth_mask)!==s.depth_mask&&(i.depthMask(at),s.depth_mask=at),ot=x[0],st=x[1],lt=x[2],ct=x[3],ot===_[0]&&st===_[1]&<===_[2]&&ct===_[3]||(i.colorMask(ot,st,lt,ct),_[0]=ot,_[1]=st,_[2]=lt,_[3]=ct),(ut=o.cull_enable)!==s.cull_enable&&(ut?i.enable(2884):i.disable(2884),s.cull_enable=ut),(ft=o.cull_face)!==s.cull_face&&(i.cullFace(ft),s.cull_face=ft),(pt=o.frontFace)!==s.frontFace&&(i.frontFace(pt),s.frontFace=pt),(ht=o.lineWidth)!==s.lineWidth&&(i.lineWidth(ht),s.lineWidth=ht),(dt=o.polygonOffset_enable)!==s.polygonOffset_enable&&(dt?i.enable(32823):i.disable(32823),s.polygonOffset_enable=dt),mt=w[0],gt=w[1],mt===A[0]&>===A[1]||(i.polygonOffset(mt,gt),A[0]=mt,A[1]=gt),(yt=o.sample_alpha)!==s.sample_alpha&&(yt?i.enable(32926):i.disable(32926),s.sample_alpha=yt),(vt=o.sample_enable)!==s.sample_enable&&(vt?i.enable(32928):i.disable(32928),s.sample_enable=vt),bt=k[0],xt=k[1],bt===T[0]&&xt===T[1]||(i.sampleCoverage(bt,xt),T[0]=bt,T[1]=xt),(_t=o.stencil_enable)!==s.stencil_enable&&(_t?i.enable(2960):i.disable(2960),s.stencil_enable=_t),(wt=o.stencil_mask)!==s.stencil_mask&&(i.stencilMask(wt),s.stencil_mask=wt),At=M[0],kt=M[1],Tt=M[2],At===S[0]&&kt===S[1]&&Tt===S[2]||(i.stencilFunc(At,kt,Tt),S[0]=At,S[1]=kt,S[2]=Tt),Mt=z[0],St=z[1],zt=z[2],Et=z[3],Mt===E[0]&&St===E[1]&&zt===E[2]&&Et===E[3]||(i.stencilOpSeparate(Mt,St,zt,Et),E[0]=Mt,E[1]=St,E[2]=zt,E[3]=Et),Lt=L[0],Ct=L[1],Pt=L[2],Ot=L[3],Lt===C[0]&&Ct===C[1]&&Pt===C[2]&&Ot===C[3]||(i.stencilOpSeparate(Lt,Ct,Pt,Ot),C[0]=Lt,C[1]=Ct,C[2]=Pt,C[3]=Ot),(It=o.scissor_enable)!==s.scissor_enable&&(It?i.enable(3089):i.disable(3089),s.scissor_enable=It),Dt=P[0],Rt=P[1],Ft=P[2],Bt=P[3],Dt===O[0]&&Rt===O[1]&&Ft===O[2]&&Bt===O[3]||(i.scissor(Dt,Rt,Ft,Bt),O[0]=Dt,O[1]=Rt,O[2]=Ft,O[3]=Bt),Nt=I[0],jt=I[1],Vt=I[2],Ut=I[3],Nt===D[0]&&jt===D[1]&&Vt===D[2]&&Ut===D[3]||(i.viewport(Nt,jt,Vt,Ut),D[0]=Nt,D[1]=jt,D[2]=Vt,D[3]=Ut),s.dirty=!1);(a=s.profile)&&(F=performance.now(),e.count++),B=l.frag,N=l.vert,j=l.program(N,B),i.useProgram(j.program),c.setVAO(null),V=j.id,(U=R[V])?U.call(this,t):(U=R[V]=r(j)).call(this,t),c.setVAO(null),a&&(e.cpuTime+=performance.now()-F)},scope:function(t,r,n){var i,o;(i=s.profile)&&(o=performance.now(),e.count++),r(a,t,n),i&&(e.cpuTime+=performance.now()-o)},batch:function(t,r){var a,R,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht;(f.angle_instanced_arrays,(a=u.next)!==u.cur&&(a?i.bindFramebuffer(36160,a.framebuffer):i.bindFramebuffer(36160,null),u.cur=a),s.dirty)&&((q=o.dither)!==s.dither&&(q?i.enable(3024):i.disable(3024),s.dither=q),(G=o.blend_enable)!==s.blend_enable&&(G?i.enable(3042):i.disable(3042),s.blend_enable=G),W=p[0],Y=p[1],Z=p[2],X=p[3],W===h[0]&&Y===h[1]&&Z===h[2]&&X===h[3]||(i.blendColor(W,Y,Z,X),h[0]=W,h[1]=Y,h[2]=Z,h[3]=X),J=d[0],K=d[1],J===m[0]&&K===m[1]||(i.blendEquationSeparate(J,K),m[0]=J,m[1]=K),Q=g[0],$=g[1],tt=g[2],et=g[3],Q===y[0]&&$===y[1]&&tt===y[2]&&et===y[3]||(i.blendFuncSeparate(Q,$,tt,et),y[0]=Q,y[1]=$,y[2]=tt,y[3]=et),(rt=o.depth_enable)!==s.depth_enable&&(rt?i.enable(2929):i.disable(2929),s.depth_enable=rt),(nt=o.depth_func)!==s.depth_func&&(i.depthFunc(nt),s.depth_func=nt),it=v[0],at=v[1],it===b[0]&&at===b[1]||(i.depthRange(it,at),b[0]=it,b[1]=at),(ot=o.depth_mask)!==s.depth_mask&&(i.depthMask(ot),s.depth_mask=ot),st=x[0],lt=x[1],ct=x[2],ut=x[3],st===_[0]&<===_[1]&&ct===_[2]&&ut===_[3]||(i.colorMask(st,lt,ct,ut),_[0]=st,_[1]=lt,_[2]=ct,_[3]=ut),(ft=o.cull_enable)!==s.cull_enable&&(ft?i.enable(2884):i.disable(2884),s.cull_enable=ft),(pt=o.cull_face)!==s.cull_face&&(i.cullFace(pt),s.cull_face=pt),(ht=o.frontFace)!==s.frontFace&&(i.frontFace(ht),s.frontFace=ht),(dt=o.lineWidth)!==s.lineWidth&&(i.lineWidth(dt),s.lineWidth=dt),(mt=o.polygonOffset_enable)!==s.polygonOffset_enable&&(mt?i.enable(32823):i.disable(32823),s.polygonOffset_enable=mt),gt=w[0],yt=w[1],gt===A[0]&&yt===A[1]||(i.polygonOffset(gt,yt),A[0]=gt,A[1]=yt),(vt=o.sample_alpha)!==s.sample_alpha&&(vt?i.enable(32926):i.disable(32926),s.sample_alpha=vt),(bt=o.sample_enable)!==s.sample_enable&&(bt?i.enable(32928):i.disable(32928),s.sample_enable=bt),xt=k[0],_t=k[1],xt===T[0]&&_t===T[1]||(i.sampleCoverage(xt,_t),T[0]=xt,T[1]=_t),(wt=o.stencil_enable)!==s.stencil_enable&&(wt?i.enable(2960):i.disable(2960),s.stencil_enable=wt),(At=o.stencil_mask)!==s.stencil_mask&&(i.stencilMask(At),s.stencil_mask=At),kt=M[0],Tt=M[1],Mt=M[2],kt===S[0]&&Tt===S[1]&&Mt===S[2]||(i.stencilFunc(kt,Tt,Mt),S[0]=kt,S[1]=Tt,S[2]=Mt),St=z[0],zt=z[1],Et=z[2],Lt=z[3],St===E[0]&&zt===E[1]&&Et===E[2]&&Lt===E[3]||(i.stencilOpSeparate(St,zt,Et,Lt),E[0]=St,E[1]=zt,E[2]=Et,E[3]=Lt),Ct=L[0],Pt=L[1],Ot=L[2],It=L[3],Ct===C[0]&&Pt===C[1]&&Ot===C[2]&&It===C[3]||(i.stencilOpSeparate(Ct,Pt,Ot,It),C[0]=Ct,C[1]=Pt,C[2]=Ot,C[3]=It),(Dt=o.scissor_enable)!==s.scissor_enable&&(Dt?i.enable(3089):i.disable(3089),s.scissor_enable=Dt),Rt=P[0],Ft=P[1],Bt=P[2],Nt=P[3],Rt===O[0]&&Ft===O[1]&&Bt===O[2]&&Nt===O[3]||(i.scissor(Rt,Ft,Bt,Nt),O[0]=Rt,O[1]=Ft,O[2]=Bt,O[3]=Nt),jt=I[0],Vt=I[1],Ut=I[2],Ht=I[3],jt===D[0]&&Vt===D[1]&&Ut===D[2]&&Ht===D[3]||(i.viewport(jt,Vt,Ut,Ht),D[0]=jt,D[1]=Vt,D[2]=Ut,D[3]=Ht),s.dirty=!1);(R=s.profile)&&(B=performance.now(),e.count+=r),N=l.frag,j=l.vert,V=l.program(j,N),i.useProgram(V.program),c.setVAO(null),U=V.id,(H=F[U])?H.call(this,t,r):(H=F[U]=n(V)).call(this,t,r),c.setVAO(null),R&&(e.cpuTime+=performance.now()-B)}}}},{}],499:[function(t,e,r){e.exports=function(t,e,r,n){"use strict";var i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R;return i=t.gl,a=t.context,t.strings,o=t.next,s=t.current,t.draw,t.elements,t.buffer,l=t.shader,t.attributes,c=t.vao,t.uniforms,u=t.framebuffer,t.extensions,t.timer,t.isBufferArgs,f=o.blend_color,p=s.blend_color,h=o.blend_equation,d=s.blend_equation,m=o.blend_func,g=s.blend_func,y=o.depth_range,v=s.depth_range,b=o.colorMask,x=s.colorMask,_=o.polygonOffset_offset,w=s.polygonOffset_offset,A=o.sample_coverage,k=s.sample_coverage,T=o.stencil_func,M=s.stencil_func,S=o.stencil_opFront,z=s.stencil_opFront,E=o.stencil_opBack,L=s.stencil_opBack,C=o.scissor_box,P=s.scissor_box,O=o.viewport,I=s.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},D={},R={},{draw:function(t){var n,a,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt;((n=u.next)!==u.cur&&(n?i.bindFramebuffer(36160,n.framebuffer):i.bindFramebuffer(36160,null),u.cur=n),s.dirty)&&((U=o.dither)!==s.dither&&(U?i.enable(3024):i.disable(3024),s.dither=U),(H=o.blend_enable)!==s.blend_enable&&(H?i.enable(3042):i.disable(3042),s.blend_enable=H),q=f[0],G=f[1],W=f[2],Y=f[3],q===p[0]&&G===p[1]&&W===p[2]&&Y===p[3]||(i.blendColor(q,G,W,Y),p[0]=q,p[1]=G,p[2]=W,p[3]=Y),Z=h[0],X=h[1],Z===d[0]&&X===d[1]||(i.blendEquationSeparate(Z,X),d[0]=Z,d[1]=X),J=m[0],K=m[1],Q=m[2],$=m[3],J===g[0]&&K===g[1]&&Q===g[2]&&$===g[3]||(i.blendFuncSeparate(J,K,Q,$),g[0]=J,g[1]=K,g[2]=Q,g[3]=$),(tt=o.depth_enable)!==s.depth_enable&&(tt?i.enable(2929):i.disable(2929),s.depth_enable=tt),(et=o.depth_func)!==s.depth_func&&(i.depthFunc(et),s.depth_func=et),rt=y[0],nt=y[1],rt===v[0]&&nt===v[1]||(i.depthRange(rt,nt),v[0]=rt,v[1]=nt),(it=o.depth_mask)!==s.depth_mask&&(i.depthMask(it),s.depth_mask=it),at=b[0],ot=b[1],st=b[2],lt=b[3],at===x[0]&&ot===x[1]&&st===x[2]&<===x[3]||(i.colorMask(at,ot,st,lt),x[0]=at,x[1]=ot,x[2]=st,x[3]=lt),(ct=o.cull_enable)!==s.cull_enable&&(ct?i.enable(2884):i.disable(2884),s.cull_enable=ct),(ut=o.cull_face)!==s.cull_face&&(i.cullFace(ut),s.cull_face=ut),(ft=o.frontFace)!==s.frontFace&&(i.frontFace(ft),s.frontFace=ft),(pt=o.lineWidth)!==s.lineWidth&&(i.lineWidth(pt),s.lineWidth=pt),(ht=o.polygonOffset_enable)!==s.polygonOffset_enable&&(ht?i.enable(32823):i.disable(32823),s.polygonOffset_enable=ht),dt=_[0],mt=_[1],dt===w[0]&&mt===w[1]||(i.polygonOffset(dt,mt),w[0]=dt,w[1]=mt),(gt=o.sample_alpha)!==s.sample_alpha&&(gt?i.enable(32926):i.disable(32926),s.sample_alpha=gt),(yt=o.sample_enable)!==s.sample_enable&&(yt?i.enable(32928):i.disable(32928),s.sample_enable=yt),vt=A[0],bt=A[1],vt===k[0]&&bt===k[1]||(i.sampleCoverage(vt,bt),k[0]=vt,k[1]=bt),(xt=o.stencil_enable)!==s.stencil_enable&&(xt?i.enable(2960):i.disable(2960),s.stencil_enable=xt),(_t=o.stencil_mask)!==s.stencil_mask&&(i.stencilMask(_t),s.stencil_mask=_t),wt=T[0],At=T[1],kt=T[2],wt===M[0]&&At===M[1]&&kt===M[2]||(i.stencilFunc(wt,At,kt),M[0]=wt,M[1]=At,M[2]=kt),Tt=S[0],Mt=S[1],St=S[2],zt=S[3],Tt===z[0]&&Mt===z[1]&&St===z[2]&&zt===z[3]||(i.stencilOpSeparate(Tt,Mt,St,zt),z[0]=Tt,z[1]=Mt,z[2]=St,z[3]=zt),Et=E[0],Lt=E[1],Ct=E[2],Pt=E[3],Et===L[0]&&Lt===L[1]&&Ct===L[2]&&Pt===L[3]||(i.stencilOpSeparate(Et,Lt,Ct,Pt),L[0]=Et,L[1]=Lt,L[2]=Ct,L[3]=Pt),(Ot=o.scissor_enable)!==s.scissor_enable&&(Ot?i.enable(3089):i.disable(3089),s.scissor_enable=Ot),It=C[0],Dt=C[1],Rt=C[2],Ft=C[3],It===P[0]&&Dt===P[1]&&Rt===P[2]&&Ft===P[3]||(i.scissor(It,Dt,Rt,Ft),P[0]=It,P[1]=Dt,P[2]=Rt,P[3]=Ft),Bt=O[0],Nt=O[1],jt=O[2],Vt=O[3],Bt===I[0]&&Nt===I[1]&&jt===I[2]&&Vt===I[3]||(i.viewport(Bt,Nt,jt,Vt),I[0]=Bt,I[1]=Nt,I[2]=jt,I[3]=Vt),s.dirty=!1);(a=s.profile)&&(R=performance.now(),e.count++),F=l.frag,B=l.vert,N=l.program(B,F),i.useProgram(N.program),c.setVAO(null),j=N.id,(V=D[j])?V.call(this,t):(V=D[j]=r(N)).call(this,t),c.setVAO(null),a&&(e.cpuTime+=performance.now()-R)},scope:function(t,r,n){var i,o;(i=s.profile)&&(o=performance.now(),e.count++),r(a,t,n),i&&(e.cpuTime+=performance.now()-o)},batch:function(t,r){var a,D,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut;((a=u.next)!==u.cur&&(a?i.bindFramebuffer(36160,a.framebuffer):i.bindFramebuffer(36160,null),u.cur=a),s.dirty)&&((H=o.dither)!==s.dither&&(H?i.enable(3024):i.disable(3024),s.dither=H),(q=o.blend_enable)!==s.blend_enable&&(q?i.enable(3042):i.disable(3042),s.blend_enable=q),G=f[0],W=f[1],Y=f[2],Z=f[3],G===p[0]&&W===p[1]&&Y===p[2]&&Z===p[3]||(i.blendColor(G,W,Y,Z),p[0]=G,p[1]=W,p[2]=Y,p[3]=Z),X=h[0],J=h[1],X===d[0]&&J===d[1]||(i.blendEquationSeparate(X,J),d[0]=X,d[1]=J),K=m[0],Q=m[1],$=m[2],tt=m[3],K===g[0]&&Q===g[1]&&$===g[2]&&tt===g[3]||(i.blendFuncSeparate(K,Q,$,tt),g[0]=K,g[1]=Q,g[2]=$,g[3]=tt),(et=o.depth_enable)!==s.depth_enable&&(et?i.enable(2929):i.disable(2929),s.depth_enable=et),(rt=o.depth_func)!==s.depth_func&&(i.depthFunc(rt),s.depth_func=rt),nt=y[0],it=y[1],nt===v[0]&&it===v[1]||(i.depthRange(nt,it),v[0]=nt,v[1]=it),(at=o.depth_mask)!==s.depth_mask&&(i.depthMask(at),s.depth_mask=at),ot=b[0],st=b[1],lt=b[2],ct=b[3],ot===x[0]&&st===x[1]&<===x[2]&&ct===x[3]||(i.colorMask(ot,st,lt,ct),x[0]=ot,x[1]=st,x[2]=lt,x[3]=ct),(ut=o.cull_enable)!==s.cull_enable&&(ut?i.enable(2884):i.disable(2884),s.cull_enable=ut),(ft=o.cull_face)!==s.cull_face&&(i.cullFace(ft),s.cull_face=ft),(pt=o.frontFace)!==s.frontFace&&(i.frontFace(pt),s.frontFace=pt),(ht=o.lineWidth)!==s.lineWidth&&(i.lineWidth(ht),s.lineWidth=ht),(dt=o.polygonOffset_enable)!==s.polygonOffset_enable&&(dt?i.enable(32823):i.disable(32823),s.polygonOffset_enable=dt),mt=_[0],gt=_[1],mt===w[0]&>===w[1]||(i.polygonOffset(mt,gt),w[0]=mt,w[1]=gt),(yt=o.sample_alpha)!==s.sample_alpha&&(yt?i.enable(32926):i.disable(32926),s.sample_alpha=yt),(vt=o.sample_enable)!==s.sample_enable&&(vt?i.enable(32928):i.disable(32928),s.sample_enable=vt),bt=A[0],xt=A[1],bt===k[0]&&xt===k[1]||(i.sampleCoverage(bt,xt),k[0]=bt,k[1]=xt),(_t=o.stencil_enable)!==s.stencil_enable&&(_t?i.enable(2960):i.disable(2960),s.stencil_enable=_t),(wt=o.stencil_mask)!==s.stencil_mask&&(i.stencilMask(wt),s.stencil_mask=wt),At=T[0],kt=T[1],Tt=T[2],At===M[0]&&kt===M[1]&&Tt===M[2]||(i.stencilFunc(At,kt,Tt),M[0]=At,M[1]=kt,M[2]=Tt),Mt=S[0],St=S[1],zt=S[2],Et=S[3],Mt===z[0]&&St===z[1]&&zt===z[2]&&Et===z[3]||(i.stencilOpSeparate(Mt,St,zt,Et),z[0]=Mt,z[1]=St,z[2]=zt,z[3]=Et),Lt=E[0],Ct=E[1],Pt=E[2],Ot=E[3],Lt===L[0]&&Ct===L[1]&&Pt===L[2]&&Ot===L[3]||(i.stencilOpSeparate(Lt,Ct,Pt,Ot),L[0]=Lt,L[1]=Ct,L[2]=Pt,L[3]=Ot),(It=o.scissor_enable)!==s.scissor_enable&&(It?i.enable(3089):i.disable(3089),s.scissor_enable=It),Dt=C[0],Rt=C[1],Ft=C[2],Bt=C[3],Dt===P[0]&&Rt===P[1]&&Ft===P[2]&&Bt===P[3]||(i.scissor(Dt,Rt,Ft,Bt),P[0]=Dt,P[1]=Rt,P[2]=Ft,P[3]=Bt),Nt=O[0],jt=O[1],Vt=O[2],Ut=O[3],Nt===I[0]&&jt===I[1]&&Vt===I[2]&&Ut===I[3]||(i.viewport(Nt,jt,Vt,Ut),I[0]=Nt,I[1]=jt,I[2]=Vt,I[3]=Ut),s.dirty=!1);(D=s.profile)&&(F=performance.now(),e.count+=r),B=l.frag,N=l.vert,j=l.program(N,B),i.useProgram(j.program),c.setVAO(null),V=j.id,(U=R[V])?U.call(this,t,r):(U=R[V]=n(j)).call(this,t,r),c.setVAO(null),D&&(e.cpuTime+=performance.now()-F)}}}},{}],500:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt){"use strict";var _t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae;return _t=t.gl,wt=t.context,t.strings,At=t.next,kt=t.current,Tt=t.draw,Mt=t.elements,St=t.buffer,zt=t.shader,Et=t.attributes,Lt=t.vao,Ct=t.uniforms,Pt=t.framebuffer,Ot=t.extensions,t.timer,It=t.isBufferArgs,Dt=At.blend_color,Rt=kt.blend_color,Ft=At.blend_equation,Bt=kt.blend_equation,Nt=At.blend_func,jt=kt.blend_func,Vt=At.depth_range,Ut=kt.depth_range,Ht=At.colorMask,qt=kt.colorMask,Gt=At.polygonOffset_offset,Wt=kt.polygonOffset_offset,Yt=At.sample_coverage,Zt=kt.sample_coverage,Xt=At.stencil_func,Jt=kt.stencil_func,Kt=At.stencil_opFront,Qt=kt.stencil_opFront,$t=At.stencil_opBack,te=kt.stencil_opBack,ee=At.scissor_box,re=kt.scissor_box,ne=At.viewport,ie=kt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ae={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},{draw:function(t){var R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,zt,Ct,Dt,Nt,ee,ne,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti;(Ot.angle_instanced_arrays,(R=Pt.next)!==Pt.cur&&(R?_t.bindFramebuffer(36160,R.framebuffer):_t.bindFramebuffer(36160,null),Pt.cur=R),kt.dirty)&&((Wn=At.dither)!==kt.dither&&(Wn?_t.enable(3024):_t.disable(3024),kt.dither=Wn),Yn=Ft[0],Zn=Ft[1],Yn===Bt[0]&&Zn===Bt[1]||(_t.blendEquationSeparate(Yn,Zn),Bt[0]=Yn,Bt[1]=Zn),(Xn=At.depth_func)!==kt.depth_func&&(_t.depthFunc(Xn),kt.depth_func=Xn),Jn=Vt[0],Kn=Vt[1],Jn===Ut[0]&&Kn===Ut[1]||(_t.depthRange(Jn,Kn),Ut[0]=Jn,Ut[1]=Kn),(Qn=At.depth_mask)!==kt.depth_mask&&(_t.depthMask(Qn),kt.depth_mask=Qn),$n=Ht[0],ti=Ht[1],ei=Ht[2],ri=Ht[3],$n===qt[0]&&ti===qt[1]&&ei===qt[2]&&ri===qt[3]||(_t.colorMask($n,ti,ei,ri),qt[0]=$n,qt[1]=ti,qt[2]=ei,qt[3]=ri),(ni=At.cull_enable)!==kt.cull_enable&&(ni?_t.enable(2884):_t.disable(2884),kt.cull_enable=ni),(ii=At.cull_face)!==kt.cull_face&&(_t.cullFace(ii),kt.cull_face=ii),(ai=At.frontFace)!==kt.frontFace&&(_t.frontFace(ai),kt.frontFace=ai),(oi=At.lineWidth)!==kt.lineWidth&&(_t.lineWidth(oi),kt.lineWidth=oi),(si=At.polygonOffset_enable)!==kt.polygonOffset_enable&&(si?_t.enable(32823):_t.disable(32823),kt.polygonOffset_enable=si),li=Gt[0],ci=Gt[1],li===Wt[0]&&ci===Wt[1]||(_t.polygonOffset(li,ci),Wt[0]=li,Wt[1]=ci),(ui=At.sample_alpha)!==kt.sample_alpha&&(ui?_t.enable(32926):_t.disable(32926),kt.sample_alpha=ui),(fi=At.sample_enable)!==kt.sample_enable&&(fi?_t.enable(32928):_t.disable(32928),kt.sample_enable=fi),pi=Yt[0],hi=Yt[1],pi===Zt[0]&&hi===Zt[1]||(_t.sampleCoverage(pi,hi),Zt[0]=pi,Zt[1]=hi),(di=At.stencil_mask)!==kt.stencil_mask&&(_t.stencilMask(di),kt.stencil_mask=di),mi=Xt[0],gi=Xt[1],yi=Xt[2],mi===Jt[0]&&gi===Jt[1]&&yi===Jt[2]||(_t.stencilFunc(mi,gi,yi),Jt[0]=mi,Jt[1]=gi,Jt[2]=yi),vi=Kt[0],bi=Kt[1],xi=Kt[2],_i=Kt[3],vi===Qt[0]&&bi===Qt[1]&&xi===Qt[2]&&_i===Qt[3]||(_t.stencilOpSeparate(vi,bi,xi,_i),Qt[0]=vi,Qt[1]=bi,Qt[2]=xi,Qt[3]=_i),wi=$t[0],Ai=$t[1],ki=$t[2],Ti=$t[3],wi===te[0]&&Ai===te[1]&&ki===te[2]&&Ti===te[3]||(_t.stencilOpSeparate(wi,Ai,ki,Ti),te[0]=wi,te[1]=Ai,te[2]=ki,te[3]=Ti));B=0|(F=t.viewport).x,N=0|F.y,j="width"in F?0|F.width:wt.framebufferWidth-B,V="height"in F?0|F.height:wt.framebufferHeight-N,U=wt.viewportWidth,wt.viewportWidth=j,H=wt.viewportHeight,wt.viewportHeight=V,_t.viewport(B,N,j,V),ie[0]=B,ie[1]=N,ie[2]=j,ie[3]=V,_t.blendColor(0,0,0,1),Rt[0]=0,Rt[1]=0,Rt[2]=0,Rt[3]=1,r?_t.enable(3042):_t.disable(3042),kt.blend_enable=r,_t.blendFuncSeparate(770,771,773,1),jt[0]=770,jt[1]=771,jt[2]=773,jt[3]=1,n?_t.enable(2929):_t.disable(2929),kt.depth_enable=n,G=0|(q=t.viewport).x,W=0|q.y,Y="width"in q?0|q.width:wt.framebufferWidth-G,Z="height"in q?0|q.height:wt.framebufferHeight-W,_t.scissor(G,W,Y,Z),re[0]=G,re[1]=W,re[2]=Y,re[3]=Z,i?_t.enable(3089):_t.disable(3089),kt.scissor_enable=i,a?_t.enable(2960):_t.disable(2960),kt.stencil_enable=a,(X=kt.profile)&&(J=performance.now(),e.count++),_t.useProgram(o.program),K=Ot.angle_instanced_arrays,Lt.setVAO(null),Q=s.call(this,wt,t,0),$=!1,tt=1,et=0,rt=0,nt=0,it=0,at=null,ot=0,st=!1,lt=5126,ct=0,ut=0,ft=0,It(Q)?($=!0,lt=(at=St.createStream(34962,Q)).dtype):(at=St.getBuffer(Q))?lt=at.dtype:"constant"in Q?(tt=2,"number"==typeof Q.constant?(et=Q.constant,rt=nt=it=0):(et=Q.constant.length>0?Q.constant[0]:0,rt=Q.constant.length>1?Q.constant[1]:0,nt=Q.constant.length>2?Q.constant[2]:0,it=Q.constant.length>3?Q.constant[3]:0)):(at=It(Q.buffer)?St.createStream(34962,Q.buffer):St.getBuffer(Q.buffer),lt="type"in Q?ae[Q.type]:at.dtype,st=!!Q.normalized,ot=0|Q.size,ct=0|Q.offset,ut=0|Q.stride,ft=0|Q.divisor),pt=l.location,ht=Et[pt],1===tt?(ht.buffer||_t.enableVertexAttribArray(pt),dt=ot||4,ht.type===lt&&ht.size===dt&&ht.buffer===at&&ht.normalized===st&&ht.offset===ct&&ht.stride===ut||(_t.bindBuffer(34962,at.buffer),_t.vertexAttribPointer(pt,dt,lt,st,ut,ct),ht.type=lt,ht.size=dt,ht.buffer=at,ht.normalized=st,ht.offset=ct,ht.stride=ut),ht.divisor!==ft&&(K.vertexAttribDivisorANGLE(pt,ft),ht.divisor=ft)):(ht.buffer&&(_t.disableVertexAttribArray(pt),ht.buffer=null),ht.x===et&&ht.y===rt&&ht.z===nt&&ht.w===it||(_t.vertexAttrib4f(pt,et,rt,nt,it),ht.x=et,ht.y=rt,ht.z=nt,ht.w=it)),mt=c.call(this,wt,t,0),gt=!1,yt=1,vt=0,bt=0,xt=0,zt=0,Ct=null,Dt=0,Nt=!1,ee=5126,ne=0,oe=0,se=0,It(mt)?(gt=!0,ee=(Ct=St.createStream(34962,mt)).dtype):(Ct=St.getBuffer(mt))?ee=Ct.dtype:"constant"in mt?(yt=2,"number"==typeof mt.constant?(vt=mt.constant,bt=xt=zt=0):(vt=mt.constant.length>0?mt.constant[0]:0,bt=mt.constant.length>1?mt.constant[1]:0,xt=mt.constant.length>2?mt.constant[2]:0,zt=mt.constant.length>3?mt.constant[3]:0)):(Ct=It(mt.buffer)?St.createStream(34962,mt.buffer):St.getBuffer(mt.buffer),ee="type"in mt?ae[mt.type]:Ct.dtype,Nt=!!mt.normalized,Dt=0|mt.size,ne=0|mt.offset,oe=0|mt.stride,se=0|mt.divisor),le=u.location,ce=Et[le],1===yt?(ce.buffer||_t.enableVertexAttribArray(le),ue=Dt||1,ce.type===ee&&ce.size===ue&&ce.buffer===Ct&&ce.normalized===Nt&&ce.offset===ne&&ce.stride===oe||(_t.bindBuffer(34962,Ct.buffer),_t.vertexAttribPointer(le,ue,ee,Nt,oe,ne),ce.type=ee,ce.size=ue,ce.buffer=Ct,ce.normalized=Nt,ce.offset=ne,ce.stride=oe),ce.divisor!==se&&(K.vertexAttribDivisorANGLE(le,se),ce.divisor=se)):(ce.buffer&&(_t.disableVertexAttribArray(le),ce.buffer=null),ce.x===vt&&ce.y===bt&&ce.z===xt&&ce.w===zt||(_t.vertexAttrib4f(le,vt,bt,xt,zt),ce.x=vt,ce.y=bt,ce.z=xt,ce.w=zt)),fe=f.call(this,wt,t,0),pe=!1,he=1,de=0,me=0,ge=0,ye=0,ve=null,be=0,xe=!1,_e=5126,we=0,Ae=0,ke=0,It(fe)?(pe=!0,_e=(ve=St.createStream(34962,fe)).dtype):(ve=St.getBuffer(fe))?_e=ve.dtype:"constant"in fe?(he=2,"number"==typeof fe.constant?(de=fe.constant,me=ge=ye=0):(de=fe.constant.length>0?fe.constant[0]:0,me=fe.constant.length>1?fe.constant[1]:0,ge=fe.constant.length>2?fe.constant[2]:0,ye=fe.constant.length>3?fe.constant[3]:0)):(ve=It(fe.buffer)?St.createStream(34962,fe.buffer):St.getBuffer(fe.buffer),_e="type"in fe?ae[fe.type]:ve.dtype,xe=!!fe.normalized,be=0|fe.size,we=0|fe.offset,Ae=0|fe.stride,ke=0|fe.divisor),Te=p.location,Me=Et[Te],1===he?(Me.buffer||_t.enableVertexAttribArray(Te),Se=be||4,Me.type===_e&&Me.size===Se&&Me.buffer===ve&&Me.normalized===xe&&Me.offset===we&&Me.stride===Ae||(_t.bindBuffer(34962,ve.buffer),_t.vertexAttribPointer(Te,Se,_e,xe,Ae,we),Me.type=_e,Me.size=Se,Me.buffer=ve,Me.normalized=xe,Me.offset=we,Me.stride=Ae),Me.divisor!==ke&&(K.vertexAttribDivisorANGLE(Te,ke),Me.divisor=ke)):(Me.buffer&&(_t.disableVertexAttribArray(Te),Me.buffer=null),Me.x===de&&Me.y===me&&Me.z===ge&&Me.w===ye||(_t.vertexAttrib4f(Te,de,me,ge,ye),Me.x=de,Me.y=me,Me.z=ge,Me.w=ye)),ze=h.call(this,wt,t,0),Ee=!1,Le=1,Ce=0,Pe=0,Oe=0,Ie=0,De=null,Re=0,Fe=!1,Be=5126,Ne=0,je=0,Ve=0,It(ze)?(Ee=!0,Be=(De=St.createStream(34962,ze)).dtype):(De=St.getBuffer(ze))?Be=De.dtype:"constant"in ze?(Le=2,"number"==typeof ze.constant?(Ce=ze.constant,Pe=Oe=Ie=0):(Ce=ze.constant.length>0?ze.constant[0]:0,Pe=ze.constant.length>1?ze.constant[1]:0,Oe=ze.constant.length>2?ze.constant[2]:0,Ie=ze.constant.length>3?ze.constant[3]:0)):(De=It(ze.buffer)?St.createStream(34962,ze.buffer):St.getBuffer(ze.buffer),Be="type"in ze?ae[ze.type]:De.dtype,Fe=!!ze.normalized,Re=0|ze.size,Ne=0|ze.offset,je=0|ze.stride,Ve=0|ze.divisor),Ue=d.location,He=Et[Ue],1===Le?(He.buffer||_t.enableVertexAttribArray(Ue),qe=Re||1,He.type===Be&&He.size===qe&&He.buffer===De&&He.normalized===Fe&&He.offset===Ne&&He.stride===je||(_t.bindBuffer(34962,De.buffer),_t.vertexAttribPointer(Ue,qe,Be,Fe,je,Ne),He.type=Be,He.size=qe,He.buffer=De,He.normalized=Fe,He.offset=Ne,He.stride=je),He.divisor!==Ve&&(K.vertexAttribDivisorANGLE(Ue,Ve),He.divisor=Ve)):(He.buffer&&(_t.disableVertexAttribArray(Ue),He.buffer=null),He.x===Ce&&He.y===Pe&&He.z===Oe&&He.w===Ie||(_t.vertexAttrib4f(Ue,Ce,Pe,Oe,Ie),He.x=Ce,He.y=Pe,He.z=Oe,He.w=Ie)),Ge=m.call(this,wt,t,0),We=!1,Ye=1,Ze=0,Xe=0,Je=0,Ke=0,Qe=null,$e=0,tr=!1,er=5126,rr=0,nr=0,ir=0,It(Ge)?(We=!0,er=(Qe=St.createStream(34962,Ge)).dtype):(Qe=St.getBuffer(Ge))?er=Qe.dtype:"constant"in Ge?(Ye=2,"number"==typeof Ge.constant?(Ze=Ge.constant,Xe=Je=Ke=0):(Ze=Ge.constant.length>0?Ge.constant[0]:0,Xe=Ge.constant.length>1?Ge.constant[1]:0,Je=Ge.constant.length>2?Ge.constant[2]:0,Ke=Ge.constant.length>3?Ge.constant[3]:0)):(Qe=It(Ge.buffer)?St.createStream(34962,Ge.buffer):St.getBuffer(Ge.buffer),er="type"in Ge?ae[Ge.type]:Qe.dtype,tr=!!Ge.normalized,$e=0|Ge.size,rr=0|Ge.offset,nr=0|Ge.stride,ir=0|Ge.divisor),ar=g.location,or=Et[ar],1===Ye?(or.buffer||_t.enableVertexAttribArray(ar),sr=$e||1,or.type===er&&or.size===sr&&or.buffer===Qe&&or.normalized===tr&&or.offset===rr&&or.stride===nr||(_t.bindBuffer(34962,Qe.buffer),_t.vertexAttribPointer(ar,sr,er,tr,nr,rr),or.type=er,or.size=sr,or.buffer=Qe,or.normalized=tr,or.offset=rr,or.stride=nr),or.divisor!==ir&&(K.vertexAttribDivisorANGLE(ar,ir),or.divisor=ir)):(or.buffer&&(_t.disableVertexAttribArray(ar),or.buffer=null),or.x===Ze&&or.y===Xe&&or.z===Je&&or.w===Ke||(_t.vertexAttrib4f(ar,Ze,Xe,Je,Ke),or.x=Ze,or.y=Xe,or.z=Je,or.w=Ke)),lr=y.call(this,wt,t,0),cr=!1,ur=1,fr=0,pr=0,hr=0,dr=0,mr=null,gr=0,yr=!1,vr=5126,br=0,xr=0,_r=0,It(lr)?(cr=!0,vr=(mr=St.createStream(34962,lr)).dtype):(mr=St.getBuffer(lr))?vr=mr.dtype:"constant"in lr?(ur=2,"number"==typeof lr.constant?(fr=lr.constant,pr=hr=dr=0):(fr=lr.constant.length>0?lr.constant[0]:0,pr=lr.constant.length>1?lr.constant[1]:0,hr=lr.constant.length>2?lr.constant[2]:0,dr=lr.constant.length>3?lr.constant[3]:0)):(mr=It(lr.buffer)?St.createStream(34962,lr.buffer):St.getBuffer(lr.buffer),vr="type"in lr?ae[lr.type]:mr.dtype,yr=!!lr.normalized,gr=0|lr.size,br=0|lr.offset,xr=0|lr.stride,_r=0|lr.divisor),wr=v.location,Ar=Et[wr],1===ur?(Ar.buffer||_t.enableVertexAttribArray(wr),kr=gr||1,Ar.type===vr&&Ar.size===kr&&Ar.buffer===mr&&Ar.normalized===yr&&Ar.offset===br&&Ar.stride===xr||(_t.bindBuffer(34962,mr.buffer),_t.vertexAttribPointer(wr,kr,vr,yr,xr,br),Ar.type=vr,Ar.size=kr,Ar.buffer=mr,Ar.normalized=yr,Ar.offset=br,Ar.stride=xr),Ar.divisor!==_r&&(K.vertexAttribDivisorANGLE(wr,_r),Ar.divisor=_r)):(Ar.buffer&&(_t.disableVertexAttribArray(wr),Ar.buffer=null),Ar.x===fr&&Ar.y===pr&&Ar.z===hr&&Ar.w===dr||(_t.vertexAttrib4f(wr,fr,pr,hr,dr),Ar.x=fr,Ar.y=pr,Ar.z=hr,Ar.w=dr)),Tr=b.call(this,wt,t,0),Mr=!1,Sr=1,zr=0,Er=0,Lr=0,Cr=0,Pr=null,Or=0,Ir=!1,Dr=5126,Rr=0,Fr=0,Br=0,It(Tr)?(Mr=!0,Dr=(Pr=St.createStream(34962,Tr)).dtype):(Pr=St.getBuffer(Tr))?Dr=Pr.dtype:"constant"in Tr?(Sr=2,"number"==typeof Tr.constant?(zr=Tr.constant,Er=Lr=Cr=0):(zr=Tr.constant.length>0?Tr.constant[0]:0,Er=Tr.constant.length>1?Tr.constant[1]:0,Lr=Tr.constant.length>2?Tr.constant[2]:0,Cr=Tr.constant.length>3?Tr.constant[3]:0)):(Pr=It(Tr.buffer)?St.createStream(34962,Tr.buffer):St.getBuffer(Tr.buffer),Dr="type"in Tr?ae[Tr.type]:Pr.dtype,Ir=!!Tr.normalized,Or=0|Tr.size,Rr=0|Tr.offset,Fr=0|Tr.stride,Br=0|Tr.divisor),Nr=x.location,jr=Et[Nr],1===Sr?(jr.buffer||_t.enableVertexAttribArray(Nr),Vr=Or||1,jr.type===Dr&&jr.size===Vr&&jr.buffer===Pr&&jr.normalized===Ir&&jr.offset===Rr&&jr.stride===Fr||(_t.bindBuffer(34962,Pr.buffer),_t.vertexAttribPointer(Nr,Vr,Dr,Ir,Fr,Rr),jr.type=Dr,jr.size=Vr,jr.buffer=Pr,jr.normalized=Ir,jr.offset=Rr,jr.stride=Fr),jr.divisor!==Br&&(K.vertexAttribDivisorANGLE(Nr,Br),jr.divisor=Br)):(jr.buffer&&(_t.disableVertexAttribArray(Nr),jr.buffer=null),jr.x===zr&&jr.y===Er&&jr.z===Lr&&jr.w===Cr||(_t.vertexAttrib4f(Nr,zr,Er,Lr,Cr),jr.x=zr,jr.y=Er,jr.z=Lr,jr.w=Cr)),Ur=_.call(this,wt,t,0),Hr=!1,qr=1,Gr=0,Wr=0,Yr=0,Zr=0,Xr=null,Jr=0,Kr=!1,Qr=5126,$r=0,tn=0,en=0,It(Ur)?(Hr=!0,Qr=(Xr=St.createStream(34962,Ur)).dtype):(Xr=St.getBuffer(Ur))?Qr=Xr.dtype:"constant"in Ur?(qr=2,"number"==typeof Ur.constant?(Gr=Ur.constant,Wr=Yr=Zr=0):(Gr=Ur.constant.length>0?Ur.constant[0]:0,Wr=Ur.constant.length>1?Ur.constant[1]:0,Yr=Ur.constant.length>2?Ur.constant[2]:0,Zr=Ur.constant.length>3?Ur.constant[3]:0)):(Xr=It(Ur.buffer)?St.createStream(34962,Ur.buffer):St.getBuffer(Ur.buffer),Qr="type"in Ur?ae[Ur.type]:Xr.dtype,Kr=!!Ur.normalized,Jr=0|Ur.size,$r=0|Ur.offset,tn=0|Ur.stride,en=0|Ur.divisor),rn=w.location,nn=Et[rn],1===qr?(nn.buffer||_t.enableVertexAttribArray(rn),an=Jr||1,nn.type===Qr&&nn.size===an&&nn.buffer===Xr&&nn.normalized===Kr&&nn.offset===$r&&nn.stride===tn||(_t.bindBuffer(34962,Xr.buffer),_t.vertexAttribPointer(rn,an,Qr,Kr,tn,$r),nn.type=Qr,nn.size=an,nn.buffer=Xr,nn.normalized=Kr,nn.offset=$r,nn.stride=tn),nn.divisor!==en&&(K.vertexAttribDivisorANGLE(rn,en),nn.divisor=en)):(nn.buffer&&(_t.disableVertexAttribArray(rn),nn.buffer=null),nn.x===Gr&&nn.y===Wr&&nn.z===Yr&&nn.w===Zr||(_t.vertexAttrib4f(rn,Gr,Wr,Yr,Zr),nn.x=Gr,nn.y=Wr,nn.z=Yr,nn.w=Zr)),on=A.call(this,wt,t,0),sn=!1,ln=1,cn=0,un=0,fn=0,pn=0,hn=null,dn=0,mn=!1,gn=5126,yn=0,vn=0,bn=0,It(on)?(sn=!0,gn=(hn=St.createStream(34962,on)).dtype):(hn=St.getBuffer(on))?gn=hn.dtype:"constant"in on?(ln=2,"number"==typeof on.constant?(cn=on.constant,un=fn=pn=0):(cn=on.constant.length>0?on.constant[0]:0,un=on.constant.length>1?on.constant[1]:0,fn=on.constant.length>2?on.constant[2]:0,pn=on.constant.length>3?on.constant[3]:0)):(hn=It(on.buffer)?St.createStream(34962,on.buffer):St.getBuffer(on.buffer),gn="type"in on?ae[on.type]:hn.dtype,mn=!!on.normalized,dn=0|on.size,yn=0|on.offset,vn=0|on.stride,bn=0|on.divisor),xn=k.location,_n=Et[xn],1===ln?(_n.buffer||_t.enableVertexAttribArray(xn),wn=dn||1,_n.type===gn&&_n.size===wn&&_n.buffer===hn&&_n.normalized===mn&&_n.offset===yn&&_n.stride===vn||(_t.bindBuffer(34962,hn.buffer),_t.vertexAttribPointer(xn,wn,gn,mn,vn,yn),_n.type=gn,_n.size=wn,_n.buffer=hn,_n.normalized=mn,_n.offset=yn,_n.stride=vn),_n.divisor!==bn&&(K.vertexAttribDivisorANGLE(xn,bn),_n.divisor=bn)):(_n.buffer&&(_t.disableVertexAttribArray(xn),_n.buffer=null),_n.x===cn&&_n.y===un&&_n.z===fn&&_n.w===pn||(_t.vertexAttrib4f(xn,cn,un,fn,pn),_n.x=cn,_n.y=un,_n.z=fn,_n.w=pn)),_t.uniform1i(T.location,!1),An=t.opacity,_t.uniform1f(M.location,An),Tn=(kn=z.call(this,wt,t,0))[0],Mn=kn[1],_t.uniform2f(S.location,Tn,Mn),_t.uniform1i(E.location,L.bind()),Sn=wt.pixelRatio,_t.uniform1f(C.location,Sn),En=(zn=t.scale)[0],Ln=zn[1],_t.uniform2f(P.location,En,Ln),Pn=(Cn=t.scaleFract)[0],On=Cn[1],_t.uniform2f(O.location,Pn,On),Dn=(In=t.translate)[0],Rn=In[1],_t.uniform2f(I.location,Dn,Rn),Bn=(Fn=t.translateFract)[0],Nn=Fn[1],_t.uniform2f(D.location,Bn,Nn),jn=t.elements,Vn=null,(Vn=(Un=It(jn))?Mt.createStream(jn):Mt.getElements(jn))&&_t.bindBuffer(34963,Vn.buffer.buffer),Hn=t.offset,(qn=t.count)&&((Gn=Tt.instances)>0?Vn?K.drawElementsInstancedANGLE(0,qn,Vn.type,Hn<<(Vn.type-5121>>1),Gn):K.drawArraysInstancedANGLE(0,Hn,qn,Gn):Gn<0&&(Vn?_t.drawElements(0,qn,Vn.type,Hn<<(Vn.type-5121>>1)):_t.drawArrays(0,Hn,qn)),kt.dirty=!0,Lt.setVAO(null),wt.viewportWidth=U,wt.viewportHeight=H,X&&(e.cpuTime+=performance.now()-J),$&&St.destroyStream(at),gt&&St.destroyStream(Ct),pe&&St.destroyStream(ve),Ee&&St.destroyStream(De),We&&St.destroyStream(Qe),cr&&St.destroyStream(mr),Mr&&St.destroyStream(Pr),Hr&&St.destroyStream(Xr),sn&&St.destroyStream(hn),L.unbind(),Un&&Mt.destroyStream(Vn))},scope:function(t,r,n){var i,a,o,l,u,p,d,g,v,x,w,k,T,M,S,E,L,C,P,O,I,D,yt,vt,bt,xt,_t,Et,Lt,Pt,Ot,Rt,Ft,Bt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,re,ie,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi,Ei,Li,Ci,Pi,Oi,Ii,Di,Ri,Fi,Bi,Ni,ji,Vi,Ui,Hi,qi,Gi,Wi,Yi,Zi,Xi,Ji,Ki,Qi,$i,ta,ea,ra,na,ia,aa,oa,sa,la,ca,ua,fa,pa,ha,da,ma,ga,ya,va,ba,xa,_a,wa,Aa,ka,Ta,Ma,Sa,za,Ea,La,Ca,Pa,Oa,Ia,Da,Ra;a=0|(i=t.viewport).x,o=0|i.y,l="width"in i?0|i.width:wt.framebufferWidth-a,u="height"in i?0|i.height:wt.framebufferHeight-o,p=wt.viewportWidth,wt.viewportWidth=l,d=wt.viewportHeight,wt.viewportHeight=u,g=ne[0],ne[0]=a,v=ne[1],ne[1]=o,x=ne[2],ne[2]=l,w=ne[3],ne[3]=u,k=Dt[0],Dt[0]=R,T=Dt[1],Dt[1]=F,M=Dt[2],Dt[2]=B,S=Dt[3],Dt[3]=N,E=At.blend_enable,At.blend_enable=j,L=Nt[0],Nt[0]=V,C=Nt[1],Nt[1]=U,P=Nt[2],Nt[2]=H,O=Nt[3],Nt[3]=q,I=At.depth_enable,At.depth_enable=G,yt=0|(D=t.viewport).x,vt=0|D.y,bt="width"in D?0|D.width:wt.framebufferWidth-yt,xt="height"in D?0|D.height:wt.framebufferHeight-vt,_t=ee[0],ee[0]=yt,Et=ee[1],ee[1]=vt,Lt=ee[2],ee[2]=bt,Pt=ee[3],ee[3]=xt,Ot=At.scissor_enable,At.scissor_enable=W,Rt=At.stencil_enable,At.stencil_enable=Y,(Ft=kt.profile)&&(Bt=performance.now(),e.count++),jt=t.elements,Vt=null,Vt=(Ut=It(jt))?Mt.createStream(jt):Mt.getElements(jt),Ht=Tt.elements,Tt.elements=Vt,qt=t.offset,Gt=Tt.offset,Tt.offset=qt,Wt=t.count,Yt=Tt.count,Tt.count=Wt,Zt=Tt.primitive,Tt.primitive=Z,Xt=Ct[X],Ct[X]=!1,Jt=Ct[K],Ct[K]=J,Kt=t.opacity,Qt=Ct[Q],Ct[Q]=Kt,$t=z.call(this,wt,t,n),te=Ct[$],Ct[$]=$t,re=wt.pixelRatio,ie=Ct[tt],Ct[tt]=re,oe=t.scale,se=Ct[et],Ct[et]=oe,le=t.scaleFract,ce=Ct[rt],Ct[rt]=le,ue=t.translate,fe=Ct[nt],Ct[nt]=ue,pe=t.translateFract,he=Ct[it],Ct[it]=pe,de=t.markerTexture,me=Ct[at],Ct[at]=de,ge=y.call(this,wt,t,n),ye=!1,ve=1,be=0,xe=0,_e=0,we=0,Ae=null,ke=0,Te=!1,Me=5126,Se=0,ze=0,Ee=0,It(ge)?(ye=!0,Me=(Ae=St.createStream(34962,ge)).dtype):(Ae=St.getBuffer(ge))?Me=Ae.dtype:"constant"in ge?(ve=2,"number"==typeof ge.constant?(be=ge.constant,xe=_e=we=0):(be=ge.constant.length>0?ge.constant[0]:0,xe=ge.constant.length>1?ge.constant[1]:0,_e=ge.constant.length>2?ge.constant[2]:0,we=ge.constant.length>3?ge.constant[3]:0)):(Ae=It(ge.buffer)?St.createStream(34962,ge.buffer):St.getBuffer(ge.buffer),Me="type"in ge?ae[ge.type]:Ae.dtype,Te=!!ge.normalized,ke=0|ge.size,Se=0|ge.offset,ze=0|ge.stride,Ee=0|ge.divisor),Le=ot.state,ot.state=ve,Ce=ot.x,ot.x=be,Pe=ot.y,ot.y=xe,Oe=ot.z,ot.z=_e,Ie=ot.w,ot.w=we,De=ot.buffer,ot.buffer=Ae,Re=ot.size,ot.size=ke,Fe=ot.normalized,ot.normalized=Te,Be=ot.type,ot.type=Me,Ne=ot.offset,ot.offset=Se,je=ot.stride,ot.stride=ze,Ve=ot.divisor,ot.divisor=Ee,Ue=_.call(this,wt,t,n),He=!1,qe=1,Ge=0,We=0,Ye=0,Ze=0,Xe=null,Je=0,Ke=!1,Qe=5126,$e=0,tr=0,er=0,It(Ue)?(He=!0,Qe=(Xe=St.createStream(34962,Ue)).dtype):(Xe=St.getBuffer(Ue))?Qe=Xe.dtype:"constant"in Ue?(qe=2,"number"==typeof Ue.constant?(Ge=Ue.constant,We=Ye=Ze=0):(Ge=Ue.constant.length>0?Ue.constant[0]:0,We=Ue.constant.length>1?Ue.constant[1]:0,Ye=Ue.constant.length>2?Ue.constant[2]:0,Ze=Ue.constant.length>3?Ue.constant[3]:0)):(Xe=It(Ue.buffer)?St.createStream(34962,Ue.buffer):St.getBuffer(Ue.buffer),Qe="type"in Ue?ae[Ue.type]:Xe.dtype,Ke=!!Ue.normalized,Je=0|Ue.size,$e=0|Ue.offset,tr=0|Ue.stride,er=0|Ue.divisor),rr=st.state,st.state=qe,nr=st.x,st.x=Ge,ir=st.y,st.y=We,ar=st.z,st.z=Ye,or=st.w,st.w=Ze,sr=st.buffer,st.buffer=Xe,lr=st.size,st.size=Je,cr=st.normalized,st.normalized=Ke,ur=st.type,st.type=Qe,fr=st.offset,st.offset=$e,pr=st.stride,st.stride=tr,hr=st.divisor,st.divisor=er,dr=b.call(this,wt,t,n),mr=!1,gr=1,yr=0,vr=0,br=0,xr=0,_r=null,wr=0,Ar=!1,kr=5126,Tr=0,Mr=0,Sr=0,It(dr)?(mr=!0,kr=(_r=St.createStream(34962,dr)).dtype):(_r=St.getBuffer(dr))?kr=_r.dtype:"constant"in dr?(gr=2,"number"==typeof dr.constant?(yr=dr.constant,vr=br=xr=0):(yr=dr.constant.length>0?dr.constant[0]:0,vr=dr.constant.length>1?dr.constant[1]:0,br=dr.constant.length>2?dr.constant[2]:0,xr=dr.constant.length>3?dr.constant[3]:0)):(_r=It(dr.buffer)?St.createStream(34962,dr.buffer):St.getBuffer(dr.buffer),kr="type"in dr?ae[dr.type]:_r.dtype,Ar=!!dr.normalized,wr=0|dr.size,Tr=0|dr.offset,Mr=0|dr.stride,Sr=0|dr.divisor),zr=lt.state,lt.state=gr,Er=lt.x,lt.x=yr,Lr=lt.y,lt.y=vr,Cr=lt.z,lt.z=br,Pr=lt.w,lt.w=xr,Or=lt.buffer,lt.buffer=_r,Ir=lt.size,lt.size=wr,Dr=lt.normalized,lt.normalized=Ar,Rr=lt.type,lt.type=kr,Fr=lt.offset,lt.offset=Tr,Br=lt.stride,lt.stride=Mr,Nr=lt.divisor,lt.divisor=Sr,jr=A.call(this,wt,t,n),Vr=!1,Ur=1,Hr=0,qr=0,Gr=0,Wr=0,Yr=null,Zr=0,Xr=!1,Jr=5126,Kr=0,Qr=0,$r=0,It(jr)?(Vr=!0,Jr=(Yr=St.createStream(34962,jr)).dtype):(Yr=St.getBuffer(jr))?Jr=Yr.dtype:"constant"in jr?(Ur=2,"number"==typeof jr.constant?(Hr=jr.constant,qr=Gr=Wr=0):(Hr=jr.constant.length>0?jr.constant[0]:0,qr=jr.constant.length>1?jr.constant[1]:0,Gr=jr.constant.length>2?jr.constant[2]:0,Wr=jr.constant.length>3?jr.constant[3]:0)):(Yr=It(jr.buffer)?St.createStream(34962,jr.buffer):St.getBuffer(jr.buffer),Jr="type"in jr?ae[jr.type]:Yr.dtype,Xr=!!jr.normalized,Zr=0|jr.size,Kr=0|jr.offset,Qr=0|jr.stride,$r=0|jr.divisor),tn=ct.state,ct.state=Ur,en=ct.x,ct.x=Hr,rn=ct.y,ct.y=qr,nn=ct.z,ct.z=Gr,an=ct.w,ct.w=Wr,on=ct.buffer,ct.buffer=Yr,sn=ct.size,ct.size=Zr,ln=ct.normalized,ct.normalized=Xr,cn=ct.type,ct.type=Jr,un=ct.offset,ct.offset=Kr,fn=ct.stride,ct.stride=Qr,pn=ct.divisor,ct.divisor=$r,hn=m.call(this,wt,t,n),dn=!1,mn=1,gn=0,yn=0,vn=0,bn=0,xn=null,_n=0,wn=!1,An=5126,kn=0,Tn=0,Mn=0,It(hn)?(dn=!0,An=(xn=St.createStream(34962,hn)).dtype):(xn=St.getBuffer(hn))?An=xn.dtype:"constant"in hn?(mn=2,"number"==typeof hn.constant?(gn=hn.constant,yn=vn=bn=0):(gn=hn.constant.length>0?hn.constant[0]:0,yn=hn.constant.length>1?hn.constant[1]:0,vn=hn.constant.length>2?hn.constant[2]:0,bn=hn.constant.length>3?hn.constant[3]:0)):(xn=It(hn.buffer)?St.createStream(34962,hn.buffer):St.getBuffer(hn.buffer),An="type"in hn?ae[hn.type]:xn.dtype,wn=!!hn.normalized,_n=0|hn.size,kn=0|hn.offset,Tn=0|hn.stride,Mn=0|hn.divisor),Sn=ut.state,ut.state=mn,zn=ut.x,ut.x=gn,En=ut.y,ut.y=yn,Ln=ut.z,ut.z=vn,Cn=ut.w,ut.w=bn,Pn=ut.buffer,ut.buffer=xn,On=ut.size,ut.size=_n,In=ut.normalized,ut.normalized=wn,Dn=ut.type,ut.type=An,Rn=ut.offset,ut.offset=kn,Fn=ut.stride,ut.stride=Tn,Bn=ut.divisor,ut.divisor=Mn,Nn=c.call(this,wt,t,n),jn=!1,Vn=1,Un=0,Hn=0,qn=0,Gn=0,Wn=null,Yn=0,Zn=!1,Xn=5126,Jn=0,Kn=0,Qn=0,It(Nn)?(jn=!0,Xn=(Wn=St.createStream(34962,Nn)).dtype):(Wn=St.getBuffer(Nn))?Xn=Wn.dtype:"constant"in Nn?(Vn=2,"number"==typeof Nn.constant?(Un=Nn.constant,Hn=qn=Gn=0):(Un=Nn.constant.length>0?Nn.constant[0]:0,Hn=Nn.constant.length>1?Nn.constant[1]:0,qn=Nn.constant.length>2?Nn.constant[2]:0,Gn=Nn.constant.length>3?Nn.constant[3]:0)):(Wn=It(Nn.buffer)?St.createStream(34962,Nn.buffer):St.getBuffer(Nn.buffer),Xn="type"in Nn?ae[Nn.type]:Wn.dtype,Zn=!!Nn.normalized,Yn=0|Nn.size,Jn=0|Nn.offset,Kn=0|Nn.stride,Qn=0|Nn.divisor),$n=ft.state,ft.state=Vn,ti=ft.x,ft.x=Un,ei=ft.y,ft.y=Hn,ri=ft.z,ft.z=qn,ni=ft.w,ft.w=Gn,ii=ft.buffer,ft.buffer=Wn,ai=ft.size,ft.size=Yn,oi=ft.normalized,ft.normalized=Zn,si=ft.type,ft.type=Xn,li=ft.offset,ft.offset=Jn,ci=ft.stride,ft.stride=Kn,ui=ft.divisor,ft.divisor=Qn,fi=f.call(this,wt,t,n),pi=!1,hi=1,di=0,mi=0,gi=0,yi=0,vi=null,bi=0,xi=!1,_i=5126,wi=0,Ai=0,ki=0,It(fi)?(pi=!0,_i=(vi=St.createStream(34962,fi)).dtype):(vi=St.getBuffer(fi))?_i=vi.dtype:"constant"in fi?(hi=2,"number"==typeof fi.constant?(di=fi.constant,mi=gi=yi=0):(di=fi.constant.length>0?fi.constant[0]:0,mi=fi.constant.length>1?fi.constant[1]:0,gi=fi.constant.length>2?fi.constant[2]:0,yi=fi.constant.length>3?fi.constant[3]:0)):(vi=It(fi.buffer)?St.createStream(34962,fi.buffer):St.getBuffer(fi.buffer),_i="type"in fi?ae[fi.type]:vi.dtype,xi=!!fi.normalized,bi=0|fi.size,wi=0|fi.offset,Ai=0|fi.stride,ki=0|fi.divisor),Ti=pt.state,pt.state=hi,Mi=pt.x,pt.x=di,Si=pt.y,pt.y=mi,zi=pt.z,pt.z=gi,Ei=pt.w,pt.w=yi,Li=pt.buffer,pt.buffer=vi,Ci=pt.size,pt.size=bi,Pi=pt.normalized,pt.normalized=xi,Oi=pt.type,pt.type=_i,Ii=pt.offset,pt.offset=wi,Di=pt.stride,pt.stride=Ai,Ri=pt.divisor,pt.divisor=ki,Fi=s.call(this,wt,t,n),Bi=!1,Ni=1,ji=0,Vi=0,Ui=0,Hi=0,qi=null,Gi=0,Wi=!1,Yi=5126,Zi=0,Xi=0,Ji=0,It(Fi)?(Bi=!0,Yi=(qi=St.createStream(34962,Fi)).dtype):(qi=St.getBuffer(Fi))?Yi=qi.dtype:"constant"in Fi?(Ni=2,"number"==typeof Fi.constant?(ji=Fi.constant,Vi=Ui=Hi=0):(ji=Fi.constant.length>0?Fi.constant[0]:0,Vi=Fi.constant.length>1?Fi.constant[1]:0,Ui=Fi.constant.length>2?Fi.constant[2]:0,Hi=Fi.constant.length>3?Fi.constant[3]:0)):(qi=It(Fi.buffer)?St.createStream(34962,Fi.buffer):St.getBuffer(Fi.buffer),Yi="type"in Fi?ae[Fi.type]:qi.dtype,Wi=!!Fi.normalized,Gi=0|Fi.size,Zi=0|Fi.offset,Xi=0|Fi.stride,Ji=0|Fi.divisor),Ki=ht.state,ht.state=Ni,Qi=ht.x,ht.x=ji,$i=ht.y,ht.y=Vi,ta=ht.z,ht.z=Ui,ea=ht.w,ht.w=Hi,ra=ht.buffer,ht.buffer=qi,na=ht.size,ht.size=Gi,ia=ht.normalized,ht.normalized=Wi,aa=ht.type,ht.type=Yi,oa=ht.offset,ht.offset=Zi,sa=ht.stride,ht.stride=Xi,la=ht.divisor,ht.divisor=Ji,ca=h.call(this,wt,t,n),ua=!1,fa=1,pa=0,ha=0,da=0,ma=0,ga=null,ya=0,va=!1,ba=5126,xa=0,_a=0,wa=0,It(ca)?(ua=!0,ba=(ga=St.createStream(34962,ca)).dtype):(ga=St.getBuffer(ca))?ba=ga.dtype:"constant"in ca?(fa=2,"number"==typeof ca.constant?(pa=ca.constant,ha=da=ma=0):(pa=ca.constant.length>0?ca.constant[0]:0,ha=ca.constant.length>1?ca.constant[1]:0,da=ca.constant.length>2?ca.constant[2]:0,ma=ca.constant.length>3?ca.constant[3]:0)):(ga=It(ca.buffer)?St.createStream(34962,ca.buffer):St.getBuffer(ca.buffer),ba="type"in ca?ae[ca.type]:ga.dtype,va=!!ca.normalized,ya=0|ca.size,xa=0|ca.offset,_a=0|ca.stride,wa=0|ca.divisor),Aa=dt.state,dt.state=fa,ka=dt.x,dt.x=pa,Ta=dt.y,dt.y=ha,Ma=dt.z,dt.z=da,Sa=dt.w,dt.w=ma,za=dt.buffer,dt.buffer=ga,Ea=dt.size,dt.size=ya,La=dt.normalized,dt.normalized=va,Ca=dt.type,dt.type=ba,Pa=dt.offset,dt.offset=xa,Oa=dt.stride,dt.stride=_a,Ia=dt.divisor,dt.divisor=wa,Da=zt.vert,zt.vert=mt,Ra=zt.frag,zt.frag=gt,kt.dirty=!0,r(wt,t,n),wt.viewportWidth=p,wt.viewportHeight=d,ne[0]=g,ne[1]=v,ne[2]=x,ne[3]=w,Dt[0]=k,Dt[1]=T,Dt[2]=M,Dt[3]=S,At.blend_enable=E,Nt[0]=L,Nt[1]=C,Nt[2]=P,Nt[3]=O,At.depth_enable=I,ee[0]=_t,ee[1]=Et,ee[2]=Lt,ee[3]=Pt,At.scissor_enable=Ot,At.stencil_enable=Rt,Ft&&(e.cpuTime+=performance.now()-Bt),Ut&&Mt.destroyStream(Vt),Tt.elements=Ht,Tt.offset=Gt,Tt.count=Yt,Tt.primitive=Zt,Ct[X]=Xt,Ct[K]=Jt,Ct[Q]=Qt,Ct[$]=te,Ct[tt]=ie,Ct[et]=se,Ct[rt]=ce,Ct[nt]=fe,Ct[it]=he,Ct[at]=me,ye&&St.destroyStream(Ae),ot.state=Le,ot.x=Ce,ot.y=Pe,ot.z=Oe,ot.w=Ie,ot.buffer=De,ot.size=Re,ot.normalized=Fe,ot.type=Be,ot.offset=Ne,ot.stride=je,ot.divisor=Ve,He&&St.destroyStream(Xe),st.state=rr,st.x=nr,st.y=ir,st.z=ar,st.w=or,st.buffer=sr,st.size=lr,st.normalized=cr,st.type=ur,st.offset=fr,st.stride=pr,st.divisor=hr,mr&&St.destroyStream(_r),lt.state=zr,lt.x=Er,lt.y=Lr,lt.z=Cr,lt.w=Pr,lt.buffer=Or,lt.size=Ir,lt.normalized=Dr,lt.type=Rr,lt.offset=Fr,lt.stride=Br,lt.divisor=Nr,Vr&&St.destroyStream(Yr),ct.state=tn,ct.x=en,ct.y=rn,ct.z=nn,ct.w=an,ct.buffer=on,ct.size=sn,ct.normalized=ln,ct.type=cn,ct.offset=un,ct.stride=fn,ct.divisor=pn,dn&&St.destroyStream(xn),ut.state=Sn,ut.x=zn,ut.y=En,ut.z=Ln,ut.w=Cn,ut.buffer=Pn,ut.size=On,ut.normalized=In,ut.type=Dn,ut.offset=Rn,ut.stride=Fn,ut.divisor=Bn,jn&&St.destroyStream(Wn),ft.state=$n,ft.x=ti,ft.y=ei,ft.z=ri,ft.w=ni,ft.buffer=ii,ft.size=ai,ft.normalized=oi,ft.type=si,ft.offset=li,ft.stride=ci,ft.divisor=ui,pi&&St.destroyStream(vi),pt.state=Ti,pt.x=Mi,pt.y=Si,pt.z=zi,pt.w=Ei,pt.buffer=Li,pt.size=Ci,pt.normalized=Pi,pt.type=Oi,pt.offset=Ii,pt.stride=Di,pt.divisor=Ri,Bi&&St.destroyStream(qi),ht.state=Ki,ht.x=Qi,ht.y=$i,ht.z=ta,ht.w=ea,ht.buffer=ra,ht.size=na,ht.normalized=ia,ht.type=aa,ht.offset=oa,ht.stride=sa,ht.divisor=la,ua&&St.destroyStream(ga),dt.state=Aa,dt.x=ka,dt.y=Ta,dt.z=Ma,dt.w=Sa,dt.buffer=za,dt.size=Ea,dt.normalized=La,dt.type=Ca,dt.offset=Pa,dt.stride=Oa,dt.divisor=Ia,zt.vert=Da,zt.frag=Ra,kt.dirty=!0},batch:function(t,r){var n,i,a,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,zt,Ct,Dt;(Ot.angle_instanced_arrays,(n=Pt.next)!==Pt.cur&&(n?_t.bindFramebuffer(36160,n.framebuffer):_t.bindFramebuffer(36160,null),Pt.cur=n),kt.dirty)&&((N=At.dither)!==kt.dither&&(N?_t.enable(3024):_t.disable(3024),kt.dither=N),j=Ft[0],V=Ft[1],j===Bt[0]&&V===Bt[1]||(_t.blendEquationSeparate(j,V),Bt[0]=j,Bt[1]=V),(U=At.depth_func)!==kt.depth_func&&(_t.depthFunc(U),kt.depth_func=U),H=Vt[0],q=Vt[1],H===Ut[0]&&q===Ut[1]||(_t.depthRange(H,q),Ut[0]=H,Ut[1]=q),(G=At.depth_mask)!==kt.depth_mask&&(_t.depthMask(G),kt.depth_mask=G),W=Ht[0],Y=Ht[1],Z=Ht[2],X=Ht[3],W===qt[0]&&Y===qt[1]&&Z===qt[2]&&X===qt[3]||(_t.colorMask(W,Y,Z,X),qt[0]=W,qt[1]=Y,qt[2]=Z,qt[3]=X),(J=At.cull_enable)!==kt.cull_enable&&(J?_t.enable(2884):_t.disable(2884),kt.cull_enable=J),(K=At.cull_face)!==kt.cull_face&&(_t.cullFace(K),kt.cull_face=K),(Q=At.frontFace)!==kt.frontFace&&(_t.frontFace(Q),kt.frontFace=Q),($=At.lineWidth)!==kt.lineWidth&&(_t.lineWidth($),kt.lineWidth=$),(tt=At.polygonOffset_enable)!==kt.polygonOffset_enable&&(tt?_t.enable(32823):_t.disable(32823),kt.polygonOffset_enable=tt),et=Gt[0],rt=Gt[1],et===Wt[0]&&rt===Wt[1]||(_t.polygonOffset(et,rt),Wt[0]=et,Wt[1]=rt),(nt=At.sample_alpha)!==kt.sample_alpha&&(nt?_t.enable(32926):_t.disable(32926),kt.sample_alpha=nt),(it=At.sample_enable)!==kt.sample_enable&&(it?_t.enable(32928):_t.disable(32928),kt.sample_enable=it),at=Yt[0],ot=Yt[1],at===Zt[0]&&ot===Zt[1]||(_t.sampleCoverage(at,ot),Zt[0]=at,Zt[1]=ot),(st=At.stencil_mask)!==kt.stencil_mask&&(_t.stencilMask(st),kt.stencil_mask=st),lt=Xt[0],ct=Xt[1],ut=Xt[2],lt===Jt[0]&&ct===Jt[1]&&ut===Jt[2]||(_t.stencilFunc(lt,ct,ut),Jt[0]=lt,Jt[1]=ct,Jt[2]=ut),ft=Kt[0],pt=Kt[1],ht=Kt[2],dt=Kt[3],ft===Qt[0]&&pt===Qt[1]&&ht===Qt[2]&&dt===Qt[3]||(_t.stencilOpSeparate(ft,pt,ht,dt),Qt[0]=ft,Qt[1]=pt,Qt[2]=ht,Qt[3]=dt),mt=$t[0],gt=$t[1],zt=$t[2],Ct=$t[3],mt===te[0]&>===te[1]&&zt===te[2]&&Ct===te[3]||(_t.stencilOpSeparate(mt,gt,zt,Ct),te[0]=mt,te[1]=gt,te[2]=zt,te[3]=Ct));for(_t.blendColor(0,0,0,1),Rt[0]=0,Rt[1]=0,Rt[2]=0,Rt[3]=1,yt?_t.enable(3042):_t.disable(3042),kt.blend_enable=yt,_t.blendFuncSeparate(770,771,773,1),jt[0]=770,jt[1]=771,jt[2]=773,jt[3]=1,vt?_t.enable(2929):_t.disable(2929),kt.depth_enable=vt,bt?_t.enable(3089):_t.disable(3089),kt.scissor_enable=bt,xt?_t.enable(2960):_t.disable(2960),kt.stencil_enable=xt,(i=kt.profile)&&(a=performance.now(),e.count+=r),_t.useProgram(o.program),R=Ot.angle_instanced_arrays,Lt.setVAO(null),_t.uniform1i(T.location,!1),_t.uniform1i(E.location,L.bind()),Dt=Tt.instances,F=0;F0?me.constant[0]:0,be=me.constant.length>1?me.constant[1]:0,xe=me.constant.length>2?me.constant[2]:0,_e=me.constant.length>3?me.constant[3]:0)):(we=It(me.buffer)?St.createStream(34962,me.buffer):St.getBuffer(me.buffer),Te="type"in me?ae[me.type]:we.dtype,ke=!!me.normalized,Ae=0|me.size,Me=0|me.offset,Se=0|me.stride,ze=0|me.divisor),Ee=l.location,Le=Et[Ee],1===ye?(Le.buffer||_t.enableVertexAttribArray(Ee),Ce=Ae||4,Le.type===Te&&Le.size===Ce&&Le.buffer===we&&Le.normalized===ke&&Le.offset===Me&&Le.stride===Se||(_t.bindBuffer(34962,we.buffer),_t.vertexAttribPointer(Ee,Ce,Te,ke,Se,Me),Le.type=Te,Le.size=Ce,Le.buffer=we,Le.normalized=ke,Le.offset=Me,Le.stride=Se),Le.divisor!==ze&&(R.vertexAttribDivisorANGLE(Ee,ze),Le.divisor=ze)):(Le.buffer&&(_t.disableVertexAttribArray(Ee),Le.buffer=null),Le.x===ve&&Le.y===be&&Le.z===xe&&Le.w===_e||(_t.vertexAttrib4f(Ee,ve,be,xe,_e),Le.x=ve,Le.y=be,Le.z=xe,Le.w=_e)),Pe=c.call(this,wt,B,F),Oe=!1,Ie=1,De=0,Re=0,Fe=0,Be=0,Ne=null,je=0,Ve=!1,Ue=5126,He=0,qe=0,Ge=0,It(Pe)?(Oe=!0,Ue=(Ne=St.createStream(34962,Pe)).dtype):(Ne=St.getBuffer(Pe))?Ue=Ne.dtype:"constant"in Pe?(Ie=2,"number"==typeof Pe.constant?(De=Pe.constant,Re=Fe=Be=0):(De=Pe.constant.length>0?Pe.constant[0]:0,Re=Pe.constant.length>1?Pe.constant[1]:0,Fe=Pe.constant.length>2?Pe.constant[2]:0,Be=Pe.constant.length>3?Pe.constant[3]:0)):(Ne=It(Pe.buffer)?St.createStream(34962,Pe.buffer):St.getBuffer(Pe.buffer),Ue="type"in Pe?ae[Pe.type]:Ne.dtype,Ve=!!Pe.normalized,je=0|Pe.size,He=0|Pe.offset,qe=0|Pe.stride,Ge=0|Pe.divisor),We=u.location,Ye=Et[We],1===Ie?(Ye.buffer||_t.enableVertexAttribArray(We),Ze=je||1,Ye.type===Ue&&Ye.size===Ze&&Ye.buffer===Ne&&Ye.normalized===Ve&&Ye.offset===He&&Ye.stride===qe||(_t.bindBuffer(34962,Ne.buffer),_t.vertexAttribPointer(We,Ze,Ue,Ve,qe,He),Ye.type=Ue,Ye.size=Ze,Ye.buffer=Ne,Ye.normalized=Ve,Ye.offset=He,Ye.stride=qe),Ye.divisor!==Ge&&(R.vertexAttribDivisorANGLE(We,Ge),Ye.divisor=Ge)):(Ye.buffer&&(_t.disableVertexAttribArray(We),Ye.buffer=null),Ye.x===De&&Ye.y===Re&&Ye.z===Fe&&Ye.w===Be||(_t.vertexAttrib4f(We,De,Re,Fe,Be),Ye.x=De,Ye.y=Re,Ye.z=Fe,Ye.w=Be)),Xe=f.call(this,wt,B,F),Je=!1,Ke=1,Qe=0,$e=0,tr=0,er=0,rr=null,nr=0,ir=!1,ar=5126,or=0,sr=0,lr=0,It(Xe)?(Je=!0,ar=(rr=St.createStream(34962,Xe)).dtype):(rr=St.getBuffer(Xe))?ar=rr.dtype:"constant"in Xe?(Ke=2,"number"==typeof Xe.constant?(Qe=Xe.constant,$e=tr=er=0):(Qe=Xe.constant.length>0?Xe.constant[0]:0,$e=Xe.constant.length>1?Xe.constant[1]:0,tr=Xe.constant.length>2?Xe.constant[2]:0,er=Xe.constant.length>3?Xe.constant[3]:0)):(rr=It(Xe.buffer)?St.createStream(34962,Xe.buffer):St.getBuffer(Xe.buffer),ar="type"in Xe?ae[Xe.type]:rr.dtype,ir=!!Xe.normalized,nr=0|Xe.size,or=0|Xe.offset,sr=0|Xe.stride,lr=0|Xe.divisor),cr=p.location,ur=Et[cr],1===Ke?(ur.buffer||_t.enableVertexAttribArray(cr),fr=nr||4,ur.type===ar&&ur.size===fr&&ur.buffer===rr&&ur.normalized===ir&&ur.offset===or&&ur.stride===sr||(_t.bindBuffer(34962,rr.buffer),_t.vertexAttribPointer(cr,fr,ar,ir,sr,or),ur.type=ar,ur.size=fr,ur.buffer=rr,ur.normalized=ir,ur.offset=or,ur.stride=sr),ur.divisor!==lr&&(R.vertexAttribDivisorANGLE(cr,lr),ur.divisor=lr)):(ur.buffer&&(_t.disableVertexAttribArray(cr),ur.buffer=null),ur.x===Qe&&ur.y===$e&&ur.z===tr&&ur.w===er||(_t.vertexAttrib4f(cr,Qe,$e,tr,er),ur.x=Qe,ur.y=$e,ur.z=tr,ur.w=er)),pr=h.call(this,wt,B,F),hr=!1,dr=1,mr=0,gr=0,yr=0,vr=0,br=null,xr=0,_r=!1,wr=5126,Ar=0,kr=0,Tr=0,It(pr)?(hr=!0,wr=(br=St.createStream(34962,pr)).dtype):(br=St.getBuffer(pr))?wr=br.dtype:"constant"in pr?(dr=2,"number"==typeof pr.constant?(mr=pr.constant,gr=yr=vr=0):(mr=pr.constant.length>0?pr.constant[0]:0,gr=pr.constant.length>1?pr.constant[1]:0,yr=pr.constant.length>2?pr.constant[2]:0,vr=pr.constant.length>3?pr.constant[3]:0)):(br=It(pr.buffer)?St.createStream(34962,pr.buffer):St.getBuffer(pr.buffer),wr="type"in pr?ae[pr.type]:br.dtype,_r=!!pr.normalized,xr=0|pr.size,Ar=0|pr.offset,kr=0|pr.stride,Tr=0|pr.divisor),Mr=d.location,Sr=Et[Mr],1===dr?(Sr.buffer||_t.enableVertexAttribArray(Mr),zr=xr||1,Sr.type===wr&&Sr.size===zr&&Sr.buffer===br&&Sr.normalized===_r&&Sr.offset===Ar&&Sr.stride===kr||(_t.bindBuffer(34962,br.buffer),_t.vertexAttribPointer(Mr,zr,wr,_r,kr,Ar),Sr.type=wr,Sr.size=zr,Sr.buffer=br,Sr.normalized=_r,Sr.offset=Ar,Sr.stride=kr),Sr.divisor!==Tr&&(R.vertexAttribDivisorANGLE(Mr,Tr),Sr.divisor=Tr)):(Sr.buffer&&(_t.disableVertexAttribArray(Mr),Sr.buffer=null),Sr.x===mr&&Sr.y===gr&&Sr.z===yr&&Sr.w===vr||(_t.vertexAttrib4f(Mr,mr,gr,yr,vr),Sr.x=mr,Sr.y=gr,Sr.z=yr,Sr.w=vr)),Er=m.call(this,wt,B,F),Lr=!1,Cr=1,Pr=0,Or=0,Ir=0,Dr=0,Rr=null,Fr=0,Br=!1,Nr=5126,jr=0,Vr=0,Ur=0,It(Er)?(Lr=!0,Nr=(Rr=St.createStream(34962,Er)).dtype):(Rr=St.getBuffer(Er))?Nr=Rr.dtype:"constant"in Er?(Cr=2,"number"==typeof Er.constant?(Pr=Er.constant,Or=Ir=Dr=0):(Pr=Er.constant.length>0?Er.constant[0]:0,Or=Er.constant.length>1?Er.constant[1]:0,Ir=Er.constant.length>2?Er.constant[2]:0,Dr=Er.constant.length>3?Er.constant[3]:0)):(Rr=It(Er.buffer)?St.createStream(34962,Er.buffer):St.getBuffer(Er.buffer),Nr="type"in Er?ae[Er.type]:Rr.dtype,Br=!!Er.normalized,Fr=0|Er.size,jr=0|Er.offset,Vr=0|Er.stride,Ur=0|Er.divisor),Hr=g.location,qr=Et[Hr],1===Cr?(qr.buffer||_t.enableVertexAttribArray(Hr),Gr=Fr||1,qr.type===Nr&&qr.size===Gr&&qr.buffer===Rr&&qr.normalized===Br&&qr.offset===jr&&qr.stride===Vr||(_t.bindBuffer(34962,Rr.buffer),_t.vertexAttribPointer(Hr,Gr,Nr,Br,Vr,jr),qr.type=Nr,qr.size=Gr,qr.buffer=Rr,qr.normalized=Br,qr.offset=jr,qr.stride=Vr),qr.divisor!==Ur&&(R.vertexAttribDivisorANGLE(Hr,Ur),qr.divisor=Ur)):(qr.buffer&&(_t.disableVertexAttribArray(Hr),qr.buffer=null),qr.x===Pr&&qr.y===Or&&qr.z===Ir&&qr.w===Dr||(_t.vertexAttrib4f(Hr,Pr,Or,Ir,Dr),qr.x=Pr,qr.y=Or,qr.z=Ir,qr.w=Dr)),Wr=y.call(this,wt,B,F),Yr=!1,Zr=1,Xr=0,Jr=0,Kr=0,Qr=0,$r=null,tn=0,en=!1,rn=5126,nn=0,an=0,on=0,It(Wr)?(Yr=!0,rn=($r=St.createStream(34962,Wr)).dtype):($r=St.getBuffer(Wr))?rn=$r.dtype:"constant"in Wr?(Zr=2,"number"==typeof Wr.constant?(Xr=Wr.constant,Jr=Kr=Qr=0):(Xr=Wr.constant.length>0?Wr.constant[0]:0,Jr=Wr.constant.length>1?Wr.constant[1]:0,Kr=Wr.constant.length>2?Wr.constant[2]:0,Qr=Wr.constant.length>3?Wr.constant[3]:0)):($r=It(Wr.buffer)?St.createStream(34962,Wr.buffer):St.getBuffer(Wr.buffer),rn="type"in Wr?ae[Wr.type]:$r.dtype,en=!!Wr.normalized,tn=0|Wr.size,nn=0|Wr.offset,an=0|Wr.stride,on=0|Wr.divisor),sn=v.location,ln=Et[sn],1===Zr?(ln.buffer||_t.enableVertexAttribArray(sn),cn=tn||1,ln.type===rn&&ln.size===cn&&ln.buffer===$r&&ln.normalized===en&&ln.offset===nn&&ln.stride===an||(_t.bindBuffer(34962,$r.buffer),_t.vertexAttribPointer(sn,cn,rn,en,an,nn),ln.type=rn,ln.size=cn,ln.buffer=$r,ln.normalized=en,ln.offset=nn,ln.stride=an),ln.divisor!==on&&(R.vertexAttribDivisorANGLE(sn,on),ln.divisor=on)):(ln.buffer&&(_t.disableVertexAttribArray(sn),ln.buffer=null),ln.x===Xr&&ln.y===Jr&&ln.z===Kr&&ln.w===Qr||(_t.vertexAttrib4f(sn,Xr,Jr,Kr,Qr),ln.x=Xr,ln.y=Jr,ln.z=Kr,ln.w=Qr)),un=b.call(this,wt,B,F),fn=!1,pn=1,hn=0,dn=0,mn=0,gn=0,yn=null,vn=0,bn=!1,xn=5126,_n=0,wn=0,An=0,It(un)?(fn=!0,xn=(yn=St.createStream(34962,un)).dtype):(yn=St.getBuffer(un))?xn=yn.dtype:"constant"in un?(pn=2,"number"==typeof un.constant?(hn=un.constant,dn=mn=gn=0):(hn=un.constant.length>0?un.constant[0]:0,dn=un.constant.length>1?un.constant[1]:0,mn=un.constant.length>2?un.constant[2]:0,gn=un.constant.length>3?un.constant[3]:0)):(yn=It(un.buffer)?St.createStream(34962,un.buffer):St.getBuffer(un.buffer),xn="type"in un?ae[un.type]:yn.dtype,bn=!!un.normalized,vn=0|un.size,_n=0|un.offset,wn=0|un.stride,An=0|un.divisor),kn=x.location,Tn=Et[kn],1===pn?(Tn.buffer||_t.enableVertexAttribArray(kn),Mn=vn||1,Tn.type===xn&&Tn.size===Mn&&Tn.buffer===yn&&Tn.normalized===bn&&Tn.offset===_n&&Tn.stride===wn||(_t.bindBuffer(34962,yn.buffer),_t.vertexAttribPointer(kn,Mn,xn,bn,wn,_n),Tn.type=xn,Tn.size=Mn,Tn.buffer=yn,Tn.normalized=bn,Tn.offset=_n,Tn.stride=wn),Tn.divisor!==An&&(R.vertexAttribDivisorANGLE(kn,An),Tn.divisor=An)):(Tn.buffer&&(_t.disableVertexAttribArray(kn),Tn.buffer=null),Tn.x===hn&&Tn.y===dn&&Tn.z===mn&&Tn.w===gn||(_t.vertexAttrib4f(kn,hn,dn,mn,gn),Tn.x=hn,Tn.y=dn,Tn.z=mn,Tn.w=gn)),Sn=_.call(this,wt,B,F),zn=!1,En=1,Ln=0,Cn=0,Pn=0,On=0,In=null,Dn=0,Rn=!1,Fn=5126,Bn=0,Nn=0,jn=0,It(Sn)?(zn=!0,Fn=(In=St.createStream(34962,Sn)).dtype):(In=St.getBuffer(Sn))?Fn=In.dtype:"constant"in Sn?(En=2,"number"==typeof Sn.constant?(Ln=Sn.constant,Cn=Pn=On=0):(Ln=Sn.constant.length>0?Sn.constant[0]:0,Cn=Sn.constant.length>1?Sn.constant[1]:0,Pn=Sn.constant.length>2?Sn.constant[2]:0,On=Sn.constant.length>3?Sn.constant[3]:0)):(In=It(Sn.buffer)?St.createStream(34962,Sn.buffer):St.getBuffer(Sn.buffer),Fn="type"in Sn?ae[Sn.type]:In.dtype,Rn=!!Sn.normalized,Dn=0|Sn.size,Bn=0|Sn.offset,Nn=0|Sn.stride,jn=0|Sn.divisor),Vn=w.location,Un=Et[Vn],1===En?(Un.buffer||_t.enableVertexAttribArray(Vn),Hn=Dn||1,Un.type===Fn&&Un.size===Hn&&Un.buffer===In&&Un.normalized===Rn&&Un.offset===Bn&&Un.stride===Nn||(_t.bindBuffer(34962,In.buffer),_t.vertexAttribPointer(Vn,Hn,Fn,Rn,Nn,Bn),Un.type=Fn,Un.size=Hn,Un.buffer=In,Un.normalized=Rn,Un.offset=Bn,Un.stride=Nn),Un.divisor!==jn&&(R.vertexAttribDivisorANGLE(Vn,jn),Un.divisor=jn)):(Un.buffer&&(_t.disableVertexAttribArray(Vn),Un.buffer=null),Un.x===Ln&&Un.y===Cn&&Un.z===Pn&&Un.w===On||(_t.vertexAttrib4f(Vn,Ln,Cn,Pn,On),Un.x=Ln,Un.y=Cn,Un.z=Pn,Un.w=On)),qn=A.call(this,wt,B,F),Gn=!1,Wn=1,Yn=0,Zn=0,Xn=0,Jn=0,Kn=null,Qn=0,$n=!1,ti=5126,ei=0,ri=0,ni=0,It(qn)?(Gn=!0,ti=(Kn=St.createStream(34962,qn)).dtype):(Kn=St.getBuffer(qn))?ti=Kn.dtype:"constant"in qn?(Wn=2,"number"==typeof qn.constant?(Yn=qn.constant,Zn=Xn=Jn=0):(Yn=qn.constant.length>0?qn.constant[0]:0,Zn=qn.constant.length>1?qn.constant[1]:0,Xn=qn.constant.length>2?qn.constant[2]:0,Jn=qn.constant.length>3?qn.constant[3]:0)):(Kn=It(qn.buffer)?St.createStream(34962,qn.buffer):St.getBuffer(qn.buffer),ti="type"in qn?ae[qn.type]:Kn.dtype,$n=!!qn.normalized,Qn=0|qn.size,ei=0|qn.offset,ri=0|qn.stride,ni=0|qn.divisor),ii=k.location,ai=Et[ii],1===Wn?(ai.buffer||_t.enableVertexAttribArray(ii),oi=Qn||1,ai.type===ti&&ai.size===oi&&ai.buffer===Kn&&ai.normalized===$n&&ai.offset===ei&&ai.stride===ri||(_t.bindBuffer(34962,Kn.buffer),_t.vertexAttribPointer(ii,oi,ti,$n,ri,ei),ai.type=ti,ai.size=oi,ai.buffer=Kn,ai.normalized=$n,ai.offset=ei,ai.stride=ri),ai.divisor!==ni&&(R.vertexAttribDivisorANGLE(ii,ni),ai.divisor=ni)):(ai.buffer&&(_t.disableVertexAttribArray(ii),ai.buffer=null),ai.x===Yn&&ai.y===Zn&&ai.z===Xn&&ai.w===Jn||(_t.vertexAttrib4f(ii,Yn,Zn,Xn,Jn),ai.x=Yn,ai.y=Zn,ai.z=Xn,ai.w=Jn)),si=B.opacity,F&&li===si||(li=si,_t.uniform1f(M.location,si)),ui=(ci=z.call(this,wt,B,F))[0],pi=ci[1],F&&fi===ui&&hi===pi||(fi=ui,hi=pi,_t.uniform2f(S.location,ui,pi)),di=wt.pixelRatio,F&&mi===di||(mi=di,_t.uniform1f(C.location,di)),yi=(gi=B.scale)[0],bi=gi[1],F&&vi===yi&&xi===bi||(vi=yi,xi=bi,_t.uniform2f(P.location,yi,bi)),wi=(_i=B.scaleFract)[0],ki=_i[1],F&&Ai===wi&&Ti===ki||(Ai=wi,Ti=ki,_t.uniform2f(O.location,wi,ki)),Si=(Mi=B.translate)[0],Ei=Mi[1],F&&zi===Si&&Li===Ei||(zi=Si,Li=Ei,_t.uniform2f(I.location,Si,Ei)),Pi=(Ci=B.translateFract)[0],Ii=Ci[1],F&&Oi===Pi&&Di===Ii||(Oi=Pi,Di=Ii,_t.uniform2f(D.location,Pi,Ii)),Ri=B.elements,Fi=null,(Fi=(Bi=It(Ri))?Mt.createStream(Ri):Mt.getElements(Ri))&&_t.bindBuffer(34963,Fi.buffer.buffer),Ni=B.offset,(ji=B.count)&&(Dt>0?Fi?R.drawElementsInstancedANGLE(0,ji,Fi.type,Ni<<(Fi.type-5121>>1),Dt):R.drawArraysInstancedANGLE(0,Ni,ji,Dt):Dt<0&&(Fi?_t.drawElements(0,ji,Fi.type,Ni<<(Fi.type-5121>>1)):_t.drawArrays(0,Ni,ji)),wt.viewportWidth=le,wt.viewportHeight=ce,ge&&St.destroyStream(we),Oe&&St.destroyStream(Ne),Je&&St.destroyStream(rr),hr&&St.destroyStream(br),Lr&&St.destroyStream(Rr),Yr&&St.destroyStream($r),fn&&St.destroyStream(yn),zn&&St.destroyStream(In),Gn&&St.destroyStream(Kn),Bi&&Mt.destroyStream(Fi))}L.unbind(),kt.dirty=!0,Lt.setVAO(null),i&&(e.cpuTime+=performance.now()-a)}}}},{}],501:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s){"use strict";var l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V;return l=t.gl,c=t.context,t.strings,u=t.next,f=t.current,t.draw,t.elements,t.buffer,p=t.shader,t.attributes,h=t.vao,t.uniforms,d=t.framebuffer,m=t.extensions,t.timer,t.isBufferArgs,g=u.blend_color,y=f.blend_color,v=u.blend_equation,b=f.blend_equation,x=u.blend_func,_=f.blend_func,w=u.depth_range,A=f.depth_range,k=u.colorMask,T=f.colorMask,M=u.polygonOffset_offset,S=f.polygonOffset_offset,z=u.sample_coverage,E=f.sample_coverage,L=u.stencil_func,C=f.stencil_func,P=u.stencil_opFront,O=f.stencil_opFront,I=u.stencil_opBack,D=f.stencil_opBack,R=u.scissor_box,F=f.scissor_box,B=u.viewport,N=f.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},{int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},j={},V={},{draw:function(t){var n,i,a,o,s,R,B,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht;(m.angle_instanced_arrays,n=t.framebuffer,i=d.getFramebuffer(n),a=d.next,d.next=i,o=c.framebufferWidth,c.framebufferWidth=i?i.width:c.drawingBufferWidth,s=c.framebufferHeight,c.framebufferHeight=i?i.height:c.drawingBufferHeight,i!==d.cur&&(i?l.bindFramebuffer(36160,i.framebuffer):l.bindFramebuffer(36160,null),d.cur=i),f.dirty)&&((Q=u.dither)!==f.dither&&(Q?l.enable(3024):l.disable(3024),f.dither=Q),($=u.blend_enable)!==f.blend_enable&&($?l.enable(3042):l.disable(3042),f.blend_enable=$),tt=g[0],et=g[1],rt=g[2],nt=g[3],tt===y[0]&&et===y[1]&&rt===y[2]&&nt===y[3]||(l.blendColor(tt,et,rt,nt),y[0]=tt,y[1]=et,y[2]=rt,y[3]=nt),it=v[0],at=v[1],it===b[0]&&at===b[1]||(l.blendEquationSeparate(it,at),b[0]=it,b[1]=at),ot=x[0],st=x[1],lt=x[2],ct=x[3],ot===_[0]&&st===_[1]&<===_[2]&&ct===_[3]||(l.blendFuncSeparate(ot,st,lt,ct),_[0]=ot,_[1]=st,_[2]=lt,_[3]=ct),(ut=u.depth_enable)!==f.depth_enable&&(ut?l.enable(2929):l.disable(2929),f.depth_enable=ut),(ft=u.depth_func)!==f.depth_func&&(l.depthFunc(ft),f.depth_func=ft),pt=w[0],ht=w[1],pt===A[0]&&ht===A[1]||(l.depthRange(pt,ht),A[0]=pt,A[1]=ht),(dt=u.depth_mask)!==f.depth_mask&&(l.depthMask(dt),f.depth_mask=dt),mt=k[0],gt=k[1],yt=k[2],vt=k[3],mt===T[0]&>===T[1]&&yt===T[2]&&vt===T[3]||(l.colorMask(mt,gt,yt,vt),T[0]=mt,T[1]=gt,T[2]=yt,T[3]=vt),(bt=u.cull_enable)!==f.cull_enable&&(bt?l.enable(2884):l.disable(2884),f.cull_enable=bt),(xt=u.cull_face)!==f.cull_face&&(l.cullFace(xt),f.cull_face=xt),(_t=u.frontFace)!==f.frontFace&&(l.frontFace(_t),f.frontFace=_t),(wt=u.lineWidth)!==f.lineWidth&&(l.lineWidth(wt),f.lineWidth=wt),(At=u.polygonOffset_enable)!==f.polygonOffset_enable&&(At?l.enable(32823):l.disable(32823),f.polygonOffset_enable=At),kt=M[0],Tt=M[1],kt===S[0]&&Tt===S[1]||(l.polygonOffset(kt,Tt),S[0]=kt,S[1]=Tt),(Mt=u.sample_alpha)!==f.sample_alpha&&(Mt?l.enable(32926):l.disable(32926),f.sample_alpha=Mt),(St=u.sample_enable)!==f.sample_enable&&(St?l.enable(32928):l.disable(32928),f.sample_enable=St),zt=z[0],Et=z[1],zt===E[0]&&Et===E[1]||(l.sampleCoverage(zt,Et),E[0]=zt,E[1]=Et),(Lt=u.stencil_enable)!==f.stencil_enable&&(Lt?l.enable(2960):l.disable(2960),f.stencil_enable=Lt),(Ct=u.stencil_mask)!==f.stencil_mask&&(l.stencilMask(Ct),f.stencil_mask=Ct),Pt=L[0],Ot=L[1],It=L[2],Pt===C[0]&&Ot===C[1]&&It===C[2]||(l.stencilFunc(Pt,Ot,It),C[0]=Pt,C[1]=Ot,C[2]=It),Dt=P[0],Rt=P[1],Ft=P[2],Bt=P[3],Dt===O[0]&&Rt===O[1]&&Ft===O[2]&&Bt===O[3]||(l.stencilOpSeparate(Dt,Rt,Ft,Bt),O[0]=Dt,O[1]=Rt,O[2]=Ft,O[3]=Bt),Nt=I[0],jt=I[1],Vt=I[2],Ut=I[3],Nt===D[0]&&jt===D[1]&&Vt===D[2]&&Ut===D[3]||(l.stencilOpSeparate(Nt,jt,Vt,Ut),D[0]=Nt,D[1]=jt,D[2]=Vt,D[3]=Ut),(Ht=u.scissor_enable)!==f.scissor_enable&&(Ht?l.enable(3089):l.disable(3089),f.scissor_enable=Ht));R=c.framebufferWidth,B=c.framebufferHeight,V=c.viewportWidth,c.viewportWidth=R,U=c.viewportHeight,c.viewportHeight=B,l.viewport(0,0,R,B),N[0]=0,N[1]=0,N[2]=R,N[3]=B,H=c.framebufferWidth,q=c.framebufferHeight,l.scissor(0,0,H,q),F[0]=0,F[1]=0,F[2]=H,F[3]=q,(G=f.profile)&&(W=performance.now(),e.count++),Y=p.frag,Z=p.vert,X=p.program(Z,Y),l.useProgram(X.program),h.setVAO(null),J=X.id,(K=j[J])?K.call(this,t):(K=j[J]=r(X)).call(this,t),f.dirty=!0,h.setVAO(null),d.next=a,c.framebufferWidth=o,c.framebufferHeight=s,c.viewportWidth=V,c.viewportHeight=U,G&&(e.cpuTime+=performance.now()-W)},scope:function(t,r,s){var l,u,p,h,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C;l=t.framebuffer,u=d.getFramebuffer(l),p=d.next,d.next=u,h=c.framebufferWidth,c.framebufferWidth=u?u.width:c.drawingBufferWidth,m=c.framebufferHeight,c.framebufferHeight=u?u.height:c.drawingBufferHeight,g=c.framebufferWidth,y=c.framebufferHeight,v=c.viewportWidth,c.viewportWidth=g,b=c.viewportHeight,c.viewportHeight=y,x=B[0],B[0]=n,_=B[1],B[1]=i,w=B[2],B[2]=g,A=B[3],B[3]=y,k=c.framebufferWidth,T=c.framebufferHeight,M=R[0],R[0]=a,S=R[1],R[1]=o,z=R[2],R[2]=k,E=R[3],R[3]=T,(L=f.profile)&&(C=performance.now(),e.count++),f.dirty=!0,r(c,t,s),d.next=p,c.framebufferWidth=h,c.framebufferHeight=m,c.viewportWidth=v,c.viewportHeight=b,B[0]=x,B[1]=_,B[2]=w,B[3]=A,R[0]=M,R[1]=S,R[2]=z,R[3]=E,L&&(e.cpuTime+=performance.now()-C),f.dirty=!0},batch:function(t,r){var n,i,a,o,c,d,R,F,B,N,j,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et;(m.angle_instanced_arrays,f.dirty)&&((F=u.dither)!==f.dither&&(F?l.enable(3024):l.disable(3024),f.dither=F),(B=u.blend_enable)!==f.blend_enable&&(B?l.enable(3042):l.disable(3042),f.blend_enable=B),N=g[0],j=g[1],U=g[2],H=g[3],N===y[0]&&j===y[1]&&U===y[2]&&H===y[3]||(l.blendColor(N,j,U,H),y[0]=N,y[1]=j,y[2]=U,y[3]=H),q=v[0],G=v[1],q===b[0]&&G===b[1]||(l.blendEquationSeparate(q,G),b[0]=q,b[1]=G),W=x[0],Y=x[1],Z=x[2],X=x[3],W===_[0]&&Y===_[1]&&Z===_[2]&&X===_[3]||(l.blendFuncSeparate(W,Y,Z,X),_[0]=W,_[1]=Y,_[2]=Z,_[3]=X),(J=u.depth_enable)!==f.depth_enable&&(J?l.enable(2929):l.disable(2929),f.depth_enable=J),(K=u.depth_func)!==f.depth_func&&(l.depthFunc(K),f.depth_func=K),Q=w[0],$=w[1],Q===A[0]&&$===A[1]||(l.depthRange(Q,$),A[0]=Q,A[1]=$),(tt=u.depth_mask)!==f.depth_mask&&(l.depthMask(tt),f.depth_mask=tt),et=k[0],rt=k[1],nt=k[2],it=k[3],et===T[0]&&rt===T[1]&&nt===T[2]&&it===T[3]||(l.colorMask(et,rt,nt,it),T[0]=et,T[1]=rt,T[2]=nt,T[3]=it),(at=u.cull_enable)!==f.cull_enable&&(at?l.enable(2884):l.disable(2884),f.cull_enable=at),(ot=u.cull_face)!==f.cull_face&&(l.cullFace(ot),f.cull_face=ot),(st=u.frontFace)!==f.frontFace&&(l.frontFace(st),f.frontFace=st),(lt=u.lineWidth)!==f.lineWidth&&(l.lineWidth(lt),f.lineWidth=lt),(ct=u.polygonOffset_enable)!==f.polygonOffset_enable&&(ct?l.enable(32823):l.disable(32823),f.polygonOffset_enable=ct),ut=M[0],ft=M[1],ut===S[0]&&ft===S[1]||(l.polygonOffset(ut,ft),S[0]=ut,S[1]=ft),(pt=u.sample_alpha)!==f.sample_alpha&&(pt?l.enable(32926):l.disable(32926),f.sample_alpha=pt),(ht=u.sample_enable)!==f.sample_enable&&(ht?l.enable(32928):l.disable(32928),f.sample_enable=ht),dt=z[0],mt=z[1],dt===E[0]&&mt===E[1]||(l.sampleCoverage(dt,mt),E[0]=dt,E[1]=mt),(gt=u.stencil_enable)!==f.stencil_enable&&(gt?l.enable(2960):l.disable(2960),f.stencil_enable=gt),(yt=u.stencil_mask)!==f.stencil_mask&&(l.stencilMask(yt),f.stencil_mask=yt),vt=L[0],bt=L[1],xt=L[2],vt===C[0]&&bt===C[1]&&xt===C[2]||(l.stencilFunc(vt,bt,xt),C[0]=vt,C[1]=bt,C[2]=xt),_t=P[0],wt=P[1],At=P[2],kt=P[3],_t===O[0]&&wt===O[1]&&At===O[2]&&kt===O[3]||(l.stencilOpSeparate(_t,wt,At,kt),O[0]=_t,O[1]=wt,O[2]=At,O[3]=kt),Tt=I[0],Mt=I[1],St=I[2],zt=I[3],Tt===D[0]&&Mt===D[1]&&St===D[2]&&zt===D[3]||(l.stencilOpSeparate(Tt,Mt,St,zt),D[0]=Tt,D[1]=Mt,D[2]=St,D[3]=zt),(Et=u.scissor_enable)!==f.scissor_enable&&(Et?l.enable(3089):l.disable(3089),f.scissor_enable=Et));(n=f.profile)&&(i=performance.now(),e.count+=r),a=p.frag,o=p.vert,c=p.program(o,a),l.useProgram(c.program),h.setVAO(null),d=c.id,(R=V[d])?R.call(this,t,r):(R=V[d]=s(c)).call(this,t,r),f.dirty=!0,h.setVAO(null),n&&(e.cpuTime+=performance.now()-i)}}}},{}],502:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt){"use strict";var At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe,se,le,ce,ue,fe,pe,he;return At=t.gl,kt=t.context,t.strings,Tt=t.next,Mt=t.current,St=t.draw,zt=t.elements,Et=t.buffer,Lt=t.shader,Ct=t.attributes,Pt=t.vao,Ot=t.uniforms,It=t.framebuffer,Dt=t.extensions,t.timer,Rt=t.isBufferArgs,Ft=Tt.blend_color,Bt=Mt.blend_color,Nt=Tt.blend_equation,jt=Mt.blend_equation,Vt=Tt.blend_func,Ut=Mt.blend_func,Ht=Tt.depth_range,qt=Mt.depth_range,Gt=Tt.colorMask,Wt=Mt.colorMask,Yt=Tt.polygonOffset_offset,Zt=Mt.polygonOffset_offset,Xt=Tt.sample_coverage,Jt=Mt.sample_coverage,Kt=Tt.stencil_func,Qt=Mt.stencil_func,$t=Tt.stencil_opFront,te=Mt.stencil_opFront,ee=Tt.stencil_opBack,re=Mt.stencil_opBack,ne=Tt.scissor_box,ie=Mt.scissor_box,ae=Tt.viewport,oe=Mt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},se={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(le={}).stride=4,le.offset=0,le.divisor=1,(ce={}).stride=4,ce.offset=4,ce.divisor=1,(ue={}).stride=8,ue.offset=0,ue.divisor=1,(fe={}).stride=8,fe.offset=8,fe.divisor=1,(pe={}).stride=8,pe.offset=16,pe.divisor=1,(he={}).stride=8,he.offset=24,he.divisor=1,{draw:function(t){var L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,wt,Lt,Ot,Ft,Nt,Vt,ne,ae,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn;(Dt.angle_instanced_arrays,(L=It.next)!==It.cur&&(L?At.bindFramebuffer(36160,L.framebuffer):At.bindFramebuffer(36160,null),It.cur=L),Mt.dirty)&&((Jr=Tt.dither)!==Mt.dither&&(Jr?At.enable(3024):At.disable(3024),Mt.dither=Jr),(Kr=Tt.depth_func)!==Mt.depth_func&&(At.depthFunc(Kr),Mt.depth_func=Kr),Qr=Ht[0],$r=Ht[1],Qr===qt[0]&&$r===qt[1]||(At.depthRange(Qr,$r),qt[0]=Qr,qt[1]=$r),(tn=Tt.depth_mask)!==Mt.depth_mask&&(At.depthMask(tn),Mt.depth_mask=tn),en=Gt[0],rn=Gt[1],nn=Gt[2],an=Gt[3],en===Wt[0]&&rn===Wt[1]&&nn===Wt[2]&&an===Wt[3]||(At.colorMask(en,rn,nn,an),Wt[0]=en,Wt[1]=rn,Wt[2]=nn,Wt[3]=an),(on=Tt.frontFace)!==Mt.frontFace&&(At.frontFace(on),Mt.frontFace=on),(sn=Tt.lineWidth)!==Mt.lineWidth&&(At.lineWidth(sn),Mt.lineWidth=sn),(ln=Tt.polygonOffset_enable)!==Mt.polygonOffset_enable&&(ln?At.enable(32823):At.disable(32823),Mt.polygonOffset_enable=ln),cn=Yt[0],un=Yt[1],cn===Zt[0]&&un===Zt[1]||(At.polygonOffset(cn,un),Zt[0]=cn,Zt[1]=un),(fn=Tt.sample_alpha)!==Mt.sample_alpha&&(fn?At.enable(32926):At.disable(32926),Mt.sample_alpha=fn),(pn=Tt.sample_enable)!==Mt.sample_enable&&(pn?At.enable(32928):At.disable(32928),Mt.sample_enable=pn),hn=Xt[0],dn=Xt[1],hn===Jt[0]&&dn===Jt[1]||(At.sampleCoverage(hn,dn),Jt[0]=hn,Jt[1]=dn),(mn=Tt.stencil_mask)!==Mt.stencil_mask&&(At.stencilMask(mn),Mt.stencil_mask=mn),gn=Kt[0],yn=Kt[1],vn=Kt[2],gn===Qt[0]&&yn===Qt[1]&&vn===Qt[2]||(At.stencilFunc(gn,yn,vn),Qt[0]=gn,Qt[1]=yn,Qt[2]=vn),bn=$t[0],xn=$t[1],_n=$t[2],wn=$t[3],bn===te[0]&&xn===te[1]&&_n===te[2]&&wn===te[3]||(At.stencilOpSeparate(bn,xn,_n,wn),te[0]=bn,te[1]=xn,te[2]=_n,te[3]=wn),An=ee[0],kn=ee[1],Tn=ee[2],Mn=ee[3],An===re[0]&&kn===re[1]&&Tn===re[2]&&Mn===re[3]||(At.stencilOpSeparate(An,kn,Tn,Mn),re[0]=An,re[1]=kn,re[2]=Tn,re[3]=Mn));P=0|(C=t.viewport).x,O=0|C.y,I="width"in C?0|C.width:kt.framebufferWidth-P,D="height"in C?0|C.height:kt.framebufferHeight-O,R=kt.viewportWidth,kt.viewportWidth=I,F=kt.viewportHeight,kt.viewportHeight=D,At.viewport(P,O,I,D),oe[0]=P,oe[1]=O,oe[2]=I,oe[3]=D,At.blendColor(0,0,0,0),Bt[0]=0,Bt[1]=0,Bt[2]=0,Bt[3]=0,r?At.enable(3042):At.disable(3042),Mt.blend_enable=r,At.blendEquationSeparate(32774,32774),jt[0]=32774,jt[1]=32774,At.blendFuncSeparate(770,771,773,1),Ut[0]=770,Ut[1]=771,Ut[2]=773,Ut[3]=1,n?At.enable(2884):At.disable(2884),Mt.cull_enable=n,At.cullFace(i),Mt.cull_face=i,(B=a.call(this,kt,t,0))?At.enable(2929):At.disable(2929),Mt.depth_enable=B,j=0|(N=t.viewport).x,V=0|N.y,U="width"in N?0|N.width:kt.framebufferWidth-j,H="height"in N?0|N.height:kt.framebufferHeight-V,At.scissor(j,V,U,H),ie[0]=j,ie[1]=V,ie[2]=U,ie[3]=H,o?At.enable(3089):At.disable(3089),Mt.scissor_enable=o,s?At.enable(2960):At.disable(2960),Mt.stencil_enable=s,(q=Mt.profile)&&(G=performance.now(),e.count++),At.useProgram(l.program),W=Dt.angle_instanced_arrays,Pt.setVAO(null),Y=t.colorBuffer,le.buffer=Y,Z=!1,X=1,J=0,K=0,Q=0,$=0,tt=null,et=0,rt=!1,nt=5126,it=0,at=0,ot=0,Rt(le)?(Z=!0,nt=(tt=Et.createStream(34962,le)).dtype):(tt=Et.getBuffer(le))?nt=tt.dtype:"constant"in le?(X=2,"number"==typeof le.constant?(J=le.constant,K=Q=$=0):(J=le.constant.length>0?le.constant[0]:0,K=le.constant.length>1?le.constant[1]:0,Q=le.constant.length>2?le.constant[2]:0,$=le.constant.length>3?le.constant[3]:0)):(tt=Rt(le.buffer)?Et.createStream(34962,le.buffer):Et.getBuffer(le.buffer),nt="type"in le?se[le.type]:tt.dtype,rt=!!le.normalized,et=0|le.size,it=0|le.offset,at=0|le.stride,ot=0|le.divisor),st=c.location,lt=Ct[st],1===X?(lt.buffer||At.enableVertexAttribArray(st),ct=et||4,lt.type===nt&<.size===ct&<.buffer===tt&<.normalized===rt&<.offset===it&<.stride===at||(At.bindBuffer(34962,tt.buffer),At.vertexAttribPointer(st,ct,nt,rt,at,it),lt.type=nt,lt.size=ct,lt.buffer=tt,lt.normalized=rt,lt.offset=it,lt.stride=at),lt.divisor!==ot&&(W.vertexAttribDivisorANGLE(st,ot),lt.divisor=ot)):(lt.buffer&&(At.disableVertexAttribArray(st),lt.buffer=null),lt.x===J&<.y===K&<.z===Q&<.w===$||(At.vertexAttrib4f(st,J,K,Q,$),lt.x=J,lt.y=K,lt.z=Q,lt.w=$)),ut=t.positionBuffer,fe.buffer=ut,ft=!1,pt=1,ht=0,dt=0,mt=0,gt=0,yt=null,vt=0,bt=!1,xt=5126,_t=0,wt=0,Lt=0,Rt(fe)?(ft=!0,xt=(yt=Et.createStream(34962,fe)).dtype):(yt=Et.getBuffer(fe))?xt=yt.dtype:"constant"in fe?(pt=2,"number"==typeof fe.constant?(ht=fe.constant,dt=mt=gt=0):(ht=fe.constant.length>0?fe.constant[0]:0,dt=fe.constant.length>1?fe.constant[1]:0,mt=fe.constant.length>2?fe.constant[2]:0,gt=fe.constant.length>3?fe.constant[3]:0)):(yt=Rt(fe.buffer)?Et.createStream(34962,fe.buffer):Et.getBuffer(fe.buffer),xt="type"in fe?se[fe.type]:yt.dtype,bt=!!fe.normalized,vt=0|fe.size,_t=0|fe.offset,wt=0|fe.stride,Lt=0|fe.divisor),Ot=u.location,Ft=Ct[Ot],1===pt?(Ft.buffer||At.enableVertexAttribArray(Ot),Nt=vt||2,Ft.type===xt&&Ft.size===Nt&&Ft.buffer===yt&&Ft.normalized===bt&&Ft.offset===_t&&Ft.stride===wt||(At.bindBuffer(34962,yt.buffer),At.vertexAttribPointer(Ot,Nt,xt,bt,wt,_t),Ft.type=xt,Ft.size=Nt,Ft.buffer=yt,Ft.normalized=bt,Ft.offset=_t,Ft.stride=wt),Ft.divisor!==Lt&&(W.vertexAttribDivisorANGLE(Ot,Lt),Ft.divisor=Lt)):(Ft.buffer&&(At.disableVertexAttribArray(Ot),Ft.buffer=null),Ft.x===ht&&Ft.y===dt&&Ft.z===mt&&Ft.w===gt||(At.vertexAttrib4f(Ot,ht,dt,mt,gt),Ft.x=ht,Ft.y=dt,Ft.z=mt,Ft.w=gt)),Vt=t.colorBuffer,ce.buffer=Vt,ne=!1,ae=1,de=0,me=0,ge=0,ye=0,ve=null,be=0,xe=!1,_e=5126,we=0,Ae=0,ke=0,Rt(ce)?(ne=!0,_e=(ve=Et.createStream(34962,ce)).dtype):(ve=Et.getBuffer(ce))?_e=ve.dtype:"constant"in ce?(ae=2,"number"==typeof ce.constant?(de=ce.constant,me=ge=ye=0):(de=ce.constant.length>0?ce.constant[0]:0,me=ce.constant.length>1?ce.constant[1]:0,ge=ce.constant.length>2?ce.constant[2]:0,ye=ce.constant.length>3?ce.constant[3]:0)):(ve=Rt(ce.buffer)?Et.createStream(34962,ce.buffer):Et.getBuffer(ce.buffer),_e="type"in ce?se[ce.type]:ve.dtype,xe=!!ce.normalized,be=0|ce.size,we=0|ce.offset,Ae=0|ce.stride,ke=0|ce.divisor),Te=f.location,Me=Ct[Te],1===ae?(Me.buffer||At.enableVertexAttribArray(Te),Se=be||4,Me.type===_e&&Me.size===Se&&Me.buffer===ve&&Me.normalized===xe&&Me.offset===we&&Me.stride===Ae||(At.bindBuffer(34962,ve.buffer),At.vertexAttribPointer(Te,Se,_e,xe,Ae,we),Me.type=_e,Me.size=Se,Me.buffer=ve,Me.normalized=xe,Me.offset=we,Me.stride=Ae),Me.divisor!==ke&&(W.vertexAttribDivisorANGLE(Te,ke),Me.divisor=ke)):(Me.buffer&&(At.disableVertexAttribArray(Te),Me.buffer=null),Me.x===de&&Me.y===me&&Me.z===ge&&Me.w===ye||(At.vertexAttrib4f(Te,de,me,ge,ye),Me.x=de,Me.y=me,Me.z=ge,Me.w=ye)),ze=t.positionBuffer,pe.buffer=ze,Ee=!1,Le=1,Ce=0,Pe=0,Oe=0,Ie=0,De=null,Re=0,Fe=!1,Be=5126,Ne=0,je=0,Ve=0,Rt(pe)?(Ee=!0,Be=(De=Et.createStream(34962,pe)).dtype):(De=Et.getBuffer(pe))?Be=De.dtype:"constant"in pe?(Le=2,"number"==typeof pe.constant?(Ce=pe.constant,Pe=Oe=Ie=0):(Ce=pe.constant.length>0?pe.constant[0]:0,Pe=pe.constant.length>1?pe.constant[1]:0,Oe=pe.constant.length>2?pe.constant[2]:0,Ie=pe.constant.length>3?pe.constant[3]:0)):(De=Rt(pe.buffer)?Et.createStream(34962,pe.buffer):Et.getBuffer(pe.buffer),Be="type"in pe?se[pe.type]:De.dtype,Fe=!!pe.normalized,Re=0|pe.size,Ne=0|pe.offset,je=0|pe.stride,Ve=0|pe.divisor),Ue=p.location,He=Ct[Ue],1===Le?(He.buffer||At.enableVertexAttribArray(Ue),qe=Re||2,He.type===Be&&He.size===qe&&He.buffer===De&&He.normalized===Fe&&He.offset===Ne&&He.stride===je||(At.bindBuffer(34962,De.buffer),At.vertexAttribPointer(Ue,qe,Be,Fe,je,Ne),He.type=Be,He.size=qe,He.buffer=De,He.normalized=Fe,He.offset=Ne,He.stride=je),He.divisor!==Ve&&(W.vertexAttribDivisorANGLE(Ue,Ve),He.divisor=Ve)):(He.buffer&&(At.disableVertexAttribArray(Ue),He.buffer=null),He.x===Ce&&He.y===Pe&&He.z===Oe&&He.w===Ie||(At.vertexAttrib4f(Ue,Ce,Pe,Oe,Ie),He.x=Ce,He.y=Pe,He.z=Oe,He.w=Ie)),Ge=d.location,(We=Ct[Ge]).buffer||At.enableVertexAttribArray(Ge),5126===We.type&&1===We.size&&We.buffer===h&&!1===We.normalized&&0===We.offset&&8===We.stride||(At.bindBuffer(34962,h.buffer),At.vertexAttribPointer(Ge,1,5126,!1,8,0),We.type=5126,We.size=1,We.buffer=h,We.normalized=!1,We.offset=0,We.stride=8),0!==We.divisor&&(W.vertexAttribDivisorANGLE(Ge,0),We.divisor=0),Ye=m.location,(Ze=Ct[Ye]).buffer||At.enableVertexAttribArray(Ye),5126===Ze.type&&1===Ze.size&&Ze.buffer===h&&!1===Ze.normalized&&4===Ze.offset&&8===Ze.stride||(At.bindBuffer(34962,h.buffer),At.vertexAttribPointer(Ye,1,5126,!1,8,4),Ze.type=5126,Ze.size=1,Ze.buffer=h,Ze.normalized=!1,Ze.offset=4,Ze.stride=8),0!==Ze.divisor&&(W.vertexAttribDivisorANGLE(Ye,0),Ze.divisor=0),Xe=t.positionBuffer,he.buffer=Xe,Je=!1,Ke=1,Qe=0,$e=0,tr=0,er=0,rr=null,nr=0,ir=!1,ar=5126,or=0,sr=0,lr=0,Rt(he)?(Je=!0,ar=(rr=Et.createStream(34962,he)).dtype):(rr=Et.getBuffer(he))?ar=rr.dtype:"constant"in he?(Ke=2,"number"==typeof he.constant?(Qe=he.constant,$e=tr=er=0):(Qe=he.constant.length>0?he.constant[0]:0,$e=he.constant.length>1?he.constant[1]:0,tr=he.constant.length>2?he.constant[2]:0,er=he.constant.length>3?he.constant[3]:0)):(rr=Rt(he.buffer)?Et.createStream(34962,he.buffer):Et.getBuffer(he.buffer),ar="type"in he?se[he.type]:rr.dtype,ir=!!he.normalized,nr=0|he.size,or=0|he.offset,sr=0|he.stride,lr=0|he.divisor),cr=g.location,ur=Ct[cr],1===Ke?(ur.buffer||At.enableVertexAttribArray(cr),fr=nr||2,ur.type===ar&&ur.size===fr&&ur.buffer===rr&&ur.normalized===ir&&ur.offset===or&&ur.stride===sr||(At.bindBuffer(34962,rr.buffer),At.vertexAttribPointer(cr,fr,ar,ir,sr,or),ur.type=ar,ur.size=fr,ur.buffer=rr,ur.normalized=ir,ur.offset=or,ur.stride=sr),ur.divisor!==lr&&(W.vertexAttribDivisorANGLE(cr,lr),ur.divisor=lr)):(ur.buffer&&(At.disableVertexAttribArray(cr),ur.buffer=null),ur.x===Qe&&ur.y===$e&&ur.z===tr&&ur.w===er||(At.vertexAttrib4f(cr,Qe,$e,tr,er),ur.x=Qe,ur.y=$e,ur.z=tr,ur.w=er)),pr=t.positionBuffer,ue.buffer=pr,hr=!1,dr=1,mr=0,gr=0,yr=0,vr=0,br=null,xr=0,_r=!1,wr=5126,Ar=0,kr=0,Tr=0,Rt(ue)?(hr=!0,wr=(br=Et.createStream(34962,ue)).dtype):(br=Et.getBuffer(ue))?wr=br.dtype:"constant"in ue?(dr=2,"number"==typeof ue.constant?(mr=ue.constant,gr=yr=vr=0):(mr=ue.constant.length>0?ue.constant[0]:0,gr=ue.constant.length>1?ue.constant[1]:0,yr=ue.constant.length>2?ue.constant[2]:0,vr=ue.constant.length>3?ue.constant[3]:0)):(br=Rt(ue.buffer)?Et.createStream(34962,ue.buffer):Et.getBuffer(ue.buffer),wr="type"in ue?se[ue.type]:br.dtype,_r=!!ue.normalized,xr=0|ue.size,Ar=0|ue.offset,kr=0|ue.stride,Tr=0|ue.divisor),Mr=y.location,Sr=Ct[Mr],1===dr?(Sr.buffer||At.enableVertexAttribArray(Mr),zr=xr||2,Sr.type===wr&&Sr.size===zr&&Sr.buffer===br&&Sr.normalized===_r&&Sr.offset===Ar&&Sr.stride===kr||(At.bindBuffer(34962,br.buffer),At.vertexAttribPointer(Mr,zr,wr,_r,kr,Ar),Sr.type=wr,Sr.size=zr,Sr.buffer=br,Sr.normalized=_r,Sr.offset=Ar,Sr.stride=kr),Sr.divisor!==Tr&&(W.vertexAttribDivisorANGLE(Mr,Tr),Sr.divisor=Tr)):(Sr.buffer&&(At.disableVertexAttribArray(Mr),Sr.buffer=null),Sr.x===mr&&Sr.y===gr&&Sr.z===yr&&Sr.w===vr||(At.vertexAttrib4f(Mr,mr,gr,yr,vr),Sr.x=mr,Sr.y=gr,Sr.z=yr,Sr.w=vr)),Er=t.dashLength,At.uniform1f(v.location,Er),(Lr=t.dashTexture)&&"framebuffer"===Lr._reglType&&(Lr=Lr.color[0]),Cr=Lr._texture,At.uniform1i(b.location,Cr.bind()),Pr=t.depth,At.uniform1f(x.location,Pr),Or=t.miterLimit,At.uniform1f(_.location,Or),Ir=A.call(this,kt,t,0),At.uniform1f(w.location,Ir),Dr=t.opacity,At.uniform1f(k.location,Dr),Fr=(Rr=t.scale)[0],Br=Rr[1],At.uniform2f(T.location,Fr,Br),Nr=t.thickness,At.uniform1f(M.location,Nr),Vr=(jr=t.translate)[0],Ur=jr[1],At.uniform2f(S.location,Vr,Ur),qr=(Hr=E.call(this,kt,t,0))[0],Gr=Hr[1],Wr=Hr[2],Yr=Hr[3],At.uniform4f(z.location,qr,Gr,Wr,Yr),((Zr=St.elements)||Pt.currentVAO&&(Zr=zt.getElements(Pt.currentVAO.elements)))&&At.bindBuffer(34963,Zr.buffer.buffer),(Xr=t.count)>0?Zr?W.drawElementsInstancedANGLE(5,4,Zr.type,0<<(Zr.type-5121>>1),Xr):W.drawArraysInstancedANGLE(5,0,4,Xr):Xr<0&&(Zr?At.drawElements(5,4,Zr.type,0<<(Zr.type-5121>>1)):At.drawArrays(5,0,4)),Mt.dirty=!0,Pt.setVAO(null),kt.viewportWidth=R,kt.viewportHeight=F,q&&(e.cpuTime+=performance.now()-G),Z&&Et.destroyStream(tt),ft&&Et.destroyStream(yt),ne&&Et.destroyStream(ve),Ee&&Et.destroyStream(De),Je&&Et.destroyStream(rr),hr&&Et.destroyStream(br),Cr.unbind()},scope:function(t,r,n){var i,o,s,l,c,u,f,p,d,m,g,y,v,b,x,_,w,k,T,M,S,z,vt,bt,xt,_t,wt,At,zt,Ct,Pt,It,Dt,Bt,jt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ie,oe,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi,Ei,Li,Ci,Pi,Oi,Ii,Di,Ri,Fi,Bi,Ni,ji,Vi,Ui,Hi,qi,Gi,Wi,Yi,Zi,Xi,Ji,Ki,Qi,$i,ta;o=0|(i=t.viewport).x,s=0|i.y,l="width"in i?0|i.width:kt.framebufferWidth-o,c="height"in i?0|i.height:kt.framebufferHeight-s,u=kt.viewportWidth,kt.viewportWidth=l,f=kt.viewportHeight,kt.viewportHeight=c,p=ae[0],ae[0]=o,d=ae[1],ae[1]=s,m=ae[2],ae[2]=l,g=ae[3],ae[3]=c,y=Ft[0],Ft[0]=L,v=Ft[1],Ft[1]=C,b=Ft[2],Ft[2]=P,x=Ft[3],Ft[3]=O,_=Tt.blend_enable,Tt.blend_enable=I,w=Nt[0],Nt[0]=D,k=Nt[1],Nt[1]=R,T=Vt[0],Vt[0]=F,M=Vt[1],Vt[1]=B,S=Vt[2],Vt[2]=N,z=Vt[3],Vt[3]=j,vt=Tt.cull_enable,Tt.cull_enable=V,bt=Tt.cull_face,Tt.cull_face=U,xt=a.call(this,kt,t,n),_t=Tt.depth_enable,Tt.depth_enable=xt,At=0|(wt=t.viewport).x,zt=0|wt.y,Ct="width"in wt?0|wt.width:kt.framebufferWidth-At,Pt="height"in wt?0|wt.height:kt.framebufferHeight-zt,It=ne[0],ne[0]=At,Dt=ne[1],ne[1]=zt,Bt=ne[2],ne[2]=Ct,jt=ne[3],ne[3]=Pt,Ut=Tt.scissor_enable,Tt.scissor_enable=H,Ht=Tt.stencil_enable,Tt.stencil_enable=q,(qt=Mt.profile)&&(Gt=performance.now(),e.count++),Wt=St.offset,St.offset=G,Yt=St.count,St.count=W,Zt=t.count,Xt=St.instances,St.instances=Zt,Jt=St.primitive,St.primitive=Y,Kt=A.call(this,kt,t,n),Qt=Ot[Z],Ot[Z]=Kt,$t=t.miterLimit,te=Ot[X],Ot[X]=$t,ee=t.scale,re=Ot[J],Ot[J]=ee,ie=t.scaleFract,oe=Ot[K],Ot[K]=ie,de=t.translateFract,me=Ot[Q],Ot[Q]=de,ge=t.translate,ye=Ot[$],Ot[$]=ge,ve=t.thickness,be=Ot[tt],Ot[tt]=ve,xe=t.dashTexture,_e=Ot[et],Ot[et]=xe,we=t.opacity,Ae=Ot[rt],Ot[rt]=we,ke=kt.pixelRatio,Te=Ot[nt],Ot[nt]=ke,Me=t.id,Se=Ot[it],Ot[it]=Me,ze=t.dashLength,Ee=Ot[at],Ot[at]=ze,Le=E.call(this,kt,t,n),Ce=Ot[ot],Ot[ot]=Le,Pe=t.depth,Oe=Ot[st],Ot[st]=Pe,Ie=lt.state,lt.state=1,De=lt.x,lt.x=0,Re=lt.y,lt.y=0,Fe=lt.z,lt.z=0,Be=lt.w,lt.w=0,Ne=lt.buffer,lt.buffer=h,je=lt.size,lt.size=0,Ve=lt.normalized,lt.normalized=!1,Ue=lt.type,lt.type=5126,He=lt.offset,lt.offset=0,qe=lt.stride,lt.stride=8,Ge=lt.divisor,lt.divisor=0,We=ct.state,ct.state=1,Ye=ct.x,ct.x=0,Ze=ct.y,ct.y=0,Xe=ct.z,ct.z=0,Je=ct.w,ct.w=0,Ke=ct.buffer,ct.buffer=h,Qe=ct.size,ct.size=0,$e=ct.normalized,ct.normalized=!1,tr=ct.type,ct.type=5126,er=ct.offset,ct.offset=4,rr=ct.stride,ct.stride=8,nr=ct.divisor,ct.divisor=0,ir=t.colorBuffer,le.buffer=ir,ar=!1,or=1,sr=0,lr=0,cr=0,ur=0,fr=null,pr=0,hr=!1,dr=5126,mr=0,gr=0,yr=0,Rt(le)?(ar=!0,dr=(fr=Et.createStream(34962,le)).dtype):(fr=Et.getBuffer(le))?dr=fr.dtype:"constant"in le?(or=2,"number"==typeof le.constant?(sr=le.constant,lr=cr=ur=0):(sr=le.constant.length>0?le.constant[0]:0,lr=le.constant.length>1?le.constant[1]:0,cr=le.constant.length>2?le.constant[2]:0,ur=le.constant.length>3?le.constant[3]:0)):(fr=Rt(le.buffer)?Et.createStream(34962,le.buffer):Et.getBuffer(le.buffer),dr="type"in le?se[le.type]:fr.dtype,hr=!!le.normalized,pr=0|le.size,mr=0|le.offset,gr=0|le.stride,yr=0|le.divisor),vr=ut.state,ut.state=or,br=ut.x,ut.x=sr,xr=ut.y,ut.y=lr,_r=ut.z,ut.z=cr,wr=ut.w,ut.w=ur,Ar=ut.buffer,ut.buffer=fr,kr=ut.size,ut.size=pr,Tr=ut.normalized,ut.normalized=hr,Mr=ut.type,ut.type=dr,Sr=ut.offset,ut.offset=mr,zr=ut.stride,ut.stride=gr,Er=ut.divisor,ut.divisor=yr,Lr=t.colorBuffer,ce.buffer=Lr,Cr=!1,Pr=1,Or=0,Ir=0,Dr=0,Rr=0,Fr=null,Br=0,Nr=!1,jr=5126,Vr=0,Ur=0,Hr=0,Rt(ce)?(Cr=!0,jr=(Fr=Et.createStream(34962,ce)).dtype):(Fr=Et.getBuffer(ce))?jr=Fr.dtype:"constant"in ce?(Pr=2,"number"==typeof ce.constant?(Or=ce.constant,Ir=Dr=Rr=0):(Or=ce.constant.length>0?ce.constant[0]:0,Ir=ce.constant.length>1?ce.constant[1]:0,Dr=ce.constant.length>2?ce.constant[2]:0,Rr=ce.constant.length>3?ce.constant[3]:0)):(Fr=Rt(ce.buffer)?Et.createStream(34962,ce.buffer):Et.getBuffer(ce.buffer),jr="type"in ce?se[ce.type]:Fr.dtype,Nr=!!ce.normalized,Br=0|ce.size,Vr=0|ce.offset,Ur=0|ce.stride,Hr=0|ce.divisor),qr=ft.state,ft.state=Pr,Gr=ft.x,ft.x=Or,Wr=ft.y,ft.y=Ir,Yr=ft.z,ft.z=Dr,Zr=ft.w,ft.w=Rr,Xr=ft.buffer,ft.buffer=Fr,Jr=ft.size,ft.size=Br,Kr=ft.normalized,ft.normalized=Nr,Qr=ft.type,ft.type=jr,$r=ft.offset,ft.offset=Vr,tn=ft.stride,ft.stride=Ur,en=ft.divisor,ft.divisor=Hr,rn=t.positionBuffer,ue.buffer=rn,nn=!1,an=1,on=0,sn=0,ln=0,cn=0,un=null,fn=0,pn=!1,hn=5126,dn=0,mn=0,gn=0,Rt(ue)?(nn=!0,hn=(un=Et.createStream(34962,ue)).dtype):(un=Et.getBuffer(ue))?hn=un.dtype:"constant"in ue?(an=2,"number"==typeof ue.constant?(on=ue.constant,sn=ln=cn=0):(on=ue.constant.length>0?ue.constant[0]:0,sn=ue.constant.length>1?ue.constant[1]:0,ln=ue.constant.length>2?ue.constant[2]:0,cn=ue.constant.length>3?ue.constant[3]:0)):(un=Rt(ue.buffer)?Et.createStream(34962,ue.buffer):Et.getBuffer(ue.buffer),hn="type"in ue?se[ue.type]:un.dtype,pn=!!ue.normalized,fn=0|ue.size,dn=0|ue.offset,mn=0|ue.stride,gn=0|ue.divisor),yn=pt.state,pt.state=an,vn=pt.x,pt.x=on,bn=pt.y,pt.y=sn,xn=pt.z,pt.z=ln,_n=pt.w,pt.w=cn,wn=pt.buffer,pt.buffer=un,An=pt.size,pt.size=fn,kn=pt.normalized,pt.normalized=pn,Tn=pt.type,pt.type=hn,Mn=pt.offset,pt.offset=dn,Sn=pt.stride,pt.stride=mn,zn=pt.divisor,pt.divisor=gn,En=t.positionBuffer,fe.buffer=En,Ln=!1,Cn=1,Pn=0,On=0,In=0,Dn=0,Rn=null,Fn=0,Bn=!1,Nn=5126,jn=0,Vn=0,Un=0,Rt(fe)?(Ln=!0,Nn=(Rn=Et.createStream(34962,fe)).dtype):(Rn=Et.getBuffer(fe))?Nn=Rn.dtype:"constant"in fe?(Cn=2,"number"==typeof fe.constant?(Pn=fe.constant,On=In=Dn=0):(Pn=fe.constant.length>0?fe.constant[0]:0,On=fe.constant.length>1?fe.constant[1]:0,In=fe.constant.length>2?fe.constant[2]:0,Dn=fe.constant.length>3?fe.constant[3]:0)):(Rn=Rt(fe.buffer)?Et.createStream(34962,fe.buffer):Et.getBuffer(fe.buffer),Nn="type"in fe?se[fe.type]:Rn.dtype,Bn=!!fe.normalized,Fn=0|fe.size,jn=0|fe.offset,Vn=0|fe.stride,Un=0|fe.divisor),Hn=ht.state,ht.state=Cn,qn=ht.x,ht.x=Pn,Gn=ht.y,ht.y=On,Wn=ht.z,ht.z=In,Yn=ht.w,ht.w=Dn,Zn=ht.buffer,ht.buffer=Rn,Xn=ht.size,ht.size=Fn,Jn=ht.normalized,ht.normalized=Bn,Kn=ht.type,ht.type=Nn,Qn=ht.offset,ht.offset=jn,$n=ht.stride,ht.stride=Vn,ti=ht.divisor,ht.divisor=Un,ei=t.positionBuffer,pe.buffer=ei,ri=!1,ni=1,ii=0,ai=0,oi=0,si=0,li=null,ci=0,ui=!1,fi=5126,pi=0,hi=0,di=0,Rt(pe)?(ri=!0,fi=(li=Et.createStream(34962,pe)).dtype):(li=Et.getBuffer(pe))?fi=li.dtype:"constant"in pe?(ni=2,"number"==typeof pe.constant?(ii=pe.constant,ai=oi=si=0):(ii=pe.constant.length>0?pe.constant[0]:0,ai=pe.constant.length>1?pe.constant[1]:0,oi=pe.constant.length>2?pe.constant[2]:0,si=pe.constant.length>3?pe.constant[3]:0)):(li=Rt(pe.buffer)?Et.createStream(34962,pe.buffer):Et.getBuffer(pe.buffer),fi="type"in pe?se[pe.type]:li.dtype,ui=!!pe.normalized,ci=0|pe.size,pi=0|pe.offset,hi=0|pe.stride,di=0|pe.divisor),mi=dt.state,dt.state=ni,gi=dt.x,dt.x=ii,yi=dt.y,dt.y=ai,vi=dt.z,dt.z=oi,bi=dt.w,dt.w=si,xi=dt.buffer,dt.buffer=li,_i=dt.size,dt.size=ci,wi=dt.normalized,dt.normalized=ui,Ai=dt.type,dt.type=fi,ki=dt.offset,dt.offset=pi,Ti=dt.stride,dt.stride=hi,Mi=dt.divisor,dt.divisor=di,Si=t.positionBuffer,he.buffer=Si,zi=!1,Ei=1,Li=0,Ci=0,Pi=0,Oi=0,Ii=null,Di=0,Ri=!1,Fi=5126,Bi=0,Ni=0,ji=0,Rt(he)?(zi=!0,Fi=(Ii=Et.createStream(34962,he)).dtype):(Ii=Et.getBuffer(he))?Fi=Ii.dtype:"constant"in he?(Ei=2,"number"==typeof he.constant?(Li=he.constant,Ci=Pi=Oi=0):(Li=he.constant.length>0?he.constant[0]:0,Ci=he.constant.length>1?he.constant[1]:0,Pi=he.constant.length>2?he.constant[2]:0,Oi=he.constant.length>3?he.constant[3]:0)):(Ii=Rt(he.buffer)?Et.createStream(34962,he.buffer):Et.getBuffer(he.buffer),Fi="type"in he?se[he.type]:Ii.dtype,Ri=!!he.normalized,Di=0|he.size,Bi=0|he.offset,Ni=0|he.stride,ji=0|he.divisor),Vi=mt.state,mt.state=Ei,Ui=mt.x,mt.x=Li,Hi=mt.y,mt.y=Ci,qi=mt.z,mt.z=Pi,Gi=mt.w,mt.w=Oi,Wi=mt.buffer,mt.buffer=Ii,Yi=mt.size,mt.size=Di,Zi=mt.normalized,mt.normalized=Ri,Xi=mt.type,mt.type=Fi,Ji=mt.offset,mt.offset=Bi,Ki=mt.stride,mt.stride=Ni,Qi=mt.divisor,mt.divisor=ji,$i=Lt.vert,Lt.vert=gt,ta=Lt.frag,Lt.frag=yt,Mt.dirty=!0,r(kt,t,n),kt.viewportWidth=u,kt.viewportHeight=f,ae[0]=p,ae[1]=d,ae[2]=m,ae[3]=g,Ft[0]=y,Ft[1]=v,Ft[2]=b,Ft[3]=x,Tt.blend_enable=_,Nt[0]=w,Nt[1]=k,Vt[0]=T,Vt[1]=M,Vt[2]=S,Vt[3]=z,Tt.cull_enable=vt,Tt.cull_face=bt,Tt.depth_enable=_t,ne[0]=It,ne[1]=Dt,ne[2]=Bt,ne[3]=jt,Tt.scissor_enable=Ut,Tt.stencil_enable=Ht,qt&&(e.cpuTime+=performance.now()-Gt),St.offset=Wt,St.count=Yt,St.instances=Xt,St.primitive=Jt,Ot[Z]=Qt,Ot[X]=te,Ot[J]=re,Ot[K]=oe,Ot[Q]=me,Ot[$]=ye,Ot[tt]=be,Ot[et]=_e,Ot[rt]=Ae,Ot[nt]=Te,Ot[it]=Se,Ot[at]=Ee,Ot[ot]=Ce,Ot[st]=Oe,lt.state=Ie,lt.x=De,lt.y=Re,lt.z=Fe,lt.w=Be,lt.buffer=Ne,lt.size=je,lt.normalized=Ve,lt.type=Ue,lt.offset=He,lt.stride=qe,lt.divisor=Ge,ct.state=We,ct.x=Ye,ct.y=Ze,ct.z=Xe,ct.w=Je,ct.buffer=Ke,ct.size=Qe,ct.normalized=$e,ct.type=tr,ct.offset=er,ct.stride=rr,ct.divisor=nr,ar&&Et.destroyStream(fr),ut.state=vr,ut.x=br,ut.y=xr,ut.z=_r,ut.w=wr,ut.buffer=Ar,ut.size=kr,ut.normalized=Tr,ut.type=Mr,ut.offset=Sr,ut.stride=zr,ut.divisor=Er,Cr&&Et.destroyStream(Fr),ft.state=qr,ft.x=Gr,ft.y=Wr,ft.z=Yr,ft.w=Zr,ft.buffer=Xr,ft.size=Jr,ft.normalized=Kr,ft.type=Qr,ft.offset=$r,ft.stride=tn,ft.divisor=en,nn&&Et.destroyStream(un),pt.state=yn,pt.x=vn,pt.y=bn,pt.z=xn,pt.w=_n,pt.buffer=wn,pt.size=An,pt.normalized=kn,pt.type=Tn,pt.offset=Mn,pt.stride=Sn,pt.divisor=zn,Ln&&Et.destroyStream(Rn),ht.state=Hn,ht.x=qn,ht.y=Gn,ht.z=Wn,ht.w=Yn,ht.buffer=Zn,ht.size=Xn,ht.normalized=Jn,ht.type=Kn,ht.offset=Qn,ht.stride=$n,ht.divisor=ti,ri&&Et.destroyStream(li),dt.state=mi,dt.x=gi,dt.y=yi,dt.z=vi,dt.w=bi,dt.buffer=xi,dt.size=_i,dt.normalized=wi,dt.type=Ai,dt.offset=ki,dt.stride=Ti,dt.divisor=Mi,zi&&Et.destroyStream(Ii),mt.state=Vi,mt.x=Ui,mt.y=Hi,mt.z=qi,mt.w=Gi,mt.buffer=Wi,mt.size=Yi,mt.normalized=Zi,mt.type=Xi,mt.offset=Ji,mt.stride=Ki,mt.divisor=Qi,Lt.vert=$i,Lt.frag=ta,Mt.dirty=!0},batch:function(t,r){var n,i,o,s,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt;(Dt.angle_instanced_arrays,(n=It.next)!==It.cur&&(n?At.bindFramebuffer(36160,n.framebuffer):At.bindFramebuffer(36160,null),It.cur=n),Mt.dirty)&&((P=Tt.dither)!==Mt.dither&&(P?At.enable(3024):At.disable(3024),Mt.dither=P),(O=Tt.depth_func)!==Mt.depth_func&&(At.depthFunc(O),Mt.depth_func=O),I=Ht[0],D=Ht[1],I===qt[0]&&D===qt[1]||(At.depthRange(I,D),qt[0]=I,qt[1]=D),(R=Tt.depth_mask)!==Mt.depth_mask&&(At.depthMask(R),Mt.depth_mask=R),F=Gt[0],B=Gt[1],N=Gt[2],j=Gt[3],F===Wt[0]&&B===Wt[1]&&N===Wt[2]&&j===Wt[3]||(At.colorMask(F,B,N,j),Wt[0]=F,Wt[1]=B,Wt[2]=N,Wt[3]=j),(V=Tt.frontFace)!==Mt.frontFace&&(At.frontFace(V),Mt.frontFace=V),(U=Tt.lineWidth)!==Mt.lineWidth&&(At.lineWidth(U),Mt.lineWidth=U),(H=Tt.polygonOffset_enable)!==Mt.polygonOffset_enable&&(H?At.enable(32823):At.disable(32823),Mt.polygonOffset_enable=H),q=Yt[0],G=Yt[1],q===Zt[0]&&G===Zt[1]||(At.polygonOffset(q,G),Zt[0]=q,Zt[1]=G),(W=Tt.sample_alpha)!==Mt.sample_alpha&&(W?At.enable(32926):At.disable(32926),Mt.sample_alpha=W),(Y=Tt.sample_enable)!==Mt.sample_enable&&(Y?At.enable(32928):At.disable(32928),Mt.sample_enable=Y),Z=Xt[0],X=Xt[1],Z===Jt[0]&&X===Jt[1]||(At.sampleCoverage(Z,X),Jt[0]=Z,Jt[1]=X),(J=Tt.stencil_mask)!==Mt.stencil_mask&&(At.stencilMask(J),Mt.stencil_mask=J),K=Kt[0],Q=Kt[1],$=Kt[2],K===Qt[0]&&Q===Qt[1]&&$===Qt[2]||(At.stencilFunc(K,Q,$),Qt[0]=K,Qt[1]=Q,Qt[2]=$),tt=$t[0],et=$t[1],rt=$t[2],nt=$t[3],tt===te[0]&&et===te[1]&&rt===te[2]&&nt===te[3]||(At.stencilOpSeparate(tt,et,rt,nt),te[0]=tt,te[1]=et,te[2]=rt,te[3]=nt),it=ee[0],at=ee[1],ot=ee[2],st=ee[3],it===re[0]&&at===re[1]&&ot===re[2]&&st===re[3]||(At.stencilOpSeparate(it,at,ot,st),re[0]=it,re[1]=at,re[2]=ot,re[3]=st));for(At.blendColor(0,0,0,0),Bt[0]=0,Bt[1]=0,Bt[2]=0,Bt[3]=0,vt?At.enable(3042):At.disable(3042),Mt.blend_enable=vt,At.blendEquationSeparate(32774,32774),jt[0]=32774,jt[1]=32774,At.blendFuncSeparate(770,771,773,1),Ut[0]=770,Ut[1]=771,Ut[2]=773,Ut[3]=1,bt?At.enable(2884):At.disable(2884),Mt.cull_enable=bt,At.cullFace(xt),Mt.cull_face=xt,_t?At.enable(3089):At.disable(3089),Mt.scissor_enable=_t,wt?At.enable(2960):At.disable(2960),Mt.stencil_enable=wt,(i=Mt.profile)&&(o=performance.now(),e.count+=r),At.useProgram(l.program),s=Dt.angle_instanced_arrays,Pt.setVAO(null),lt=d.location,(ct=Ct[lt]).buffer||At.enableVertexAttribArray(lt),5126===ct.type&&1===ct.size&&ct.buffer===h&&!1===ct.normalized&&0===ct.offset&&8===ct.stride||(At.bindBuffer(34962,h.buffer),At.vertexAttribPointer(lt,1,5126,!1,8,0),ct.type=5126,ct.size=1,ct.buffer=h,ct.normalized=!1,ct.offset=0,ct.stride=8),0!==ct.divisor&&(s.vertexAttribDivisorANGLE(lt,0),ct.divisor=0),ut=m.location,(ft=Ct[ut]).buffer||At.enableVertexAttribArray(ut),5126===ft.type&&1===ft.size&&ft.buffer===h&&!1===ft.normalized&&4===ft.offset&&8===ft.stride||(At.bindBuffer(34962,h.buffer),At.vertexAttribPointer(ut,1,5126,!1,8,4),ft.type=5126,ft.size=1,ft.buffer=h,ft.normalized=!1,ft.offset=4,ft.stride=8),0!==ft.divisor&&(s.vertexAttribDivisorANGLE(ut,0),ft.divisor=0),((pt=St.elements)||Pt.currentVAO&&(pt=zt.getElements(Pt.currentVAO.elements)))&&At.bindBuffer(34963,pt.buffer.buffer),L=0;L0?le.constant[0]:0,be=le.constant.length>1?le.constant[1]:0,xe=le.constant.length>2?le.constant[2]:0,_e=le.constant.length>3?le.constant[3]:0)):(we=Rt(le.buffer)?Et.createStream(34962,le.buffer):Et.getBuffer(le.buffer),Te="type"in le?se[le.type]:we.dtype,ke=!!le.normalized,Ae=0|le.size,Me=0|le.offset,Se=0|le.stride,ze=0|le.divisor),Ee=c.location,Le=Ct[Ee],1===ye?(Le.buffer||At.enableVertexAttribArray(Ee),Ce=Ae||4,Le.type===Te&&Le.size===Ce&&Le.buffer===we&&Le.normalized===ke&&Le.offset===Me&&Le.stride===Se||(At.bindBuffer(34962,we.buffer),At.vertexAttribPointer(Ee,Ce,Te,ke,Se,Me),Le.type=Te,Le.size=Ce,Le.buffer=we,Le.normalized=ke,Le.offset=Me,Le.stride=Se),Le.divisor!==ze&&(s.vertexAttribDivisorANGLE(Ee,ze),Le.divisor=ze)):(Le.buffer&&(At.disableVertexAttribArray(Ee),Le.buffer=null),Le.x===ve&&Le.y===be&&Le.z===xe&&Le.w===_e||(At.vertexAttrib4f(Ee,ve,be,xe,_e),Le.x=ve,Le.y=be,Le.z=xe,Le.w=_e)),Pe=C.positionBuffer,fe.buffer=Pe,Oe=!1,Ie=1,De=0,Re=0,Fe=0,Be=0,Ne=null,je=0,Ve=!1,Ue=5126,He=0,qe=0,Ge=0,Rt(fe)?(Oe=!0,Ue=(Ne=Et.createStream(34962,fe)).dtype):(Ne=Et.getBuffer(fe))?Ue=Ne.dtype:"constant"in fe?(Ie=2,"number"==typeof fe.constant?(De=fe.constant,Re=Fe=Be=0):(De=fe.constant.length>0?fe.constant[0]:0,Re=fe.constant.length>1?fe.constant[1]:0,Fe=fe.constant.length>2?fe.constant[2]:0,Be=fe.constant.length>3?fe.constant[3]:0)):(Ne=Rt(fe.buffer)?Et.createStream(34962,fe.buffer):Et.getBuffer(fe.buffer),Ue="type"in fe?se[fe.type]:Ne.dtype,Ve=!!fe.normalized,je=0|fe.size,He=0|fe.offset,qe=0|fe.stride,Ge=0|fe.divisor),We=u.location,Ye=Ct[We],1===Ie?(Ye.buffer||At.enableVertexAttribArray(We),Ze=je||2,Ye.type===Ue&&Ye.size===Ze&&Ye.buffer===Ne&&Ye.normalized===Ve&&Ye.offset===He&&Ye.stride===qe||(At.bindBuffer(34962,Ne.buffer),At.vertexAttribPointer(We,Ze,Ue,Ve,qe,He),Ye.type=Ue,Ye.size=Ze,Ye.buffer=Ne,Ye.normalized=Ve,Ye.offset=He,Ye.stride=qe),Ye.divisor!==Ge&&(s.vertexAttribDivisorANGLE(We,Ge),Ye.divisor=Ge)):(Ye.buffer&&(At.disableVertexAttribArray(We),Ye.buffer=null),Ye.x===De&&Ye.y===Re&&Ye.z===Fe&&Ye.w===Be||(At.vertexAttrib4f(We,De,Re,Fe,Be),Ye.x=De,Ye.y=Re,Ye.z=Fe,Ye.w=Be)),Xe=C.colorBuffer,ce.buffer=Xe,Je=!1,Ke=1,Qe=0,$e=0,tr=0,er=0,rr=null,nr=0,ir=!1,ar=5126,or=0,sr=0,lr=0,Rt(ce)?(Je=!0,ar=(rr=Et.createStream(34962,ce)).dtype):(rr=Et.getBuffer(ce))?ar=rr.dtype:"constant"in ce?(Ke=2,"number"==typeof ce.constant?(Qe=ce.constant,$e=tr=er=0):(Qe=ce.constant.length>0?ce.constant[0]:0,$e=ce.constant.length>1?ce.constant[1]:0,tr=ce.constant.length>2?ce.constant[2]:0,er=ce.constant.length>3?ce.constant[3]:0)):(rr=Rt(ce.buffer)?Et.createStream(34962,ce.buffer):Et.getBuffer(ce.buffer),ar="type"in ce?se[ce.type]:rr.dtype,ir=!!ce.normalized,nr=0|ce.size,or=0|ce.offset,sr=0|ce.stride,lr=0|ce.divisor),cr=f.location,ur=Ct[cr],1===Ke?(ur.buffer||At.enableVertexAttribArray(cr),fr=nr||4,ur.type===ar&&ur.size===fr&&ur.buffer===rr&&ur.normalized===ir&&ur.offset===or&&ur.stride===sr||(At.bindBuffer(34962,rr.buffer),At.vertexAttribPointer(cr,fr,ar,ir,sr,or),ur.type=ar,ur.size=fr,ur.buffer=rr,ur.normalized=ir,ur.offset=or,ur.stride=sr),ur.divisor!==lr&&(s.vertexAttribDivisorANGLE(cr,lr),ur.divisor=lr)):(ur.buffer&&(At.disableVertexAttribArray(cr),ur.buffer=null),ur.x===Qe&&ur.y===$e&&ur.z===tr&&ur.w===er||(At.vertexAttrib4f(cr,Qe,$e,tr,er),ur.x=Qe,ur.y=$e,ur.z=tr,ur.w=er)),pr=C.positionBuffer,pe.buffer=pr,hr=!1,dr=1,mr=0,gr=0,yr=0,vr=0,br=null,xr=0,_r=!1,wr=5126,Ar=0,kr=0,Tr=0,Rt(pe)?(hr=!0,wr=(br=Et.createStream(34962,pe)).dtype):(br=Et.getBuffer(pe))?wr=br.dtype:"constant"in pe?(dr=2,"number"==typeof pe.constant?(mr=pe.constant,gr=yr=vr=0):(mr=pe.constant.length>0?pe.constant[0]:0,gr=pe.constant.length>1?pe.constant[1]:0,yr=pe.constant.length>2?pe.constant[2]:0,vr=pe.constant.length>3?pe.constant[3]:0)):(br=Rt(pe.buffer)?Et.createStream(34962,pe.buffer):Et.getBuffer(pe.buffer),wr="type"in pe?se[pe.type]:br.dtype,_r=!!pe.normalized,xr=0|pe.size,Ar=0|pe.offset,kr=0|pe.stride,Tr=0|pe.divisor),Mr=p.location,Sr=Ct[Mr],1===dr?(Sr.buffer||At.enableVertexAttribArray(Mr),zr=xr||2,Sr.type===wr&&Sr.size===zr&&Sr.buffer===br&&Sr.normalized===_r&&Sr.offset===Ar&&Sr.stride===kr||(At.bindBuffer(34962,br.buffer),At.vertexAttribPointer(Mr,zr,wr,_r,kr,Ar),Sr.type=wr,Sr.size=zr,Sr.buffer=br,Sr.normalized=_r,Sr.offset=Ar,Sr.stride=kr),Sr.divisor!==Tr&&(s.vertexAttribDivisorANGLE(Mr,Tr),Sr.divisor=Tr)):(Sr.buffer&&(At.disableVertexAttribArray(Mr),Sr.buffer=null),Sr.x===mr&&Sr.y===gr&&Sr.z===yr&&Sr.w===vr||(At.vertexAttrib4f(Mr,mr,gr,yr,vr),Sr.x=mr,Sr.y=gr,Sr.z=yr,Sr.w=vr)),Er=C.positionBuffer,he.buffer=Er,Lr=!1,Cr=1,Pr=0,Or=0,Ir=0,Dr=0,Rr=null,Fr=0,Br=!1,Nr=5126,jr=0,Vr=0,Ur=0,Rt(he)?(Lr=!0,Nr=(Rr=Et.createStream(34962,he)).dtype):(Rr=Et.getBuffer(he))?Nr=Rr.dtype:"constant"in he?(Cr=2,"number"==typeof he.constant?(Pr=he.constant,Or=Ir=Dr=0):(Pr=he.constant.length>0?he.constant[0]:0,Or=he.constant.length>1?he.constant[1]:0,Ir=he.constant.length>2?he.constant[2]:0,Dr=he.constant.length>3?he.constant[3]:0)):(Rr=Rt(he.buffer)?Et.createStream(34962,he.buffer):Et.getBuffer(he.buffer),Nr="type"in he?se[he.type]:Rr.dtype,Br=!!he.normalized,Fr=0|he.size,jr=0|he.offset,Vr=0|he.stride,Ur=0|he.divisor),Hr=g.location,qr=Ct[Hr],1===Cr?(qr.buffer||At.enableVertexAttribArray(Hr),Gr=Fr||2,qr.type===Nr&&qr.size===Gr&&qr.buffer===Rr&&qr.normalized===Br&&qr.offset===jr&&qr.stride===Vr||(At.bindBuffer(34962,Rr.buffer),At.vertexAttribPointer(Hr,Gr,Nr,Br,Vr,jr),qr.type=Nr,qr.size=Gr,qr.buffer=Rr,qr.normalized=Br,qr.offset=jr,qr.stride=Vr),qr.divisor!==Ur&&(s.vertexAttribDivisorANGLE(Hr,Ur),qr.divisor=Ur)):(qr.buffer&&(At.disableVertexAttribArray(Hr),qr.buffer=null),qr.x===Pr&&qr.y===Or&&qr.z===Ir&&qr.w===Dr||(At.vertexAttrib4f(Hr,Pr,Or,Ir,Dr),qr.x=Pr,qr.y=Or,qr.z=Ir,qr.w=Dr)),Wr=C.positionBuffer,ue.buffer=Wr,Yr=!1,Zr=1,Xr=0,Jr=0,Kr=0,Qr=0,$r=null,tn=0,en=!1,rn=5126,nn=0,an=0,on=0,Rt(ue)?(Yr=!0,rn=($r=Et.createStream(34962,ue)).dtype):($r=Et.getBuffer(ue))?rn=$r.dtype:"constant"in ue?(Zr=2,"number"==typeof ue.constant?(Xr=ue.constant,Jr=Kr=Qr=0):(Xr=ue.constant.length>0?ue.constant[0]:0,Jr=ue.constant.length>1?ue.constant[1]:0,Kr=ue.constant.length>2?ue.constant[2]:0,Qr=ue.constant.length>3?ue.constant[3]:0)):($r=Rt(ue.buffer)?Et.createStream(34962,ue.buffer):Et.getBuffer(ue.buffer),rn="type"in ue?se[ue.type]:$r.dtype,en=!!ue.normalized,tn=0|ue.size,nn=0|ue.offset,an=0|ue.stride,on=0|ue.divisor),sn=y.location,ln=Ct[sn],1===Zr?(ln.buffer||At.enableVertexAttribArray(sn),cn=tn||2,ln.type===rn&&ln.size===cn&&ln.buffer===$r&&ln.normalized===en&&ln.offset===nn&&ln.stride===an||(At.bindBuffer(34962,$r.buffer),At.vertexAttribPointer(sn,cn,rn,en,an,nn),ln.type=rn,ln.size=cn,ln.buffer=$r,ln.normalized=en,ln.offset=nn,ln.stride=an),ln.divisor!==on&&(s.vertexAttribDivisorANGLE(sn,on),ln.divisor=on)):(ln.buffer&&(At.disableVertexAttribArray(sn),ln.buffer=null),ln.x===Xr&&ln.y===Jr&&ln.z===Kr&&ln.w===Qr||(At.vertexAttrib4f(sn,Xr,Jr,Kr,Qr),ln.x=Xr,ln.y=Jr,ln.z=Kr,ln.w=Qr)),un=C.dashLength,L&&fn===un||(fn=un,At.uniform1f(v.location,un)),(pn=C.dashTexture)&&"framebuffer"===pn._reglType&&(pn=pn.color[0]),hn=pn._texture,At.uniform1i(b.location,hn.bind()),dn=C.depth,L&&mn===dn||(mn=dn,At.uniform1f(x.location,dn)),gn=C.miterLimit,L&&yn===gn||(yn=gn,At.uniform1f(_.location,gn)),vn=A.call(this,kt,C,L),L&&bn===vn||(bn=vn,At.uniform1f(w.location,vn)),xn=C.opacity,L&&_n===xn||(_n=xn,At.uniform1f(k.location,xn)),An=(wn=C.scale)[0],Tn=wn[1],L&&kn===An&&Mn===Tn||(kn=An,Mn=Tn,At.uniform2f(T.location,An,Tn)),Sn=C.thickness,L&&zn===Sn||(zn=Sn,At.uniform1f(M.location,Sn)),Ln=(En=C.translate)[0],Pn=En[1],L&&Cn===Ln&&On===Pn||(Cn=Ln,On=Pn,At.uniform2f(S.location,Ln,Pn)),Dn=(In=E.call(this,kt,C,L))[0],Fn=In[1],Nn=In[2],Vn=In[3],L&&Rn===Dn&&Bn===Fn&&jn===Nn&&Un===Vn||(Rn=Dn,Bn=Fn,jn=Nn,Un=Vn,At.uniform4f(z.location,Dn,Fn,Nn,Vn)),(Hn=C.count)>0?pt?s.drawElementsInstancedANGLE(5,4,pt.type,0<<(pt.type-5121>>1),Hn):s.drawArraysInstancedANGLE(5,0,4,Hn):Hn<0&&(pt?At.drawElements(5,4,pt.type,0<<(pt.type-5121>>1)):At.drawArrays(5,0,4)),kt.viewportWidth=Lt,kt.viewportHeight=Ot,ge&&Et.destroyStream(we),Oe&&Et.destroyStream(Ne),Je&&Et.destroyStream(rr),hr&&Et.destroyStream(br),Lr&&Et.destroyStream(Rr),Yr&&Et.destroyStream($r),hn.unbind()}Mt.dirty=!0,Pt.setVAO(null),i&&(e.cpuTime+=performance.now()-o)}}}},{}],503:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t){"use strict";var wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie,ae,oe;return wt=t.gl,At=t.context,t.strings,kt=t.next,Tt=t.current,Mt=t.draw,St=t.elements,zt=t.buffer,Et=t.shader,Lt=t.attributes,Ct=t.vao,Pt=t.uniforms,Ot=t.framebuffer,It=t.extensions,t.timer,Dt=t.isBufferArgs,Rt=kt.blend_color,Ft=Tt.blend_color,Bt=kt.blend_equation,Nt=Tt.blend_equation,jt=kt.blend_func,Vt=Tt.blend_func,Ut=kt.depth_range,Ht=Tt.depth_range,qt=kt.colorMask,Gt=Tt.colorMask,Wt=kt.polygonOffset_offset,Yt=Tt.polygonOffset_offset,Zt=kt.sample_coverage,Xt=Tt.sample_coverage,Jt=kt.stencil_func,Kt=Tt.stencil_func,Qt=kt.stencil_opFront,$t=Tt.stencil_opFront,te=kt.stencil_opBack,ee=Tt.stencil_opBack,re=kt.scissor_box,ne=Tt.scissor_box,ie=kt.viewport,ae=Tt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},oe={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},{draw:function(t){var F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,vt,bt,xt,_t,Et,Pt,Rt,jt,re,ie,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi;(It.angle_instanced_arrays,(F=Ot.next)!==Ot.cur&&(F?wt.bindFramebuffer(36160,F.framebuffer):wt.bindFramebuffer(36160,null),Ot.cur=F),Tt.dirty)&&((Xn=kt.dither)!==Tt.dither&&(Xn?wt.enable(3024):wt.disable(3024),Tt.dither=Xn),Jn=Bt[0],Kn=Bt[1],Jn===Nt[0]&&Kn===Nt[1]||(wt.blendEquationSeparate(Jn,Kn),Nt[0]=Jn,Nt[1]=Kn),(Qn=kt.depth_func)!==Tt.depth_func&&(wt.depthFunc(Qn),Tt.depth_func=Qn),$n=Ut[0],ti=Ut[1],$n===Ht[0]&&ti===Ht[1]||(wt.depthRange($n,ti),Ht[0]=$n,Ht[1]=ti),(ei=kt.depth_mask)!==Tt.depth_mask&&(wt.depthMask(ei),Tt.depth_mask=ei),ri=qt[0],ni=qt[1],ii=qt[2],ai=qt[3],ri===Gt[0]&&ni===Gt[1]&&ii===Gt[2]&&ai===Gt[3]||(wt.colorMask(ri,ni,ii,ai),Gt[0]=ri,Gt[1]=ni,Gt[2]=ii,Gt[3]=ai),(oi=kt.cull_enable)!==Tt.cull_enable&&(oi?wt.enable(2884):wt.disable(2884),Tt.cull_enable=oi),(si=kt.cull_face)!==Tt.cull_face&&(wt.cullFace(si),Tt.cull_face=si),(li=kt.frontFace)!==Tt.frontFace&&(wt.frontFace(li),Tt.frontFace=li),(ci=kt.lineWidth)!==Tt.lineWidth&&(wt.lineWidth(ci),Tt.lineWidth=ci),(ui=kt.polygonOffset_enable)!==Tt.polygonOffset_enable&&(ui?wt.enable(32823):wt.disable(32823),Tt.polygonOffset_enable=ui),fi=Wt[0],pi=Wt[1],fi===Yt[0]&&pi===Yt[1]||(wt.polygonOffset(fi,pi),Yt[0]=fi,Yt[1]=pi),(hi=kt.sample_alpha)!==Tt.sample_alpha&&(hi?wt.enable(32926):wt.disable(32926),Tt.sample_alpha=hi),(di=kt.sample_enable)!==Tt.sample_enable&&(di?wt.enable(32928):wt.disable(32928),Tt.sample_enable=di),mi=Zt[0],gi=Zt[1],mi===Xt[0]&&gi===Xt[1]||(wt.sampleCoverage(mi,gi),Xt[0]=mi,Xt[1]=gi),(yi=kt.stencil_mask)!==Tt.stencil_mask&&(wt.stencilMask(yi),Tt.stencil_mask=yi),vi=Jt[0],bi=Jt[1],xi=Jt[2],vi===Kt[0]&&bi===Kt[1]&&xi===Kt[2]||(wt.stencilFunc(vi,bi,xi),Kt[0]=vi,Kt[1]=bi,Kt[2]=xi),_i=Qt[0],wi=Qt[1],Ai=Qt[2],ki=Qt[3],_i===$t[0]&&wi===$t[1]&&Ai===$t[2]&&ki===$t[3]||(wt.stencilOpSeparate(_i,wi,Ai,ki),$t[0]=_i,$t[1]=wi,$t[2]=Ai,$t[3]=ki),Ti=te[0],Mi=te[1],Si=te[2],zi=te[3],Ti===ee[0]&&Mi===ee[1]&&Si===ee[2]&&zi===ee[3]||(wt.stencilOpSeparate(Ti,Mi,Si,zi),ee[0]=Ti,ee[1]=Mi,ee[2]=Si,ee[3]=zi));N=0|(B=t.viewport).x,j=0|B.y,V="width"in B?0|B.width:At.framebufferWidth-N,U="height"in B?0|B.height:At.framebufferHeight-j,H=At.viewportWidth,At.viewportWidth=V,q=At.viewportHeight,At.viewportHeight=U,wt.viewport(N,j,V,U),ae[0]=N,ae[1]=j,ae[2]=V,ae[3]=U,wt.blendColor(0,0,0,1),Ft[0]=0,Ft[1]=0,Ft[2]=0,Ft[3]=1,r?wt.enable(3042):wt.disable(3042),Tt.blend_enable=r,wt.blendFuncSeparate(770,771,773,1),Vt[0]=770,Vt[1]=771,Vt[2]=773,Vt[3]=1,n?wt.enable(2929):wt.disable(2929),Tt.depth_enable=n,W=0|(G=t.viewport).x,Y=0|G.y,Z="width"in G?0|G.width:At.framebufferWidth-W,X="height"in G?0|G.height:At.framebufferHeight-Y,wt.scissor(W,Y,Z,X),ne[0]=W,ne[1]=Y,ne[2]=Z,ne[3]=X,i?wt.enable(3089):wt.disable(3089),Tt.scissor_enable=i,a?wt.enable(2960):wt.disable(2960),Tt.stencil_enable=a,(J=Tt.profile)&&(K=performance.now(),e.count++),wt.useProgram(o.program),Q=It.angle_instanced_arrays,Ct.setVAO(null),$=s.call(this,At,t,0),tt=!1,et=1,rt=0,nt=0,it=0,at=0,ot=null,st=0,lt=!1,ct=5126,ut=0,ft=0,pt=0,Dt($)?(tt=!0,ct=(ot=zt.createStream(34962,$)).dtype):(ot=zt.getBuffer($))?ct=ot.dtype:"constant"in $?(et=2,"number"==typeof $.constant?(rt=$.constant,nt=it=at=0):(rt=$.constant.length>0?$.constant[0]:0,nt=$.constant.length>1?$.constant[1]:0,it=$.constant.length>2?$.constant[2]:0,at=$.constant.length>3?$.constant[3]:0)):(ot=Dt($.buffer)?zt.createStream(34962,$.buffer):zt.getBuffer($.buffer),ct="type"in $?oe[$.type]:ot.dtype,lt=!!$.normalized,st=0|$.size,ut=0|$.offset,ft=0|$.stride,pt=0|$.divisor),ht=l.location,dt=Lt[ht],1===et?(dt.buffer||wt.enableVertexAttribArray(ht),mt=st||4,dt.type===ct&&dt.size===mt&&dt.buffer===ot&&dt.normalized===lt&&dt.offset===ut&&dt.stride===ft||(wt.bindBuffer(34962,ot.buffer),wt.vertexAttribPointer(ht,mt,ct,lt,ft,ut),dt.type=ct,dt.size=mt,dt.buffer=ot,dt.normalized=lt,dt.offset=ut,dt.stride=ft),dt.divisor!==pt&&(Q.vertexAttribDivisorANGLE(ht,pt),dt.divisor=pt)):(dt.buffer&&(wt.disableVertexAttribArray(ht),dt.buffer=null),dt.x===rt&&dt.y===nt&&dt.z===it&&dt.w===at||(wt.vertexAttrib4f(ht,rt,nt,it,at),dt.x=rt,dt.y=nt,dt.z=it,dt.w=at)),gt=c.call(this,At,t,0),yt=!1,vt=1,bt=0,xt=0,_t=0,Et=0,Pt=null,Rt=0,jt=!1,re=5126,ie=0,se=0,le=0,Dt(gt)?(yt=!0,re=(Pt=zt.createStream(34962,gt)).dtype):(Pt=zt.getBuffer(gt))?re=Pt.dtype:"constant"in gt?(vt=2,"number"==typeof gt.constant?(bt=gt.constant,xt=_t=Et=0):(bt=gt.constant.length>0?gt.constant[0]:0,xt=gt.constant.length>1?gt.constant[1]:0,_t=gt.constant.length>2?gt.constant[2]:0,Et=gt.constant.length>3?gt.constant[3]:0)):(Pt=Dt(gt.buffer)?zt.createStream(34962,gt.buffer):zt.getBuffer(gt.buffer),re="type"in gt?oe[gt.type]:Pt.dtype,jt=!!gt.normalized,Rt=0|gt.size,ie=0|gt.offset,se=0|gt.stride,le=0|gt.divisor),ce=u.location,ue=Lt[ce],1===vt?(ue.buffer||wt.enableVertexAttribArray(ce),fe=Rt||1,ue.type===re&&ue.size===fe&&ue.buffer===Pt&&ue.normalized===jt&&ue.offset===ie&&ue.stride===se||(wt.bindBuffer(34962,Pt.buffer),wt.vertexAttribPointer(ce,fe,re,jt,se,ie),ue.type=re,ue.size=fe,ue.buffer=Pt,ue.normalized=jt,ue.offset=ie,ue.stride=se),ue.divisor!==le&&(Q.vertexAttribDivisorANGLE(ce,le),ue.divisor=le)):(ue.buffer&&(wt.disableVertexAttribArray(ce),ue.buffer=null),ue.x===bt&&ue.y===xt&&ue.z===_t&&ue.w===Et||(wt.vertexAttrib4f(ce,bt,xt,_t,Et),ue.x=bt,ue.y=xt,ue.z=_t,ue.w=Et)),pe=f.call(this,At,t,0),he=!1,de=1,me=0,ge=0,ye=0,ve=0,be=null,xe=0,_e=!1,we=5126,Ae=0,ke=0,Te=0,Dt(pe)?(he=!0,we=(be=zt.createStream(34962,pe)).dtype):(be=zt.getBuffer(pe))?we=be.dtype:"constant"in pe?(de=2,"number"==typeof pe.constant?(me=pe.constant,ge=ye=ve=0):(me=pe.constant.length>0?pe.constant[0]:0,ge=pe.constant.length>1?pe.constant[1]:0,ye=pe.constant.length>2?pe.constant[2]:0,ve=pe.constant.length>3?pe.constant[3]:0)):(be=Dt(pe.buffer)?zt.createStream(34962,pe.buffer):zt.getBuffer(pe.buffer),we="type"in pe?oe[pe.type]:be.dtype,_e=!!pe.normalized,xe=0|pe.size,Ae=0|pe.offset,ke=0|pe.stride,Te=0|pe.divisor),Me=p.location,Se=Lt[Me],1===de?(Se.buffer||wt.enableVertexAttribArray(Me),ze=xe||4,Se.type===we&&Se.size===ze&&Se.buffer===be&&Se.normalized===_e&&Se.offset===Ae&&Se.stride===ke||(wt.bindBuffer(34962,be.buffer),wt.vertexAttribPointer(Me,ze,we,_e,ke,Ae),Se.type=we,Se.size=ze,Se.buffer=be,Se.normalized=_e,Se.offset=Ae,Se.stride=ke),Se.divisor!==Te&&(Q.vertexAttribDivisorANGLE(Me,Te),Se.divisor=Te)):(Se.buffer&&(wt.disableVertexAttribArray(Me),Se.buffer=null),Se.x===me&&Se.y===ge&&Se.z===ye&&Se.w===ve||(wt.vertexAttrib4f(Me,me,ge,ye,ve),Se.x=me,Se.y=ge,Se.z=ye,Se.w=ve)),Ee=h.call(this,At,t,0),Le=!1,Ce=1,Pe=0,Oe=0,Ie=0,De=0,Re=null,Fe=0,Be=!1,Ne=5126,je=0,Ve=0,Ue=0,Dt(Ee)?(Le=!0,Ne=(Re=zt.createStream(34962,Ee)).dtype):(Re=zt.getBuffer(Ee))?Ne=Re.dtype:"constant"in Ee?(Ce=2,"number"==typeof Ee.constant?(Pe=Ee.constant,Oe=Ie=De=0):(Pe=Ee.constant.length>0?Ee.constant[0]:0,Oe=Ee.constant.length>1?Ee.constant[1]:0,Ie=Ee.constant.length>2?Ee.constant[2]:0,De=Ee.constant.length>3?Ee.constant[3]:0)):(Re=Dt(Ee.buffer)?zt.createStream(34962,Ee.buffer):zt.getBuffer(Ee.buffer),Ne="type"in Ee?oe[Ee.type]:Re.dtype,Be=!!Ee.normalized,Fe=0|Ee.size,je=0|Ee.offset,Ve=0|Ee.stride,Ue=0|Ee.divisor),He=d.location,qe=Lt[He],1===Ce?(qe.buffer||wt.enableVertexAttribArray(He),Ge=Fe||1,qe.type===Ne&&qe.size===Ge&&qe.buffer===Re&&qe.normalized===Be&&qe.offset===je&&qe.stride===Ve||(wt.bindBuffer(34962,Re.buffer),wt.vertexAttribPointer(He,Ge,Ne,Be,Ve,je),qe.type=Ne,qe.size=Ge,qe.buffer=Re,qe.normalized=Be,qe.offset=je,qe.stride=Ve),qe.divisor!==Ue&&(Q.vertexAttribDivisorANGLE(He,Ue),qe.divisor=Ue)):(qe.buffer&&(wt.disableVertexAttribArray(He),qe.buffer=null),qe.x===Pe&&qe.y===Oe&&qe.z===Ie&&qe.w===De||(wt.vertexAttrib4f(He,Pe,Oe,Ie,De),qe.x=Pe,qe.y=Oe,qe.z=Ie,qe.w=De)),We=m.call(this,At,t,0),Ye=!1,Ze=1,Xe=0,Je=0,Ke=0,Qe=0,$e=null,tr=0,er=!1,rr=5126,nr=0,ir=0,ar=0,Dt(We)?(Ye=!0,rr=($e=zt.createStream(34962,We)).dtype):($e=zt.getBuffer(We))?rr=$e.dtype:"constant"in We?(Ze=2,"number"==typeof We.constant?(Xe=We.constant,Je=Ke=Qe=0):(Xe=We.constant.length>0?We.constant[0]:0,Je=We.constant.length>1?We.constant[1]:0,Ke=We.constant.length>2?We.constant[2]:0,Qe=We.constant.length>3?We.constant[3]:0)):($e=Dt(We.buffer)?zt.createStream(34962,We.buffer):zt.getBuffer(We.buffer),rr="type"in We?oe[We.type]:$e.dtype,er=!!We.normalized,tr=0|We.size,nr=0|We.offset,ir=0|We.stride,ar=0|We.divisor),or=g.location,sr=Lt[or],1===Ze?(sr.buffer||wt.enableVertexAttribArray(or),lr=tr||1,sr.type===rr&&sr.size===lr&&sr.buffer===$e&&sr.normalized===er&&sr.offset===nr&&sr.stride===ir||(wt.bindBuffer(34962,$e.buffer),wt.vertexAttribPointer(or,lr,rr,er,ir,nr),sr.type=rr,sr.size=lr,sr.buffer=$e,sr.normalized=er,sr.offset=nr,sr.stride=ir),sr.divisor!==ar&&(Q.vertexAttribDivisorANGLE(or,ar),sr.divisor=ar)):(sr.buffer&&(wt.disableVertexAttribArray(or),sr.buffer=null),sr.x===Xe&&sr.y===Je&&sr.z===Ke&&sr.w===Qe||(wt.vertexAttrib4f(or,Xe,Je,Ke,Qe),sr.x=Xe,sr.y=Je,sr.z=Ke,sr.w=Qe)),cr=y.call(this,At,t,0),ur=!1,fr=1,pr=0,hr=0,dr=0,mr=0,gr=null,yr=0,vr=!1,br=5126,xr=0,_r=0,wr=0,Dt(cr)?(ur=!0,br=(gr=zt.createStream(34962,cr)).dtype):(gr=zt.getBuffer(cr))?br=gr.dtype:"constant"in cr?(fr=2,"number"==typeof cr.constant?(pr=cr.constant,hr=dr=mr=0):(pr=cr.constant.length>0?cr.constant[0]:0,hr=cr.constant.length>1?cr.constant[1]:0,dr=cr.constant.length>2?cr.constant[2]:0,mr=cr.constant.length>3?cr.constant[3]:0)):(gr=Dt(cr.buffer)?zt.createStream(34962,cr.buffer):zt.getBuffer(cr.buffer),br="type"in cr?oe[cr.type]:gr.dtype,vr=!!cr.normalized,yr=0|cr.size,xr=0|cr.offset,_r=0|cr.stride,wr=0|cr.divisor),Ar=v.location,kr=Lt[Ar],1===fr?(kr.buffer||wt.enableVertexAttribArray(Ar),Tr=yr||1,kr.type===br&&kr.size===Tr&&kr.buffer===gr&&kr.normalized===vr&&kr.offset===xr&&kr.stride===_r||(wt.bindBuffer(34962,gr.buffer),wt.vertexAttribPointer(Ar,Tr,br,vr,_r,xr),kr.type=br,kr.size=Tr,kr.buffer=gr,kr.normalized=vr,kr.offset=xr,kr.stride=_r),kr.divisor!==wr&&(Q.vertexAttribDivisorANGLE(Ar,wr),kr.divisor=wr)):(kr.buffer&&(wt.disableVertexAttribArray(Ar),kr.buffer=null),kr.x===pr&&kr.y===hr&&kr.z===dr&&kr.w===mr||(wt.vertexAttrib4f(Ar,pr,hr,dr,mr),kr.x=pr,kr.y=hr,kr.z=dr,kr.w=mr)),Mr=b.call(this,At,t,0),Sr=!1,zr=1,Er=0,Lr=0,Cr=0,Pr=0,Or=null,Ir=0,Dr=!1,Rr=5126,Fr=0,Br=0,Nr=0,Dt(Mr)?(Sr=!0,Rr=(Or=zt.createStream(34962,Mr)).dtype):(Or=zt.getBuffer(Mr))?Rr=Or.dtype:"constant"in Mr?(zr=2,"number"==typeof Mr.constant?(Er=Mr.constant,Lr=Cr=Pr=0):(Er=Mr.constant.length>0?Mr.constant[0]:0,Lr=Mr.constant.length>1?Mr.constant[1]:0,Cr=Mr.constant.length>2?Mr.constant[2]:0,Pr=Mr.constant.length>3?Mr.constant[3]:0)):(Or=Dt(Mr.buffer)?zt.createStream(34962,Mr.buffer):zt.getBuffer(Mr.buffer),Rr="type"in Mr?oe[Mr.type]:Or.dtype,Dr=!!Mr.normalized,Ir=0|Mr.size,Fr=0|Mr.offset,Br=0|Mr.stride,Nr=0|Mr.divisor),jr=x.location,Vr=Lt[jr],1===zr?(Vr.buffer||wt.enableVertexAttribArray(jr),Ur=Ir||1,Vr.type===Rr&&Vr.size===Ur&&Vr.buffer===Or&&Vr.normalized===Dr&&Vr.offset===Fr&&Vr.stride===Br||(wt.bindBuffer(34962,Or.buffer),wt.vertexAttribPointer(jr,Ur,Rr,Dr,Br,Fr),Vr.type=Rr,Vr.size=Ur,Vr.buffer=Or,Vr.normalized=Dr,Vr.offset=Fr,Vr.stride=Br),Vr.divisor!==Nr&&(Q.vertexAttribDivisorANGLE(jr,Nr),Vr.divisor=Nr)):(Vr.buffer&&(wt.disableVertexAttribArray(jr),Vr.buffer=null),Vr.x===Er&&Vr.y===Lr&&Vr.z===Cr&&Vr.w===Pr||(wt.vertexAttrib4f(jr,Er,Lr,Cr,Pr),Vr.x=Er,Vr.y=Lr,Vr.z=Cr,Vr.w=Pr)),Hr=_.call(this,At,t,0),qr=!1,Gr=1,Wr=0,Yr=0,Zr=0,Xr=0,Jr=null,Kr=0,Qr=!1,$r=5126,tn=0,en=0,rn=0,Dt(Hr)?(qr=!0,$r=(Jr=zt.createStream(34962,Hr)).dtype):(Jr=zt.getBuffer(Hr))?$r=Jr.dtype:"constant"in Hr?(Gr=2,"number"==typeof Hr.constant?(Wr=Hr.constant,Yr=Zr=Xr=0):(Wr=Hr.constant.length>0?Hr.constant[0]:0,Yr=Hr.constant.length>1?Hr.constant[1]:0,Zr=Hr.constant.length>2?Hr.constant[2]:0,Xr=Hr.constant.length>3?Hr.constant[3]:0)):(Jr=Dt(Hr.buffer)?zt.createStream(34962,Hr.buffer):zt.getBuffer(Hr.buffer),$r="type"in Hr?oe[Hr.type]:Jr.dtype,Qr=!!Hr.normalized,Kr=0|Hr.size,tn=0|Hr.offset,en=0|Hr.stride,rn=0|Hr.divisor),nn=w.location,an=Lt[nn],1===Gr?(an.buffer||wt.enableVertexAttribArray(nn),on=Kr||1,an.type===$r&&an.size===on&&an.buffer===Jr&&an.normalized===Qr&&an.offset===tn&&an.stride===en||(wt.bindBuffer(34962,Jr.buffer),wt.vertexAttribPointer(nn,on,$r,Qr,en,tn),an.type=$r,an.size=on,an.buffer=Jr,an.normalized=Qr,an.offset=tn,an.stride=en),an.divisor!==rn&&(Q.vertexAttribDivisorANGLE(nn,rn),an.divisor=rn)):(an.buffer&&(wt.disableVertexAttribArray(nn),an.buffer=null),an.x===Wr&&an.y===Yr&&an.z===Zr&&an.w===Xr||(wt.vertexAttrib4f(nn,Wr,Yr,Zr,Xr),an.x=Wr,an.y=Yr,an.z=Zr,an.w=Xr)),sn=A.call(this,At,t,0),ln=!1,cn=1,un=0,fn=0,pn=0,hn=0,dn=null,mn=0,gn=!1,yn=5126,vn=0,bn=0,xn=0,Dt(sn)?(ln=!0,yn=(dn=zt.createStream(34962,sn)).dtype):(dn=zt.getBuffer(sn))?yn=dn.dtype:"constant"in sn?(cn=2,"number"==typeof sn.constant?(un=sn.constant,fn=pn=hn=0):(un=sn.constant.length>0?sn.constant[0]:0,fn=sn.constant.length>1?sn.constant[1]:0,pn=sn.constant.length>2?sn.constant[2]:0,hn=sn.constant.length>3?sn.constant[3]:0)):(dn=Dt(sn.buffer)?zt.createStream(34962,sn.buffer):zt.getBuffer(sn.buffer),yn="type"in sn?oe[sn.type]:dn.dtype,gn=!!sn.normalized,mn=0|sn.size,vn=0|sn.offset,bn=0|sn.stride,xn=0|sn.divisor),_n=k.location,wn=Lt[_n],1===cn?(wn.buffer||wt.enableVertexAttribArray(_n),An=mn||1,wn.type===yn&&wn.size===An&&wn.buffer===dn&&wn.normalized===gn&&wn.offset===vn&&wn.stride===bn||(wt.bindBuffer(34962,dn.buffer),wt.vertexAttribPointer(_n,An,yn,gn,bn,vn),wn.type=yn,wn.size=An,wn.buffer=dn,wn.normalized=gn,wn.offset=vn,wn.stride=bn),wn.divisor!==xn&&(Q.vertexAttribDivisorANGLE(_n,xn),wn.divisor=xn)):(wn.buffer&&(wt.disableVertexAttribArray(_n),wn.buffer=null),wn.x===un&&wn.y===fn&&wn.z===pn&&wn.w===hn||(wt.vertexAttrib4f(_n,un,fn,pn,hn),wn.x=un,wn.y=fn,wn.z=pn,wn.w=hn)),wt.uniform1i(T.location,!1),(kn=t.markerTexture)&&"framebuffer"===kn._reglType&&(kn=kn.color[0]),Tn=kn._texture,wt.uniform1i(M.location,Tn.bind()),Mn=t.opacity,wt.uniform1f(S.location,Mn),zn=(Sn=E.call(this,At,t,0))[0],En=Sn[1],wt.uniform2f(z.location,zn,En),wt.uniform1i(L.location,C.bind()),Ln=At.pixelRatio,wt.uniform1f(P.location,Ln),Pn=(Cn=t.scale)[0],On=Cn[1],wt.uniform2f(O.location,Pn,On),Dn=(In=t.scaleFract)[0],Rn=In[1],wt.uniform2f(I.location,Dn,Rn),Bn=(Fn=t.translate)[0],Nn=Fn[1],wt.uniform2f(D.location,Bn,Nn),Vn=(jn=t.translateFract)[0],Un=jn[1],wt.uniform2f(R.location,Vn,Un),Hn=t.elements,qn=null,(qn=(Gn=Dt(Hn))?St.createStream(Hn):St.getElements(Hn))&&wt.bindBuffer(34963,qn.buffer.buffer),Wn=t.offset,(Yn=t.count)&&((Zn=Mt.instances)>0?qn?Q.drawElementsInstancedANGLE(0,Yn,qn.type,Wn<<(qn.type-5121>>1),Zn):Q.drawArraysInstancedANGLE(0,Wn,Yn,Zn):Zn<0&&(qn?wt.drawElements(0,Yn,qn.type,Wn<<(qn.type-5121>>1)):wt.drawArrays(0,Wn,Yn)),Tt.dirty=!0,Ct.setVAO(null),At.viewportWidth=H,At.viewportHeight=q,J&&(e.cpuTime+=performance.now()-K),tt&&zt.destroyStream(ot),yt&&zt.destroyStream(Pt),he&&zt.destroyStream(be),Le&&zt.destroyStream(Re),Ye&&zt.destroyStream($e),ur&&zt.destroyStream(gr),Sr&&zt.destroyStream(Or),qr&&zt.destroyStream(Jr),ln&&zt.destroyStream(dn),Tn.unbind(),C.unbind(),Gn&&St.destroyStream(qn))},scope:function(t,r,n){var i,a,o,l,u,p,d,g,v,x,w,k,T,M,S,z,L,C,P,O,I,D,R,vt,bt,xt,_t,wt,Lt,Ct,Ot,It,Ft,Bt,Nt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,ne,ae,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi,Ai,ki,Ti,Mi,Si,zi,Ei,Li,Ci,Pi,Oi,Ii,Di,Ri,Fi,Bi,Ni,ji,Vi,Ui,Hi,qi,Gi,Wi,Yi,Zi,Xi,Ji,Ki,Qi,$i,ta,ea,ra,na,ia,aa,oa,sa,la,ca,ua,fa,pa,ha,da,ma,ga,ya,va,ba,xa,_a,wa,Aa,ka,Ta,Ma,Sa,za,Ea,La,Ca,Pa,Oa,Ia,Da,Ra;a=0|(i=t.viewport).x,o=0|i.y,l="width"in i?0|i.width:At.framebufferWidth-a,u="height"in i?0|i.height:At.framebufferHeight-o,p=At.viewportWidth,At.viewportWidth=l,d=At.viewportHeight,At.viewportHeight=u,g=ie[0],ie[0]=a,v=ie[1],ie[1]=o,x=ie[2],ie[2]=l,w=ie[3],ie[3]=u,k=Rt[0],Rt[0]=F,T=Rt[1],Rt[1]=B,M=Rt[2],Rt[2]=N,S=Rt[3],Rt[3]=j,z=kt.blend_enable,kt.blend_enable=V,L=jt[0],jt[0]=U,C=jt[1],jt[1]=H,P=jt[2],jt[2]=q,O=jt[3],jt[3]=G,I=kt.depth_enable,kt.depth_enable=W,R=0|(D=t.viewport).x,vt=0|D.y,bt="width"in D?0|D.width:At.framebufferWidth-R,xt="height"in D?0|D.height:At.framebufferHeight-vt,_t=re[0],re[0]=R,wt=re[1],re[1]=vt,Lt=re[2],re[2]=bt,Ct=re[3],re[3]=xt,Ot=kt.scissor_enable,kt.scissor_enable=Y,It=kt.stencil_enable,kt.stencil_enable=Z,(Ft=Tt.profile)&&(Bt=performance.now(),e.count++),Nt=t.elements,Vt=null,Vt=(Ut=Dt(Nt))?St.createStream(Nt):St.getElements(Nt),Ht=Mt.elements,Mt.elements=Vt,qt=t.offset,Gt=Mt.offset,Mt.offset=qt,Wt=t.count,Yt=Mt.count,Mt.count=Wt,Zt=Mt.primitive,Mt.primitive=X,Xt=Pt[J],Pt[J]=!1,Jt=Pt[Q],Pt[Q]=K,Kt=t.opacity,Qt=Pt[$],Pt[$]=Kt,$t=E.call(this,At,t,n),te=Pt[tt],Pt[tt]=$t,ee=At.pixelRatio,ne=Pt[et],Pt[et]=ee,ae=t.scale,se=Pt[rt],Pt[rt]=ae,le=t.scaleFract,ce=Pt[nt],Pt[nt]=le,ue=t.translate,fe=Pt[it],Pt[it]=ue,pe=t.translateFract,he=Pt[at],Pt[at]=pe,de=t.markerTexture,me=Pt[ot],Pt[ot]=de,ge=y.call(this,At,t,n),ye=!1,ve=1,be=0,xe=0,_e=0,we=0,Ae=null,ke=0,Te=!1,Me=5126,Se=0,ze=0,Ee=0,Dt(ge)?(ye=!0,Me=(Ae=zt.createStream(34962,ge)).dtype):(Ae=zt.getBuffer(ge))?Me=Ae.dtype:"constant"in ge?(ve=2,"number"==typeof ge.constant?(be=ge.constant,xe=_e=we=0):(be=ge.constant.length>0?ge.constant[0]:0,xe=ge.constant.length>1?ge.constant[1]:0,_e=ge.constant.length>2?ge.constant[2]:0,we=ge.constant.length>3?ge.constant[3]:0)):(Ae=Dt(ge.buffer)?zt.createStream(34962,ge.buffer):zt.getBuffer(ge.buffer),Me="type"in ge?oe[ge.type]:Ae.dtype,Te=!!ge.normalized,ke=0|ge.size,Se=0|ge.offset,ze=0|ge.stride,Ee=0|ge.divisor),Le=st.state,st.state=ve,Ce=st.x,st.x=be,Pe=st.y,st.y=xe,Oe=st.z,st.z=_e,Ie=st.w,st.w=we,De=st.buffer,st.buffer=Ae,Re=st.size,st.size=ke,Fe=st.normalized,st.normalized=Te,Be=st.type,st.type=Me,Ne=st.offset,st.offset=Se,je=st.stride,st.stride=ze,Ve=st.divisor,st.divisor=Ee,Ue=_.call(this,At,t,n),He=!1,qe=1,Ge=0,We=0,Ye=0,Ze=0,Xe=null,Je=0,Ke=!1,Qe=5126,$e=0,tr=0,er=0,Dt(Ue)?(He=!0,Qe=(Xe=zt.createStream(34962,Ue)).dtype):(Xe=zt.getBuffer(Ue))?Qe=Xe.dtype:"constant"in Ue?(qe=2,"number"==typeof Ue.constant?(Ge=Ue.constant,We=Ye=Ze=0):(Ge=Ue.constant.length>0?Ue.constant[0]:0,We=Ue.constant.length>1?Ue.constant[1]:0,Ye=Ue.constant.length>2?Ue.constant[2]:0,Ze=Ue.constant.length>3?Ue.constant[3]:0)):(Xe=Dt(Ue.buffer)?zt.createStream(34962,Ue.buffer):zt.getBuffer(Ue.buffer),Qe="type"in Ue?oe[Ue.type]:Xe.dtype,Ke=!!Ue.normalized,Je=0|Ue.size,$e=0|Ue.offset,tr=0|Ue.stride,er=0|Ue.divisor),rr=lt.state,lt.state=qe,nr=lt.x,lt.x=Ge,ir=lt.y,lt.y=We,ar=lt.z,lt.z=Ye,or=lt.w,lt.w=Ze,sr=lt.buffer,lt.buffer=Xe,lr=lt.size,lt.size=Je,cr=lt.normalized,lt.normalized=Ke,ur=lt.type,lt.type=Qe,fr=lt.offset,lt.offset=$e,pr=lt.stride,lt.stride=tr,hr=lt.divisor,lt.divisor=er,dr=b.call(this,At,t,n),mr=!1,gr=1,yr=0,vr=0,br=0,xr=0,_r=null,wr=0,Ar=!1,kr=5126,Tr=0,Mr=0,Sr=0,Dt(dr)?(mr=!0,kr=(_r=zt.createStream(34962,dr)).dtype):(_r=zt.getBuffer(dr))?kr=_r.dtype:"constant"in dr?(gr=2,"number"==typeof dr.constant?(yr=dr.constant,vr=br=xr=0):(yr=dr.constant.length>0?dr.constant[0]:0,vr=dr.constant.length>1?dr.constant[1]:0,br=dr.constant.length>2?dr.constant[2]:0,xr=dr.constant.length>3?dr.constant[3]:0)):(_r=Dt(dr.buffer)?zt.createStream(34962,dr.buffer):zt.getBuffer(dr.buffer),kr="type"in dr?oe[dr.type]:_r.dtype,Ar=!!dr.normalized,wr=0|dr.size,Tr=0|dr.offset,Mr=0|dr.stride,Sr=0|dr.divisor),zr=ct.state,ct.state=gr,Er=ct.x,ct.x=yr,Lr=ct.y,ct.y=vr,Cr=ct.z,ct.z=br,Pr=ct.w,ct.w=xr,Or=ct.buffer,ct.buffer=_r,Ir=ct.size,ct.size=wr,Dr=ct.normalized,ct.normalized=Ar,Rr=ct.type,ct.type=kr,Fr=ct.offset,ct.offset=Tr,Br=ct.stride,ct.stride=Mr,Nr=ct.divisor,ct.divisor=Sr,jr=A.call(this,At,t,n),Vr=!1,Ur=1,Hr=0,qr=0,Gr=0,Wr=0,Yr=null,Zr=0,Xr=!1,Jr=5126,Kr=0,Qr=0,$r=0,Dt(jr)?(Vr=!0,Jr=(Yr=zt.createStream(34962,jr)).dtype):(Yr=zt.getBuffer(jr))?Jr=Yr.dtype:"constant"in jr?(Ur=2,"number"==typeof jr.constant?(Hr=jr.constant,qr=Gr=Wr=0):(Hr=jr.constant.length>0?jr.constant[0]:0,qr=jr.constant.length>1?jr.constant[1]:0,Gr=jr.constant.length>2?jr.constant[2]:0,Wr=jr.constant.length>3?jr.constant[3]:0)):(Yr=Dt(jr.buffer)?zt.createStream(34962,jr.buffer):zt.getBuffer(jr.buffer),Jr="type"in jr?oe[jr.type]:Yr.dtype,Xr=!!jr.normalized,Zr=0|jr.size,Kr=0|jr.offset,Qr=0|jr.stride,$r=0|jr.divisor),tn=ut.state,ut.state=Ur,en=ut.x,ut.x=Hr,rn=ut.y,ut.y=qr,nn=ut.z,ut.z=Gr,an=ut.w,ut.w=Wr,on=ut.buffer,ut.buffer=Yr,sn=ut.size,ut.size=Zr,ln=ut.normalized,ut.normalized=Xr,cn=ut.type,ut.type=Jr,un=ut.offset,ut.offset=Kr,fn=ut.stride,ut.stride=Qr,pn=ut.divisor,ut.divisor=$r,hn=m.call(this,At,t,n),dn=!1,mn=1,gn=0,yn=0,vn=0,bn=0,xn=null,_n=0,wn=!1,An=5126,kn=0,Tn=0,Mn=0,Dt(hn)?(dn=!0,An=(xn=zt.createStream(34962,hn)).dtype):(xn=zt.getBuffer(hn))?An=xn.dtype:"constant"in hn?(mn=2,"number"==typeof hn.constant?(gn=hn.constant,yn=vn=bn=0):(gn=hn.constant.length>0?hn.constant[0]:0,yn=hn.constant.length>1?hn.constant[1]:0,vn=hn.constant.length>2?hn.constant[2]:0,bn=hn.constant.length>3?hn.constant[3]:0)):(xn=Dt(hn.buffer)?zt.createStream(34962,hn.buffer):zt.getBuffer(hn.buffer),An="type"in hn?oe[hn.type]:xn.dtype,wn=!!hn.normalized,_n=0|hn.size,kn=0|hn.offset,Tn=0|hn.stride,Mn=0|hn.divisor),Sn=ft.state,ft.state=mn,zn=ft.x,ft.x=gn,En=ft.y,ft.y=yn,Ln=ft.z,ft.z=vn,Cn=ft.w,ft.w=bn,Pn=ft.buffer,ft.buffer=xn,On=ft.size,ft.size=_n,In=ft.normalized,ft.normalized=wn,Dn=ft.type,ft.type=An,Rn=ft.offset,ft.offset=kn,Fn=ft.stride,ft.stride=Tn,Bn=ft.divisor,ft.divisor=Mn,Nn=c.call(this,At,t,n),jn=!1,Vn=1,Un=0,Hn=0,qn=0,Gn=0,Wn=null,Yn=0,Zn=!1,Xn=5126,Jn=0,Kn=0,Qn=0,Dt(Nn)?(jn=!0,Xn=(Wn=zt.createStream(34962,Nn)).dtype):(Wn=zt.getBuffer(Nn))?Xn=Wn.dtype:"constant"in Nn?(Vn=2,"number"==typeof Nn.constant?(Un=Nn.constant,Hn=qn=Gn=0):(Un=Nn.constant.length>0?Nn.constant[0]:0,Hn=Nn.constant.length>1?Nn.constant[1]:0,qn=Nn.constant.length>2?Nn.constant[2]:0,Gn=Nn.constant.length>3?Nn.constant[3]:0)):(Wn=Dt(Nn.buffer)?zt.createStream(34962,Nn.buffer):zt.getBuffer(Nn.buffer),Xn="type"in Nn?oe[Nn.type]:Wn.dtype,Zn=!!Nn.normalized,Yn=0|Nn.size,Jn=0|Nn.offset,Kn=0|Nn.stride,Qn=0|Nn.divisor),$n=pt.state,pt.state=Vn,ti=pt.x,pt.x=Un,ei=pt.y,pt.y=Hn,ri=pt.z,pt.z=qn,ni=pt.w,pt.w=Gn,ii=pt.buffer,pt.buffer=Wn,ai=pt.size,pt.size=Yn,oi=pt.normalized,pt.normalized=Zn,si=pt.type,pt.type=Xn,li=pt.offset,pt.offset=Jn,ci=pt.stride,pt.stride=Kn,ui=pt.divisor,pt.divisor=Qn,fi=f.call(this,At,t,n),pi=!1,hi=1,di=0,mi=0,gi=0,yi=0,vi=null,bi=0,xi=!1,_i=5126,wi=0,Ai=0,ki=0,Dt(fi)?(pi=!0,_i=(vi=zt.createStream(34962,fi)).dtype):(vi=zt.getBuffer(fi))?_i=vi.dtype:"constant"in fi?(hi=2,"number"==typeof fi.constant?(di=fi.constant,mi=gi=yi=0):(di=fi.constant.length>0?fi.constant[0]:0,mi=fi.constant.length>1?fi.constant[1]:0,gi=fi.constant.length>2?fi.constant[2]:0,yi=fi.constant.length>3?fi.constant[3]:0)):(vi=Dt(fi.buffer)?zt.createStream(34962,fi.buffer):zt.getBuffer(fi.buffer),_i="type"in fi?oe[fi.type]:vi.dtype,xi=!!fi.normalized,bi=0|fi.size,wi=0|fi.offset,Ai=0|fi.stride,ki=0|fi.divisor),Ti=ht.state,ht.state=hi,Mi=ht.x,ht.x=di,Si=ht.y,ht.y=mi,zi=ht.z,ht.z=gi,Ei=ht.w,ht.w=yi,Li=ht.buffer,ht.buffer=vi,Ci=ht.size,ht.size=bi,Pi=ht.normalized,ht.normalized=xi,Oi=ht.type,ht.type=_i,Ii=ht.offset,ht.offset=wi,Di=ht.stride,ht.stride=Ai,Ri=ht.divisor,ht.divisor=ki,Fi=s.call(this,At,t,n),Bi=!1,Ni=1,ji=0,Vi=0,Ui=0,Hi=0,qi=null,Gi=0,Wi=!1,Yi=5126,Zi=0,Xi=0,Ji=0,Dt(Fi)?(Bi=!0,Yi=(qi=zt.createStream(34962,Fi)).dtype):(qi=zt.getBuffer(Fi))?Yi=qi.dtype:"constant"in Fi?(Ni=2,"number"==typeof Fi.constant?(ji=Fi.constant,Vi=Ui=Hi=0):(ji=Fi.constant.length>0?Fi.constant[0]:0,Vi=Fi.constant.length>1?Fi.constant[1]:0,Ui=Fi.constant.length>2?Fi.constant[2]:0,Hi=Fi.constant.length>3?Fi.constant[3]:0)):(qi=Dt(Fi.buffer)?zt.createStream(34962,Fi.buffer):zt.getBuffer(Fi.buffer),Yi="type"in Fi?oe[Fi.type]:qi.dtype,Wi=!!Fi.normalized,Gi=0|Fi.size,Zi=0|Fi.offset,Xi=0|Fi.stride,Ji=0|Fi.divisor),Ki=dt.state,dt.state=Ni,Qi=dt.x,dt.x=ji,$i=dt.y,dt.y=Vi,ta=dt.z,dt.z=Ui,ea=dt.w,dt.w=Hi,ra=dt.buffer,dt.buffer=qi,na=dt.size,dt.size=Gi,ia=dt.normalized,dt.normalized=Wi,aa=dt.type,dt.type=Yi,oa=dt.offset,dt.offset=Zi,sa=dt.stride,dt.stride=Xi,la=dt.divisor,dt.divisor=Ji,ca=h.call(this,At,t,n),ua=!1,fa=1,pa=0,ha=0,da=0,ma=0,ga=null,ya=0,va=!1,ba=5126,xa=0,_a=0,wa=0,Dt(ca)?(ua=!0,ba=(ga=zt.createStream(34962,ca)).dtype):(ga=zt.getBuffer(ca))?ba=ga.dtype:"constant"in ca?(fa=2,"number"==typeof ca.constant?(pa=ca.constant,ha=da=ma=0):(pa=ca.constant.length>0?ca.constant[0]:0,ha=ca.constant.length>1?ca.constant[1]:0,da=ca.constant.length>2?ca.constant[2]:0,ma=ca.constant.length>3?ca.constant[3]:0)):(ga=Dt(ca.buffer)?zt.createStream(34962,ca.buffer):zt.getBuffer(ca.buffer),ba="type"in ca?oe[ca.type]:ga.dtype,va=!!ca.normalized,ya=0|ca.size,xa=0|ca.offset,_a=0|ca.stride,wa=0|ca.divisor),Aa=mt.state,mt.state=fa,ka=mt.x,mt.x=pa,Ta=mt.y,mt.y=ha,Ma=mt.z,mt.z=da,Sa=mt.w,mt.w=ma,za=mt.buffer,mt.buffer=ga,Ea=mt.size,mt.size=ya,La=mt.normalized,mt.normalized=va,Ca=mt.type,mt.type=ba,Pa=mt.offset,mt.offset=xa,Oa=mt.stride,mt.stride=_a,Ia=mt.divisor,mt.divisor=wa,Da=Et.vert,Et.vert=gt,Ra=Et.frag,Et.frag=yt,Tt.dirty=!0,r(At,t,n),At.viewportWidth=p,At.viewportHeight=d,ie[0]=g,ie[1]=v,ie[2]=x,ie[3]=w,Rt[0]=k,Rt[1]=T,Rt[2]=M,Rt[3]=S,kt.blend_enable=z,jt[0]=L,jt[1]=C,jt[2]=P,jt[3]=O,kt.depth_enable=I,re[0]=_t,re[1]=wt,re[2]=Lt,re[3]=Ct,kt.scissor_enable=Ot,kt.stencil_enable=It,Ft&&(e.cpuTime+=performance.now()-Bt),Ut&&St.destroyStream(Vt),Mt.elements=Ht,Mt.offset=Gt,Mt.count=Yt,Mt.primitive=Zt,Pt[J]=Xt,Pt[Q]=Jt,Pt[$]=Qt,Pt[tt]=te,Pt[et]=ne,Pt[rt]=se,Pt[nt]=ce,Pt[it]=fe,Pt[at]=he,Pt[ot]=me,ye&&zt.destroyStream(Ae),st.state=Le,st.x=Ce,st.y=Pe,st.z=Oe,st.w=Ie,st.buffer=De,st.size=Re,st.normalized=Fe,st.type=Be,st.offset=Ne,st.stride=je,st.divisor=Ve,He&&zt.destroyStream(Xe),lt.state=rr,lt.x=nr,lt.y=ir,lt.z=ar,lt.w=or,lt.buffer=sr,lt.size=lr,lt.normalized=cr,lt.type=ur,lt.offset=fr,lt.stride=pr,lt.divisor=hr,mr&&zt.destroyStream(_r),ct.state=zr,ct.x=Er,ct.y=Lr,ct.z=Cr,ct.w=Pr,ct.buffer=Or,ct.size=Ir,ct.normalized=Dr,ct.type=Rr,ct.offset=Fr,ct.stride=Br,ct.divisor=Nr,Vr&&zt.destroyStream(Yr),ut.state=tn,ut.x=en,ut.y=rn,ut.z=nn,ut.w=an,ut.buffer=on,ut.size=sn,ut.normalized=ln,ut.type=cn,ut.offset=un,ut.stride=fn,ut.divisor=pn,dn&&zt.destroyStream(xn),ft.state=Sn,ft.x=zn,ft.y=En,ft.z=Ln,ft.w=Cn,ft.buffer=Pn,ft.size=On,ft.normalized=In,ft.type=Dn,ft.offset=Rn,ft.stride=Fn,ft.divisor=Bn,jn&&zt.destroyStream(Wn),pt.state=$n,pt.x=ti,pt.y=ei,pt.z=ri,pt.w=ni,pt.buffer=ii,pt.size=ai,pt.normalized=oi,pt.type=si,pt.offset=li,pt.stride=ci,pt.divisor=ui,pi&&zt.destroyStream(vi),ht.state=Ti,ht.x=Mi,ht.y=Si,ht.z=zi,ht.w=Ei,ht.buffer=Li,ht.size=Ci,ht.normalized=Pi,ht.type=Oi,ht.offset=Ii,ht.stride=Di,ht.divisor=Ri,Bi&&zt.destroyStream(qi),dt.state=Ki,dt.x=Qi,dt.y=$i,dt.z=ta,dt.w=ea,dt.buffer=ra,dt.size=na,dt.normalized=ia,dt.type=aa,dt.offset=oa,dt.stride=sa,dt.divisor=la,ua&&zt.destroyStream(ga),mt.state=Aa,mt.x=ka,mt.y=Ta,mt.z=Ma,mt.w=Sa,mt.buffer=za,mt.size=Ea,mt.normalized=La,mt.type=Ca,mt.offset=Pa,mt.stride=Oa,mt.divisor=Ia,Et.vert=Da,Et.frag=Ra,Tt.dirty=!0},batch:function(t,r){var n,i,a,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,mt,gt,yt,Et,Pt,Rt;(It.angle_instanced_arrays,(n=Ot.next)!==Ot.cur&&(n?wt.bindFramebuffer(36160,n.framebuffer):wt.bindFramebuffer(36160,null),Ot.cur=n),Tt.dirty)&&((j=kt.dither)!==Tt.dither&&(j?wt.enable(3024):wt.disable(3024),Tt.dither=j),V=Bt[0],U=Bt[1],V===Nt[0]&&U===Nt[1]||(wt.blendEquationSeparate(V,U),Nt[0]=V,Nt[1]=U),(H=kt.depth_func)!==Tt.depth_func&&(wt.depthFunc(H),Tt.depth_func=H),q=Ut[0],G=Ut[1],q===Ht[0]&&G===Ht[1]||(wt.depthRange(q,G),Ht[0]=q,Ht[1]=G),(W=kt.depth_mask)!==Tt.depth_mask&&(wt.depthMask(W),Tt.depth_mask=W),Y=qt[0],Z=qt[1],X=qt[2],J=qt[3],Y===Gt[0]&&Z===Gt[1]&&X===Gt[2]&&J===Gt[3]||(wt.colorMask(Y,Z,X,J),Gt[0]=Y,Gt[1]=Z,Gt[2]=X,Gt[3]=J),(K=kt.cull_enable)!==Tt.cull_enable&&(K?wt.enable(2884):wt.disable(2884),Tt.cull_enable=K),(Q=kt.cull_face)!==Tt.cull_face&&(wt.cullFace(Q),Tt.cull_face=Q),($=kt.frontFace)!==Tt.frontFace&&(wt.frontFace($),Tt.frontFace=$),(tt=kt.lineWidth)!==Tt.lineWidth&&(wt.lineWidth(tt),Tt.lineWidth=tt),(et=kt.polygonOffset_enable)!==Tt.polygonOffset_enable&&(et?wt.enable(32823):wt.disable(32823),Tt.polygonOffset_enable=et),rt=Wt[0],nt=Wt[1],rt===Yt[0]&&nt===Yt[1]||(wt.polygonOffset(rt,nt),Yt[0]=rt,Yt[1]=nt),(it=kt.sample_alpha)!==Tt.sample_alpha&&(it?wt.enable(32926):wt.disable(32926),Tt.sample_alpha=it),(at=kt.sample_enable)!==Tt.sample_enable&&(at?wt.enable(32928):wt.disable(32928),Tt.sample_enable=at),ot=Zt[0],st=Zt[1],ot===Xt[0]&&st===Xt[1]||(wt.sampleCoverage(ot,st),Xt[0]=ot,Xt[1]=st),(lt=kt.stencil_mask)!==Tt.stencil_mask&&(wt.stencilMask(lt),Tt.stencil_mask=lt),ct=Jt[0],ut=Jt[1],ft=Jt[2],ct===Kt[0]&&ut===Kt[1]&&ft===Kt[2]||(wt.stencilFunc(ct,ut,ft),Kt[0]=ct,Kt[1]=ut,Kt[2]=ft),pt=Qt[0],ht=Qt[1],dt=Qt[2],mt=Qt[3],pt===$t[0]&&ht===$t[1]&&dt===$t[2]&&mt===$t[3]||(wt.stencilOpSeparate(pt,ht,dt,mt),$t[0]=pt,$t[1]=ht,$t[2]=dt,$t[3]=mt),gt=te[0],yt=te[1],Et=te[2],Pt=te[3],gt===ee[0]&&yt===ee[1]&&Et===ee[2]&&Pt===ee[3]||(wt.stencilOpSeparate(gt,yt,Et,Pt),ee[0]=gt,ee[1]=yt,ee[2]=Et,ee[3]=Pt));for(wt.blendColor(0,0,0,1),Ft[0]=0,Ft[1]=0,Ft[2]=0,Ft[3]=1,vt?wt.enable(3042):wt.disable(3042),Tt.blend_enable=vt,wt.blendFuncSeparate(770,771,773,1),Vt[0]=770,Vt[1]=771,Vt[2]=773,Vt[3]=1,bt?wt.enable(2929):wt.disable(2929),Tt.depth_enable=bt,xt?wt.enable(3089):wt.disable(3089),Tt.scissor_enable=xt,_t?wt.enable(2960):wt.disable(2960),Tt.stencil_enable=_t,(i=Tt.profile)&&(a=performance.now(),e.count+=r),wt.useProgram(o.program),F=It.angle_instanced_arrays,Ct.setVAO(null),wt.uniform1i(T.location,!1),wt.uniform1i(L.location,C.bind()),Rt=Mt.instances,B=0;B0?ge.constant[0]:0,xe=ge.constant.length>1?ge.constant[1]:0,_e=ge.constant.length>2?ge.constant[2]:0,we=ge.constant.length>3?ge.constant[3]:0)):(Ae=Dt(ge.buffer)?zt.createStream(34962,ge.buffer):zt.getBuffer(ge.buffer),Me="type"in ge?oe[ge.type]:Ae.dtype,Te=!!ge.normalized,ke=0|ge.size,Se=0|ge.offset,ze=0|ge.stride,Ee=0|ge.divisor),Le=l.location,Ce=Lt[Le],1===ve?(Ce.buffer||wt.enableVertexAttribArray(Le),Pe=ke||4,Ce.type===Me&&Ce.size===Pe&&Ce.buffer===Ae&&Ce.normalized===Te&&Ce.offset===Se&&Ce.stride===ze||(wt.bindBuffer(34962,Ae.buffer),wt.vertexAttribPointer(Le,Pe,Me,Te,ze,Se),Ce.type=Me,Ce.size=Pe,Ce.buffer=Ae,Ce.normalized=Te,Ce.offset=Se,Ce.stride=ze),Ce.divisor!==Ee&&(F.vertexAttribDivisorANGLE(Le,Ee),Ce.divisor=Ee)):(Ce.buffer&&(wt.disableVertexAttribArray(Le),Ce.buffer=null),Ce.x===be&&Ce.y===xe&&Ce.z===_e&&Ce.w===we||(wt.vertexAttrib4f(Le,be,xe,_e,we),Ce.x=be,Ce.y=xe,Ce.z=_e,Ce.w=we)),Oe=c.call(this,At,N,B),Ie=!1,De=1,Re=0,Fe=0,Be=0,Ne=0,je=null,Ve=0,Ue=!1,He=5126,qe=0,Ge=0,We=0,Dt(Oe)?(Ie=!0,He=(je=zt.createStream(34962,Oe)).dtype):(je=zt.getBuffer(Oe))?He=je.dtype:"constant"in Oe?(De=2,"number"==typeof Oe.constant?(Re=Oe.constant,Fe=Be=Ne=0):(Re=Oe.constant.length>0?Oe.constant[0]:0,Fe=Oe.constant.length>1?Oe.constant[1]:0,Be=Oe.constant.length>2?Oe.constant[2]:0,Ne=Oe.constant.length>3?Oe.constant[3]:0)):(je=Dt(Oe.buffer)?zt.createStream(34962,Oe.buffer):zt.getBuffer(Oe.buffer),He="type"in Oe?oe[Oe.type]:je.dtype,Ue=!!Oe.normalized,Ve=0|Oe.size,qe=0|Oe.offset,Ge=0|Oe.stride,We=0|Oe.divisor),Ye=u.location,Ze=Lt[Ye],1===De?(Ze.buffer||wt.enableVertexAttribArray(Ye),Xe=Ve||1,Ze.type===He&&Ze.size===Xe&&Ze.buffer===je&&Ze.normalized===Ue&&Ze.offset===qe&&Ze.stride===Ge||(wt.bindBuffer(34962,je.buffer),wt.vertexAttribPointer(Ye,Xe,He,Ue,Ge,qe),Ze.type=He,Ze.size=Xe,Ze.buffer=je,Ze.normalized=Ue,Ze.offset=qe,Ze.stride=Ge),Ze.divisor!==We&&(F.vertexAttribDivisorANGLE(Ye,We),Ze.divisor=We)):(Ze.buffer&&(wt.disableVertexAttribArray(Ye),Ze.buffer=null),Ze.x===Re&&Ze.y===Fe&&Ze.z===Be&&Ze.w===Ne||(wt.vertexAttrib4f(Ye,Re,Fe,Be,Ne),Ze.x=Re,Ze.y=Fe,Ze.z=Be,Ze.w=Ne)),Je=f.call(this,At,N,B),Ke=!1,Qe=1,$e=0,tr=0,er=0,rr=0,nr=null,ir=0,ar=!1,or=5126,sr=0,lr=0,cr=0,Dt(Je)?(Ke=!0,or=(nr=zt.createStream(34962,Je)).dtype):(nr=zt.getBuffer(Je))?or=nr.dtype:"constant"in Je?(Qe=2,"number"==typeof Je.constant?($e=Je.constant,tr=er=rr=0):($e=Je.constant.length>0?Je.constant[0]:0,tr=Je.constant.length>1?Je.constant[1]:0,er=Je.constant.length>2?Je.constant[2]:0,rr=Je.constant.length>3?Je.constant[3]:0)):(nr=Dt(Je.buffer)?zt.createStream(34962,Je.buffer):zt.getBuffer(Je.buffer),or="type"in Je?oe[Je.type]:nr.dtype,ar=!!Je.normalized,ir=0|Je.size,sr=0|Je.offset,lr=0|Je.stride,cr=0|Je.divisor),ur=p.location,fr=Lt[ur],1===Qe?(fr.buffer||wt.enableVertexAttribArray(ur),pr=ir||4,fr.type===or&&fr.size===pr&&fr.buffer===nr&&fr.normalized===ar&&fr.offset===sr&&fr.stride===lr||(wt.bindBuffer(34962,nr.buffer),wt.vertexAttribPointer(ur,pr,or,ar,lr,sr),fr.type=or,fr.size=pr,fr.buffer=nr,fr.normalized=ar,fr.offset=sr,fr.stride=lr),fr.divisor!==cr&&(F.vertexAttribDivisorANGLE(ur,cr),fr.divisor=cr)):(fr.buffer&&(wt.disableVertexAttribArray(ur),fr.buffer=null),fr.x===$e&&fr.y===tr&&fr.z===er&&fr.w===rr||(wt.vertexAttrib4f(ur,$e,tr,er,rr),fr.x=$e,fr.y=tr,fr.z=er,fr.w=rr)),hr=h.call(this,At,N,B),dr=!1,mr=1,gr=0,yr=0,vr=0,br=0,xr=null,_r=0,wr=!1,Ar=5126,kr=0,Tr=0,Mr=0,Dt(hr)?(dr=!0,Ar=(xr=zt.createStream(34962,hr)).dtype):(xr=zt.getBuffer(hr))?Ar=xr.dtype:"constant"in hr?(mr=2,"number"==typeof hr.constant?(gr=hr.constant,yr=vr=br=0):(gr=hr.constant.length>0?hr.constant[0]:0,yr=hr.constant.length>1?hr.constant[1]:0,vr=hr.constant.length>2?hr.constant[2]:0,br=hr.constant.length>3?hr.constant[3]:0)):(xr=Dt(hr.buffer)?zt.createStream(34962,hr.buffer):zt.getBuffer(hr.buffer),Ar="type"in hr?oe[hr.type]:xr.dtype,wr=!!hr.normalized,_r=0|hr.size,kr=0|hr.offset,Tr=0|hr.stride,Mr=0|hr.divisor),Sr=d.location,zr=Lt[Sr],1===mr?(zr.buffer||wt.enableVertexAttribArray(Sr),Er=_r||1,zr.type===Ar&&zr.size===Er&&zr.buffer===xr&&zr.normalized===wr&&zr.offset===kr&&zr.stride===Tr||(wt.bindBuffer(34962,xr.buffer),wt.vertexAttribPointer(Sr,Er,Ar,wr,Tr,kr),zr.type=Ar,zr.size=Er,zr.buffer=xr,zr.normalized=wr,zr.offset=kr,zr.stride=Tr),zr.divisor!==Mr&&(F.vertexAttribDivisorANGLE(Sr,Mr),zr.divisor=Mr)):(zr.buffer&&(wt.disableVertexAttribArray(Sr),zr.buffer=null),zr.x===gr&&zr.y===yr&&zr.z===vr&&zr.w===br||(wt.vertexAttrib4f(Sr,gr,yr,vr,br),zr.x=gr,zr.y=yr,zr.z=vr,zr.w=br)),Lr=m.call(this,At,N,B),Cr=!1,Pr=1,Or=0,Ir=0,Dr=0,Rr=0,Fr=null,Br=0,Nr=!1,jr=5126,Vr=0,Ur=0,Hr=0,Dt(Lr)?(Cr=!0,jr=(Fr=zt.createStream(34962,Lr)).dtype):(Fr=zt.getBuffer(Lr))?jr=Fr.dtype:"constant"in Lr?(Pr=2,"number"==typeof Lr.constant?(Or=Lr.constant,Ir=Dr=Rr=0):(Or=Lr.constant.length>0?Lr.constant[0]:0,Ir=Lr.constant.length>1?Lr.constant[1]:0,Dr=Lr.constant.length>2?Lr.constant[2]:0,Rr=Lr.constant.length>3?Lr.constant[3]:0)):(Fr=Dt(Lr.buffer)?zt.createStream(34962,Lr.buffer):zt.getBuffer(Lr.buffer),jr="type"in Lr?oe[Lr.type]:Fr.dtype,Nr=!!Lr.normalized,Br=0|Lr.size,Vr=0|Lr.offset,Ur=0|Lr.stride,Hr=0|Lr.divisor),qr=g.location,Gr=Lt[qr],1===Pr?(Gr.buffer||wt.enableVertexAttribArray(qr),Wr=Br||1,Gr.type===jr&&Gr.size===Wr&&Gr.buffer===Fr&&Gr.normalized===Nr&&Gr.offset===Vr&&Gr.stride===Ur||(wt.bindBuffer(34962,Fr.buffer),wt.vertexAttribPointer(qr,Wr,jr,Nr,Ur,Vr),Gr.type=jr,Gr.size=Wr,Gr.buffer=Fr,Gr.normalized=Nr,Gr.offset=Vr,Gr.stride=Ur),Gr.divisor!==Hr&&(F.vertexAttribDivisorANGLE(qr,Hr),Gr.divisor=Hr)):(Gr.buffer&&(wt.disableVertexAttribArray(qr),Gr.buffer=null),Gr.x===Or&&Gr.y===Ir&&Gr.z===Dr&&Gr.w===Rr||(wt.vertexAttrib4f(qr,Or,Ir,Dr,Rr),Gr.x=Or,Gr.y=Ir,Gr.z=Dr,Gr.w=Rr)),Yr=y.call(this,At,N,B),Zr=!1,Xr=1,Jr=0,Kr=0,Qr=0,$r=0,tn=null,en=0,rn=!1,nn=5126,an=0,on=0,sn=0,Dt(Yr)?(Zr=!0,nn=(tn=zt.createStream(34962,Yr)).dtype):(tn=zt.getBuffer(Yr))?nn=tn.dtype:"constant"in Yr?(Xr=2,"number"==typeof Yr.constant?(Jr=Yr.constant,Kr=Qr=$r=0):(Jr=Yr.constant.length>0?Yr.constant[0]:0,Kr=Yr.constant.length>1?Yr.constant[1]:0,Qr=Yr.constant.length>2?Yr.constant[2]:0,$r=Yr.constant.length>3?Yr.constant[3]:0)):(tn=Dt(Yr.buffer)?zt.createStream(34962,Yr.buffer):zt.getBuffer(Yr.buffer),nn="type"in Yr?oe[Yr.type]:tn.dtype,rn=!!Yr.normalized,en=0|Yr.size,an=0|Yr.offset,on=0|Yr.stride,sn=0|Yr.divisor),ln=v.location,cn=Lt[ln],1===Xr?(cn.buffer||wt.enableVertexAttribArray(ln),un=en||1,cn.type===nn&&cn.size===un&&cn.buffer===tn&&cn.normalized===rn&&cn.offset===an&&cn.stride===on||(wt.bindBuffer(34962,tn.buffer),wt.vertexAttribPointer(ln,un,nn,rn,on,an),cn.type=nn,cn.size=un,cn.buffer=tn,cn.normalized=rn,cn.offset=an,cn.stride=on),cn.divisor!==sn&&(F.vertexAttribDivisorANGLE(ln,sn),cn.divisor=sn)):(cn.buffer&&(wt.disableVertexAttribArray(ln),cn.buffer=null),cn.x===Jr&&cn.y===Kr&&cn.z===Qr&&cn.w===$r||(wt.vertexAttrib4f(ln,Jr,Kr,Qr,$r),cn.x=Jr,cn.y=Kr,cn.z=Qr,cn.w=$r)),fn=b.call(this,At,N,B),pn=!1,hn=1,dn=0,mn=0,gn=0,yn=0,vn=null,bn=0,xn=!1,_n=5126,wn=0,An=0,kn=0,Dt(fn)?(pn=!0,_n=(vn=zt.createStream(34962,fn)).dtype):(vn=zt.getBuffer(fn))?_n=vn.dtype:"constant"in fn?(hn=2,"number"==typeof fn.constant?(dn=fn.constant,mn=gn=yn=0):(dn=fn.constant.length>0?fn.constant[0]:0,mn=fn.constant.length>1?fn.constant[1]:0,gn=fn.constant.length>2?fn.constant[2]:0,yn=fn.constant.length>3?fn.constant[3]:0)):(vn=Dt(fn.buffer)?zt.createStream(34962,fn.buffer):zt.getBuffer(fn.buffer),_n="type"in fn?oe[fn.type]:vn.dtype,xn=!!fn.normalized,bn=0|fn.size,wn=0|fn.offset,An=0|fn.stride,kn=0|fn.divisor),Tn=x.location,Mn=Lt[Tn],1===hn?(Mn.buffer||wt.enableVertexAttribArray(Tn),Sn=bn||1,Mn.type===_n&&Mn.size===Sn&&Mn.buffer===vn&&Mn.normalized===xn&&Mn.offset===wn&&Mn.stride===An||(wt.bindBuffer(34962,vn.buffer),wt.vertexAttribPointer(Tn,Sn,_n,xn,An,wn),Mn.type=_n,Mn.size=Sn,Mn.buffer=vn,Mn.normalized=xn,Mn.offset=wn,Mn.stride=An),Mn.divisor!==kn&&(F.vertexAttribDivisorANGLE(Tn,kn),Mn.divisor=kn)):(Mn.buffer&&(wt.disableVertexAttribArray(Tn),Mn.buffer=null),Mn.x===dn&&Mn.y===mn&&Mn.z===gn&&Mn.w===yn||(wt.vertexAttrib4f(Tn,dn,mn,gn,yn),Mn.x=dn,Mn.y=mn,Mn.z=gn,Mn.w=yn)),zn=_.call(this,At,N,B),En=!1,Ln=1,Cn=0,Pn=0,On=0,In=0,Dn=null,Rn=0,Fn=!1,Bn=5126,Nn=0,jn=0,Vn=0,Dt(zn)?(En=!0,Bn=(Dn=zt.createStream(34962,zn)).dtype):(Dn=zt.getBuffer(zn))?Bn=Dn.dtype:"constant"in zn?(Ln=2,"number"==typeof zn.constant?(Cn=zn.constant,Pn=On=In=0):(Cn=zn.constant.length>0?zn.constant[0]:0,Pn=zn.constant.length>1?zn.constant[1]:0,On=zn.constant.length>2?zn.constant[2]:0,In=zn.constant.length>3?zn.constant[3]:0)):(Dn=Dt(zn.buffer)?zt.createStream(34962,zn.buffer):zt.getBuffer(zn.buffer),Bn="type"in zn?oe[zn.type]:Dn.dtype,Fn=!!zn.normalized,Rn=0|zn.size,Nn=0|zn.offset,jn=0|zn.stride,Vn=0|zn.divisor),Un=w.location,Hn=Lt[Un],1===Ln?(Hn.buffer||wt.enableVertexAttribArray(Un),qn=Rn||1,Hn.type===Bn&&Hn.size===qn&&Hn.buffer===Dn&&Hn.normalized===Fn&&Hn.offset===Nn&&Hn.stride===jn||(wt.bindBuffer(34962,Dn.buffer),wt.vertexAttribPointer(Un,qn,Bn,Fn,jn,Nn),Hn.type=Bn,Hn.size=qn,Hn.buffer=Dn,Hn.normalized=Fn,Hn.offset=Nn,Hn.stride=jn),Hn.divisor!==Vn&&(F.vertexAttribDivisorANGLE(Un,Vn),Hn.divisor=Vn)):(Hn.buffer&&(wt.disableVertexAttribArray(Un),Hn.buffer=null),Hn.x===Cn&&Hn.y===Pn&&Hn.z===On&&Hn.w===In||(wt.vertexAttrib4f(Un,Cn,Pn,On,In),Hn.x=Cn,Hn.y=Pn,Hn.z=On,Hn.w=In)),Gn=A.call(this,At,N,B),Wn=!1,Yn=1,Zn=0,Xn=0,Jn=0,Kn=0,Qn=null,$n=0,ti=!1,ei=5126,ri=0,ni=0,ii=0,Dt(Gn)?(Wn=!0,ei=(Qn=zt.createStream(34962,Gn)).dtype):(Qn=zt.getBuffer(Gn))?ei=Qn.dtype:"constant"in Gn?(Yn=2,"number"==typeof Gn.constant?(Zn=Gn.constant,Xn=Jn=Kn=0):(Zn=Gn.constant.length>0?Gn.constant[0]:0,Xn=Gn.constant.length>1?Gn.constant[1]:0,Jn=Gn.constant.length>2?Gn.constant[2]:0,Kn=Gn.constant.length>3?Gn.constant[3]:0)):(Qn=Dt(Gn.buffer)?zt.createStream(34962,Gn.buffer):zt.getBuffer(Gn.buffer),ei="type"in Gn?oe[Gn.type]:Qn.dtype,ti=!!Gn.normalized,$n=0|Gn.size,ri=0|Gn.offset,ni=0|Gn.stride,ii=0|Gn.divisor),ai=k.location,oi=Lt[ai],1===Yn?(oi.buffer||wt.enableVertexAttribArray(ai),si=$n||1,oi.type===ei&&oi.size===si&&oi.buffer===Qn&&oi.normalized===ti&&oi.offset===ri&&oi.stride===ni||(wt.bindBuffer(34962,Qn.buffer),wt.vertexAttribPointer(ai,si,ei,ti,ni,ri),oi.type=ei,oi.size=si,oi.buffer=Qn,oi.normalized=ti,oi.offset=ri,oi.stride=ni),oi.divisor!==ii&&(F.vertexAttribDivisorANGLE(ai,ii),oi.divisor=ii)):(oi.buffer&&(wt.disableVertexAttribArray(ai),oi.buffer=null),oi.x===Zn&&oi.y===Xn&&oi.z===Jn&&oi.w===Kn||(wt.vertexAttrib4f(ai,Zn,Xn,Jn,Kn),oi.x=Zn,oi.y=Xn,oi.z=Jn,oi.w=Kn)),(li=N.markerTexture)&&"framebuffer"===li._reglType&&(li=li.color[0]),ci=li._texture,wt.uniform1i(M.location,ci.bind()),ui=N.opacity,B&&fi===ui||(fi=ui,wt.uniform1f(S.location,ui)),hi=(pi=E.call(this,At,N,B))[0],mi=pi[1],B&&di===hi&&gi===mi||(di=hi,gi=mi,wt.uniform2f(z.location,hi,mi)),yi=At.pixelRatio,B&&vi===yi||(vi=yi,wt.uniform1f(P.location,yi)),xi=(bi=N.scale)[0],wi=bi[1],B&&_i===xi&&Ai===wi||(_i=xi,Ai=wi,wt.uniform2f(O.location,xi,wi)),Ti=(ki=N.scaleFract)[0],Si=ki[1],B&&Mi===Ti&&zi===Si||(Mi=Ti,zi=Si,wt.uniform2f(I.location,Ti,Si)),Li=(Ei=N.translate)[0],Pi=Ei[1],B&&Ci===Li&&Oi===Pi||(Ci=Li,Oi=Pi,wt.uniform2f(D.location,Li,Pi)),Di=(Ii=N.translateFract)[0],Fi=Ii[1],B&&Ri===Di&&Bi===Fi||(Ri=Di,Bi=Fi,wt.uniform2f(R.location,Di,Fi)),Ni=N.elements,ji=null,(ji=(Vi=Dt(Ni))?St.createStream(Ni):St.getElements(Ni))&&wt.bindBuffer(34963,ji.buffer.buffer),Ui=N.offset,(Hi=N.count)&&(Rt>0?ji?F.drawElementsInstancedANGLE(0,Hi,ji.type,Ui<<(ji.type-5121>>1),Rt):F.drawArraysInstancedANGLE(0,Ui,Hi,Rt):Rt<0&&(ji?wt.drawElements(0,Hi,ji.type,Ui<<(ji.type-5121>>1)):wt.drawArrays(0,Ui,Hi)),At.viewportWidth=ce,At.viewportHeight=ue,ye&&zt.destroyStream(Ae),Ie&&zt.destroyStream(je),Ke&&zt.destroyStream(nr),dr&&zt.destroyStream(xr),Cr&&zt.destroyStream(Fr),Zr&&zt.destroyStream(tn),pn&&zt.destroyStream(vn),En&&zt.destroyStream(Dn),Wn&&zt.destroyStream(Qn),ci.unbind(),Vi&&St.destroyStream(ji))}C.unbind(),Tt.dirty=!0,Ct.setVAO(null),i&&(e.cpuTime+=performance.now()-a)}}}},{}],504:[function(t,e,r){e.exports=function(t,e,r,n,i,a,o,s,l,c,u,f,p,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt){"use strict";var mt,gt,yt,vt,bt,xt,_t,wt,At,kt,Tt,Mt,St,zt,Et,Lt,Ct,Pt,Ot,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Xt,Jt,Kt,Qt,$t,te,ee,re,ne,ie;return mt=t.gl,gt=t.context,t.strings,yt=t.next,vt=t.current,bt=t.draw,xt=t.elements,_t=t.buffer,wt=t.shader,At=t.attributes,kt=t.vao,Tt=t.uniforms,Mt=t.framebuffer,St=t.extensions,t.timer,zt=t.isBufferArgs,Et=yt.blend_color,Lt=vt.blend_color,Ct=yt.blend_equation,Pt=vt.blend_equation,Ot=yt.blend_func,It=vt.blend_func,Dt=yt.depth_range,Rt=vt.depth_range,Ft=yt.colorMask,Bt=vt.colorMask,Nt=yt.polygonOffset_offset,jt=vt.polygonOffset_offset,Vt=yt.sample_coverage,Ut=vt.sample_coverage,Ht=yt.stencil_func,qt=vt.stencil_func,Gt=yt.stencil_opFront,Wt=vt.stencil_opFront,Yt=yt.stencil_opBack,Zt=vt.stencil_opBack,Xt=yt.scissor_box,Jt=vt.scissor_box,Kt=yt.viewport,Qt=vt.viewport,{points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},{never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},{0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},{add:32774,subtract:32778,"reverse subtract":32779},{0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$t={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},{cw:2304,ccw:2305},(te={}).stride=8,te.offset=8,te.divisor=1,(ee={}).stride=8,ee.offset=16,ee.divisor=1,(re={}).stride=8,re.offset=8,re.divisor=1,(ne={}).stride=8,ne.offset=16,ne.divisor=1,(ie={}).stride=4,ie.offset=0,ie.divisor=1,{draw:function(t){var M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,pt,ht,dt,wt,Tt,Et,Ct,Ot,Xt,Kt,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un;(St.angle_instanced_arrays,(M=Mt.next)!==Mt.cur&&(M?mt.bindFramebuffer(36160,M.framebuffer):mt.bindFramebuffer(36160,null),Mt.cur=M),vt.dirty)&&((Pr=yt.dither)!==vt.dither&&(Pr?mt.enable(3024):mt.disable(3024),vt.dither=Pr),(Or=yt.depth_func)!==vt.depth_func&&(mt.depthFunc(Or),vt.depth_func=Or),Ir=Dt[0],Dr=Dt[1],Ir===Rt[0]&&Dr===Rt[1]||(mt.depthRange(Ir,Dr),Rt[0]=Ir,Rt[1]=Dr),(Rr=yt.depth_mask)!==vt.depth_mask&&(mt.depthMask(Rr),vt.depth_mask=Rr),Fr=Ft[0],Br=Ft[1],Nr=Ft[2],jr=Ft[3],Fr===Bt[0]&&Br===Bt[1]&&Nr===Bt[2]&&jr===Bt[3]||(mt.colorMask(Fr,Br,Nr,jr),Bt[0]=Fr,Bt[1]=Br,Bt[2]=Nr,Bt[3]=jr),(Vr=yt.cull_enable)!==vt.cull_enable&&(Vr?mt.enable(2884):mt.disable(2884),vt.cull_enable=Vr),(Ur=yt.cull_face)!==vt.cull_face&&(mt.cullFace(Ur),vt.cull_face=Ur),(Hr=yt.frontFace)!==vt.frontFace&&(mt.frontFace(Hr),vt.frontFace=Hr),(qr=yt.lineWidth)!==vt.lineWidth&&(mt.lineWidth(qr),vt.lineWidth=qr),(Gr=yt.polygonOffset_enable)!==vt.polygonOffset_enable&&(Gr?mt.enable(32823):mt.disable(32823),vt.polygonOffset_enable=Gr),Wr=Nt[0],Yr=Nt[1],Wr===jt[0]&&Yr===jt[1]||(mt.polygonOffset(Wr,Yr),jt[0]=Wr,jt[1]=Yr),(Zr=yt.sample_alpha)!==vt.sample_alpha&&(Zr?mt.enable(32926):mt.disable(32926),vt.sample_alpha=Zr),(Xr=yt.sample_enable)!==vt.sample_enable&&(Xr?mt.enable(32928):mt.disable(32928),vt.sample_enable=Xr),Jr=Vt[0],Kr=Vt[1],Jr===Ut[0]&&Kr===Ut[1]||(mt.sampleCoverage(Jr,Kr),Ut[0]=Jr,Ut[1]=Kr),(Qr=yt.stencil_mask)!==vt.stencil_mask&&(mt.stencilMask(Qr),vt.stencil_mask=Qr),$r=Ht[0],tn=Ht[1],en=Ht[2],$r===qt[0]&&tn===qt[1]&&en===qt[2]||(mt.stencilFunc($r,tn,en),qt[0]=$r,qt[1]=tn,qt[2]=en),rn=Gt[0],nn=Gt[1],an=Gt[2],on=Gt[3],rn===Wt[0]&&nn===Wt[1]&&an===Wt[2]&&on===Wt[3]||(mt.stencilOpSeparate(rn,nn,an,on),Wt[0]=rn,Wt[1]=nn,Wt[2]=an,Wt[3]=on),sn=Yt[0],ln=Yt[1],cn=Yt[2],un=Yt[3],sn===Zt[0]&&ln===Zt[1]&&cn===Zt[2]&&un===Zt[3]||(mt.stencilOpSeparate(sn,ln,cn,un),Zt[0]=sn,Zt[1]=ln,Zt[2]=cn,Zt[3]=un));z=0|(S=t.viewport).x,E=0|S.y,L="width"in S?0|S.width:gt.framebufferWidth-z,C="height"in S?0|S.height:gt.framebufferHeight-E,P=gt.viewportWidth,gt.viewportWidth=L,O=gt.viewportHeight,gt.viewportHeight=C,mt.viewport(z,E,L,C),Qt[0]=z,Qt[1]=E,Qt[2]=L,Qt[3]=C,mt.blendColor(0,0,0,0),Lt[0]=0,Lt[1]=0,Lt[2]=0,Lt[3]=0,r?mt.enable(3042):mt.disable(3042),vt.blend_enable=r,mt.blendEquationSeparate(32774,32774),Pt[0]=32774,Pt[1]=32774,mt.blendFuncSeparate(770,771,773,1),It[0]=770,It[1]=771,It[2]=773,It[3]=1,(I=n.call(this,gt,t,0))?mt.enable(2929):mt.disable(2929),vt.depth_enable=I,R=0|(D=t.viewport).x,F=0|D.y,B="width"in D?0|D.width:gt.framebufferWidth-R,N="height"in D?0|D.height:gt.framebufferHeight-F,mt.scissor(R,F,B,N),Jt[0]=R,Jt[1]=F,Jt[2]=B,Jt[3]=N,i?mt.enable(3089):mt.disable(3089),vt.scissor_enable=i,a?mt.enable(2960):mt.disable(2960),vt.stencil_enable=a,(j=vt.profile)&&(V=performance.now(),e.count++),mt.useProgram(o.program),U=St.angle_instanced_arrays,kt.setVAO(null),H=t.positionBuffer,te.buffer=H,q=!1,G=1,W=0,Y=0,Z=0,X=0,J=null,K=0,Q=!1,$=5126,tt=0,et=0,rt=0,zt(te)?(q=!0,$=(J=_t.createStream(34962,te)).dtype):(J=_t.getBuffer(te))?$=J.dtype:"constant"in te?(G=2,"number"==typeof te.constant?(W=te.constant,Y=Z=X=0):(W=te.constant.length>0?te.constant[0]:0,Y=te.constant.length>1?te.constant[1]:0,Z=te.constant.length>2?te.constant[2]:0,X=te.constant.length>3?te.constant[3]:0)):(J=zt(te.buffer)?_t.createStream(34962,te.buffer):_t.getBuffer(te.buffer),$="type"in te?$t[te.type]:J.dtype,Q=!!te.normalized,K=0|te.size,tt=0|te.offset,et=0|te.stride,rt=0|te.divisor),nt=s.location,it=At[nt],1===G?(it.buffer||mt.enableVertexAttribArray(nt),at=K||2,it.type===$&&it.size===at&&it.buffer===J&&it.normalized===Q&&it.offset===tt&&it.stride===et||(mt.bindBuffer(34962,J.buffer),mt.vertexAttribPointer(nt,at,$,Q,et,tt),it.type=$,it.size=at,it.buffer=J,it.normalized=Q,it.offset=tt,it.stride=et),it.divisor!==rt&&(U.vertexAttribDivisorANGLE(nt,rt),it.divisor=rt)):(it.buffer&&(mt.disableVertexAttribArray(nt),it.buffer=null),it.x===W&&it.y===Y&&it.z===Z&&it.w===X||(mt.vertexAttrib4f(nt,W,Y,Z,X),it.x=W,it.y=Y,it.z=Z,it.w=X)),ot=t.positionFractBuffer,re.buffer=ot,st=!1,lt=1,ct=0,ut=0,ft=0,pt=0,ht=null,dt=0,wt=!1,Tt=5126,Et=0,Ct=0,Ot=0,zt(re)?(st=!0,Tt=(ht=_t.createStream(34962,re)).dtype):(ht=_t.getBuffer(re))?Tt=ht.dtype:"constant"in re?(lt=2,"number"==typeof re.constant?(ct=re.constant,ut=ft=pt=0):(ct=re.constant.length>0?re.constant[0]:0,ut=re.constant.length>1?re.constant[1]:0,ft=re.constant.length>2?re.constant[2]:0,pt=re.constant.length>3?re.constant[3]:0)):(ht=zt(re.buffer)?_t.createStream(34962,re.buffer):_t.getBuffer(re.buffer),Tt="type"in re?$t[re.type]:ht.dtype,wt=!!re.normalized,dt=0|re.size,Et=0|re.offset,Ct=0|re.stride,Ot=0|re.divisor),Xt=l.location,Kt=At[Xt],1===lt?(Kt.buffer||mt.enableVertexAttribArray(Xt),ae=dt||2,Kt.type===Tt&&Kt.size===ae&&Kt.buffer===ht&&Kt.normalized===wt&&Kt.offset===Et&&Kt.stride===Ct||(mt.bindBuffer(34962,ht.buffer),mt.vertexAttribPointer(Xt,ae,Tt,wt,Ct,Et),Kt.type=Tt,Kt.size=ae,Kt.buffer=ht,Kt.normalized=wt,Kt.offset=Et,Kt.stride=Ct),Kt.divisor!==Ot&&(U.vertexAttribDivisorANGLE(Xt,Ot),Kt.divisor=Ot)):(Kt.buffer&&(mt.disableVertexAttribArray(Xt),Kt.buffer=null),Kt.x===ct&&Kt.y===ut&&Kt.z===ft&&Kt.w===pt||(mt.vertexAttrib4f(Xt,ct,ut,ft,pt),Kt.x=ct,Kt.y=ut,Kt.z=ft,Kt.w=pt)),oe=t.positionBuffer,ee.buffer=oe,se=!1,le=1,ce=0,ue=0,fe=0,pe=0,he=null,de=0,me=!1,ge=5126,ye=0,ve=0,be=0,zt(ee)?(se=!0,ge=(he=_t.createStream(34962,ee)).dtype):(he=_t.getBuffer(ee))?ge=he.dtype:"constant"in ee?(le=2,"number"==typeof ee.constant?(ce=ee.constant,ue=fe=pe=0):(ce=ee.constant.length>0?ee.constant[0]:0,ue=ee.constant.length>1?ee.constant[1]:0,fe=ee.constant.length>2?ee.constant[2]:0,pe=ee.constant.length>3?ee.constant[3]:0)):(he=zt(ee.buffer)?_t.createStream(34962,ee.buffer):_t.getBuffer(ee.buffer),ge="type"in ee?$t[ee.type]:he.dtype,me=!!ee.normalized,de=0|ee.size,ye=0|ee.offset,ve=0|ee.stride,be=0|ee.divisor),xe=c.location,_e=At[xe],1===le?(_e.buffer||mt.enableVertexAttribArray(xe),we=de||2,_e.type===ge&&_e.size===we&&_e.buffer===he&&_e.normalized===me&&_e.offset===ye&&_e.stride===ve||(mt.bindBuffer(34962,he.buffer),mt.vertexAttribPointer(xe,we,ge,me,ve,ye),_e.type=ge,_e.size=we,_e.buffer=he,_e.normalized=me,_e.offset=ye,_e.stride=ve),_e.divisor!==be&&(U.vertexAttribDivisorANGLE(xe,be),_e.divisor=be)):(_e.buffer&&(mt.disableVertexAttribArray(xe),_e.buffer=null),_e.x===ce&&_e.y===ue&&_e.z===fe&&_e.w===pe||(mt.vertexAttrib4f(xe,ce,ue,fe,pe),_e.x=ce,_e.y=ue,_e.z=fe,_e.w=pe)),Ae=t.positionFractBuffer,ne.buffer=Ae,ke=!1,Te=1,Me=0,Se=0,ze=0,Ee=0,Le=null,Ce=0,Pe=!1,Oe=5126,Ie=0,De=0,Re=0,zt(ne)?(ke=!0,Oe=(Le=_t.createStream(34962,ne)).dtype):(Le=_t.getBuffer(ne))?Oe=Le.dtype:"constant"in ne?(Te=2,"number"==typeof ne.constant?(Me=ne.constant,Se=ze=Ee=0):(Me=ne.constant.length>0?ne.constant[0]:0,Se=ne.constant.length>1?ne.constant[1]:0,ze=ne.constant.length>2?ne.constant[2]:0,Ee=ne.constant.length>3?ne.constant[3]:0)):(Le=zt(ne.buffer)?_t.createStream(34962,ne.buffer):_t.getBuffer(ne.buffer),Oe="type"in ne?$t[ne.type]:Le.dtype,Pe=!!ne.normalized,Ce=0|ne.size,Ie=0|ne.offset,De=0|ne.stride,Re=0|ne.divisor),Fe=u.location,Be=At[Fe],1===Te?(Be.buffer||mt.enableVertexAttribArray(Fe),Ne=Ce||2,Be.type===Oe&&Be.size===Ne&&Be.buffer===Le&&Be.normalized===Pe&&Be.offset===Ie&&Be.stride===De||(mt.bindBuffer(34962,Le.buffer),mt.vertexAttribPointer(Fe,Ne,Oe,Pe,De,Ie),Be.type=Oe,Be.size=Ne,Be.buffer=Le,Be.normalized=Pe,Be.offset=Ie,Be.stride=De),Be.divisor!==Re&&(U.vertexAttribDivisorANGLE(Fe,Re),Be.divisor=Re)):(Be.buffer&&(mt.disableVertexAttribArray(Fe),Be.buffer=null),Be.x===Me&&Be.y===Se&&Be.z===ze&&Be.w===Ee||(mt.vertexAttrib4f(Fe,Me,Se,ze,Ee),Be.x=Me,Be.y=Se,Be.z=ze,Be.w=Ee)),je=t.colorBuffer,ie.buffer=je,Ve=!1,Ue=1,He=0,qe=0,Ge=0,We=0,Ye=null,Ze=0,Xe=!1,Je=5126,Ke=0,Qe=0,$e=0,zt(ie)?(Ve=!0,Je=(Ye=_t.createStream(34962,ie)).dtype):(Ye=_t.getBuffer(ie))?Je=Ye.dtype:"constant"in ie?(Ue=2,"number"==typeof ie.constant?(He=ie.constant,qe=Ge=We=0):(He=ie.constant.length>0?ie.constant[0]:0,qe=ie.constant.length>1?ie.constant[1]:0,Ge=ie.constant.length>2?ie.constant[2]:0,We=ie.constant.length>3?ie.constant[3]:0)):(Ye=zt(ie.buffer)?_t.createStream(34962,ie.buffer):_t.getBuffer(ie.buffer),Je="type"in ie?$t[ie.type]:Ye.dtype,Xe=!!ie.normalized,Ze=0|ie.size,Ke=0|ie.offset,Qe=0|ie.stride,$e=0|ie.divisor),tr=f.location,er=At[tr],1===Ue?(er.buffer||mt.enableVertexAttribArray(tr),rr=Ze||4,er.type===Je&&er.size===rr&&er.buffer===Ye&&er.normalized===Xe&&er.offset===Ke&&er.stride===Qe||(mt.bindBuffer(34962,Ye.buffer),mt.vertexAttribPointer(tr,rr,Je,Xe,Qe,Ke),er.type=Je,er.size=rr,er.buffer=Ye,er.normalized=Xe,er.offset=Ke,er.stride=Qe),er.divisor!==$e&&(U.vertexAttribDivisorANGLE(tr,$e),er.divisor=$e)):(er.buffer&&(mt.disableVertexAttribArray(tr),er.buffer=null),er.x===He&&er.y===qe&&er.z===Ge&&er.w===We||(mt.vertexAttrib4f(tr,He,qe,Ge,We),er.x=He,er.y=qe,er.z=Ge,er.w=We)),nr=h.location,(ir=At[nr]).buffer||mt.enableVertexAttribArray(nr),5126===ir.type&&1===ir.size&&ir.buffer===p&&!1===ir.normalized&&0===ir.offset&&8===ir.stride||(mt.bindBuffer(34962,p.buffer),mt.vertexAttribPointer(nr,1,5126,!1,8,0),ir.type=5126,ir.size=1,ir.buffer=p,ir.normalized=!1,ir.offset=0,ir.stride=8),0!==ir.divisor&&(U.vertexAttribDivisorANGLE(nr,0),ir.divisor=0),ar=d.location,(or=At[ar]).buffer||mt.enableVertexAttribArray(ar),5126===or.type&&1===or.size&&or.buffer===p&&!1===or.normalized&&4===or.offset&&8===or.stride||(mt.bindBuffer(34962,p.buffer),mt.vertexAttribPointer(ar,1,5126,!1,8,4),or.type=5126,or.size=1,or.buffer=p,or.normalized=!1,or.offset=4,or.stride=8),0!==or.divisor&&(U.vertexAttribDivisorANGLE(ar,0),or.divisor=0),sr=t.dashLength,mt.uniform1f(m.location,sr),(lr=t.dashTexture)&&"framebuffer"===lr._reglType&&(lr=lr.color[0]),cr=lr._texture,mt.uniform1i(g.location,cr.bind()),ur=t.depth,mt.uniform1f(y.location,ur),fr=t.opacity,mt.uniform1f(v.location,fr),hr=(pr=t.scale)[0],dr=pr[1],mt.uniform2f(b.location,hr,dr),gr=(mr=t.scaleFract)[0],yr=mr[1],mt.uniform2f(x.location,gr,yr),vr=t.thickness,mt.uniform1f(_.location,vr),xr=(br=t.translate)[0],_r=br[1],mt.uniform2f(w.location,xr,_r),Ar=(wr=t.translateFract)[0],kr=wr[1],mt.uniform2f(A.location,Ar,kr),Mr=(Tr=T.call(this,gt,t,0))[0],Sr=Tr[1],zr=Tr[2],Er=Tr[3],mt.uniform4f(k.location,Mr,Sr,zr,Er),((Lr=bt.elements)||kt.currentVAO&&(Lr=xt.getElements(kt.currentVAO.elements)))&&mt.bindBuffer(34963,Lr.buffer.buffer),(Cr=t.count)>0?Lr?U.drawElementsInstancedANGLE(5,4,Lr.type,0<<(Lr.type-5121>>1),Cr):U.drawArraysInstancedANGLE(5,0,4,Cr):Cr<0&&(Lr?mt.drawElements(5,4,Lr.type,0<<(Lr.type-5121>>1)):mt.drawArrays(5,0,4)),vt.dirty=!0,kt.setVAO(null),gt.viewportWidth=P,gt.viewportHeight=O,j&&(e.cpuTime+=performance.now()-V),q&&_t.destroyStream(J),st&&_t.destroyStream(ht),se&&_t.destroyStream(he),ke&&_t.destroyStream(Le),Ve&&_t.destroyStream(Ye),cr.unbind()},scope:function(t,r,i){var a,o,s,l,c,u,f,h,d,m,g,y,v,b,x,_,w,A,k,pt,ht,dt,mt,xt,At,kt,Mt,St,Lt,Pt,It,Dt,Rt,Ft,Bt,Nt,jt,Vt,Ut,Ht,qt,Gt,Wt,Yt,Zt,Jt,Qt,ae,oe,se,le,ce,ue,fe,pe,he,de,me,ge,ye,ve,be,xe,_e,we,Ae,ke,Te,Me,Se,ze,Ee,Le,Ce,Pe,Oe,Ie,De,Re,Fe,Be,Ne,je,Ve,Ue,He,qe,Ge,We,Ye,Ze,Xe,Je,Ke,Qe,$e,tr,er,rr,nr,ir,ar,or,sr,lr,cr,ur,fr,pr,hr,dr,mr,gr,yr,vr,br,xr,_r,wr,Ar,kr,Tr,Mr,Sr,zr,Er,Lr,Cr,Pr,Or,Ir,Dr,Rr,Fr,Br,Nr,jr,Vr,Ur,Hr,qr,Gr,Wr,Yr,Zr,Xr,Jr,Kr,Qr,$r,tn,en,rn,nn,an,on,sn,ln,cn,un,fn,pn,hn,dn,mn,gn,yn,vn,bn,xn,_n,wn,An,kn,Tn,Mn,Sn,zn,En,Ln,Cn,Pn,On,In,Dn,Rn,Fn,Bn,Nn,jn,Vn,Un,Hn,qn,Gn,Wn,Yn,Zn,Xn,Jn,Kn,Qn,$n,ti,ei,ri,ni,ii,ai,oi,si,li,ci,ui,fi,pi,hi,di,mi,gi,yi,vi,bi,xi,_i,wi;o=0|(a=t.viewport).x,s=0|a.y,l="width"in a?0|a.width:gt.framebufferWidth-o,c="height"in a?0|a.height:gt.framebufferHeight-s,u=gt.viewportWidth,gt.viewportWidth=l,f=gt.viewportHeight,gt.viewportHeight=c,h=Kt[0],Kt[0]=o,d=Kt[1],Kt[1]=s,m=Kt[2],Kt[2]=l,g=Kt[3],Kt[3]=c,y=Et[0],Et[0]=M,v=Et[1],Et[1]=S,b=Et[2],Et[2]=z,x=Et[3],Et[3]=E,_=yt.blend_enable,yt.blend_enable=L,w=Ct[0],Ct[0]=C,A=Ct[1],Ct[1]=P,k=Ot[0],Ot[0]=O,pt=Ot[1],Ot[1]=I,ht=Ot[2],Ot[2]=D,dt=Ot[3],Ot[3]=R,mt=n.call(this,gt,t,i),xt=yt.depth_enable,yt.depth_enable=mt,kt=0|(At=t.viewport).x,Mt=0|At.y,St="width"in At?0|At.width:gt.framebufferWidth-kt,Lt="height"in At?0|At.height:gt.framebufferHeight-Mt,Pt=Xt[0],Xt[0]=kt,It=Xt[1],Xt[1]=Mt,Dt=Xt[2],Xt[2]=St,Rt=Xt[3],Xt[3]=Lt,Ft=yt.scissor_enable,yt.scissor_enable=F,Bt=yt.stencil_enable,yt.stencil_enable=B,(Nt=vt.profile)&&(jt=performance.now(),e.count++),Vt=bt.offset,bt.offset=N,Ut=bt.count,bt.count=j,Ht=t.count,qt=bt.instances,bt.instances=Ht,Gt=bt.primitive,bt.primitive=V,Wt=U.call(this,gt,t,i),Yt=Tt[H],Tt[H]=Wt,Zt=t.miterLimit,Jt=Tt[q],Tt[q]=Zt,Qt=t.scale,ae=Tt[G],Tt[G]=Qt,oe=t.scaleFract,se=Tt[W],Tt[W]=oe,le=t.translateFract,ce=Tt[Y],Tt[Y]=le,ue=t.translate,fe=Tt[Z],Tt[Z]=ue,pe=t.thickness,he=Tt[X],Tt[X]=pe,de=t.dashTexture,me=Tt[J],Tt[J]=de,ge=t.opacity,ye=Tt[K],Tt[K]=ge,ve=gt.pixelRatio,be=Tt[Q],Tt[Q]=ve,xe=t.id,_e=Tt[$],Tt[$]=xe,we=t.dashLength,Ae=Tt[tt],Tt[tt]=we,ke=T.call(this,gt,t,i),Te=Tt[et],Tt[et]=ke,Me=t.depth,Se=Tt[rt],Tt[rt]=Me,ze=nt.state,nt.state=1,Ee=nt.x,nt.x=0,Le=nt.y,nt.y=0,Ce=nt.z,nt.z=0,Pe=nt.w,nt.w=0,Oe=nt.buffer,nt.buffer=p,Ie=nt.size,nt.size=0,De=nt.normalized,nt.normalized=!1,Re=nt.type,nt.type=5126,Fe=nt.offset,nt.offset=0,Be=nt.stride,nt.stride=8,Ne=nt.divisor,nt.divisor=0,je=it.state,it.state=1,Ve=it.x,it.x=0,Ue=it.y,it.y=0,He=it.z,it.z=0,qe=it.w,it.w=0,Ge=it.buffer,it.buffer=p,We=it.size,it.size=0,Ye=it.normalized,it.normalized=!1,Ze=it.type,it.type=5126,Xe=it.offset,it.offset=4,Je=it.stride,it.stride=8,Ke=it.divisor,it.divisor=0,Qe=t.positionBuffer,te.buffer=Qe,$e=!1,tr=1,er=0,rr=0,nr=0,ir=0,ar=null,or=0,sr=!1,lr=5126,cr=0,ur=0,fr=0,zt(te)?($e=!0,lr=(ar=_t.createStream(34962,te)).dtype):(ar=_t.getBuffer(te))?lr=ar.dtype:"constant"in te?(tr=2,"number"==typeof te.constant?(er=te.constant,rr=nr=ir=0):(er=te.constant.length>0?te.constant[0]:0,rr=te.constant.length>1?te.constant[1]:0,nr=te.constant.length>2?te.constant[2]:0,ir=te.constant.length>3?te.constant[3]:0)):(ar=zt(te.buffer)?_t.createStream(34962,te.buffer):_t.getBuffer(te.buffer),lr="type"in te?$t[te.type]:ar.dtype,sr=!!te.normalized,or=0|te.size,cr=0|te.offset,ur=0|te.stride,fr=0|te.divisor),pr=at.state,at.state=tr,hr=at.x,at.x=er,dr=at.y,at.y=rr,mr=at.z,at.z=nr,gr=at.w,at.w=ir,yr=at.buffer,at.buffer=ar,vr=at.size,at.size=or,br=at.normalized,at.normalized=sr,xr=at.type,at.type=lr,_r=at.offset,at.offset=cr,wr=at.stride,at.stride=ur,Ar=at.divisor,at.divisor=fr,kr=t.positionBuffer,ee.buffer=kr,Tr=!1,Mr=1,Sr=0,zr=0,Er=0,Lr=0,Cr=null,Pr=0,Or=!1,Ir=5126,Dr=0,Rr=0,Fr=0,zt(ee)?(Tr=!0,Ir=(Cr=_t.createStream(34962,ee)).dtype):(Cr=_t.getBuffer(ee))?Ir=Cr.dtype:"constant"in ee?(Mr=2,"number"==typeof ee.constant?(Sr=ee.constant,zr=Er=Lr=0):(Sr=ee.constant.length>0?ee.constant[0]:0,zr=ee.constant.length>1?ee.constant[1]:0,Er=ee.constant.length>2?ee.constant[2]:0,Lr=ee.constant.length>3?ee.constant[3]:0)):(Cr=zt(ee.buffer)?_t.createStream(34962,ee.buffer):_t.getBuffer(ee.buffer),Ir="type"in ee?$t[ee.type]:Cr.dtype,Or=!!ee.normalized,Pr=0|ee.size,Dr=0|ee.offset,Rr=0|ee.stride,Fr=0|ee.divisor),Br=ot.state,ot.state=Mr,Nr=ot.x,ot.x=Sr,jr=ot.y,ot.y=zr,Vr=ot.z,ot.z=Er,Ur=ot.w,ot.w=Lr,Hr=ot.buffer,ot.buffer=Cr,qr=ot.size,ot.size=Pr,Gr=ot.normalized,ot.normalized=Or,Wr=ot.type,ot.type=Ir,Yr=ot.offset,ot.offset=Dr,Zr=ot.stride,ot.stride=Rr,Xr=ot.divisor,ot.divisor=Fr,Jr=t.positionFractBuffer,re.buffer=Jr,Kr=!1,Qr=1,$r=0,tn=0,en=0,rn=0,nn=null,an=0,on=!1,sn=5126,ln=0,cn=0,un=0,zt(re)?(Kr=!0,sn=(nn=_t.createStream(34962,re)).dtype):(nn=_t.getBuffer(re))?sn=nn.dtype:"constant"in re?(Qr=2,"number"==typeof re.constant?($r=re.constant,tn=en=rn=0):($r=re.constant.length>0?re.constant[0]:0,tn=re.constant.length>1?re.constant[1]:0,en=re.constant.length>2?re.constant[2]:0,rn=re.constant.length>3?re.constant[3]:0)):(nn=zt(re.buffer)?_t.createStream(34962,re.buffer):_t.getBuffer(re.buffer),sn="type"in re?$t[re.type]:nn.dtype,on=!!re.normalized,an=0|re.size,ln=0|re.offset,cn=0|re.stride,un=0|re.divisor),fn=st.state,st.state=Qr,pn=st.x,st.x=$r,hn=st.y,st.y=tn,dn=st.z,st.z=en,mn=st.w,st.w=rn,gn=st.buffer,st.buffer=nn,yn=st.size,st.size=an,vn=st.normalized,st.normalized=on,bn=st.type,st.type=sn,xn=st.offset,st.offset=ln,_n=st.stride,st.stride=cn,wn=st.divisor,st.divisor=un,An=t.positionFractBuffer,ne.buffer=An,kn=!1,Tn=1,Mn=0,Sn=0,zn=0,En=0,Ln=null,Cn=0,Pn=!1,On=5126,In=0,Dn=0,Rn=0,zt(ne)?(kn=!0,On=(Ln=_t.createStream(34962,ne)).dtype):(Ln=_t.getBuffer(ne))?On=Ln.dtype:"constant"in ne?(Tn=2,"number"==typeof ne.constant?(Mn=ne.constant,Sn=zn=En=0):(Mn=ne.constant.length>0?ne.constant[0]:0,Sn=ne.constant.length>1?ne.constant[1]:0,zn=ne.constant.length>2?ne.constant[2]:0,En=ne.constant.length>3?ne.constant[3]:0)):(Ln=zt(ne.buffer)?_t.createStream(34962,ne.buffer):_t.getBuffer(ne.buffer),On="type"in ne?$t[ne.type]:Ln.dtype,Pn=!!ne.normalized,Cn=0|ne.size,In=0|ne.offset,Dn=0|ne.stride,Rn=0|ne.divisor),Fn=lt.state,lt.state=Tn,Bn=lt.x,lt.x=Mn,Nn=lt.y,lt.y=Sn,jn=lt.z,lt.z=zn,Vn=lt.w,lt.w=En,Un=lt.buffer,lt.buffer=Ln,Hn=lt.size,lt.size=Cn,qn=lt.normalized,lt.normalized=Pn,Gn=lt.type,lt.type=On,Wn=lt.offset,lt.offset=In,Yn=lt.stride,lt.stride=Dn,Zn=lt.divisor,lt.divisor=Rn,Xn=t.colorBuffer,ie.buffer=Xn,Jn=!1,Kn=1,Qn=0,$n=0,ti=0,ei=0,ri=null,ni=0,ii=!1,ai=5126,oi=0,si=0,li=0,zt(ie)?(Jn=!0,ai=(ri=_t.createStream(34962,ie)).dtype):(ri=_t.getBuffer(ie))?ai=ri.dtype:"constant"in ie?(Kn=2,"number"==typeof ie.constant?(Qn=ie.constant,$n=ti=ei=0):(Qn=ie.constant.length>0?ie.constant[0]:0,$n=ie.constant.length>1?ie.constant[1]:0,ti=ie.constant.length>2?ie.constant[2]:0,ei=ie.constant.length>3?ie.constant[3]:0)):(ri=zt(ie.buffer)?_t.createStream(34962,ie.buffer):_t.getBuffer(ie.buffer),ai="type"in ie?$t[ie.type]:ri.dtype,ii=!!ie.normalized,ni=0|ie.size,oi=0|ie.offset,si=0|ie.stride,li=0|ie.divisor),ci=ct.state,ct.state=Kn,ui=ct.x,ct.x=Qn,fi=ct.y,ct.y=$n,pi=ct.z,ct.z=ti,hi=ct.w,ct.w=ei,di=ct.buffer,ct.buffer=ri,mi=ct.size,ct.size=ni,gi=ct.normalized,ct.normalized=ii,yi=ct.type,ct.type=ai,vi=ct.offset,ct.offset=oi,bi=ct.stride,ct.stride=si,xi=ct.divisor,ct.divisor=li,_i=wt.vert,wt.vert=ut,wi=wt.frag,wt.frag=ft,vt.dirty=!0,r(gt,t,i),gt.viewportWidth=u,gt.viewportHeight=f,Kt[0]=h,Kt[1]=d,Kt[2]=m,Kt[3]=g,Et[0]=y,Et[1]=v,Et[2]=b,Et[3]=x,yt.blend_enable=_,Ct[0]=w,Ct[1]=A,Ot[0]=k,Ot[1]=pt,Ot[2]=ht,Ot[3]=dt,yt.depth_enable=xt,Xt[0]=Pt,Xt[1]=It,Xt[2]=Dt,Xt[3]=Rt,yt.scissor_enable=Ft,yt.stencil_enable=Bt,Nt&&(e.cpuTime+=performance.now()-jt),bt.offset=Vt,bt.count=Ut,bt.instances=qt,bt.primitive=Gt,Tt[H]=Yt,Tt[q]=Jt,Tt[G]=ae,Tt[W]=se,Tt[Y]=ce,Tt[Z]=fe,Tt[X]=he,Tt[J]=me,Tt[K]=ye,Tt[Q]=be,Tt[$]=_e,Tt[tt]=Ae,Tt[et]=Te,Tt[rt]=Se,nt.state=ze,nt.x=Ee,nt.y=Le,nt.z=Ce,nt.w=Pe,nt.buffer=Oe,nt.size=Ie,nt.normalized=De,nt.type=Re,nt.offset=Fe,nt.stride=Be,nt.divisor=Ne,it.state=je,it.x=Ve,it.y=Ue,it.z=He,it.w=qe,it.buffer=Ge,it.size=We,it.normalized=Ye,it.type=Ze,it.offset=Xe,it.stride=Je,it.divisor=Ke,$e&&_t.destroyStream(ar),at.state=pr,at.x=hr,at.y=dr,at.z=mr,at.w=gr,at.buffer=yr,at.size=vr,at.normalized=br,at.type=xr,at.offset=_r,at.stride=wr,at.divisor=Ar,Tr&&_t.destroyStream(Cr),ot.state=Br,ot.x=Nr,ot.y=jr,ot.z=Vr,ot.w=Ur,ot.buffer=Hr,ot.size=qr,ot.normalized=Gr,ot.type=Wr,ot.offset=Yr,ot.stride=Zr,ot.divisor=Xr,Kr&&_t.destroyStream(nn),st.state=fn,st.x=pn,st.y=hn,st.z=dn,st.w=mn,st.buffer=gn,st.size=yn,st.normalized=vn,st.type=bn,st.offset=xn,st.stride=_n,st.divisor=wn,kn&&_t.destroyStream(Ln),lt.state=Fn,lt.x=Bn,lt.y=Nn,lt.z=jn,lt.w=Vn,lt.buffer=Un,lt.size=Hn,lt.normalized=qn,lt.type=Gn,lt.offset=Wn,lt.stride=Yn,lt.divisor=Zn,Jn&&_t.destroyStream(ri),ct.state=ci,ct.x=ui,ct.y=fi,ct.z=pi,ct.w=hi,ct.buffer=di,ct.size=mi,ct.normalized=gi,ct.type=yi,ct.offset=vi,ct.stride=bi,ct.divisor=xi,wt.vert=_i,wt.frag=wi,vt.dirty=!0},batch:function(t,r){var i,a,M,S,z,E,L,C,P,O,I,D,R,F,B,N,j,V,U,H,q,G,W,Y,Z,X,J,K,Q,$,tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,wt;(St.angle_instanced_arrays,(i=Mt.next)!==Mt.cur&&(i?mt.bindFramebuffer(36160,i.framebuffer):mt.bindFramebuffer(36160,null),Mt.cur=i),vt.dirty)&&((L=yt.dither)!==vt.dither&&(L?mt.enable(3024):mt.disable(3024),vt.dither=L),(C=yt.depth_func)!==vt.depth_func&&(mt.depthFunc(C),vt.depth_func=C),P=Dt[0],O=Dt[1],P===Rt[0]&&O===Rt[1]||(mt.depthRange(P,O),Rt[0]=P,Rt[1]=O),(I=yt.depth_mask)!==vt.depth_mask&&(mt.depthMask(I),vt.depth_mask=I),D=Ft[0],R=Ft[1],F=Ft[2],B=Ft[3],D===Bt[0]&&R===Bt[1]&&F===Bt[2]&&B===Bt[3]||(mt.colorMask(D,R,F,B),Bt[0]=D,Bt[1]=R,Bt[2]=F,Bt[3]=B),(N=yt.cull_enable)!==vt.cull_enable&&(N?mt.enable(2884):mt.disable(2884),vt.cull_enable=N),(j=yt.cull_face)!==vt.cull_face&&(mt.cullFace(j),vt.cull_face=j),(V=yt.frontFace)!==vt.frontFace&&(mt.frontFace(V),vt.frontFace=V),(U=yt.lineWidth)!==vt.lineWidth&&(mt.lineWidth(U),vt.lineWidth=U),(H=yt.polygonOffset_enable)!==vt.polygonOffset_enable&&(H?mt.enable(32823):mt.disable(32823),vt.polygonOffset_enable=H),q=Nt[0],G=Nt[1],q===jt[0]&&G===jt[1]||(mt.polygonOffset(q,G),jt[0]=q,jt[1]=G),(W=yt.sample_alpha)!==vt.sample_alpha&&(W?mt.enable(32926):mt.disable(32926),vt.sample_alpha=W),(Y=yt.sample_enable)!==vt.sample_enable&&(Y?mt.enable(32928):mt.disable(32928),vt.sample_enable=Y),Z=Vt[0],X=Vt[1],Z===Ut[0]&&X===Ut[1]||(mt.sampleCoverage(Z,X),Ut[0]=Z,Ut[1]=X),(J=yt.stencil_mask)!==vt.stencil_mask&&(mt.stencilMask(J),vt.stencil_mask=J),K=Ht[0],Q=Ht[1],$=Ht[2],K===qt[0]&&Q===qt[1]&&$===qt[2]||(mt.stencilFunc(K,Q,$),qt[0]=K,qt[1]=Q,qt[2]=$),tt=Gt[0],et=Gt[1],rt=Gt[2],nt=Gt[3],tt===Wt[0]&&et===Wt[1]&&rt===Wt[2]&&nt===Wt[3]||(mt.stencilOpSeparate(tt,et,rt,nt),Wt[0]=tt,Wt[1]=et,Wt[2]=rt,Wt[3]=nt),it=Yt[0],at=Yt[1],ot=Yt[2],st=Yt[3],it===Zt[0]&&at===Zt[1]&&ot===Zt[2]&&st===Zt[3]||(mt.stencilOpSeparate(it,at,ot,st),Zt[0]=it,Zt[1]=at,Zt[2]=ot,Zt[3]=st));for(mt.blendColor(0,0,0,0),Lt[0]=0,Lt[1]=0,Lt[2]=0,Lt[3]=0,pt?mt.enable(3042):mt.disable(3042),vt.blend_enable=pt,mt.blendEquationSeparate(32774,32774),Pt[0]=32774,Pt[1]=32774,mt.blendFuncSeparate(770,771,773,1),It[0]=770,It[1]=771,It[2]=773,It[3]=1,ht?mt.enable(3089):mt.disable(3089),vt.scissor_enable=ht,dt?mt.enable(2960):mt.disable(2960),vt.stencil_enable=dt,(a=vt.profile)&&(M=performance.now(),e.count+=r),mt.useProgram(o.program),S=St.angle_instanced_arrays,kt.setVAO(null),lt=h.location,(ct=At[lt]).buffer||mt.enableVertexAttribArray(lt),5126===ct.type&&1===ct.size&&ct.buffer===p&&!1===ct.normalized&&0===ct.offset&&8===ct.stride||(mt.bindBuffer(34962,p.buffer),mt.vertexAttribPointer(lt,1,5126,!1,8,0),ct.type=5126,ct.size=1,ct.buffer=p,ct.normalized=!1,ct.offset=0,ct.stride=8),0!==ct.divisor&&(S.vertexAttribDivisorANGLE(lt,0),ct.divisor=0),ut=d.location,(ft=At[ut]).buffer||mt.enableVertexAttribArray(ut),5126===ft.type&&1===ft.size&&ft.buffer===p&&!1===ft.normalized&&4===ft.offset&&8===ft.stride||(mt.bindBuffer(34962,p.buffer),mt.vertexAttribPointer(ut,1,5126,!1,8,4),ft.type=5126,ft.size=1,ft.buffer=p,ft.normalized=!1,ft.offset=4,ft.stride=8),0!==ft.divisor&&(S.vertexAttribDivisorANGLE(ut,0),ft.divisor=0),((wt=bt.elements)||kt.currentVAO&&(wt=xt.getElements(kt.currentVAO.elements)))&&mt.bindBuffer(34963,wt.buffer.buffer),z=0;z0?te.constant[0]:0,ge=te.constant.length>1?te.constant[1]:0,ye=te.constant.length>2?te.constant[2]:0,ve=te.constant.length>3?te.constant[3]:0)):(be=zt(te.buffer)?_t.createStream(34962,te.buffer):_t.getBuffer(te.buffer),we="type"in te?$t[te.type]:be.dtype,_e=!!te.normalized,xe=0|te.size,Ae=0|te.offset,ke=0|te.stride,Te=0|te.divisor),Me=s.location,Se=At[Me],1===de?(Se.buffer||mt.enableVertexAttribArray(Me),ze=xe||2,Se.type===we&&Se.size===ze&&Se.buffer===be&&Se.normalized===_e&&Se.offset===Ae&&Se.stride===ke||(mt.bindBuffer(34962,be.buffer),mt.vertexAttribPointer(Me,ze,we,_e,ke,Ae),Se.type=we,Se.size=ze,Se.buffer=be,Se.normalized=_e,Se.offset=Ae,Se.stride=ke),Se.divisor!==Te&&(S.vertexAttribDivisorANGLE(Me,Te),Se.divisor=Te)):(Se.buffer&&(mt.disableVertexAttribArray(Me),Se.buffer=null),Se.x===me&&Se.y===ge&&Se.z===ye&&Se.w===ve||(mt.vertexAttrib4f(Me,me,ge,ye,ve),Se.x=me,Se.y=ge,Se.z=ye,Se.w=ve)),Ee=E.positionFractBuffer,re.buffer=Ee,Le=!1,Ce=1,Pe=0,Oe=0,Ie=0,De=0,Re=null,Fe=0,Be=!1,Ne=5126,je=0,Ve=0,Ue=0,zt(re)?(Le=!0,Ne=(Re=_t.createStream(34962,re)).dtype):(Re=_t.getBuffer(re))?Ne=Re.dtype:"constant"in re?(Ce=2,"number"==typeof re.constant?(Pe=re.constant,Oe=Ie=De=0):(Pe=re.constant.length>0?re.constant[0]:0,Oe=re.constant.length>1?re.constant[1]:0,Ie=re.constant.length>2?re.constant[2]:0,De=re.constant.length>3?re.constant[3]:0)):(Re=zt(re.buffer)?_t.createStream(34962,re.buffer):_t.getBuffer(re.buffer),Ne="type"in re?$t[re.type]:Re.dtype,Be=!!re.normalized,Fe=0|re.size,je=0|re.offset,Ve=0|re.stride,Ue=0|re.divisor),He=l.location,qe=At[He],1===Ce?(qe.buffer||mt.enableVertexAttribArray(He),Ge=Fe||2,qe.type===Ne&&qe.size===Ge&&qe.buffer===Re&&qe.normalized===Be&&qe.offset===je&&qe.stride===Ve||(mt.bindBuffer(34962,Re.buffer),mt.vertexAttribPointer(He,Ge,Ne,Be,Ve,je),qe.type=Ne,qe.size=Ge,qe.buffer=Re,qe.normalized=Be,qe.offset=je,qe.stride=Ve),qe.divisor!==Ue&&(S.vertexAttribDivisorANGLE(He,Ue),qe.divisor=Ue)):(qe.buffer&&(mt.disableVertexAttribArray(He),qe.buffer=null),qe.x===Pe&&qe.y===Oe&&qe.z===Ie&&qe.w===De||(mt.vertexAttrib4f(He,Pe,Oe,Ie,De),qe.x=Pe,qe.y=Oe,qe.z=Ie,qe.w=De)),We=E.positionBuffer,ee.buffer=We,Ye=!1,Ze=1,Xe=0,Je=0,Ke=0,Qe=0,$e=null,tr=0,er=!1,rr=5126,nr=0,ir=0,ar=0,zt(ee)?(Ye=!0,rr=($e=_t.createStream(34962,ee)).dtype):($e=_t.getBuffer(ee))?rr=$e.dtype:"constant"in ee?(Ze=2,"number"==typeof ee.constant?(Xe=ee.constant,Je=Ke=Qe=0):(Xe=ee.constant.length>0?ee.constant[0]:0,Je=ee.constant.length>1?ee.constant[1]:0,Ke=ee.constant.length>2?ee.constant[2]:0,Qe=ee.constant.length>3?ee.constant[3]:0)):($e=zt(ee.buffer)?_t.createStream(34962,ee.buffer):_t.getBuffer(ee.buffer),rr="type"in ee?$t[ee.type]:$e.dtype,er=!!ee.normalized,tr=0|ee.size,nr=0|ee.offset,ir=0|ee.stride,ar=0|ee.divisor),or=c.location,sr=At[or],1===Ze?(sr.buffer||mt.enableVertexAttribArray(or),lr=tr||2,sr.type===rr&&sr.size===lr&&sr.buffer===$e&&sr.normalized===er&&sr.offset===nr&&sr.stride===ir||(mt.bindBuffer(34962,$e.buffer),mt.vertexAttribPointer(or,lr,rr,er,ir,nr),sr.type=rr,sr.size=lr,sr.buffer=$e,sr.normalized=er,sr.offset=nr,sr.stride=ir),sr.divisor!==ar&&(S.vertexAttribDivisorANGLE(or,ar),sr.divisor=ar)):(sr.buffer&&(mt.disableVertexAttribArray(or),sr.buffer=null),sr.x===Xe&&sr.y===Je&&sr.z===Ke&&sr.w===Qe||(mt.vertexAttrib4f(or,Xe,Je,Ke,Qe),sr.x=Xe,sr.y=Je,sr.z=Ke,sr.w=Qe)),cr=E.positionFractBuffer,ne.buffer=cr,ur=!1,fr=1,pr=0,hr=0,dr=0,mr=0,gr=null,yr=0,vr=!1,br=5126,xr=0,_r=0,wr=0,zt(ne)?(ur=!0,br=(gr=_t.createStream(34962,ne)).dtype):(gr=_t.getBuffer(ne))?br=gr.dtype:"constant"in ne?(fr=2,"number"==typeof ne.constant?(pr=ne.constant,hr=dr=mr=0):(pr=ne.constant.length>0?ne.constant[0]:0,hr=ne.constant.length>1?ne.constant[1]:0,dr=ne.constant.length>2?ne.constant[2]:0,mr=ne.constant.length>3?ne.constant[3]:0)):(gr=zt(ne.buffer)?_t.createStream(34962,ne.buffer):_t.getBuffer(ne.buffer),br="type"in ne?$t[ne.type]:gr.dtype,vr=!!ne.normalized,yr=0|ne.size,xr=0|ne.offset,_r=0|ne.stride,wr=0|ne.divisor),Ar=u.location,kr=At[Ar],1===fr?(kr.buffer||mt.enableVertexAttribArray(Ar),Tr=yr||2,kr.type===br&&kr.size===Tr&&kr.buffer===gr&&kr.normalized===vr&&kr.offset===xr&&kr.stride===_r||(mt.bindBuffer(34962,gr.buffer),mt.vertexAttribPointer(Ar,Tr,br,vr,_r,xr),kr.type=br,kr.size=Tr,kr.buffer=gr,kr.normalized=vr,kr.offset=xr,kr.stride=_r),kr.divisor!==wr&&(S.vertexAttribDivisorANGLE(Ar,wr),kr.divisor=wr)):(kr.buffer&&(mt.disableVertexAttribArray(Ar),kr.buffer=null),kr.x===pr&&kr.y===hr&&kr.z===dr&&kr.w===mr||(mt.vertexAttrib4f(Ar,pr,hr,dr,mr),kr.x=pr,kr.y=hr,kr.z=dr,kr.w=mr)),Mr=E.colorBuffer,ie.buffer=Mr,Sr=!1,zr=1,Er=0,Lr=0,Cr=0,Pr=0,Or=null,Ir=0,Dr=!1,Rr=5126,Fr=0,Br=0,Nr=0,zt(ie)?(Sr=!0,Rr=(Or=_t.createStream(34962,ie)).dtype):(Or=_t.getBuffer(ie))?Rr=Or.dtype:"constant"in ie?(zr=2,"number"==typeof ie.constant?(Er=ie.constant,Lr=Cr=Pr=0):(Er=ie.constant.length>0?ie.constant[0]:0,Lr=ie.constant.length>1?ie.constant[1]:0,Cr=ie.constant.length>2?ie.constant[2]:0,Pr=ie.constant.length>3?ie.constant[3]:0)):(Or=zt(ie.buffer)?_t.createStream(34962,ie.buffer):_t.getBuffer(ie.buffer),Rr="type"in ie?$t[ie.type]:Or.dtype,Dr=!!ie.normalized,Ir=0|ie.size,Fr=0|ie.offset,Br=0|ie.stride,Nr=0|ie.divisor),jr=f.location,Vr=At[jr],1===zr?(Vr.buffer||mt.enableVertexAttribArray(jr),Ur=Ir||4,Vr.type===Rr&&Vr.size===Ur&&Vr.buffer===Or&&Vr.normalized===Dr&&Vr.offset===Fr&&Vr.stride===Br||(mt.bindBuffer(34962,Or.buffer),mt.vertexAttribPointer(jr,Ur,Rr,Dr,Br,Fr),Vr.type=Rr,Vr.size=Ur,Vr.buffer=Or,Vr.normalized=Dr,Vr.offset=Fr,Vr.stride=Br),Vr.divisor!==Nr&&(S.vertexAttribDivisorANGLE(jr,Nr),Vr.divisor=Nr)):(Vr.buffer&&(mt.disableVertexAttribArray(jr),Vr.buffer=null),Vr.x===Er&&Vr.y===Lr&&Vr.z===Cr&&Vr.w===Pr||(mt.vertexAttrib4f(jr,Er,Lr,Cr,Pr),Vr.x=Er,Vr.y=Lr,Vr.z=Cr,Vr.w=Pr)),Hr=E.dashLength,z&&qr===Hr||(qr=Hr,mt.uniform1f(m.location,Hr)),(Gr=E.dashTexture)&&"framebuffer"===Gr._reglType&&(Gr=Gr.color[0]),Wr=Gr._texture,mt.uniform1i(g.location,Wr.bind()),Yr=E.depth,z&&Zr===Yr||(Zr=Yr,mt.uniform1f(y.location,Yr)),Xr=E.opacity,z&&Jr===Xr||(Jr=Xr,mt.uniform1f(v.location,Xr)),Qr=(Kr=E.scale)[0],tn=Kr[1],z&&$r===Qr&&en===tn||($r=Qr,en=tn,mt.uniform2f(b.location,Qr,tn)),nn=(rn=E.scaleFract)[0],on=rn[1],z&&an===nn&&sn===on||(an=nn,sn=on,mt.uniform2f(x.location,nn,on)),ln=E.thickness,z&&cn===ln||(cn=ln,mt.uniform1f(_.location,ln)),fn=(un=E.translate)[0],hn=un[1],z&&pn===fn&&dn===hn||(pn=fn,dn=hn,mt.uniform2f(w.location,fn,hn)),gn=(mn=E.translateFract)[0],vn=mn[1],z&&yn===gn&&bn===vn||(yn=gn,bn=vn,mt.uniform2f(A.location,gn,vn)),_n=(xn=T.call(this,gt,E,z))[0],An=xn[1],Tn=xn[2],Sn=xn[3],z&&wn===_n&&kn===An&&Mn===Tn&&zn===Sn||(wn=_n,kn=An,Mn=Tn,zn=Sn,mt.uniform4f(k.location,_n,An,Tn,Sn)),(En=E.count)>0?wt?S.drawElementsInstancedANGLE(5,4,wt.type,0<<(wt.type-5121>>1),En):S.drawArraysInstancedANGLE(5,0,4,En):En<0&&(wt?mt.drawElements(5,4,wt.type,0<<(wt.type-5121>>1)):mt.drawArrays(5,0,4)),gt.viewportWidth=Kt,gt.viewportHeight=ae,he&&_t.destroyStream(be),Le&&_t.destroyStream(Re),Ye&&_t.destroyStream($e),ur&&_t.destroyStream(gr),Sr&&_t.destroyStream(Or),Wr.unbind()}vt.dirty=!0,kt.setVAO(null),a&&(e.cpuTime+=performance.now()-M)}}}},{}],505:[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}},{}],506:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,p,h,d,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(u=0,f=o,p=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":532}],507:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(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(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),y=t.charAt(0);!c||"G"!==y&&"g"!==y||(t=t.substr(1),e="");var w=c&&"chinese"===e.substr(0,7),A=t.match(w?b:v);if(!A)return u;var k=A[1],T=A[3]||"1",M=Number(A[5]||1),S=Number(A[7]||0),z=Number(A[9]||0),E=Number(A[11]||0);if(c){if(2===k.length)return u;var L;k=Number(k);try{var C=g.getComponentMethod("calendars","getCal")(e);if(w){var P="i"===T.charAt(T.length-1);T=parseInt(T,10),L=C.newDate(k,C.toMonthIndex(k,T,P),M)}else L=C.newDate(k,Number(T),M)}catch(t){return u}return L?(L.toJD()-m)*f+S*p+z*h+E*d:u}k=2===k.length?(Number(k)+2e3-x)%100+x:Number(k),T-=1;var O=new Date(Date.UTC(2e3,T,M,S,z));return O.setUTCFullYear(k),O.getUTCMonth()!==T||O.getUTCDate()!==M?u:O.getTime()+E*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==u};var A=90*f,k=3*p,T=5*h;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,v,b,x=Math.floor(10*l(t+.05,1)),w=Math.round(t-x/10);if(_(r)){var S=Math.floor(w/f)+m,z=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=y("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a("%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 s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,z=/%h/g,E={1:"1",2:"1",3:"2",4:"2"};function L(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(z,(function(){return E[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/p),2)+":"+w(l(Math.floor(r/h),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),C[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+L(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return L(e,t,n,i)};var P=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+m,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+P);return c.setUTCMonth(c.getUTCMonth()+e)+n-P},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=p.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(p.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var p=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,p=o-i,h=c-a,d=u*u+f*f,m=p*p+h*h,g=Math.min(l(u,f,d,i-t,a-e),l(u,f,d,o-t,c-e),l(p,h,m,t-i,e-a),l(p,h,m,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),p={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=p,p},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function p(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var h=p(c);h;){if((c+=h+r)>f)return;h=p(c)}for(h=p(f);h;){if(c>(f-=h+r))return;h=p(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,p=0,h=s;f0?h=i:p=i,f++}return a}},{"./mod":532}],521:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function p(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,h,d,m=t.color,g=l(m),y=l(e),v=o.extractOpts(t),b=[];if(n=void 0!==v.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=g?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=y?function(t,e){return void 0===t[e]?1:p(t[e])}:p,g||y)for(var x=0;x1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],525:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var p={};f.warnBadFormat=function(t){var e=String(t);p[e]||(p[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var h=t("./array");f.isTypedArray=h.isTypedArray,f.isArrayOrTypedArray=h.isArrayOrTypedArray,f.isArray1D=h.isArray1D,f.ensureArray=h.ensureArray,f.concat=h.concat,f.maxRowLength=h.maxRowLength,f.minRowLength=h.minRowLength;var d=t("./mod");f.mod=d.mod,f.modHalf=d.modHalf;var m=t("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var g=t("./dates");f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var y=t("./search");f.findBin=y.findBin,f.sorterAsc=y.sorterAsc,f.sorterDes=y.sorterDes,f.distinctVals=y.distinctVals,f.roundUp=y.roundUp,f.sort=y.sort,f.findIndexOfMin=y.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var v=t("./stats");f.aggNums=v.aggNums,f.len=v.len,f.mean=v.mean,f.median=v.median,f.midRange=v.midRange,f.variance=v.variance,f.stdev=v.stdev,f.interp=v.interp;var b=t("./matrix");f.init2dArray=b.init2dArray,f.transposeRagged=b.transposeRagged,f.dot=b.dot,f.translationMatrix=b.translationMatrix,f.rotationMatrix=b.rotationMatrix,f.rotationXYMatrix=b.rotationXYMatrix,f.apply3DTransform=b.apply3DTransform,f.apply2DTransform=b.apply2DTransform,f.apply2DTransform2=b.apply2DTransform2,f.convertCssMatrix=b.convertCssMatrix,f.inverseTransformMatrix=b.inverseTransformMatrix;var x=t("./angles");f.deg2rad=x.deg2rad,f.rad2deg=x.rad2deg,f.angleDelta=x.angleDelta,f.angleDist=x.angleDist,f.isFullCircle=x.isFullCircle,f.isAngleInsideSector=x.isAngleInsideSector,f.isPtInsideSector=x.isPtInsideSector,f.pathArc=x.pathArc,f.pathSector=x.pathSector,f.pathAnnulus=x.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var A=t("./extend");f.extendFlat=A.extendFlat,f.extendDeep=A.extendDeep,f.extendDeepAll=A.extendDeepAll,f.extendDeepNoArrays=A.extendDeepNoArrays;var k=t("./loggers");f.log=k.log,f.warn=k.warn,f.error=k.error;var T=t("./regex");f.counterRegex=T.counter;var M=t("./throttle");f.throttle=M.throttle,f.throttleDone=M.done,f.clearThrottle=M.clear;var S=t("./dom");function z(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.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},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var I=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return I.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var D={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return B.apply(D,arguments)};var R={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,p,h="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||h||m||d,y=s;if((h||d)&&(y=y.substring(1)),(m||d)&&(y=y.substring(0,y.length-1)),g){if(void 0===(c=e[y]))return""}else for(p=3;p=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var N=2e9;f.seedPseudoRandom=function(){N=2e9},f.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?f.pseudoRandom():N/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.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;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.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)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),V=null!==j&&j<86;f.getPositionFromD3Event=function(){return V?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":487,"./anchor_utils":505,"./angles":506,"./array":507,"./clean_number":508,"./clear_responsive":510,"./coerce":511,"./dates":512,"./dom":513,"./extend":515,"./filter_unique":516,"./filter_visible":517,"./geometry2d":520,"./identity":523,"./increment":524,"./is_plain_object":526,"./keyed_container":527,"./localize":528,"./loggers":529,"./make_trace_groups":530,"./matrix":531,"./mod":532,"./nested_property":533,"./noop":534,"./notifier":535,"./preserve_drawing_buffer":539,"./push_unique":540,"./regex":542,"./relative_attr":543,"./relink_private":544,"./search":545,"./sort_object_keys":548,"./stats":549,"./throttle":552,"./to_log_range":553,"@plotly/d3":54,"d3-format":108,"d3-time-format":116,"fast-isnumeric":186}],526:[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).hasOwnProperty("hasOwnProperty")}},{}],527:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],p.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":563,"./notifier":535}],530:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":54}],531:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],533:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,p,h,d,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;uMath.max(f,g)||c>Math.max(p,y)))if(cu||Math.abs(n(o,p))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":487,"./matrix":531}],538:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e,a){var o=t._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[],cachedCode:a||{}})}catch(t){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":547,regl:280}],539:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":186,"is-mobile":230}],540:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}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 a,o,f=0,p=e.length,h=0,d=p>1?(e[p-1]-e[0])/(p-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":507,"fast-isnumeric":186}],550:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":85}],551:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var M=t.text(),S=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&M.match(l),L=n.select(t.node().parentNode);if(!L.empty()){var C=t.attr("class")?t.attr("class").split(" ")[0]:"text";return C+="-math",L.selectAll("svg."+C).remove(),L.selectAll("g."+C+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),S?(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 a,o,s,l,p=parseInt((MathJax.version||"").split(".")[0]);if(2!==p&&3!==p)return void i.warn("No MathJax version:",MathJax.version);var h=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===p?MathJax.Hub.Typeset(a):MathJax.typeset([a])},d=function(){var e=l.select(2===p?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===p?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===p?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),h,d,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===p&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){h(),d(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}(S[2],o,(function(n,i,o){L.selectAll("svg."+C).remove(),L.selectAll("g."+C+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return P(),void e();var l=L.append("g").classed(C+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:C,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",p=s.select("g");p.attr({fill:f,stroke:f});var h=p.node().getBoundingClientRect(),d=h.width,g=h.height;(d>c||g>u)&&(s.style("overflow","hidden"),d=(h=s.node().getBoundingClientRect()).width,g=h.height);var y=+t.attr("x"),v=+t.attr("y"),b=-(r||t.node().getBoundingClientRect().height)/4;if("y"===C[0])l.attr({transform:"rotate("+[-90,y,v]+")"+a(-d/2,b-g/2)});else if("l"===C[0])v=b-g/2;else if("a"===C[0]&&0!==C.indexOf("atitle"))y=0,v=b;else{var x=t.attr("text-anchor");y-=d*("middle"===x?.5:"end"===x?1:0),v=v+b-g/2}s.attr({x:y,y:v}),m&&m.call(t,l),e(l)}))}))):P(),t}function P(){L.empty()||(C=t.attr("class")+"-math",L.select("svg."+C).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}b.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(y),L=0;L|>|>)/g;var f=[["$","$"],["\\(","\\)"]];var p={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"},h={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,y=/(<[^<>]*>)/,v=/<(\/?)([^ >]*)(\s+(.*))?>/i,b=//i;r.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,A=/(^|[\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&&z(n)}var T=/(^|;)\s*color:/;r.plainText=function(t,e){for(var r=void 0!==(e=e||{}).len&&-1!==e.len?e.len:1/0,n=void 0!==e.allowedTags?e.allowedTags:["br"],i="...".length,a=t.split(y),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,d-i)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function z(t){return t.replace(S,(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)):M[e])||t}))}function E(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==m.indexOf(i)&&-1!==m.indexOf(a)?e:""}function L(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=z,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(y),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.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)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],553:[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":186}],554:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":606,"topojson-client":312}],555:[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"}}},{}],556:[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"}}},{}],557:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&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 a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,p=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),d(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;e0)return t.substr(0,e)}r.hasParent=function(t,e){for(var r=x(e);r;){if(r in t)return!0;r=x(r)}return!1};var _=["x","y","z"];r.clearAxisTypes=function(t,e,r){for(var n=0;n1&&a.warn("Full array edits are incompatible with other edits",f);var v=r[""][""];if(c(v))e.set(null);else{if(!Array.isArray(v))return a.warn("Unrecognized full array edit value",f,v),!0;e.set(v)}return!m&&(p(g,y),h(t),!0)}var b,x,_,w,A,k,T,M,S=Object.keys(r).map(Number).sort(o),z=e.get(),E=z||[],L=u(y,f).get(),C=[],P=-1,O=E.length;for(b=0;bE.length-(T?0:1))a.warn("index out of range",f,_);else if(void 0!==k)A.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?C.push(_):T?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,k),-1===P&&(P=_);else for(x=0;x=0;b--)E.splice(C[b],1),L&&L.splice(C[b],1);if(E.length?z||e.set(E):e.set(null),m)return!1;if(p(g,y),d!==i){var I;if(-1===P)I=S;else{for(O=Math.max(E.length,O),I=[],b=0;b=P);b++)I.push(_);for(b=P;b=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function P(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),C(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&C(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in C(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,p=o.isPlainObject(n),h=[];for(var d in Array.isArray(r)||(r=[r]),r=L(r,t.data.length-1),e)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function V(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(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 i=Y(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[p.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(U(t,a,i)||p.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&H(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(M)),s.push(p.rehover,p.redrag,p.reselect),c.add(t,V,[t,i.undoit],V,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function U(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=h.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[h.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function H(t,e){var r=e?function(t){var r=[];for(var n in e){var i=h.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return h.draw(t,r,{skipTitle:!0})}:function(t){return h.draw(t,"redraw")};t.push(v,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,W=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,p=F(l._preGUI,c),d=Object.keys(e),m=h.list(t),g=o.extendDeepAll({},e),y={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof O.parts[D];)D--;var B=O.parts[D],N=O.parts[D-1]+"."+B,V=O.parts.slice(0,D).join("."),U=s(t.layout,V).get(),H=s(l,V).get(),Y=O.get();if(void 0!==I){M[P]=I,S[P]="reverse"===B?I:R(Y);var X=f.getLayoutValObject(l,O.parts);if(X&&X.impliedEdits&&null!==I)for(var J in X.impliedEdits)z(o.relativeAttr(P,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(P))if(I){z("autosize",null);var K="height"===P?"width":"height";z(K,l[K])}else l[P]=t._initialAutoSize[P];else if("autosize"===P)z("width",I?null:l.width),z("height",I?null:l.height);else if(N.match(q))C(N),s(l,V+"._inputRange").set(null);else if(N.match(G)){C(N),s(l,V+"._inputRange").set(null);var Q=s(l,V).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(W)&&s(l,V+"._inputDomain").set(null);if("type"===B){E=U;var $="linear"===H.type&&"log"===I,tt="log"===H.type&&"linear"===I;if($||tt){if(E&&E.range)if(H.autorange)$&&(E.range=E.range[1]>E.range[0]?[1,2]:[2,1]);else{var et=E.range[0],rt=E.range[1];$?(et<=0&&rt<=0&&z(V+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),z(V+".range[0]",Math.log(et)/Math.LN10),z(V+".range[1]",Math.log(rt)/Math.LN10)):(z(V+".range[0]",Math.pow(10,et)),z(V+".range[1]",Math.pow(10,rt)))}else z(V+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[O.parts[0]]&&"radialaxis"===O.parts[1]&&delete l[O.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,H,I,z),u.getComponentMethod("images","convertCoords")(t,H,I,z)}else z(V+".autorange",!0),z(V+".range",null);s(l,V+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,P).get(),it=(I||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,z),u.getComponentMethod("images","convertCoords")(t,nt,it,z)}var at=x.containerArrayMatch(P);if(at){r=at.array,n=at.index;var ot=at.property,st=X||{editType:"calc"};""!==n&&""===ot&&(x.isAddVal(I)?S[P]=null:x.isRemoveVal(I)?S[P]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),A.update(T,st),y[r]||(y[r]={});var lt=y[r][n];lt||(lt=y[r][n]={}),lt[ot]=I,delete e[P]}else"reverse"===B?(U.range?U.range.reverse():(z(V+".autorange",!0),U.range=[1,0]),H.autorange?T.calc=!0:T.plot=!0):("dragmode"===P&&(!1===I&&!1!==Y||!1!==I&&!1===Y)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===P&&("lasso"===I||"select"===I)&&"lasso"!==Y&&"select"!==Y||l._has("gl2d")?T.plot=!0:X?A.update(T,X):T.calc=!0,O.set(I))}}for(r in y){x.applyContainerArrayChanges(t,p(a,r),y[r],T,p)||(T.plot=!0)}for(var ct in L){var ut=(E=h.getFromId(t,ct))&&E._constraintGroup;if(ut)for(var ft in T.calc=!0,ut)L[ft]||(h.getFromId(t,ft)._constraintShrinkable=!0)}return(Z(t)||e.height||e.width)&&(T.plot=!0),(T.plot||T.calc)&&(T.layoutReplot=!0),{flags:T,rangesAltered:L,undoit:S,redoit:M,eventData:g}}function Z(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&p.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function X(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=N(t,o.extendFlat({},e),a),l=s.flags,u=Y(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var h=[];f.layoutReplot?h.push(w.layoutReplot):l.fullReplot?h.push(r._doPlot):(h.push(p.previousPromises),U(t,f,u)||p.supplyDefaults(t),l.style&&h.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&h.push(w.doColorBars),f.legend&&h.push(w.doLegend),f.layoutstyle&&h.push(w.layoutStyles),f.axrange&&H(h,u.rangesAltered),f.ticks&&h.push(w.doTicksRelayout),f.modebar&&h.push(w.doModeBar),f.camera&&h.push(w.doCamera),h.push(M)),h.push(p.rehover,p.redrag,p.reselect),c.add(t,X,[t,s.undoit,u.undoit,s.traces],X,[t,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(h,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}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(a,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,p.transition(t,e.frame.data,e.frame.layout,_.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 h(){t.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var e=function(){n._animationRaf=window.requestAnimationFrame(e),Date.now()-n._lastFrameAt>n._timeToNext&&f()};e()}var d,m,g=0;function y(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var v=[],b=null==e,x=Array.isArray(e);if(!b&&!x&&o.isPlainObject(e))v.push({type:"object",data:y(o.extendFlat({},e))});else if(b||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&T.push(m);v=T}}v.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(u[m]||d[m]||{}).name,y=e[n].name,v=u[g]||d[g];g&&y&&"number"==typeof y&&v&&T<5&&(T++,o.warn('addFrames: overwriting frame "'+(u[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===T&&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.")),d[m]={name:m},h.push({frame:p.supplyFrameDefaults(e[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:f+n})}h.sort((function(t,e){return t.index>e.index?-1:t.index=0;n--){if("number"==typeof(i=h[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=p.modifyFrames,u=p.modifyFrames,f=[t,s],h=[t,a];return c&&c.add(t,l,f,u,h),p.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,p=[e,l],h=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!v(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function v(t){return t===Math.round(t)&&t>=0}function b(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return y(i,e,s)},r.getLayoutValObject=function(t,e){return y(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":525,"../plots/attributes":572}],566:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),p=t("../plots/cartesian/axes"),h=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,g=d.clean,y=t("../plots/cartesian/autorange").doAutoRange;function v(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function b(t){var e,i,s,u,d,m,g=t._fullLayout,y=g._size,b=y.p,_=p.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return a.previousPromises(t);function A(t,e,r){var n=t._lw/2;return"x"===t._id.charAt(0)?e?"top"===r?e._offset-b-n:e._offset+e._length+b+n:y.t+y.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+b+n:e._offset-b-n:y.l+y.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=A(u,k,u.side),u._mainMirrorPosition=u.mirror&&k?A(u,k,h.OPPOSITE_SIDE[u.side]):null}var T=[],M=[],S=[],z=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var E=s.xaxis.domain,L=s.yaxis.domain,C=s.plotgroup;if(v(E,L,S)){var P=C.node(),O=s.bg=o.ensureSingle(C,"rect","bg");P.insertBefore(O.node(),P.childNodes[0]),M.push(i)}else C.select("rect.bg").remove(),S.push([E,L]),z||(T.push(i),M.push(i))}var I,D,R,F,B,N,j,V,U,H,q,G,W,Y=g._bgLayer.selectAll(".bg").data(T);for(Y.enter().append("rect").classed("bg",!0),Y.exit().remove(),Y.each((function(t){g._plots[t].bg=n.select(this)})),e=0;eA?u.push({code:"unused",traceType:v,templateCount:w,dataCount:A}):A>w&&u.push({code:"reused",traceType:v,templateCount:w,dataCount:A})}}else u.push({code:"data"});if(function t(e,r){for(var n in e)if("_"!==n.charAt(0)){var a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:h,layout:p},""),u.length)return u.map(y)}},{"../lib":525,"../plots/attributes":572,"../plots/plots":638,"./plot_config":563,"./plot_schema":564,"./plot_template":565}],568:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=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,p,h,d;function m(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],p=t.layout||{},h=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),p=o.extendDeep({},t.layout),h=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function y(t,r){return o.coerce(e,g,f,t,r)}var v=y("format"),b=y("width"),x=y("height"),_=y("scale"),w=y("setBackground"),A=y("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var T=o.extendFlat({},p);b?T.width=b:null===e.width&&n(d.width)&&(T.width=d.width),x?T.height=x:null===e.height&&n(d.height)&&(T.height=d.height);var M=o.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function z(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function E(){return new Promise((function(t,e){var r=l(k,v,_),n=k._fullLayout.width,f=k._fullLayout.height;function p(){i.purge(k),document.body.removeChild(k)}if("full-json"===v){var h=a.graphJson(k,!1,"keepdata","object",!0,!0);return h.version=u,h=JSON.stringify(h),p(),t(A?h:s.encodeJSON(h))}if(p(),"svg"===v)return t(A?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:v,width:n,height:f,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(k,r,T,M).then(S).then(z).then(E).then((function(e){t(function(t){return A?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":525,"../plots/plots":638,"../snapshot/helpers":661,"../snapshot/svgtoimg":663,"../snapshot/tosvg":665,"../version":1150,"./plot_api":562,"fast-isnumeric":186}],569:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),p=0;pb.length&&i.push(d("unused",a,y.concat(b.length)));var T,M,S,z,E,L=b.length,C=Array.isArray(k);if(C&&(L=Math.min(L,k.length)),2===x.dimensions)for(M=0;Mb[M].length&&i.push(d("unused",a,y.concat(M,b[M].length)));var P=b[M].length;for(T=0;T<(C?Math.min(P,k[M].length):P);T++)S=C?k[M][T]:k,z=v[M][T],E=b[M][T],n.validate(z,S)?E!==z&&E!==+z&&i.push(d("dynamic",a,y.concat(M,T),z,E)):i.push(d("value",a,y.concat(M,T),z))}else i.push(d("array",a,y.concat(M),v[M]));else for(M=0;M1&&h.push(d("object","layout"))),i.supplyDefaults(m);for(var g=m._fullData,y=r.length,v=0;v0&&Math.round(f)===f))return{vals:i};c=f}for(var p=e.calendar,h="start"===l,d="end"===l,m=t[r+"period0"],g=a(m,p)||0,y=[],v=[],b=[],x=i.length,_=0;_T;)k=o(k,-c,p);for(;k<=T;)k=o(k,c,p);A=o(k,-c,p)}else{for(k=g+(w=Math.round((T-g)/u))*u;k>T;)k-=u;for(;k<=T;)k+=u;A=k-u}y[_]=h?A:d?k:(A+k)/2,v[_]=A,b[_]=k}return{vals:y,starts:v,ends:b}}},{"../../constants/numerical":487,"../../lib":525,"fast-isnumeric":186}],574:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],575:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function p(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=m(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var p=u[0].val,g=f[0].val;for(r=1;r0&&((A=z-s(b)-l(x))>E?k/A>L&&(_=b,w=x,L=k/A):k/z>L&&(_={val:b.val,nopad:1},w={val:x.val,nopad:1},L=k/z));if(p===g){var C=p-1,P=p+1;if(M)if(0===p)i=[0,1];else{var O=(p>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),I=p/(1-Math.min(.5,O/z));i=p>0?[0,I]:[I,0]}else i=S?[Math.max(0,C),Math.max(1,P)]:[C,P]}else M?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-L*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),L=(w.val-_.val-h(e,b.val,x.val))/(z-s(_)-l(w)),i=[_.val-L*s(_),w.val+L*l(w)];return y&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function h(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=T((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),z=T(r.vpadplus||r.vpad),E=T(r.vpadminus||r.vpad);if(!A){if(p=1/0,h=-1/0,w)for(n=0;n0&&(p=a),a>h&&a-o&&(p=a),a>h&&a=P;n--)C(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function p(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function b(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":385,"../../constants/numerical":487,"../../lib":525,"../../registry":657,"./axis_ids":580,"@plotly/d3":54,"fast-isnumeric":186}],576:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),p=t("../../components/drawing"),h=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),g=m.ONEMAXYEAR,y=m.ONEAVGYEAR,v=m.ONEMINYEAR,b=m.ONEMAXQUARTER,x=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,A=m.ONEAVGMONTH,k=m.ONEMINMONTH,T=m.ONEWEEK,M=m.ONEDAY,S=M/2,z=m.ONEHOUR,E=m.ONEMIN,L=m.ONESEC,C=m.MINUS_SIGN,P=m.BADNUM,O={K:"zeroline"},I={K:"gridline",L:"path"},D={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},B={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},N=t("../../constants/alignment"),j=N.MID_SHIFT,V=N.CAP_SHIFT,U=N.LINE_SPACING,H=N.OPPOSITE_SIDE,q=e.exports={};q.setConvert=t("./set_convert");var G=t("./axis_autotype"),W=t("./axis_ids"),Y=W.idSort,Z=W.isLinked;q.id2name=W.id2name,q.name2id=W.name2id,q.cleanId=W.cleanId,q.list=W.list,q.listIds=W.listIds,q.getFromId=W.getFromId,q.getFromTrace=W.getFromTrace;var X=t("./autorange");q.getAutoRange=X.getAutoRange,q.findExtremes=X.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}q.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},q.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},q.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==q.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=q.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},q.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:q.getFromId(e,r).cleanPos)(t)},q.redrawComponents=function(t,e){e=e||q.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;ur&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},q.saveRangeInitial=function(t,e){for(var r=q.list(t,"",!0),n=!1,i=0;i.3*p||u(n)||u(a))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=q.tickIncrement(t,"M6","reverse")+1.5*M:a.exactMonths>.8?t=q.tickIncrement(t,"M1","reverse")+15.5*M:t-=S;var l=q.tickIncrement(t,r);if(l<=n)return l}return t}(v,t,y,c,a)),g=v,0;g<=u;)g=q.tickIncrement(g,y,!1,a);return{start:e.c2r(v,0,a),end:e.c2r(g,0,a),size:y,_dataSpan:u-c}},q.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=q.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,q.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),f=c?e.dtick:+e.dtick.substring(1),p=u?t.dtick:+t.dtick.substring(1);c&&u?tt(f,p)?f===2*T&&p===2*M&&(t.dtick=T):f===2*T&&p===3*M?t.dtick=T:f!==T||(e._input.minor||{}).nticks?et(f/p,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=M:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":tt(f,p)?f>=12&&2===p&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,p)||(t.dtick=et(f/p,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},q.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,q.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!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=q.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=z,o&&!n&&t.dtick=(O?0:1);I--){var D=!I;I?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var R=I?t:s.extendFlat({},t,t.minor);if(D?q.prepMinorTicks(R,t,e):q.prepTicks(R,e),"array"!==R.tickmode){var F=J(u),B=F[0],N=F[1],j=i(R.dtick),V="log"===a&&!(j||"L"===R.dtick.charAt(0)),U=q.tickFirst(R,e);if(I){if(t._tmin=U,U=N:Y<=N;Y=q.tickIncrement(Y,Z,f,o)){if(I&&H++,R.rangebreaks&&!f){if(Y=h)break}if(L.length>d||Y===W)break;W=Y;var X={value:Y};I?(V&&Y!==(0|Y)&&(X.simpleLabel=!0),l>1&&H%l&&(X.skipLabel=!0),L.push(X)):(X.minor=!0,C.push(X))}}else I?(L=[],m=nt(t)):(C=[],E=nt(t))}if(O&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=L.map((function(t){return t.value})),Q=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,p=0;f>=v?p=u>=v&&u<=g?u:y:r===x&&f>=_?p=u>=_&&u<=b?u:x:f>=k?p=u>=k&&u<=w?u:A:r===T&&f>=T?p=T:f>=M?p=M:r===S&&f>=S?p=S:r===z&&f>=z&&(p=z),p>=u&&(p=u,s=!0);var h=i+p;if(e.rangebreaks&&p>0){for(var d=0,m=0;m<84;m++){var E=(m+.5)/84;e.maskBreaks(i*(1-E)+E*h)!==P&&d++}(p*=d/84)||(t[n].drop=!0),s&&u>T&&(p=u)}(p>0||0===n)&&(t[n].periodX=i+p/2)}}(L,t,t._definedDelta),t.rangebreaks){var at="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=L.length-1;r>-1;r--)if(L[r].drop)L.splice(r,1);else{L[r].value=Pt(L[r].value,t);var lt=t.c2p(L[r].value);(at?st>lt-ot:sth||uth&&(ct.periodX=h),ut10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&a<=10||e>=15*M)t._tickround="d";else if(e>=E&&a<=16||e>=z)t._tickround="M";else if(e>=L&&a<=19||e>=E)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(mt(t.exponentformat)&&!gt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function ht(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}}q.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>y)e/=y,n=a(10),t.dtick="M"+12*ft(e,n,it);else if(o>A)e/=A,t.dtick="M"+ft(e,1,at);else if(o>M){if(t.dtick=ft(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=q.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>z?t.dtick=ft(e,z,at):o>E?t.dtick=ft(e,E,ot):o>L?t.dtick=ft(e,L,ot):(n=a(10),t.dtick=ft(e,n,it))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=a(10),t.dtick="L"+ft(e,n,it)}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))):Ct(t)?(t.tick0=0,n=1,t.dtick=ft(e,n,ut)):(t.tick0=0,n=a(10),t.dtick=ft(e,n,it));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var p=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(p)}},q.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ct:lt,f=t+.01*o,p=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(e)},q.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=yt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),p=Math.abs(f),h=t.exponentformat;"power"===h||mt(h)&>(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":C)+p+"",e.fontSize*=1.25):("e"===h||"E"===h)&&p>2?e.text="1"+h+(f>0?"+":C)+p:(e.text=yt(Math.pow(10,l),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,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,c,m):"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),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Ct(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=yt(e.x,t,i,n);else{var a=e.x/180;if(0===a)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,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=yt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=C+e.text)}}}}(t,o,r,c,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=yt(e.x,t,i,n)}(t,o,0,c,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},q.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return q.hoverLabelText(t,n,r)+" - "+q.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=q.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":C+o:o};var dt=["f","p","n","\u03bc","m","","k","M","G","T"];function mt(t){return"SI"===t||"B"===t}function gt(t){return t>14||t<-15}function yt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=q.getTickFormat(e),f=e.separatethousands;if(n){var p={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};pt(p),o=(Number(p._tickround)||0)+4,c=p._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,C);var h,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+h+"":"B"===l&&9===c?t+="B":mt(l)&&(t+=dt[c/3+5]));return a?C+t:t}function vt(t,e){if(t){var r=Object.keys(B).reduce((function(t,r){return-1!==e.indexOf(r)&&B[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function bt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,p)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var h=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,p),h.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var y=e._offset-r.left;y>0&&(n.xl=0,n.l=y)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,p):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,p),h.reverse()),r.height>0){var v=r.bottom-(e._offset+e._length);v>0&&(n.yb=0,n.b=v);var b=e._offset-r.top;b>0&&(n.yt=1,n.t=b)}n[m]="free"===e.anchor?e.position:e._anchorAxis.domain[h[0]],e.title.text!==c._dfltTitle[d]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=p),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[h[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][h[1]]))}it&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(vt(n,e.automargin),vt(i,e.automargin)),a.autoMargin(t,Tt(e),n),a.autoMargin(t,Mt(e),i),a.autoMargin(t,St(e),s)})),r.skipTitle||it&&"bottom"===e.side||rt.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+wt(e);else{var s=Ot(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"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,h,d,m=q.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,h="top"===e.side?m-r:m+r):(h=e._offset+e._length/2,f="right"===e.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(d={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var y=p.getTranslate(g.node().parentNode);d.offsetLeft=y.x,d.offsetTop=y.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:d,transform:c,attributes:{x:f,y:h,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function at(t){var r=h+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=kt(this),e=p.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},q.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},q.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},q.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,p=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=p*V,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=p*(1-V));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(xt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(xt(e)))}},q.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},q.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),p="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,h=0,d=0,m=p?t.ticklen:0;if(f?m*=-1:u&&(m=0),p&&(h+=m,r)){var g=s.deg2rad(r);h=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(p||t.showline)&&(h+=.2*t.tickfont.size);var y,v,b,x,_,w={labelStandoff:h+=(t.linewidth||1)/2*(f?-1:1),labelShift:d},A=0,k=t.side,T=t._id.charAt(0),M=t.tickangle;if("x"===T)x=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(x*=-1),y=d*x,v=e+h*x,b=_?1:-.2,90===Math.abs(M)&&(f?b+=j:b=-90===M&&"bottom"===k?V:90===M&&"top"===k?j:.5,A=j/2*(M/90)),w.xFn=function(t){return t.dx+y+A*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*b},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(e)&&0!==e&&180!==e?e*x<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"===T){if(x=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(x*=-1),y=h,v=d*x,b=0,f||90!==Math.abs(M)||(b=-90===M&&"left"===k||90===M&&"right"===k?V:.5),f){var S=i(M)?+M:0;if(0!==S){var z=s.deg2rad(S);A=Math.abs(Math.sin(z))*V*x,b=0}}w.xFn=function(t){return t.dx+e-(y+t.fontSize*b)*x+A*t.fontSize},w.yFn=function(t){return t.dy+v+t.fontSize*j},w.anchorFn=function(t,e){return i(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},q.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,_t);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return p.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),It(e,[R]),o.attr("transform",r.transFn)},q.drawGrid=function(t,e,r){r=r||{};var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&q.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;y--){var v=y?m:g;if(v){var b=v.selectAll("path."+i).data(y?s:o,_t);b.exit().remove(),b.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),b.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return p.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&b.attr("d",r.path)}}It(e,[I,D])},q.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=q.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.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 Y(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",p.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),It(e,[O])},q.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",h=r.vals.filter((function(t){return t.text})),d=r.labelFns,m=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[f],y=r.layer.selectAll("g."+f).data(e.showticklabels?h:[],_t),v=[];function b(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),u=d.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),h=c.lineCount(o),m=U*t.fontSize,g=d.heightFn(t,i(a)?+a:0,(h-1)*m);if(g&&(f+=l(0,g)),s.empty()){var y=o.select("text");y.attr({transform:f,"text-anchor":u}),y.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var v=p.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(v,0))}}))}y.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,d.xFn(e),d.yFn(e)).call(p.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[i]?v.push(t._promises.pop().then((function(){b(r,m)}))):b(r,m)})),It(e,[F]),y.exit().remove(),r.repositionOnUpdate&&y.each((function(t){n.select(this).select("text").call(c.positionText,d.xFn(t),d.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),h=Math.max(l,c),d=e.side,m=1/0,g=-1/0;for(var v in y.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=p.bBox(r.node()),s=0;o?(a.right>h||a.lefth||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},b(y,g+1?g:m);var x=null;e._selections&&(e._selections[f]=y);var _=[function(){return v.length&&Promise.all(v)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(x=90,_.push((function(){b(y,g)}))):_.push((function(){if(b(y,m),h.length&&"x"===u&&!i(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){x=0;var t,n=0,a=[];if(y.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=kt(this),o=p.bBox(i.node());a.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=h.length,l=Math.abs((h[o-1].x-h[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},d=f("top"),g=f("left"),v=f("right"),_=f("bottom")||g||d||v?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=x(o[s])){u=g;break}var f=i("pattern",u);if(f===g)for(s=0;s<2;s++)(c=x(o[s]))&&(e.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case g: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 y: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 p=r.range;if(p[0]p[1])return void(e.enabled=!1)}else if(o[0]>p[0]&&o[1]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 a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":657,"./constants":583}],581:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*b)||A)for(r=0;rO&&FC&&(C=F);p/=(C-L)/(2*P),L=l.l2r(L),C=l.l2r(C),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function V(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),U(t,e,i,a)}function U(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 H(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(t){P&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),P=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,C)/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 W(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},p={},h=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(H(i),2!==t||yt||qt(),gt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Ct),o.indexOf("event")>-1&&h.click(i,r,e.id);else if(1===t&&yt){var s=m?O:P,c="s"===m||"w"===y?0:1,f=s._name+".range["+c+"]",p=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),d="left",g="middle";if(s.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===y&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(xt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(p),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function It(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,ht*e+_t)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",At.r=At.l,At.t=At.b,Et.attr("d","M0,0Z")}if(At.l=Math.min(_t,n),At.r=Math.max(_t,n),At.t=Math.min(wt,i),At.b=Math.max(wt,i),rt.isSubplotConstrained)a>C||o>C?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?At.t=wt-o:At.b=wt+o):(a=o*tt/et,_t>n?At.l=_t-a:At.r=_t+a),Et.attr("d",G(At))):s();else if(nt.isSubplotConstrained)if(a>C||o>C){St="xy";var l=Math.min(At.l/tt,(et-At.b)/et),c=Math.max(At.r/tt,(et-At.t)/et);At.l=l*tt,At.r=c*tt,At.b=(1-l)*et,At.t=(1-c)*et,Et.attr("d",G(At))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;um[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":525,"fast-isnumeric":186}],593:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":596}],594:[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 i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":479}],595:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,p=a.isArrayOrTypedArray,h=t("../../constants/numerical"),d=h.FP_SAFE,m=h.BADNUM,g=h.LOG_CLIP,y=h.ONEWEEK,v=h.ONEDAY,b=h.ONEHOUR,x=h.ONEMIN,_=h.ONESEC,w=t("./axis_ids"),A=t("./constants"),k=A.HOUR_PATTERN,T=A.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",h=r.charAt(0);function z(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return m}function E(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function L(e,r,n){return c(e,r,n||t.calendar)}function C(e){return t._categories[Math.round(e)]}function P(e){if(S(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 m}function O(e){if(t._categoriesMap)return t._categoriesMap[e]}function I(t){var e=O(t);return void 0!==e?e:s(t)?+t:void 0}function D(t){return s(t)?+t:O(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===h;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?R(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?z:f,t.l2c="log"===t.type?M:f,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(z(t,e))}:B,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=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return z(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=z,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=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=E,t.c2d=t.c2r=t.l2d=t.l2r=L,t.d2p=t.r2p=function(e,r,n){return t.l2p(E(e,0,n))},t.p2d=t.p2r=function(t,e,r){return L(N(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=P,t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=C,t.d2r=t.d2l_noadd=I,t.r2c=function(e){var r=I(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=O,t.l2r=t.c2r=f,t.r2l=I,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return C(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(i=0;id&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),f="y"===h;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(s=0;su&&(p=!p),p&&t._rangebreaks.reverse();var d=p?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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 g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,p=!!e.yr1,h=[];if(f){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),g=d[1]-d[0],y=m[1]-m[0];h[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,h[2]=c*(1-r+r*y/g),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else h[0]=0,h[2]=c;if(p){var v=a.simpleMap(e.yr0,l.r2l),b=a.simpleMap(e.yr1,l.r2l),x=v[1]-v[0],_=b[1]-b[0];h[1]=(v[1]*(1-r)+r*b[1]-v[1])/(v[0]-v[1])*u,h[3]=u*(1-r+r*_/x),l.range[0]=i.l2r(v[0]*(1-r)+r*b[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*b[1])}else h[1]=0,h[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/h[2]:1,A=p?u/h[3]:1,k=f?h[0]:0,T=p?h[1]:0,M=f?h[0]/h[2]*c:0,S=p?h[1]/h[3]*u:0,z=i._offset-M,E=l._offset-S;n.clipRect.call(o.setTranslate,k,T).call(o.setScale,1/w,1/A),n.plot.call(o.setTranslate,z,E).call(o.setScale,w,A),o.setPointGroupScale(n.zoomScalePts,1/w,1/A),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/A)}s.redrawComponents(t)}},{"../../components/drawing":385,"../../lib":525,"../../registry":657,"./axes":576,"@plotly/d3":54}],601:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],p={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(p.noMultiCategory=!0);if(p.autotypenumbers=t.autotypenumbers,o(c,l)){var h=a(c),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),d.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,u=n.domain,f=n.projection,p=n.lonaxis,h=n.lataxis,d=p._ax,m=h._ax,y=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(i[n]||s[n])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],p=function(t){return t?l:[]},h=0;hu*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance);u&&l.clipAngle(u-w.clipPad);return l}(n),v=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],b=n.center||{},x=f.rotation||{},_=p.range||[],A=h.range||[];if(n.fitbounds){d._length=v[1][0]-v[0][0],m._length=v[1][1]-v[0][1],d.range=g(r,d),m.range=g(r,m);var k=(d.range[0]+d.range[1])/2,T=(m.range[0]+m.range[1])/2;if(n._isScoped)b={lon:k,lat:T};else if(n._isClipped){b={lon:k,lat:T},x={lon:k,lat:T,roll:x.roll};var M=f.type,S=w.lonaxisSpan[M]/2||180,E=w.lataxisSpan[M]/2||90;_=[k-S,k+S],A=[T-E,T+E]}else b={lon:k,lat:T},x={lon:k,lat:x.lat,roll:x.roll}}y.center([b.lon-x.lon,b.lat-x.lat]).rotate([-x.lon,-x.lat,x.roll]).parallels(f.parallels);var L=z(_,A);y.fitExtent(v,L);var C=this.bounds=y.getBounds(L),P=this.fitScale=y.scale(),O=y.translate();if(n.fitbounds){var I=y.getBounds(z(d.range,m.range)),D=Math.min((C[1][0]-C[0][0])/(I[1][0]-I[0][0]),(C[1][1]-C[0][1])/(I[1][1]-I[0][1]));isFinite(D)?y.scale(D*P):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(f.scale*P);var R=this.midPt=[(C[0][0]+C[1][0])/2,(C[0][1]+C[1][1])/2];if(y.translate([O[0]+(R[0]-O[0]),O[1]+(R[1]-O[1])]).clipExtent(C),n._isAlbersUsa){var F=y([b.lon,b.lat]),B=y.translate();y.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),h=r.framework.selectAll(".layer").data(u,String);h.exit().each((function(t){delete a[t],delete o[t],n.select(this).remove()})),h.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),h.order(),h.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(T(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};m.setConvert(l,r);var c=m.calcTicks(l);e.isScoped||"lonaxis"!==t||c.pop();for(var u=c.length,f=new Array(u),p=0;p-1&&x(n.event,i,[r.xaxis],[r.yaxis],r.id,u),s.indexOf("event")>-1&&h.click(i,n.event))}))}function f(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(p.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},c.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":363,"../../components/dragelement":382,"../../components/drawing":385,"../../components/fx":403,"../../components/selections":451,"../../lib":525,"../../lib/geo_location_utils":518,"../../lib/topojson_utils":554,"../../registry":657,"../cartesian/autorange":575,"../cartesian/axes":576,"../plots":638,"./constants":606,"./zoom":611,"@plotly/d3":54,"d3-geo":110,"d3-geo-projection":109,"topojson-client":312}],608:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./geo"),o="geo",s=i(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.geo,s=0;s0&&C<0&&(C+=360);var P,O,I,D=(L+C)/2;if(!h){var R=d?f.projRotate:[D,0,0];P=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&b)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!b&&void 0)&&r("oceancolor")}(h?(O=-96.6,I=38.7):(O=d?D:P,I=(E[0]+E[1])/2),r("center.lon",O),r("center.lat",I),m&&(r("projection.tilt"),r("projection.distance")),g)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!b&&void 0)&&r("landcolor"),r("showlakes",!!b&&void 0)&&r("lakecolor"),r("showrivers",!!b&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&b)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",b),r("subunitcolor"),r("subunitwidth")),d||r("showframe",b)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):y?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":525,"../get_data":612,"../subplot_defaults":651,"./constants":606,"./layout_attributes":609}],611:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],f={},p={};function h(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,c._preGUI,f);var r=i.nestedProperty(u,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),p[n+"."+t]=e)}r(h),h("projection.scale",e.scale()/t.fitScale),h("fitbounds",!1),o.emit("plotly_relayout",p)}function p(t,e){var r=u(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render(!0);var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(t,e,i)})),r}function h(t,e){var r,i,a,o,s,p,h,d,m,g=u(0,e);function y(t){return e.invert(t)}function v(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=y(r)})).on("zoom",(function(){if(p=n.mouse(this),function(t){var r=y(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?y(p)&&(d=y(p),h=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(h),o=h):s=y(r=p),m=!0,t.render(!0);var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),m&&f(t,e,v)})),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=u(0,e),o=function(t){var e=0,r=arguments.length,i=[];for(;++ed?(a=(f>0?90:-90)-h,i=0):(a=Math.asin(f/d)*s-h,i=Math.sqrt(d*d-f*f));var m=180-a-2*h,g=(Math.atan2(p,u)-Math.atan2(c,i))*s,y=(Math.atan2(p,u)-Math.atan2(c,-i))*s;return x(r[0],r[1],a,g)<=x(r[0],r[1],m,y)?[a,g,r[2]]:[m,y,r[2]]}function x(t,e,r,n){var i=_(r-t),a=_(n-e);return Math.sqrt(i*i+a*a)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[a]=t[a]*l-t[s]*c,i[s]=t[s]*l+t[a]*c,i}function A(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(g(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n).999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":363,"../../../lib":525,"../../../registry":657,"../../get_data":612,"../../subplot_defaults":651,"./axis_defaults":620,"./layout_attributes":623}],623:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":525,"../../../lib/extend":515,"../../domain":603,"./axis_attributes":619}],624:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":550}],625:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var p=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/p)}for(var h=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=h,u.tickmode=f}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),u=null,p=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(A.valueLabel=h.hoverLabelText(e._mockAxis,e._mockAxis.d2l(p.traceCoordinate[3]),t.valuehoverformat),S.push("value: "+A.valueLabel),p.textLabel&&S.push(p.textLabel),b=S.join("
")):b=p.textLabel;var z={x:p.traceCoordinate[0],y:p.traceCoordinate[1],z:p.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};d.appendArrayPointValue(z,_,w),t._module.eventData&&(z=_._module.eventData(z,p,_,{},w));var E={points:[z]};if(e.fullSceneLayout.hovermode){var L=[];d.loneHover({trace:_,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:A.xLabel,yLabel:A.yLabel,zLabel:A.zLabel,text:b,name:u.name,color:d.castHoverOption(_,w,"bgcolor")||u.color,borderColor:d.castHoverOption(_,w,"bordercolor"),fontFamily:d.castHoverOption(_,w,"font.family"),fontSize:d.castHoverOption(_,w,"font.size"),fontColor:d.castHoverOption(_,w,"font.color"),nameLength:d.castHoverOption(_,w,"namelength"),textAlign:d.castHoverOption(_,w,"align"),hovertemplate:f.castOption(_,w,"hovertemplate"),hovertemplateLabels:f.extendFlat({},z,A),eventData:[z]},{container:n,gd:r,inOut_bbox:L}),z.bbox=L[0]}p.buttons&&p.distance<5?r.emit("plotly_click",E):r.emit("plotly_hover",E),this.oldEventData=E}else d.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function T(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var p,h=0;h<(u||l.length);h++)if(f.isArrayOrTypedArray(l[h]))for(var d=0;dg[1][a])g[0][a]=-1,g[1][a]=1;else{var E=g[1][a]-g[0][a];g[0][a]-=E/32,g[1][a]+=E/32}if("reversed"===s.autorange){var L=g[0][a];g[0][a]=g[1][a],g[1][a]=L}}else{var C=s.range;g[0][a]=s.r2l(C[0]),g[1][a]=s.r2l(C[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),y[a]=g[1][a]-g[0][a],this.glplot.setBounds(a,{min:g[0][a]*p[a],max:g[1][a]*p[a]})}var P=c.aspectmode;if("cube"===P)d=[1,1,1];else if("manual"===P){var O=c.aspectratio;d=[O.x,O.y,O.z]}else{if("auto"!==P&&"data"!==P)throw new Error("scene.js aspectRatio was not one of the enumerated types");var I=[1,1,1];for(a=0;a<3;++a){var D=v[l=(s=c[k[a]]).type];I[a]=Math.pow(D.acc,1/D.count)/p[a]}d="data"===P||Math.max.apply(null,I)/Math.min.apply(null,I)<=4?I:[1,1,1]}c.aspectratio.x=u.aspectratio.x=d[0],c.aspectratio.y=u.aspectratio.y=d[1],c.aspectratio.z=u.aspectratio.z=d[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var B=this.container.style;B.position="absolute",B.left=F.l+R.x[0]*F.w+"px",B.top=F.t+(1-R.y[1])*F.h+"px",B.width=F.w*(R.x[1]-R.x[0])+"px",B.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),p=l||c;if(p){var h={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),h[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),h[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,h),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return p},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",p={x:0,y:0,z:1},h={};h[c]=p;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,h),a.up=p,f.nestedProperty(d,c).set(p)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d",{willReadFrequently:!0}),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];h.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},h.setConvert(this._mockAxis,t)},e.exports=_},{"../../../stackgl_modules":1151,"../../components/fx":403,"../../lib":525,"../../lib/show_no_webgl_msg":547,"../../lib/str2rgbarray":550,"../../plots/cartesian/axes":576,"../../registry":657,"./layout/convert":621,"./layout/spikes":624,"./layout/tick_marks":625,"./project":626,"has-passive-events":225,"webgl-context":328}],628:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;aOpenStreetMap
contributors',a=['\xa9 Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":548}],631:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":525}],632:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),i=t("../../lib"),a=i.strTranslate,o=i.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),c=t("@plotly/d3"),u=t("../../components/drawing"),f=t("../../lib/svg_text_utils"),p=t("./mapbox"),h=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==h.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots.mapbox;if(n.version!==h.requiredVersion)throw new Error(h.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(h.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;l_/2){var w=y.split("|").join("
");b.text(w).attr("data-unformatted",w).call(f.convertToTspans,t),x=u.bBox(b.node())}b.attr("transform",a(-3,8-x.height)),v.insert("rect",".static-attribution").attr({x:-x.width-6,y:-x.height-3,width:x.width+6,height:x.height+3,fill:"rgba(255, 255, 255, 0.75)"});var A=1;x.width+6>_&&(A=_/(x.width+6));var k=[n.l+n.w*p.x[1],n.t+n.h*(1-p.y[0])];v.attr("transform",a(k[0],k[1])+o(A))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},x.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),p(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){h(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},x.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},x.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.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"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=x.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var A=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function T(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&I.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&I.length>15&&0===l.shapes.length&&0===l.images.length,x.linkSubplots(p,l,f,n),x.cleanPlot(p,l,f,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),V=!(!n._has||!n._has("cartesian"))||N,U=!(!l._has||!l._has("cartesian"))||j;V&&!U?n._bgLayer.remove():U&&!V&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var p=x.layoutAttributes.width.min,h=x.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),x.sanitizeMargins(r)},x.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var p in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[p].sort(u.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(h){var v=(r.t+r.b)/h;v>1&&(r.t/=v,r.b/=v)}var b=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,A=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:b,size:r.l+g},r:{val:_,size:r.r+g},b:{val:A,size:r.b+g},t:{val:w,size:r.t+g}},m[e]=1}else delete d[e],delete m[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={}),L(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,p=a.t,d=a.b,m=e._pushmargin,g=e._pushmarginIds,y=e.minreducedwidth,v=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var b in m)g[b]||delete m[b];for(var _ in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:p},b:{val:0,size:d}},m){var w=m[_].l||{},A=m[_].b||{},k=w.val,T=w.size,M=A.val,S=A.size;for(var z in m){if(o(T)&&m[z].r){var E=m[z].r.val,C=m[z].r.size;if(E>k){var P=(T*E+(C-r)*k)/(E-k),O=(C*(1-k)+(T-r)*(1-E))/(E-k);P+O>c+f&&(c=P,f=O)}}if(o(S)&&m[z].t){var I=m[z].t.val,D=m[z].t.size;if(I>M){var R=(S*I+(D-n)*M)/(I-M),F=(D*(1-M)+(S-n)*(1-I))/(I-M);R+F>d+p&&(d=R,p=F)}}}}}var B=u.constrain(r-a.l-a.r,2,y),N=u.constrain(n-a.t-a.b,2,v),j=Math.max(0,r-B),V=Math.max(0,n-N);if(j){var U=(c+f)/j;U>1&&(c/=U,f/=U)}if(V){var H=(d+p)/V;H>1&&(d/=H,p/=H)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(p),i.b=Math.round(d),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&x.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var q=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}x.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},x.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&x.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var p=s._size;f.layout.computed={margin:{b:p.b,l:p.l,r:p.r,t:p.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},x.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:p,y:p}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(I(o,c,f),i=0;i1e-10?t:0}function p(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+p(u(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=90||s>90&&l>=450?1:u<=0&&p<=0?0:Math.max(u,p);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&p>=0?0:Math.min(u,p);n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f);return[e,r,n,i]}(h),x=b[2]-b[0],_=b[3]-b[1],w=p/f,A=Math.abs(_/x);w>A?(d=f,v=(p-(m=f*A))/n.h/2,g=[o[0],o[1]],y=[s[0]+v,s[1]-v]):(m=p,v=(f-(d=p/A))/n.w/2,g=[o[0]+v,o[1]-v],y=[s[0],s[1]]),this.xLength2=d,this.yLength2=m,this.xDomain2=g,this.yDomain2=y;var k,T=this.xOffset2=n.l+n.w*g[0],M=this.yOffset2=n.t+n.h*(1-y[1]),S=this.radius=d/x,z=this.innerRadius=this.getHole(e)*S,E=this.cx=T-S*b[0],L=this.cy=M+S*b[3],C=this.cxx=E-T,P=this.cyy=L-M,O=i.side;"counterclockwise"===O?(k=O,O="top"):"clockwise"===O&&(k=O,O="bottom"),this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:O,_trueSide:k,domain:[z/n.w,S/n.w]}),this.angularAxis=this.mockAxis(t,e,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:y});var I=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",I).attr("transform",l(C,P)),r.frontplot.attr("transform",l(T,M)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",I).attr("transform",l(E,L)).call(c.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=o.extendFlat({},r,n);return d(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);h(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*o,t[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=this.getRadial(e);m(r,n);var a=n.range;i.range=a.slice(),i._input.range=a.slice(),n._rl=[n.r2l(a[0],null,"gregorian"),n.r2l(a[1],null,"gregorian")]},N.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,h=r.cy,d=r.getRadial(e),m=D(r.getSector(e)[0],360),g=r.radialAxis,y=u90&&m<=270&&(g.tickangle=180);var b=v?function(t){var e=O(r,L([t.x,0]));return l(e[0]-f,e[1]-h)}:function(t){return l(g.l2p(t.x)+u,0)},x=v?function(t){return P(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},_=j(d);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),y){g.setScale();var w=0,A=v?(g.tickvals||[]).filter((function(t){return t>=0})).map((function(t){return p.tickText(g,t,!0,!1)})):p.calcTicks(g),k=v?A:p.clipEnds(g,A),T=p.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(T=-T),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),p.drawTicks(n,g,{vals:A,layer:i["radial-axis"],path:p.makeTickPath(g,0,T),transFn:b,crisp:!1}),p.drawGrid(n,g,{vals:k,layer:i["radial-grid"],path:x,transFn:o.noop,crisp:!1}),p.drawLabels(n,g,{vals:A,layer:i["radial-axis"],transFn:b,labelFns:p.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?F(V(R(d.angle),r.vangles)):d.angle,S=l(f,h),z=S+s(-M);U(i["radial-axis"],y&&(d.showticklabels||d.ticks),{transform:z}),U(i["radial-grid"],y&&d.showgrid,{transform:v?"":S}),U(i["radial-line"].select("line"),y&&d.showline,{x1:v?-a:u,y1:0,x2:a,y2:0,transform:z}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=this.getRadial(e),l=this.id+"title",c=0;if(s.title){var f=u.bBox(this.layers["radial-axis"].node()).height,p=s.title.font.size,h=s.side;c="top"===h?p:"counterclockwise"===h?-(f+.4*p):f+.8*p}var d=void 0!==r?r:this.radialAxisAngle,m=R(d),g=Math.cos(m),y=Math.sin(m),v=a+i/2*g+c*y,x=o-i/2*y+c*g;this.layers["radial-axis-title"]=b.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:I(n,"Click to enter radial axis title"),attributes:{x:v,y:x,"text-anchor":"middle"},transform:{rotate:-d}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,h=r.cy,d=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var y=g?function(t){var e=O(r,L([0,t.x]));return Math.atan2(e[0]-f,e[1]-h)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=F(m.tick0),m.dtick=F(m.dtick));var v=function(t){return l(f+a*Math.cos(t),h-a*Math.sin(t))},b=g?function(t){var e=O(r,L([0,t.x]));return l(e[0],e[1])}:function(t){return v(y(t))},x=g?function(t){var e=O(r,L([0,t.x])),n=Math.atan2(e[0]-f,e[1]-h)-Math.PI/2;return l(e[0],e[1])+s(-F(n))}:function(t){var e=y(t);return v(e)+s(-F(e))},_=g?function(t){return C(r,t.x,0,1/0)}:function(t){var e=y(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+u*r,h-u*n]+"L"+[f+a*r,h-a*n]},w=p.makeLabelFns(m,0).labelStandoff,A={xFn:function(t){var e=y(t);return Math.cos(e)*w},yFn:function(t){var e=y(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=y(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=y(t);return-.5*(1+Math.sin(n))*r}},k=j(d);r.angularTickLayout!==k&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=k);var T,S=g?[1/0].concat(m.tickvals||[]).map((function(t){return p.tickText(m,t,!0,!1)})):p.calcTicks(m);if(g&&(S[0].text="\u221e",S[0].fontSize*=1.75),"linear"===e.gridshape?(T=S.map(y),o.angleDelta(T[0],T[1])<0&&(T=T.slice().reverse())):T=null,r.vangles=T,"category"===m.type&&(S=S.filter((function(t){return o.isAngleInsideSector(y(t),r.sectorInRad)}))),m.visible){var z="inside"===m.ticks?-1:1,E=(m.linewidth||1)/2;p.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+z*E+",0h"+z*m.ticklen,transFn:x,crisp:!1}),p.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:_,transFn:o.noop,crisp:!1}),p.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:b,labelFns:A})}U(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(f,h)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,r,s=this,c=s.isSmith,u=s.gd,f=s.layers,p=t._zoomlayer,h=S.MINZOOM,d=S.OFFEDGE,m=s.radius,b=s.innerRadius,A=s.cx,k=s.cy,T=s.cxx,M=s.cyy,E=s.sectorInRad,L=s.vangles,C=s.radialAxis,P=z.clampTiny,O=z.findXYatLength,I=z.findEnclosingVertexAngles,D=S.cornerHalfWidth,R=S.cornerLen/2,F=g.makeDragger(f,"path","maindrag",!1===t.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(A,k)),F.onmousemove=function(t){v.hover(u,t,s.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=s.id},F.onmouseout=function(t){u._dragging||y.unhover(u,t)};var B,N,j,V,U,H,q,G,W,Y={element:F,gd:u,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Z(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Z(t-T,e-M)}function J(t,e){return Math.atan2(M-e,t-T)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function Q(t,e){if(0===t)return s.pathSector(2*D);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,m)),o=a-D,l=a+D;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(l,i)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function $(t,e,r){if(0===t)return s.pathSector(2*D);var n,i,a=K(t,e),o=K(t,r),l=P((a[0]+o[0])/2),c=P((a[1]+o[1])/2);if(l&&c){var u=c/l,f=-1/u,p=O(D,u,l,c);n=O(R,f,p[0][0],p[0][1]),i=O(R,f,p[1][0],p[1][1])}else{var h,d;c?(h=R,d=D):(h=D,d=R),n=[[l-h,c-d],[l+h,c-d]],i=[[l-h,c+d],[l+h,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,m),b),th?(t-1&&1===t&&_(e,u,[s.xaxis],[s.yaxis],s.id,Y),r.indexOf("event")>-1&&v.click(u,e,s.id)}Y.prepFn=function(t,n,a){var l=u._fullLayout.dragmode,f=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var h=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,r=u._fullLayout._invScaleY;var d=o.apply3DTransform(h)(n-f.left,a-f.top);if(B=d[0],N=d[1],L){var y=z.findPolygonOffset(m,E[0],E[1],L);B+=T+y[0],N+=M+y[1]}switch(l){case"zoom":Y.clickFn=st,c||(Y.moveFn=L?it:rt,Y.doneFn=at,function(){j=null,V=null,U=s.pathSubplot(),H=!1;var t=u._fullLayout[s.id];q=i(t.bgcolor).getLuminance(),(G=g.makeZoombox(p,q,A,k,U)).attr("fill-rule","evenodd"),W=g.makeCorners(p,A,k),w(u)}());break;case"select":case"lasso":x(t,n,a,Y,l)}},y.init(Y)},N.updateRadialDrag=function(t,e,r){var i=this,c=i.gd,u=i.layers,f=i.radius,p=i.innerRadius,h=i.cx,d=i.cy,m=i.radialAxis,v=S.radialDragBoxSize,b=v/2;if(m.visible){var x,_,A,M=R(i.radialAxisAngle),z=m._rl,E=z[0],L=z[1],C=z[r],P=.75*(z[1]-z[0])/(1-i.getHole(e))/f;r?(x=h+(f+b)*Math.cos(M),_=d-(f+b)*Math.sin(M),A="radialdrag"):(x=h+(p-b)*Math.cos(M),_=d-(p-b)*Math.sin(M),A="radialdrag-inner");var O,I,D,B=g.makeRectDragger(u,A,"crosshair",-b,-b,v,v),N={element:B,gd:c};!1===t.dragmode&&(N.dragmode=!1),U(n.select(B),m.visible&&p0==(r?D>E:Dn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0?1:0}function i(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function a(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function o(t,e){return e*t.radius}e.exports={smith:i,reactanceArc:function(t,e,r,n){var s=a(t,i([r,e])),l=s[0],c=s[1],u=a(t,i([n,e])),f=u[0],p=u[1];if(0===e)return["M"+l+","+c,"L"+f+","+p].join(" ");var h=o(t,1/Math.abs(e));return["M"+l+","+c,"A"+h+","+h+" 0 0,"+(e<0?1:0)+" "+f+","+p].join(" ")},resistanceArc:function(t,e,r,s){var l=o(t,1/(e+1)),c=a(t,i([e,r])),u=c[0],f=c[1],p=a(t,i([e,s])),h=p[0],d=p[1];if(n(r)!==n(s)){var m=a(t,i([e,0]));return["M"+u+","+f,"A"+l+","+l+" 0 0,"+(00){for(var n=[],i=0;i=u&&(p.min=0,d.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function m(t,e,r,n){var i=p[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var h=o("color"),d=h!==i.color.dflt?h:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,y=o("title.text",g);e._hovertitle=y===g?y:m,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:d}),o("min"),u(t,e,o,"linear"),l(t,e,o,"linear"),s(t,e,o,"linear"),c(t,e,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:d}),o("tickangle"),o("tickformat")),f(t,e,o,{dfltColor:h,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:p,handleDefaults:d,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":363,"../../lib":525,"../../plot_api/plot_template":565,"../cartesian/line_grid_defaults":591,"../cartesian/prefix_suffix_defaults":593,"../cartesian/tick_label_defaults":597,"../cartesian/tick_mark_defaults":598,"../cartesian/tick_value_defaults":599,"../subplot_defaults":651,"./layout_attributes":654}],656:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o.strTranslate,l=o._,c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),p=t("../../lib/extend").extendFlat,h=t("../plots"),d=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/fx"),y=t("../../components/dragelement/helpers"),v=y.freeMode,b=y.rectMode,x=t("../../components/titles"),_=t("../../components/selections").prepSelect,w=t("../../components/selections").selectOnClick,A=t("../../components/selections").clearOutline,k=t("../../components/selections").clearSelectionsCache,T=t("../cartesian/constants");function M(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=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iz*x?i=(a=x)*z:a=(i=b)/z,o=y*i/b,l=v*a/x,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,h.x0=r,h.y0=n,h.w=i,h.h=a,h.sum=_,h.xaxis={type:"linear",range:[w+2*k-_,_-w-2*A],domain:[m-o/2,m+o/2],_id:"x"},f(h.xaxis,h.graphDiv._fullLayout),h.xaxis.setScale(),h.xaxis.isPtWithinRange=function(t){return t.a>=h.aaxis.range[0]&&t.a<=h.aaxis.range[1]&&t.b>=h.baxis.range[1]&&t.b<=h.baxis.range[0]&&t.c>=h.caxis.range[1]&&t.c<=h.caxis.range[0]},h.yaxis={type:"linear",range:[w,_-A-k],domain:[g-l/2,g+l/2],_id:"y"},f(h.yaxis,h.graphDiv._fullLayout),h.yaxis.setScale(),h.yaxis.isPtWithinRange=function(){return!0};var T=h.yaxis.domain[0],M=h.aaxis=p({},t.aaxis,{range:[w,_-A-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[T,T+l*z],anchor:"free",position:0,_id:"y",_length:i});f(M,h.graphDiv._fullLayout),M.setScale();var S=h.baxis=p({},t.baxis,{range:[_-w-k,A],side:"bottom",domain:h.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(S,h.graphDiv._fullLayout),S.setScale();var E=h.caxis=p({},t.caxis,{range:[_-w-A,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[T,T+l*z],anchor:"free",position:0,_id:"y",_length:i});f(E,h.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDef.select("path").attr("d",L),h.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";h.clipDefRelative.select("path").attr("d",C);var P=s(r,n);h.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",P),h.clipDefRelative.select("path").attr("transform",null);var O=s(r-S._offset,n+a);h.layers.baxis.attr("transform",O),h.layers.bgrid.attr("transform",O);var I=s(r+i/2,n)+"rotate(30)"+s(0,-M._offset);h.layers.aaxis.attr("transform",I),h.layers.agrid.attr("transform",I);var D=s(r+i/2,n)+"rotate(-30)"+s(0,-E._offset);h.layers.caxis.attr("transform",D),h.layers.cgrid.attr("transform",D),h.drawAxes(!0),h.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),h.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),h.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),h.graphDiv._context.staticPlot||h.initInteractions(),u.setClipUrl(h.layers.frontplot,h._hasClipOnAxisFalse?null:h.clipId,h.graphDiv)},S.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,i=this.aaxis,a=this.baxis,o=this.caxis;if(this.drawAx(i),this.drawAx(a),this.drawAx(o),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=x.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=x.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*a.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=x.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(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"}})}},S.drawAx=function(t){var e,r=this.graphDiv,n=t._name,i=n.charAt(0),a=t._id,s=this.layers[n],l=i+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+a+"tick").remove(),this[l]=c),t.setScale();var u=d.calcTicks(t),f=d.clipEnds(t,u),p=d.makeTransTickFn(t),h=d.getTickSigns(t)[2],m=o.deg2rad(30),g=h*(t.linewidth||1)/2,y=h*t.ticklen,v=this.w,b=this.h,x="b"===i?"M0,"+g+"l"+Math.sin(m)*y+","+Math.cos(m)*y:"M"+g+",0l"+Math.cos(m)*y+","+-Math.sin(m)*y,_={a:"M0,0l"+b+",-"+v/2,b:"M0,0l-"+v/2+",-"+b,c:"M0,0l-"+b+","+v/2}[i];d.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:s,path:x,transFn:p,crisp:!1}),d.drawGrid(r,t,{vals:f,layer:this.layers[i+"grid"],path:_,transFn:p,crisp:!1}),d.drawLabels(r,t,{vals:u,layer:s,transFn:p,labelFns:d.makeLabelFns(t,0,30)})};var E=T.MINZOOM/2+.87,L="m-0.87,.5h"+E+"v3h-"+(E+5.2)+"l"+(E/2+2.6)+",-"+(.87*E+4.5)+"l2.6,1.5l-"+E/2+","+.87*E+"Z",C="m0.87,.5h-"+E+"v3h"+(E+5.2)+"l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-2.6,1.5l"+E/2+","+.87*E+"Z",P="m0,1l"+E/2+","+.87*E+"l2.6,-1.5l-"+(E/2+2.6)+",-"+(.87*E+4.5)+"l-"+(E/2+2.6)+","+(.87*E+4.5)+"l2.6,1.5l"+E/2+",-"+.87*E+"Z",O=!0;function I(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){k(this.dragOptions),A(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,f,p,h,d,y,x,A,k,M=this,S=M.layers.plotbg.select("path").node(),E=M.graphDiv,D=E._fullLayout._zoomlayer;function R(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=E._fullLayout.clickmode;I(E),2===t&&(E.emit("plotly_doubleclick",null),a.call("_guiRelayout",E,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,E,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&g.click(E,e,M.id)}function B(t,e){return 1-e/M.h}function N(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function j(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function V(i,a){var o=r+i*t,s=n+a*e,l=Math.max(0,Math.min(1,B(0,n),B(0,s))),c=Math.max(0,Math.min(1,N(r,n),N(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),m=(l/2+u)*M.w,g=(1-l/2-c)*M.w,v=(m+g)/2,b=g-m,_=(1-l)*M.h,w=_-b/z;b.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),x=!0),E.emit("plotly_relayouting",R(h))}function U(){I(E),h!==f&&(a.call("_guiRelayout",E,R(h)),O&&E.data&&E._context.showTips&&(o.notifier(l(E,"Double-click to zoom back out"),"long"),O=!1))}function H(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(h={a:f.a-n,b:f.b+(r+n)/2,c:f.c-(r-n)/2}).a,h.b,h.c].sort(o.sorterAsc),a=i.indexOf(h.a),l=i.indexOf(h.b),c=i.indexOf(h.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),h={a:i[a],b:i[l],c:i[c]},e=(f.a-h.a)*M.yaxis._m,t=(f.c-h.c-f.b+h.b)*M.xaxis._m);var p=s(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",p);var d=s(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[h.a,M.sum-h.b-h.c],M.baxis.range=[M.sum-h.a-h.c,h.b],M.caxis.range=[M.sum-h.a-h.b,h.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,M),E.emit("plotly_relayouting",R(h))}function q(){a.call("_guiRelayout",E,R(h))}this.dragOptions={element:S,gd:E,plotinfo:{id:M.id,domain:E._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(a,l,u){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=E._fullLayout._invScaleX,e=E._fullLayout._invScaleY;var m=M.dragOptions.dragmode=E._fullLayout.dragmode;v(m)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===m?(M.dragOptions.moveFn=V,M.dragOptions.clickFn=F,M.dragOptions.doneFn=U,function(t,e,a){var l=S.getBoundingClientRect();r=e-l.left,n=a-l.top,E._fullLayout._calcInverseTransform(E);var u=E._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},h=f,p=M.aaxis.range[1]-f.a,d=i(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),y="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",x=!1,A=D.append("path").attr("class","zoombox").attr("transform",s(M.x0,M.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",y),k=D.append("path").attr("class","zoombox-corners").attr("transform",s(M.x0,M.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(E)}(0,l,u)):"pan"===m?(M.dragOptions.moveFn=H,M.dragOptions.clickFn=F,M.dragOptions.doneFn=q,f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},h=f,M.clearOutline(E)):(b(m)||v(m))&&_(a,l,u,M.dragOptions,m)}},S.onmousemove=function(t){g.hover(E,t,M.id),E._fullLayout._lasthover=S,E._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){E._dragging||m.unhover(E,t)},m.init(this.dragOptions)}},{"../../components/color":363,"../../components/dragelement":382,"../../components/dragelement/helpers":381,"../../components/drawing":385,"../../components/fx":403,"../../components/selections":451,"../../components/titles":472,"../../lib":525,"../../lib/extend":515,"../../registry":657,"../cartesian/axes":576,"../cartesian/constants":583,"../cartesian/set_convert":595,"../plots":638,"@plotly/d3":54,tinycolor2:309}],657:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=l.extendFlat,p=l.extendDeepAll;function h(t){var e=t.name,i=t.categories,a=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 i in y(t),r.subplotsRegistry[e]=t,r.componentsRegistry)x(i,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(f[h[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":363,"../components/drawing":385,"../constants/xmlns_namespaces":488,"../lib":525,"@plotly/d3":54}],666:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rf+c||!n(u))}for(var h=0;ha))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return i(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)?e0?e+=r:u<0&&(e-=r)}return e}function I(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,_+(i-e)/(i-r)-1)}var D=t[f+"a"],R=t[p+"a"];m=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=n.getDistanceFunction(i,h,d,(function(t){return(h(t)+d(t))/2}));if(n.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==c){k||(E=function(t){return Math.min(T(t),t.p-v.bargroupwidth/2)},L=function(t){return Math.max(M(t),t.p+v.bargroupwidth/2)});var B=g[t.index],N=y.base?B.b+B.s:B.s;t[p+"0"]=t[p+"1"]=R.c2p(B[p],!0),t[p+"LabelVal"]=N;var j=v.extents[v.extents.round(B.p)];t[f+"0"]=D.c2p(b?E(B):j[0],!0),t[f+"1"]=D.c2p(b?L(B):j[1],!0);var V=void 0!==B.orig_p;return t[f+"LabelVal"]=V?B.orig_p:B.p,t.labelLabel=l(D,t[f+"LabelVal"],y[f+"hoverformat"]),t.valueLabel=l(R,t[p+"LabelVal"],y[p+"hoverformat"]),t.baseLabel=l(R,B.b,y[p+"hoverformat"]),t.spikeDistance=(function(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,w+(i-e)/(i-r)-1)}(B)+function(t){return C(T(t),M(t),w)}(B))/2,t[f+"Spike"]=D.c2p(B.p,!0),o(B,y,t),t.hovertemplate=y.hovertemplate,t}}function f(t,e){var r=e.mcc||t.marker.color,n=e.mlcc||t.marker.line.color,i=s(t,e);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(t,e,r,n,a){var o=u(t,e,r,n,a);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=f(l,c),i.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":363,"../../components/fx":403,"../../constants/numerical":487,"../../lib":525,"../../plots/cartesian/axes":576,"../../registry":657,"./helpers":673}],675:[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":588,"../scatter/marker_colorbar":966,"./arrays_to_calcdata":666,"./attributes":667,"./calc":668,"./cross_trace_calc":670,"./defaults":671,"./event_data":672,"./hover":674,"./layout_attributes":676,"./layout_defaults":677,"./plot":678,"./select":679,"./style":681}],676:[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"}}},{}],677:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,f={},p=s("barmode"),h=0;h0}function S(t){return"auto"===t?0:t}function z(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function E(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor||"end",u="end"===c,f="start"===c,p=((a.leftToRight||0)+1)/2,h=1-p,d=i.width,m=i.height,g=Math.abs(e-t),y=Math.abs(n-r),v=g>2*_&&y>2*_?_:0;g-=2*v,y-=2*v;var b=S(l);"auto"!==l||d<=g&&m<=y||!(d>g||m>y)||(d>y||m>g)&&d.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)};B=G(B,N,D),N=G(N,B,D),j=G(j,V,!D),V=G(V,j,!D)}var W=T(a.ensureSingle(P,"path"),C,g,y);if(W.style("vector-effect","non-scaling-stroke").attr("d",isNaN((N-B)*(V-j))||U&&t._context.staticPlot?"M0,0Z":"M"+B+","+j+"V"+V+"H"+N+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!C.uniformtext.mode&&R){var Y=l.makePointStyleFns(f);l.singlePointStyle(c,W,f,Y,t)}!function(t,e,r,n,i,s,c,f,h,g,y){var w,A=e.xaxis,M=e.yaxis,L=t._fullLayout;function C(e,r,n){return a.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var P=n[0].trace,O="h"===P.orientation,I=function(t,e,r,n,i){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,i){var o=e[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,c,f,p,h="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;g?(l="y",c=i,f="x",p=n):(l="x",c=n,f="y",p=i);function y(t){return u(p,p.c2l(t),!0).text}var v=e[r],b={};b.label=v.p,b.labelLabel=b[l+"Label"]=(_=v.p,u(c,c.c2l(_),!0).text);var _;var w=a.castOption(o,v.i,"text");(0===w||w)&&(b.text=w);b.value=v.s,b.valueLabel=b[f+"Label"]=y(v.s);var A={};x(A,o,v.i),(h||void 0===A.x)&&(A.x=g?b.value:b.label);(h||void 0===A.y)&&(A.y=g?b.label:b.value);(h||void 0===A.xLabel)&&(A.xLabel=g?b.valueLabel:b.labelLabel);(h||void 0===A.yLabel)&&(A.yLabel=g?b.labelLabel:b.valueLabel);d&&(b.delta=+v.rawS||v.s,b.deltaLabel=y(b.delta),b.final=v.v,b.finalLabel=y(b.final),b.initial=b.final-b.delta,b.initialLabel=y(b.initial));m&&(b.value=v.s,b.valueLabel=y(b.value),b.percentInitial=v.begR,b.percentInitialLabel=a.formatPercent(v.begR),b.percentPrevious=v.difR,b.percentPreviousLabel=a.formatPercent(v.difR),b.percentTotal=v.sumR,b.percenTotalLabel=a.formatPercent(v.sumR));var k=a.castOption(o,v.i,"customdata");k&&(b.customdata=k);return a.texttemplateString(s,b,t._d3locale,A,b,o._meta||{})}(t,e,r,n,i):s.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function c(t){return u(o?r:n,+t,!0).text}var f,p=i.textinfo,h=t[e],d=p.split("+"),m=[],g=function(t){return-1!==d.indexOf(t)};g("label")&&m.push((y=t[e].p,u(o?n:r,y,!0).text));var y;g("text")&&(0===(f=a.castOption(i,h.i,"text"))||f)&&m.push(f);if(s){var v=+h.rawS||h.s,b=h.v,x=b-v;g("initial")&&m.push(c(x)),g("delta")&&m.push(c(v)),g("final")&&m.push(c(b))}if(l){g("value")&&m.push(c(h.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(f=a.formatPercent(h.begR),w&&(f+=" of initial"),m.push(f)),g("percent previous")&&(f=a.formatPercent(h.difR),w&&(f+=" of previous"),m.push(f)),g("percent total")&&(f=a.formatPercent(h.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(e,r,n,i):m.getValue(s.text,r);return m.coerceString(v,o)}(L,n,i,A,M);w=function(t,e){var r=m.getValue(t.textposition,e);return m.coerceEnumerated(b,r)}(P,i);var D="stack"===g.mode||"relative"===g.mode,R=n[i],F=!D||R._outmost;if(!I||"none"===w||(R.isBlank||s===c||f===h)&&("auto"===w||"inside"===w))return void r.select("text").remove();var B=L.font,N=d.getBarColor(n[i],P),j=d.getInsideTextFont(P,i,B,N),V=d.getOutsideTextFont(P,i,B),U=r.datum();O?"log"===A.type&&U.s0<=0&&(s=A.range[0]=G*(X/W):X>=W*(Z/G);G>0&&W>0&&(J||K||Q)?w="inside":(w="outside",H.remove(),H=null)}else w="inside";if(!H){Y=a.ensureUniformFontSize(t,"outside"===w?V:j);var $=(H=C(r,I,Y)).attr("transform");if(H.attr("transform",""),q=l.bBox(H.node()),G=q.width,W=q.height,H.attr("transform",$),G<=0||W<=0)return void H.remove()}var tt,et,rt=P.textangle;"outside"===w?(et="both"===P.constraintext||"outside"===P.constraintext,tt=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,f=i.height,p=Math.abs(e-t),h=Math.abs(n-r);o=s?h>2*_?_:0:p>2*_?_:0;var d=1;l&&(d=s?Math.min(1,h/f):Math.min(1,p/u));var m=S(c),g=z(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,b=(i.top+i.bottom)/2,x=(t+e)/2,w=(r+n)/2,A=0,T=0,M=s?k(e,t):k(r,n);s?(x=e-M*o,A=M*y):(w=n+M*o,T=-M*y);return{textX:v,textY:b,targetX:x,targetY:w,anchorX:A,anchorY:T,scale:d,rotate:m}}(s,c,f,h,q,{isHorizontal:O,constrained:et,angle:rt})):(et="both"===P.constraintext||"inside"===P.constraintext,tt=E(s,c,f,h,q,{isHorizontal:O,constrained:et,angle:rt,anchor:P.insidetextanchor}));tt.fontSize=Y.size,p("histogram"===P.type?"bar":P.type,tt,L),R.transform=tt;var nt=T(H,L,g,y);a.setTransormAndDisplay(nt,tt)}(t,e,P,r,h,B,N,j,V,g,y),e.layerClipId&&l.hideOutsideRangePoint(c,P.select("text"),w,L,f.xcalendar,f.ycalendar)}));var j=!1===f.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,P,e,g)},toMoveInsideBar:E}},{"../../components/color":363,"../../components/drawing":385,"../../components/fx/helpers":399,"../../lib":525,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"../../registry":657,"./attributes":667,"./constants":669,"./helpers":673,"./style":681,"./uniform_text":683,"@plotly/d3":54,"fast-isnumeric":186}],679:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:m,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?function(t,e,r){a.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var i,s=n.select(this);if(t.selected){i=o.ensureUniformFontSize(r,g(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,i,t):(d(r,i,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:v,getOutsideTextFont:b,getBarColor:_,resizeText:l}},{"../../components/color":363,"../../components/drawing":385,"../../lib":525,"../../registry":657,"./attributes":667,"./helpers":673,"./uniform_text":683,"@plotly/d3":54}],682:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("../../lib").coercePattern;e.exports=function(t,e,r,s,l){var c=r("marker.color",s),u=i(t,"marker");u&&a(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":363,"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"../../lib":525}],683:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");function a(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=a(t),i=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=op.range[1]&&(b+=Math.PI);if(n.getClosest(c,(function(t){return m(v,b,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/y)-1+(t.rp1-v)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var x=c[t.index];t.x0=t.x1=x.ct[0],t.y0=t.y1=x.ct[1];var _=i.extendFlat({},x,{r:x.s,theta:x.p});return o(x,u,t),s(_,u,f,t),t.hovertemplate=u.hovertemplate,t.color=a(u,x),t.xLabelVal=t.yLabelVal=void 0,x.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":403,"../../lib":525,"../../plots/polar/helpers":640,"../bar/hover":674,"../scatterpolar/hover":1029}],688:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":641,"../bar/select":679,"../bar/style":681,"../scatter/marker_colorbar":966,"../scatterpolar/format_labels":1028,"./attributes":684,"./calc":685,"./defaults":686,"./hover":687,"./layout_attributes":689,"./layout_defaults":690,"./plot":691}],689:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],690:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a,o={};function s(r,o){return n.coerce(t[a]||{},e[a],i,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var f=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,i,c,u,f,e,r)};return function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),h=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(h,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),h=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(i(o)&&i(s)&&i(h)&&i(d)&&o!==s&&h!==d){var m=u.c2g(t.s1),g=(h+d)/2;t.ct=[l.c2p(m*Math.cos(g)),c.c2p(m*Math.sin(g))],e=p(o,s,h,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":385,"../../lib":525,"../../plots/polar/helpers":640,"@plotly/d3":54,"fast-isnumeric":186}],692:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,c=n.marker,u=c.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,xhoverformat:o("x"),yhoverformat:o("y"),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({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},c.angle,{arrayOk:!1,editType:"calc"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":362,"../../lib/extend":515,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652,"../bar/attributes":667,"../scatter/attributes":948}],693:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../plots/cartesian/align_period"),o=t("../../lib"),s=t("../../constants/numerical").BADNUM,l=o._;e.exports=function(t,e){var r,c,v,b,x,_,w,A=t._fullLayout,k=i.getFromId(t,e.xaxis||"x"),T=i.getFromId(t,e.yaxis||"y"),M=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(v=k,b="x",x=T,_="y",w=!!e.yperiodalignment):(v=T,b="y",x=k,_="x",w=!!e.xperiodalignment);var z,E,L,C,P,O,I=function(t,e,r,i){var s,l=e+"0"in t,c="d"+e in t;if(e in t||l&&c){var u=r.makeCalcdata(t,e);return[a(t,r,e,u).vals,u]}s=l?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:i;for(var f="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]),p=t._length,h=new Array(p),d=0;dz.uf};if(e._hasPreCompStats){var V=e[b],U=function(t){return v.d2c((e[t]||[])[r])},H=1/0,q=-1/0;for(r=0;r=z.q1&&z.q3>=z.med){var W=U("lowerfence");z.lf=W!==s&&W<=z.q1?W:h(z,L,C);var Y=U("upperfence");z.uf=Y!==s&&Y>=z.q3?Y:d(z,L,C);var Z=U("mean");z.mean=Z!==s?Z:C?o.mean(L,C):(z.q1+z.q3)/2;var X=U("sd");z.sd=Z!==s&&X>=0?X:C?o.stdev(L,C,z.mean):z.q3-z.q1,z.lo=m(z),z.uo=g(z);var J=U("notchspan");J=J!==s&&J>0?J:y(z,C),z.ln=z.med-J,z.un=z.med+J;var K=z.lf,Q=z.uf;e.boxpoints&&L.length&&(K=Math.min(K,L[0]),Q=Math.max(Q,L[C-1])),e.notched&&(K=Math.min(K,z.ln),Q=Math.max(Q,z.un)),z.min=K,z.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+z.q1,"median = "+z.med,"q3 = "+z.q3].join("\n")),$=z.med!==s?z.med:z.q1!==s?z.q3!==s?(z.q1+z.q3)/2:z.q1:z.q3!==s?z.q3:0,z.med=$,z.q1=z.q3=$,z.lf=z.uf=$,z.mean=z.sd=$,z.ln=z.un=$,z.min=z.max=$}H=Math.min(H,z.min),q=Math.max(q,z.max),z.pts2=E.filter(j),M.push(z)}}e._extremes[v._id]=i.findExtremes(v,[H,q],{padded:!0})}else{var tt=v.makeCalcdata(e,b),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ft;if((z={}).pos=z[_]=B[r],E=z.pts=nt[r].sort(f),C=(L=z[b]=E.map(p)).length,z.min=L[0],z.max=L[C-1],z.mean=o.mean(L,C),z.sd=o.stdev(L,C,z.mean),z.med=o.interp(L,.5),C%2&&(lt||ct))lt?(ut=L.slice(0,C/2),ft=L.slice(C/2+1)):ct&&(ut=L.slice(0,C/2+1),ft=L.slice(C/2)),z.q1=o.interp(ut,.5),z.q3=o.interp(ft,.5);else z.q1=o.interp(L,.25),z.q3=o.interp(L,.75);z.lf=h(z,L,C),z.uf=d(z,L,C),z.lo=m(z),z.uo=g(z);var pt=y(z,C);z.ln=z.med-pt,z.un=z.med+pt,at=Math.min(at,z.ln),ot=Math.max(ot,z.un),z.pts2=E.filter(j),M.push(z)}e._extremes[v._id]=i.findExtremes(v,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:A[S],dPos:N,posLetter:_,valLetter:b,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean \xb1 \u03c3:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},A[S]++,M):[{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 p(t){return t.v}function h(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 d(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 m(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function y(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":487,"../../lib":525,"../../plots/cartesian/align_period":573,"../../plots/cartesian/axes":576,"fast-isnumeric":186}],694:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,f=e._fullLayout,p=o._id,h=p.charAt(0),d=[],m=0;for(s=0;s1,x=1-f[t+"gap"],_=1-f[t+"groupgap"];for(s=0;s0){var q=z.pointpos,G=z.jitter,W=z.marker.size/2,Y=0;q+G>=0&&((Y=U*(q+G))>M?(H=!0,j=W,B=Y):Y>R&&(j=W,B=M)),Y<=M&&(B=M);var Z=0;q-G<=0&&((Z=-U*(q-G))>S?(H=!0,V=W,N=Z):Z>F&&(V=W,N=S)),Z<=S&&(N=S)}else B=M,N=S;var X=new Array(c.length);for(l=0;l0?(g="v",y=b>0?Math.min(_,x):Math.min(x)):b>0?(g="h",y=Math.min(_)):y=0;if(y){e._length=y;var S=r("orientation",g);e._hasPreCompStats?"v"===S&&0===b?(r("x0",0),r("dx",1)):"h"===S&&0===v&&(r("y0",0),r("dy",1)):"v"===S&&0===b?r("x0"):"h"===S&&0===v&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function f(t,e,r,i){var a=i.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(a+"points",l);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.angle"),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,i){function s(r,i){return n.coerce(t,e,c,r,i)}if(u(t,e,s,i),!1!==e.visible){o(t,e,i,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(e.line.color,.5));var p=!1;if(l){var h=s("mean"),d=s("sd");h&&h.length&&(p=!0,d&&d.length&&(p="sd"))}s("boxmean",p),s("whiskerwidth"),s("width"),s("quartilemethod");var m=!1;if(l){var g=s("notchspan");g&&g.length&&(m=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(m=!0);s("notched",m)&&s("notchwidth"),f(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,c,t)}for(var o=0;ot.lo&&(b.so=!0)}return a}));p.enter().append("path").classed("point",!0),p.exit().remove(),p.call(a.translatePoints,o,s)}function l(t,e,r,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,f=a.bPos,p=a.bPosPxOffset||0,h=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+f,!0),i=c.l2p(e-o)+p,a=c.l2p(e+s)+p,d=u?(i+a)/2:c.l2p(e)+p,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),y=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+i+"V"+a+("sd"===h?"m0,0L"+g+","+d+"L"+m+","+i+"L"+y+","+d+"Z":"")):n.select(this).attr("d","M"+i+","+m+"H"+a+("sd"===h?"m0,0L"+d+","+g+"L"+i+","+m+"L"+d+","+y+"Z":""))}))}e.exports={plot:function(t,e,r,a){var c=e.xaxis,u=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(t){var e,r,i=n.select(this),a=t[0],f=a.t,p=a.trace;(f.wdPos=f.bdPos*p.whiskerwidth,!0!==p.visible||f.empty)?i.remove():("h"===p.orientation?(e=u,r=c):(e=c,r=u),o(i,{pos:e,val:r},p,f),s(i,{x:c,y:u},p,f),l(i,{pos:e,val:r},p,f))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":385,"../../lib":525,"@plotly/d3":54}],702:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,P=E>0?Math.ceil:Math.floor,O=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,D=C(S+L),R=P(z-L),F=[[f=M(S)]];for(a=D;a*E=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],716:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,c,u,f,p,h,d,m,g,y,v,b=t["_"+e],x=t[e+"axis"],_=x._gridlines=[],w=x._minorgridlines=[],A=x._boundarylines=[],k=t["_"+r],T=t[r+"axis"];"array"===x.tickmode&&(x.tickvals=b.slice());var M=t._xctrl,S=t._yctrl,z=M[0].length,E=M.length,L=t._a.length,C=t._b.length;n.prepTicks(x),"array"===x.tickmode&&delete x.tickvals;var P=x.smoothing?3:1;function O(n){var i,a,o,s,l,c,u,f,h,d,m,g,y=[],v=[],b={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(C-2,a))),s=a-o,b.length=C,b.crossLength=L,b.xy=function(e){return t.evalxy([],e,a)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(h=t.dxydi([],i-1,o,0,s),y.push(l[0]+h[0]/3),v.push(l[1]+h[1]/3),d=t.dxydi([],i-1,o,1,s),y.push(f[0]-d[0]/3),v.push(f[1]-d[1]/3)),y.push(f[0]),v.push(f[1]),l=f;else for(i=t.a2i(n),c=Math.floor(Math.max(0,Math.min(L-2,i))),u=i-c,b.length=L,b.crossLength=C,b.xy=function(e){return t.evalxy([],i,e)},b.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),y.push(f[0]-g[0]/3),v.push(f[1]-g[1]/3)),y.push(f[0]),v.push(f[1]),l=f;return b.axisLetter=e,b.axis=x,b.crossAxis=T,b.value=n,b.constvar=r,b.index=p,b.x=y,b.y=v,b.smoothing=T.smoothing,b}function I(n){var i,a,o,s,l,c=[],u=[],f={};if(f.length=b.length,f.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(C-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(e){return t.evalxy([],e,n)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ib.length-1||_.push(i(I(o),{color:x.gridcolor,width:x.gridwidth,dash:x.griddash}));for(p=u;pb.length-1||m<0||m>b.length-1))for(g=b[s],y=b[m],a=0;ab[b.length-1]||w.push(i(O(d),{color:x.minorgridcolor,width:x.minorgridwidth,dash:x.minorgriddash}));x.startline&&A.push(i(I(0),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&A.push(i(I(b.length-1),{color:x.endlinecolor,width:x.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((b[b.length-1]-x.tick0)/x.dtick*(1+l)),Math.ceil((b[0]-x.tick0)/x.dtick/(1+l))].sort((function(t,e){return t-e})))[0],f=c[1],p=u;p<=f;p++)h=x.tick0+x.dtick*p,_.push(i(O(h),{color:x.gridcolor,width:x.gridwidth,dash:x.griddash}));for(p=u-1;pb[b.length-1]||w.push(i(O(d),{color:x.minorgridcolor,width:x.minorgridwidth,dash:x.minorgriddash}));x.startline&&A.push(i(O(b[0]),{color:x.startlinecolor,width:x.startlinewidth})),x.endline&&A.push(i(O(b[b.length-1]),{color:x.endlinecolor,width:x.endlinewidth}))}}},{"../../lib/extend":515,"../../plots/cartesian/axes":576}],717:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(h-=180,l=-l),{angle:h,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],731:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=c.strRotate,f=c.strTranslate,p=t("../../constants/alignment");function h(t,e,r,s,l,c){var u="const-"+l+"-lines",f=r.selectAll("."+u).data(c);f.enter().append("path").classed(u,!0).style("vector-effect","non-scaling-stroke"),f.each((function(r){var s=r,l=s.x,c=s.y,u=a([],l,t.c2p),f=a([],c,e.c2p),p="M"+o(u,f,s.smoothing);n.select(this).attr("d",p).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")})),f.exit().remove()}function d(t,e,r,a,o,c,p,h){var d=c.selectAll("text."+h).data(p);d.enter().append("text").classed(h,!0);var m=0,g={};return d.each((function(o,c){var p;if("auto"===o.axis.tickangle)p=s(a,e,r,o.xy,o.dxy);else{var h=(o.axis.tickangle+180)*Math.PI/180;p=s(a,e,r,o.xy,[Math.cos(h),Math.sin(h)])}c||(g={angle:p.angle,flip:p.flip});var d=(o.endAnchor?-1:1)*p.flip,y=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),v=i.bBox(this);y.attr("transform",f(p.p[0],p.p[1])+u(p.angle)+f(o.axis.labelpadding*d,.3*v.height)),m=Math.max(m,v.width+o.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,r,i){var l=e.xaxis,u=e.yaxis,f=t._fullLayout._clips;c.makeTraceGroups(i,r,"trace").each((function(e){var r=n.select(this),i=e[0],p=i.trace,m=p.aaxis,g=p.baxis,v=c.ensureSingle(r,"g","minorlayer"),b=c.ensureSingle(r,"g","majorlayer"),x=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",p.opacity),h(l,u,b,m,"a",m._gridlines),h(l,u,b,g,"b",g._gridlines),h(l,u,v,m,"a",m._minorgridlines),h(l,u,v,g,"b",g._minorgridlines),h(l,u,x,m,"a-boundary",m._boundarylines),h(l,u,x,g,"b-boundary",g._boundarylines);var w=d(t,l,u,p,i,_,m._labels,"a-label"),A=d(t,l,u,p,i,_,g._labels,"b-label");!function(t,e,r,n,i,a,o,l){var u,f,p,h,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),g=c.aggNums(Math.min,null,r.b),v=c.aggNums(Math.max,null,r.b);u=.5*(d+m),f=g,p=r.ab2xy(u,f,!0),h=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,i,a,p,r.dxydb_rough(u,f)));y(t,e,r,n,p,h,r.aaxis,i,a,o,"a-title"),u=d,f=.5*(g+v),p=r.ab2xy(u,f,!0),h=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,i,a,p,r.dxyda_rough(u,f)));y(t,e,r,n,p,h,r.baxis,i,a,l,"b-title")}(t,_,p,i,l,u,w,A),function(t,e,r,n,i){var s,l,u,f,p=r.select("#"+t._clipPathId);p.size()||(p=r.append("clipPath").classed("carpetclip",!0));var h=c.ensureSingle(p,"path","carpetboundary"),d=e.clipsegments,m=[];for(f=0;f90&&v<270,x=n.select(this);x.text(p.title.text).call(l.convertToTspans,t),b&&(_=(-l.lineCount(x)+g)*m*a-_),x.attr("transform",f(e.p[0],e.p[1])+u(e.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,p.title.font)})),x.exit().remove()}},{"../../components/drawing":385,"../../constants/alignment":479,"../../lib":525,"../../lib/svg_text_utils":551,"./makepath":728,"./map_1d_array":729,"./orient_text":730,"@plotly/d3":54}],732:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,f=t.aaxis,p=t.baxis,h=e[0],d=e[c-1],m=r[0],g=r[u-1],y=e[e.length-1]-e[0],v=r[r.length-1]-r[0],b=y*n.RELATIVE_CULL_TOLERANCE,x=v*n.RELATIVE_CULL_TOLERANCE;h-=b,d+=b,m-=x,g+=x,t.isVisible=function(t,e){return t>h&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,f.smoothing,p.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,f.smoothing,p.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,p.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,p.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,p,h,d,m=0,g=0,y=[];ne[c-1]?(f=c-2,p=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):p=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(h=u-2,d=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):d=s-(h=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(y,f,h,p,d),l[0]+=y[0]*m,l[1]+=y[1]*m),g&&(t.dxydj(y,f,h,p,d),l[0]+=y[0]*g,l[1]+=y[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":545,"./compute_control_points":720,"./constants":721,"./create_i_derivative_evaluator":722,"./create_j_derivative_evaluator":723,"./create_spline_evaluator":724}],733:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function f(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",k,"after",T,"iterations"),t}},{"../../lib":525}],734:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":525}],735:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":362,"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/template_attributes":652,"../scattergeo/attributes":990}],736:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var f=0;f")}(t,f,o),[t]}},{"../../lib":525,"../../plots/cartesian/axes":576,"./attributes":735}],740:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":608,"../heatmap/colorbar":814,"./attributes":735,"./calc":736,"./defaults":737,"./event_data":738,"./hover":739,"./plot":741,"./select":742,"./style":743}],741:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],i=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?a.extractTraceFeature(t):o(r,i.topojson),f=[],p=[],h=0;h=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":630,"./convert":745}],749:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652,"../mesh3d/attributes":886}],750:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":h>c&&(n.prefixBoundary=!0);break;case"<":(hc||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(h[0],h[1]),p=Math.max(h[0],h[1]),fc&&(n.prefixBoundary=!0)}}}},{}],757:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("./make_color_map"),a=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=i(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:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":375,"./end_plus":765,"./make_color_map":770}],758:[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}}},{}],759:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var p,h,d,m=e.contours,g=r("contours.operation");(m._operation=c[g],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,m),"="===g?p=m.showlines=!0:(p=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),p)&&(h=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,h,f)}},{"../../components/color":363,"../../constants/filter_ops":483,"./label_defaults":769,"fast-isnumeric":186}],760:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":483,"fast-isnumeric":186}],761:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],762:[function(t,e,r){"use strict";var n=t("../../lib");function i(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,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":525,"./constraint_mapping":760,"./end_plus":765}],765:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],766:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(f,r,e),h=[s(t,e,[-p[0],-p[1]])],d=t.z.length,m=t.z[0].length,g=e.slice(),y=p.slice();for(c=0;c<1e4;c++){if(f>20?(f=i.CHOOSESADDLE[f][(p[0]||p[1])<0?0:1],t.crossings[u]=i.SADDLEREMAINDER[f]):delete t.crossings[u],!(p=i.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}h.push(s(t,e,p)),e[0]+=p[0],e[1]+=p[1],u=e.join(","),a(h[h.length-1],h[h.length-2],o,l)&&h.pop();var v=p[0]&&(e[0]<0||e[0]>m-2)||p[1]&&(e[1]<0||e[1]>d-2);if(e[0]===g[0]&&e[1]===g[1]&&p[0]===y[0]&&p[1]===y[1]||r&&v)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var b,x,_,w,A,k,T,M,S,z,E,L,C,P,O,I=a(h[0],h[h.length-1],o,l),D=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((b=F[c])=B&&b+F[x]M&&S--,t.edgepaths[S]=E.concat(h,z));break}U||(t.edgepaths[M]=h.concat(z))}for(M=0;Mt?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,a,o,s,l,c,u,f,p=t[0].z,h=p.length,d=p[0].length,m=2===h||2===d;for(r=0;r=0&&(n=v,s=l):Math.abs(r[1]-n[1])<.01?Math.abs(r[1]-v[1])<.01&&(v[0]-r[0])*(n[0]-v[0])>=0&&(n=v,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,v)}if(r=n,s>=0)break;f+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}p=s,(d=-1===h.indexOf(p))&&(p=h[0],f+="Z")}for(p=0;pn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),h=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*o);if(p<1||h<1)return 1/0;var d=y.EDGECOST*(1/(p-1)+1/(h-1));d+=y.ANGLECOST*c*c;for(var m=s-u,g=l-f,v=s+u,b=l+f,x=0;x2*y.MAXCOST)break;h&&(s/=2),l=(o=c-s/2)+1.5*s}if(p<=y.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),f=Math.cos(c),p=function(t,e){return[s+t*f-e*u,l+t*u+e*f]},h=[p(-a/2,-o/2),p(-a/2,o/2),p(a/2,o/2),p(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(h)},r.drawLabels=function(t,e,r,a,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.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,p=t._input.contours;if(u>f&&(r.start=p.start=f,f=r.end=p.end=u,u=r.start),!(r.size>0))c=u===f?1:a(u,f,t.ncontours).dtick,p.size=r.size=c}}},{"../../lib":525,"../../plots/cartesian/axes":576}],774:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,a=r.contours,s=r.line,l=a.size||1,c=a.start,u="constraint"===a.type,f=!u&&"lines"===a.coloring,p=!u&&"fill"===a.coloring,h=f||p?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?h(t.level):s.color,s.dash)}));var d=a.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(f?h(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(p){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),h(t.level+.5*l)})),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",h(m-.5*l))}})),a(t)}},{"../../components/drawing":385,"../heatmap/style":824,"./make_color_map":770,"@plotly/d3":54}],775:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":373,"./label_defaults":769}],776:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../contour/attributes":754,"../heatmap/attributes":811}],777:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),f=t("../carpet/lookup_carpetid"),p=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=f(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var h=t.data[r.index],d=t.data[e.index];d.a||(d.a=h.a),d.b||(d.b=h.b),u(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,u,f,p,h,d,m,g=e._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,i.isArray1D(e.z)&&a(e,y,v,"a","b",["z"]);r=e._a=e._a||e.a,p=e._b=e._b||e.b,r=r?y.makeCalcdata(e,"_a"):[],p=p?v.makeCalcdata(e,"_b"):[],u=e.a0||0,f=e.da||1,h=e.b0||0,d=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(m),s(m,e._emptypoints);var b=i.maxRowLength(m),x="scaled"===e.xtype?"":r,_=c(e,x,u,f,b,y),w="scaled"===e.ytype?"":p,A=c(e,w,h,d,m.length,v),k={a:_,b:A,z:m};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:m,containerStr:"",cLetter:"z"});return[k]}(t,e);return p(e,e._z),m}}},{"../../components/colorscale/calc":371,"../../lib":525,"../carpet/lookup_carpetid":727,"../contour/set_contours":773,"../heatmap/clean_2d_array":813,"../heatmap/convert_column_xyz":815,"../heatmap/find_empties":817,"../heatmap/interp2d":820,"../heatmap/make_bound_array":822,"./defaults":778}],778:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,a,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":525,"../contour/constraint_defaults":759,"../contour/contours_defaults":761,"../contour/style_defaults":775,"../heatmap/xyz_defaults":826,"./attributes":776}],779:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":588,"../contour/colorbar":757,"../contour/style":774,"./attributes":776,"./calc":777,"./defaults":778,"./plot":780}],780:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../carpet/map_1d_array"),a=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),f=t("../contour/constants"),p=t("../contour/convert_to_constraints"),h=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),m=t("../carpet/lookup_carpetid"),g=t("../carpet/axis_aligned_line");function y(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function v(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function b(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,x){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(x,r,"contour").each((function(r){var x=n.select(this),A=r[0],k=A.trace,T=k._carpetTrace=m(t,k),M=t.calcdata[T.index][0];if(T.visible&&"legendonly"!==T.visible){var S=A.a,z=A.b,E=k.contours,L=h(E,e,A),C="constraint"===E.type,P=E._operation,O=C?"="===P?"lines":"fill":E.coloring,I=[[S[0],z[z.length-1]],[S[S.length-1],z[z.length-1]],[S[S.length-1],z[0]],[S[0],z[0]]];l(L);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(z[z.length-1]-z[0]);c(L,D,R);var F,B,N,j,V=L;"constraint"===E.type&&(V=p(L,P)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r=0;j--)F=M.clipsegments[j],B=i([],F.x,_.c2p),N=i([],F.y,w.c2p),B.reverse(),N.reverse(),U.push(a(B,N,F.bicubic));var H="M"+U.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,f,p,h=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);h.enter().append("path"),h.exit().remove();var d=[];for(p=0;p=0&&(p=E,d=m):Math.abs(f[1]-p[1])=0&&(p=E,d=m):s.log("endpt to newendpt is not vert. or horz.",f,p,E)}if(d>=0)break;v+=S(f,p),f=p}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(x=-1===b.indexOf(u))&&(u=b[0],v+=S(f,p)+"Z",f=null)}for(u=0;ug&&(n.max=g);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/P),f.LABELMAX),a=0;a0?+h[u]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var x=o.extractOpts(e),_=x.reversescale?o.flipScale(x.colorscale):x.colorscale,w=_[0][1],A=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(u=1;u<_.length;u++)A.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],x.min,0,x.max,1];return i.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(x.max-x.min),"heatmap-color":A,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:f},c.heatmap.layout.visibility="visible",c}},{"../../components/color":363,"../../components/colorscale":375,"../../constants/numerical":487,"../../lib":525,"../../lib/geojson_utils":519,"fast-isnumeric":186}],784:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":373,"../../lib":525,"./attributes":781}],785:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],786:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover").hoverPoints,a=t("../scattermapbox/hover").getExtraText;e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var f=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(f,f.c2l(u.z),"hover").text}return s.extraText=a(c,u,l[0].t.labels),[s]}}},{"../../plots/cartesian/axes":576,"../scattermapbox/hover":1021}],787:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":630,"./convert":783}],789:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),l.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(i))return i;if(n(a)&&o)return a}(u,p),[l]}}},{"../../components/color":363,"../../lib":525,"../bar/hover":674}],797:[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"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":588,"../bar/select":679,"./attributes":790,"./calc":791,"./cross_trace_calc":793,"./defaults":794,"./event_data":795,"./hover":796,"./layout_attributes":798,"./layout_defaults":799,"./plot":800,"./style":801}],798:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],799:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":363,"../../components/drawing":385,"../../constants/interactions":486,"../bar/style":681,"../bar/uniform_text":683,"@plotly/d3":54}],802:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":515,"../../plots/attributes":572,"../../plots/domain":603,"../../plots/template_attributes":652,"../pie/attributes":922}],803:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":638}],804:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":924}],805:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}var u=c("labels"),f=c("values"),p=s(u,f),h=p.len;if(e._hasLabels=p.hasLabels,e._hasValues=p.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),h){e._length=h,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,m=c("text"),g=c("texttemplate");if(g||(d=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||d&&"none"!==d){var y=c("textposition");o(t,e,l,c,y,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":525,"../../plots/domain":603,"../bar/defaults":671,"../pie/defaults":925,"./attributes":802}],806:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":933,"./attributes":802,"./base_plot":803,"./calc":804,"./defaults":805,"./layout_attributes":807,"./layout_defaults":808,"./plot":809,"./style":810}],807:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":929}],808:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":525,"./layout_attributes":807}],809:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../../lib"),o=a.strScale,s=a.strTranslate,l=t("../../lib/svg_text_utils"),c=t("../bar/plot").toMoveInsideBar,u=t("../bar/uniform_text"),f=u.recordMinTextSize,p=u.clearMinTextSize,h=t("../pie/helpers"),d=t("../pie/plot"),m=d.attachFxHandlers,g=d.determineInsideTextFont,y=d.layoutAreas,v=d.prerenderTitles,b=d.positionTitleOutside,x=d.formatSliceLabel;function _(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._context.staticPlot,u=t._fullLayout;p("funnelarea",u),v(e,t),y(e,u._size),a.makeTraceGroups(u._funnelarealayer,e,"trace").each((function(e){var p=n.select(this),d=e[0],y=d.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o=Math.pow(i,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var f,p,h=[];for(h.push(u()),f=t.length-1;f>-1;f--)if(!(p=t[f]).hidden){var d=p.v/l;c+=d,h.push(u())}var m=1/0,g=-1/0;for(f=0;f-1;f--)if(!(p=t[f]).hidden){var T=h[k+=1][0],M=h[k][1];p.TL=[-T,M],p.TR=[T,M],p.BL=w,p.BR=A,p.pxmid=(S=p.TR,z=p.BR,[.5*(S[0]+z[0]),.5*(S[1]+z[1])]),w=p.TL,A=p.TR}var S,z}(e),p.each((function(){var p=n.select(this).selectAll("g.slice").data(e);p.enter().append("g").classed("slice",!0),p.exit().remove(),p.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=y.index;var p=d.cx,v=d.cy,b=n.select(this),w=b.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),b.call(m,t,e);var A="M"+(p+o.TR[0])+","+(v+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",A),x(t,o,d);var k=h.castOption(y.textposition,o.pts),T=b.selectAll("g.slicetext").data(o.text&&"none"!==k?[0]:[]);T.enter().append("g").classed("slicetext",!0),T.exit().remove(),T.each((function(){var r=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=a.ensureUniformFontSize(t,g(y,o,u.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,h).call(l.convertToTspans,t);var d,m,b,x=i.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+v,w=Math.max(o.TL[1],o.TR[1])+v;m=Math.max(o.TL[0],o.BL[0])+p,b=Math.min(o.TR[0],o.BR[0])+p,(d=c(m,b,_,w,x,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=h.size,f(y.type,d,u),e[s].transform=d,a.setTransormAndDisplay(r,d)}))}}));var v=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var e=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),r=y.title.text;y._meta&&(r=a.templateString(r,y._meta)),e.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,y.title.font).call(l.convertToTspans,t);var c=b(d,u._size);e.attr("transform",s(c.x,c.y)+o(Math.min(1,c.scale))+s(c.tx,c.ty))}))}))}))}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../bar/plot":678,"../bar/uniform_text":683,"../pie/helpers":927,"../pie/plot":931,"@plotly/d3":54}],810:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../pie/style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");a(t,e,"funnelarea"),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(i,t,e)}))}))}},{"../bar/uniform_text":683,"../pie/style_one":933,"@plotly/d3":54}],811:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../lib/extend").extendFlat;e.exports=u({z:{valType:"data_array",editType:"calc"},x:u({},n.x,{impliedEdits:{xtype:"array"}}),x0:u({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:u({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:u({},n.y,{impliedEdits:{ytype:"array"}}),y0:u({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:u({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:u({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:u({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:u({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:u({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:u({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:u({},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"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:a({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:u({},i.showlegend,{dflt:!1})},{transforms:void 0},c("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/font_attributes":604,"../../plots/template_attributes":652,"../scatter/attributes":948}],812:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),f=t("./interp2d"),p=t("./find_empties"),h=t("./make_bound_array"),d=t("../../constants/numerical").BADNUM;function m(t){for(var e=[],r=t.length,n=0;nD){O("x scale is not linear");break}}if(b.length&&"fast"===C){var R=(b[b.length-1]-b[0])/(b.length-1),F=Math.abs(R/100);for(k=0;kF){O("y scale is not linear");break}}}var B=i.maxRowLength(A),N="scaled"===e.xtype?"":r,j=h(e,N,g,y,B,M),V="scaled"===e.ytype?"":b,U=h(e,V,x,_,A.length,S);L||(e._extremes[M._id]=a.findExtremes(M,j),e._extremes[S._id]=a.findExtremes(S,U));var H={x:j,y:U,z:A,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&v&&(H.orig_x=v),e.yperiodalignment&&w&&(H.orig_y=w),N&&N.length===j.length-1&&(H.xCenter=N),V&&V.length===U.length-1&&(H.yCenter=V),E&&(H.xRanges=T.xRanges,H.yRanges=T.yRanges,H.pts=T.pts),z||l(t,e,{vals:A,cLetter:"z"}),z&&e.contours&&"heatmap"===e.contours.coloring){var q={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};H.xfill=h(q,N,g,y,B,M),H.yfill=h(q,V,x,_,A.length,S)}return[H]}},{"../../components/colorscale/calc":371,"../../constants/numerical":487,"../../lib":525,"../../plots/cartesian/align_period":573,"../../plots/cartesian/axes":576,"../../registry":657,"../histogram2d/calc":845,"./clean_2d_array":813,"./convert_column_xyz":815,"./find_empties":817,"./interp2d":820,"./make_bound_array":822}],813:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,f,p;function h(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(a=p[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],p.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":525}],818:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l){l||(l={});var c,u,f,p,h=l.isContour,d=t.cd[0],m=d.trace,g=t.xa,y=t.ya,v=d.x,b=d.y,x=d.z,_=d.xCenter,w=d.yCenter,A=d.zmask,k=m.zhoverformat,T=v,M=b;if(!1!==t.index){try{f=Math.round(t.index[1]),p=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=x[0].length||p<0||p>x.length)return}else{if(n.inbox(e-v[0],e-v[v.length-1],0)>0||n.inbox(r-b[0],r-b[b.length-1],0)>0)return;if(h){var S;for(T=[2*v[0]-v[1]],S=1;Sm&&(y=Math.max(y,Math.abs(t[a][o]-d)/(g-m))))}return y}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":525}],821:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){t("texttemplate");var r=n.extendFlat({},e.font,{color:"auto",size:"auto"});n.coerceFont(t,"textfont",r)}},{"../../lib":525}],822:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,f=[],p=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!h&&"category"!==s.type){var m=e.length;if(!(m<=o))return p?e.slice(0,o):e.slice(0,o+1);if(p||d)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;u0;)_=w.c2p(R[S]),S--;for(_0;)M=A.c2p(F[S]),S--;if(MGt||Gt>A._length))for(z=Vt;zYt||Yt>w._length)){var Zt=u({x:Wt,y:qt},P,t._fullLayout);Zt.x=Wt,Zt.y=qt;var Xt=C.z[S][z];void 0===Xt?(Zt.z="",Zt.zLabel=""):(Zt.z=Xt,Zt.zLabel=s.tickText(Ft,Xt,"hover").text);var Jt=C.text&&C.text[S]&&C.text[S][z];void 0!==Jt&&!1!==Jt||(Jt=""),Zt.text=Jt;var Kt=l.texttemplateString(Dt,Zt,t._fullLayout._d3locale,Zt,P._meta||{});if(Kt){var Qt=Kt.split("
"),$t=Qt.length,te=0;for(E=0;E<$t;E++)te=Math.max(te,Qt[E].length);Ht.push({l:$t,c:te,t:Kt,x:Yt,y:Gt,z:Xt})}}}}var ee=P.textfont,re=ee.family,ne=ee.size,ie=t._fullLayout.font.size;if(!ne||"auto"===ne){var ae=1/0,oe=1/0,se=0,le=0;for(E=0;E0&&(a=!0);for(var l=0;la){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function h(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),c=d(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,p=-.1*e,h=t-p,d=r[0],m=r[1],g=Math.min(f(d+p,d+h,n,a),f(m+p,m+h,n,a)),y=Math.min(f(d+c,d+p,n,a),f(m+c,m+p,n,a));if(g>y&&yo){var v=s===i?1:6,b=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",v);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(B)&&(j=o.tickIncrement(j,x.size,!0,h)),I.start=r.l2r(j),F||i.nestedProperty(e,y+".start").set(I.start)}var V=x.end,U=r.r2l(O.end),H=void 0!==U;if((x.endFound||H)&&U!==r.r2l(V)){var q=H?U:i.aggNums(Math.max,null,d);I.end=r.l2r(q),H||i.nestedProperty(e,y+".start").set(I.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[y]=i.extendFlat({},e[y]||{}),delete e._input[G],delete e[G]),[I,d]}e.exports={calc:function(t,e){var r,a,h,d,m=[],g=[],y="h"===e.orientation,v=o.getFromId(t,y?e.yaxis:e.xaxis),b=y?"y":"x",x={x:"y",y:"x"}[b],_=e[b+"calendar"],w=e.cumulative,A=p(t,e,v,b),k=A[0],T=A[1],M="string"==typeof k.size,S=[],z=M?S:k,E=[],L=[],C=[],P=0,O=e.histnorm,I=e.histfunc,D=-1!==O.indexOf("density");w.enabled&&D&&(O=O.replace(/ ?density$/,""),D=!1);var R,F="max"===I||"min"===I?null:0,B=l.count,N=c[O],j=!1,V=function(t){return v.r2c(t,0,_)};for(i.isArrayOrTypedArray(e[x])&&"count"!==I&&(R=e[x],j="avg"===I,B=l[I]),r=V(k.start),h=V(k.end)+(r-o.tickIncrement(r,k.size,!1,_))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),Q=[],$=0,tt=K-1;for(r=0;r=$;r--)if(g[r]){tt=r;break}for(r=$;r<=tt;r++)if(n(m[r])&&n(g[r])){var et={p:m[r],s:g[r],b:0};w.enabled||(et.pts=C[r],W?et.ph0=et.ph1=C[r].length?T[C[r][0]]:m[r]:(e._computePh=!0,et.ph0=q(S[r]),et.ph1=q(S[r+1],!0))),Q.push(et)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,k.size,!1,_)-Q[0].p),s(Q,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(Q,e,X),Q},calcAllAutoBins:p}},{"../../lib":525,"../../plots/cartesian/axes":576,"../../registry":657,"../bar/arrays_to_calcdata":666,"./average":832,"./bin_functions":834,"./bin_label_vals":835,"./norm_functions":843,"fast-isnumeric":186}],837:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],838:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),a=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=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,p,h,d,m,g,y=e._histogramBinOpts={},v=[],b={},x=[];function _(t,e){return n.coerce(r._input,r,r._module.attributes,t,e)}function w(t){return"v"===t.orientation?"x":"y"}function A(t,r,a){var o=t.uid+"__"+a;r||(r=o);var s=function(t,r){return i.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",c=y[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(y[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dS&&A.splice(S,A.length-S),M.length>S&&M.splice(S,M.length-S);var z=[],E=[],L=[],C="string"==typeof w.size,P="string"==typeof T.size,O=[],I=[],D=C?O:w,R=P?I:T,F=0,B=[],N=[],j=e.histnorm,V=e.histfunc,U=-1!==j.indexOf("density"),H="max"===V||"min"===V?null:0,q=a.count,G=o[j],W=!1,Y=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==V&&(W="avg"===V,q=a[V]);var J=w.size,K=b(w.start),Q=b(w.end)+(K-i.tickIncrement(K,J,!1,y))/1e6;for(r=K;r=0&&h=0&&d-1,flipY:E.tiling.flip.indexOf("y")>-1,orientation:E.tiling.orientation,pad:{inner:E.tiling.pad},maxDepth:E._maxDepth}).descendants(),I=1/0,D=-1/0;O.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(I=Math.min(I,e),D=Math.max(D,e))})),h=h.data(O,u.getPtId),E._maxVisibleLayers=isFinite(D)?D-I+1:0,h.enter().append("g").classed("slice",!0),A(h,!1,{},[m,g],b),h.order();var R=null;if(w&&M){var F=u.getPtId(M);h.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return R||{x0:0,x1:m,y0:0,y1:g}},N=h;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-E.tiling.pad),s._hoverY=v(P?s.y1-E.tiling.pad/2:s.y0+E.tiling.pad/2);var h=n.select(this),d=i.ensureSingle(h,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?d.transition().attrTween("d",(function(t){var e=k(t,!1,B(),[m,g],{orientation:E.tiling.orientation,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1});return function(t){return b(e(t))}})):d.attr("d",b),h.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),d.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p(s,r,E,e,z)||"";var A=i.ensureSingle(h,"g","slicetext"),M=i.ensureSingle(A,"text","",(function(t){t.attr("data-notex",1)})),O=i.ensureUniformFontSize(t,u.determineTextFont(E,s,z.font));M.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L?"start":"middle").call(a.font,O).call(o.convertToTspans,t),s.textBB=a.bBox(M.node()),s.transform=x(s,{fontSize:O.size}),s.transform.fontSize=O.size,w?M.transition().attrTween("transform",(function(t){var e=T(t,!1,B(),[m,g]);return function(t){return _(e(t))}})):M.attr("transform",_(s))})),R}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../sunburst/fx":1081,"../sunburst/helpers":1082,"../sunburst/plot":1086,"../treemap/constants":1105,"./partition":861,"./style":863,"@plotly/d3":54}],858:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":966,"./attributes":853,"./base_plot":854,"./calc":855,"./defaults":856,"./layout_attributes":859,"./layout_defaults":860,"./plot":862,"./style":863}],859:[function(t,e,r){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],860:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("iciclecolorway",e.colorway),r("extendiciclecolors")}},{"../../lib":525,"./layout_attributes":859}],861:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),i=t("../treemap/flip_tree");e.exports=function(t,e,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&i(f,e,{swapXY:s,flipX:a,flipY:o}),f}},{"../treemap/flip_tree":1110,"d3-hierarchy":111}],862:[function(t,e,r){"use strict";var n=t("../treemap/draw"),i=t("./draw_descendants");e.exports=function(t,e,r,a){return n(t,e,r,a,{type:"icicle",drawDescendants:i})}},{"../treemap/draw":1107,"./draw_descendants":857}],863:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");o(t,e,"icicle"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":363,"../../lib":525,"../bar/uniform_text":683,"@plotly/d3":54}],864:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,f=Math.floor((e-o.x0)/s.dx),p=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[p][f]:s._hasSource&&(u=s._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,p,1,1).data),u){var h,d=o.hi||s.hoverinfo;if(d){var m=d.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(h=!0)}var g,y=a.colormodel[s.colormodel],v=y.colormodel||s.colormodel,b=v.length,x=s._scaler(u),_=y.suffix,w=[];(s.hovertemplate||h)&&(w.push("["+[x[0]+_[0],x[1]+_[1],x[2]+_[2]].join(", ")),4===b&&w.push(", "+x[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=v.toUpperCase()+": "+w),Array.isArray(s.hovertext)&&Array.isArray(s.hovertext[p])?g=s.hovertext[p][f]:Array.isArray(s.text)&&Array.isArray(s.text[p])&&(g=s.text[p][f]);var A=c.c2p(o.y0+(p+.5)*s.dy),k=o.x0+(f+.5)*s.dx,T=o.y0+(p+.5)*s.dy,M="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(t,{index:[p,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:A,y1:A,color:x,xVal:k,xLabelVal:k,yVal:T,yLabelVal:T,zLabelVal:M,text:g,hovertemplateLabels:{zLabel:M,colorLabel:w,"color[0]Label":x[0]+_[0],"color[1]Label":x[1]+_[1],"color[2]Label":x[2]+_[2],"color[3]Label":x[3]+_[3]}})]}}}},{"../../components/fx":403,"../../lib":525,"./constants":866}],871:[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":588,"./attributes":864,"./calc":865,"./defaults":867,"./event_data":868,"./hover":870,"./plot":872,"./style":873}],872:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.strTranslate,o=t("../../constants/xmlns_namespaces"),s=t("./constants"),l=i.isIOS()||i.isSafari()||i.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,f=e.yaxis,p=!(l||t._context._exportedPlot);i.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),l=e[0],c=l.trace,h=("fast"===c.zsmooth||!1===c.zsmooth&&p)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=h;var d,m,g,y,v,b,x=l.z,_=l.x0,w=l.y0,A=l.w,k=l.h,T=c.dx,M=c.dy;for(b=0;void 0===d&&b0;)m=u.c2p(_+b*T),b--;for(b=0;void 0===y&&b0;)v=f.c2p(w+b*M),b--;if(mP[0];if(O||I){var D=d+S/2,R=y+z/2;L+="transform:"+a(D+"px",R+"px")+"scale("+(O?-1:1)+","+(I?-1:1)+")"+a(-D+"px",-R+"px")+";"}}E.attr("style",L);var F=new Promise((function(t){if(c._hasZ)t();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===A&&c._canvas.el.height===k&&c._canvas.source===c.source)t();else{var e=document.createElement("canvas");e.width=A,e.height=k;var r=e.getContext("2d",{willReadFrequently:!0});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=B((function(t,e){return x[e][t]})).toDataURL("image/png");else if(c._hasSource)if(h)t=c.source;else{var e=c._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,A,k).data;t=B((function(t,r){var n=4*(r*A+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}E.attr({"xlink:href":t,height:z,width:S,x:d,y:y})}));t._promises.push(F)}function B(t){var e=document.createElement("canvas");e.width=S,e.height=z;var r,n=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return i.constrain(Math.round(u.c2p(_+t*T)-d),0,S)},o=function(t){return i.constrain(Math.round(f.c2p(w+t*M)-y),0,z)},p=s.colormodel[c.colormodel],h=p.colormodel||c.colormodel,m=p.fmt;for(b=0;b0}function A(t){t.each((function(t){v.stroke(n.select(this),t.line.color)})).each((function(t){v.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),a={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(i,a,y,t,e)}return m(i,a,l,s,n),g(i,a,l,s),a}function T(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function M(t,e,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(h.convertToTspans,i).call(f.font,e),f.bBox(o.node())}function S(t,e,r,n,i,a){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=o.aggNums(a,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,m){var g,y=t._fullLayout;w(r)&&m&&(g=m()),o.makeTraceGroups(y._indicatorlayer,e,"trace").each((function(e){var m,z,E,L,C,P=e[0].trace,O=n.select(this),I=P._hasGauge,D=P._isAngular,R=P._isBullet,F=P.domain,B={w:y._size.w*(F.x[1]-F.x[0]),h:y._size.h*(F.y[1]-F.y[0]),l:y._size.l+y._size.w*F.x[0],r:y._size.r+y._size.w*(1-F.x[1]),t:y._size.t+y._size.h*(1-F.y[1]),b:y._size.b+y._size.h*F.y[0]},N=B.l+B.w/2,j=B.t+B.h/2,V=Math.min(B.w/2,B.h),U=p.innerRadius*V,H=P.align||"center";if(z=j,I){if(D&&(m=N,z=j+V/2,E=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*U)}),R){var q=p.bulletPadding,G=1-p.bulletNumberDomainSize+q;m=B.l+(G+(1-G)*x[H])*B.w,E=function(t){return T(t,(p.bulletNumberDomainSize-q)*B.w,B.h)}}}else m=B.l+x[H]*B.w,E=function(t){return T(t,B.w,B.h)};!function(t,e,r,i){var c,u,p,m=r[0].trace,g=i.numbersX,y=i.numbersY,A=m.align||"center",T=b[A],z=i.transitionOpts,E=i.onComplete,L=o.ensureSingle(e,"g","numbers"),C=[];m._hasNumber&&C.push("number");m._hasDelta&&(C.push("delta"),"left"===m.delta.position&&C.reverse());var P=L.selectAll("text").data(C);function O(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}P.enter().append("text"),P.attr("text-anchor",(function(){return T})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),P.exit().remove();var I,D=m.mode+m.align;m._hasDelta&&(I=function(){var e=k(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},c=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},p=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(r[0]));var g=L.select("text.delta");function y(){g.text(c(l(r[0]),i)).call(v.fill,p(r[0])).call(h.convertToTspans,t)}return g.call(f.font,m.delta.font).call(v.fill,p({delta:m._deltaLastValue})),w(z)?g.transition().duration(z.duration).ease(z.easing).tween("text",(function(){var t=n.select(this),e=l(r[0]),o=m._deltaLastValue,s=O(m.delta.valueformat,i,o,e),u=a(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(v.fill,p({delta:u(e)}))}})).each("end",(function(){y(),E&&E()})).each("interrupt",(function(){y(),E&&E()})):y(),u=M(c(l(r[0]),i),m.delta.font,T,t),g}(),D+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,D+=m.delta.increasing.symbol+m.delta.decreasing.symbol,p=u);m._hasNumber&&(!function(){var e=k(t,{tickformat:m.number.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=L.select("text.number");function u(){var e="number"==typeof r[0].y?s+i(r[0].y)+o:"-";l.text(e).call(f.font,m.number.font).call(h.convertToTspans,t)}w(z)?l.transition().duration(z.duration).ease(z.easing).each("end",(function(){u(),E&&E()})).each("interrupt",(function(){u(),E&&E()})).attrTween("text",(function(){var t=n.select(this),e=a(r[0].lastY,r[0].y);m._lastValue=r[0].y;var l=O(m.number.valueformat,i,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}})):u(),c=M(s+i(r[0].y)+o,m.number.font,T,t)}(),D+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,p=c);if(m._hasDelta&&m._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],N=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*m.delta.font.size;"left"===m.delta.position&&(R=S(m,"deltaPos",0,-1*(c.width*x[m.align]+u.width*(1-x[m.align])+j),D,Math.min),F=B[1]-N[1],p={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=S(m,"deltaPos",0,c.width*(1-x[m.align])+u.width*x[m.align]+j,D,Math.max),F=B[1]-N[1],p={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,p={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,p={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),I.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&L.attr("transform",(function(){var t=i.numbersScaler(p);D+=t[2];var e,r=S(m,"numbersScale",1,t[0],D,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?y-r*p.bottom:y-r*(p.top+p.bottom)/2,m._numbersTop=r*p.top+e;var n=p[A];"center"===A&&(n=(p.left+p.right)/2);var a=g-r*n;return a=S(m,"numbersTranslate",0,a,D,Math.max),l(a,e)+s(r)}))}(t,O,e,{numbersX:m,numbersY:z,numbersScaler:E,transitionOpts:r,onComplete:g}),I&&(L={range:P.gauge.axis.range,color:P.gauge.bgcolor,line:{color:P.gauge.bordercolor,width:0},thickness:1},C={range:P.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:P.gauge.bordercolor,width:P.gauge.borderwidth},thickness:1});var W=O.selectAll("g.angular").data(D?e:[]);W.exit().remove();var Y=O.selectAll("g.angularaxis").data(D?e:[]);Y.exit().remove(),D&&function(t,e,r,a){var o,s,f,p,h=r[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,b=a.gaugeOutline,x=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,T=a.layer,M=a.transitionOpts,S=a.onComplete,z=Math.PI/2;function E(t){var e=h.gauge.axis.range[0],r=(t-e)/(h.gauge.axis.range[1]-e)*Math.PI-z;return r<-z?-z:r>z?z:r}function L(t){return n.svg.arc().innerRadius((y+g)/2-t/2*(g-y)).outerRadius((y+g)/2+t/2*(g-y)).startAngle(-z)}function C(t){t.attr("d",(function(t){return L(t.thickness).startAngle(E(t.range[0])).endAngle(E(t.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(x[0],x[1])),T.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),T.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,h.gauge.axis)).type="linear",o.range=h.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var P=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},O={},I=d.makeLabelFns(o,0).labelStandoff;O.xFn=function(t){var e=P(t);return Math.cos(e)*I},O.yFn=function(t){var e=P(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(I+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},O.anchorFn=function(t){var e=P(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},O.heightFn=function(t,e,r){var n=P(t);return-.5*(1+Math.sin(n))*r};var D=function(t){return l(x[0]+g*Math.cos(t),x[1]-g*Math.sin(t))};f=function(t){return D(P(t))};if(s=d.calcTicks(o),p=d.getTickSigns(o)[2],o.visible){p="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:T,path:"M"+p*R+",0h"+p*o.ticklen,transFn:function(t){var e=P(t);return D(e)+"rotate("+-c(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:T,transFn:f,labelFns:O})}var F=[v].concat(h.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(C).call(A),B.exit().remove();var N=L(h.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([h.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var V=j.select("path");w(M)?(V.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(U=N,H=E(r[0].lastY),q=E(r[0].y),function(){var t=i(H,q);return function(e){return U.endAngle(t(e))()}})),h._lastValue=r[0].y):V.attr("d","number"==typeof r[0].y?N.endAngle(E(r[0].y)):"M0,0Z");var U,H,q;V.call(A),j.exit().remove(),F=[];var G=h.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:h.gauge.threshold.color,line:{color:h.gauge.threshold.line.color,width:h.gauge.threshold.line.width},thickness:h.gauge.threshold.thickness});var W=_.selectAll("g.threshold-arc").data(F);W.enter().append("g").classed("threshold-arc",!0).append("path"),W.select("path").call(C).call(A),W.exit().remove();var Y=_.selectAll("g.gauge-outline").data([b]);Y.enter().append("g").classed("gauge-outline",!0).append("path"),Y.select("path").call(C).call(A),Y.exit().remove()}(t,0,e,{radius:V,innerRadius:U,gauge:W,layer:Y,size:B,gaugeBg:L,gaugeOutline:C,transitionOpts:r,onComplete:g});var Z=O.selectAll("g.bullet").data(R?e:[]);Z.exit().remove();var X=O.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,s,c,u=r[0].trace,f=n.gauge,h=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,b=u.domain,x=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(y.l,y.t)),h.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),h.selectAll("g.xbulletaxistick,path,text").remove();var T=y.h,M=u.gauge.bar.thickness*T,S=b.x[0],z=b.x[0]+(b.x[1]-b.x[0])*(u._hasNumber||u._hasDelta?1-p.bulletNumberDomainSize:1);(i=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,z],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),s=d.getTickSigns(i)[2],c=y.t+y.h,i.visible&&(d.drawTicks(t,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:h,path:d.makeTickPath(i,c,s),transFn:o}),d.drawLabels(t,i,{vals:a,layer:h,transFn:o,labelFns:d.makeLabelFns(i,c)}));function E(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*T})).attr("height",(function(t){return t.thickness*T}))}var L=[m].concat(u.gauge.steps),C=f.selectAll("g.bg-bullet").data(L);C.enter().append("g").classed("bg-bullet",!0).append("rect"),C.select("rect").call(E).call(A),C.exit().remove();var P=f.selectAll("g.value-bullet").data([u.gauge.bar]);P.enter().append("g").classed("value-bullet",!0).append("rect"),P.select("rect").attr("height",M).attr("y",(T-M)/2).call(A),w(x)?P.select("rect").transition().duration(x.duration).ease(x.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):P.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);P.exit().remove();var O=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),I=f.selectAll("g.threshold-bullet").data(O);I.enter().append("g").classed("threshold-bullet",!0).append("line"),I.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*T).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*T).call(v.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),I.exit().remove();var D=f.selectAll("g.gauge-outline").data([g]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(E).call(A),D.exit().remove()}(t,0,e,{gauge:Z,layer:X,size:B,gaugeBg:L,gaugeOutline:C,transitionOpts:r,onComplete:g});var J=O.selectAll("text.title").data(e);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?b.right:b[P.title.align]})).text(P.title.text).call(f.font,P.title.font).call(h.convertToTspans,t),J.attr("transform",(function(){var t,e=B.l+B.w*x[P.title.align],r=p.titlePadding,n=f.bBox(J.node());if(I){if(D)if(P.gauge.axis.visible)t=f.bBox(Y.node()).top-r-n.bottom;else t=B.t+B.h/2-V/2-n.bottom-r;R&&(t=z-(n.top+n.bottom)/2,e=B.l-p.bulletPadding*B.w)}else t=P._numbersTop-r-n.bottom;return l(e,t)}))}))}},{"../../components/color":363,"../../components/drawing":385,"../../constants/alignment":479,"../../lib":525,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"../../plots/cartesian/axis_defaults":578,"../../plots/cartesian/layout_attributes":589,"../../plots/cartesian/position_defaults":592,"./constants":877,"@plotly/d3":54,"d3-interpolate":112}],881:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plot_api/edit_types":558,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652,"../mesh3d/attributes":886}],882:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){L();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[h]:E(d,m,y);p[h]=b>-1?b:P(d,m,y,R(e,v))}i=p[0],a=p[1],o=p[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function B(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(z-S);return t>=S-e&&t<=z+e}function V(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function U(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,i),N(e[1][3],n,i),N(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):a<3&&U(t,e,r,S,z,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],p=e[a[2]],h=B(p,u,n,i),d=B(p,f,n,i);o=l(t,[d,h,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,f,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],p=e[a[2]],h=B(f,u,n,i),d=B(p,u,n,i);o=l(t,[d,h,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function H(t,e,r,n){var i=!1,a=V(e),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],p=a[l[3]];if(m)i=F(t,[c,u,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var h=B(p,c,r,n),d=B(p,u,r,n),g=B(p,f,r,n);i=F(null,[h,d,g],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],p=a[l[3]],h=B(f,c,r,n),d=B(f,u,r,n),g=B(p,u,r,n),y=B(p,c,r,n);m?(i=F(t,[c,y,h],[e[l[0]],-1,-1])||i,i=F(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[h,d,g,y],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],p=a[l[3]],h=B(u,c,r,n),d=B(f,c,r,n),g=B(p,c,r,n);m?(i=F(t,[c,h,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,h],[e[l[0]],-1,-1])||i):i=F(null,[h,d,g],[-1,-1,-1])||i,s=!0}})),i)}function q(t,e,r,n,i,a,o,s,l,c,u){var f=!1;return d&&(D(t,"A")&&(f=H(null,[e,r,n,a],c,u)||f),D(t,"B")&&(f=H(null,[r,n,i,l],c,u)||f),D(t,"C")&&(f=H(null,[r,a,o,l],c,u)||f),D(t,"D")&&(f=H(null,[n,a,s,l],c,u)||f),D(t,"E")&&(f=H(null,[r,n,a,l],c,u)||f)),m&&(f=H(t,[r,n,a,l],c,u)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||U(t,V([e,r,n]),[e,r,n],a,o),!0===s[1]||U(t,V([n,i,e]),[n,i,e],a,o)]}function W(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function Y(t,e,r,n,i,a,o){var s,l,c,u,f=!1,p=function(){f=U(t,[s,l,c],[-1,-1,-1],i,a)||f,f=U(t,[c,u,s],[-1,-1,-1],i,a)||f},h=o[0],d=o[1],m=o[2];return h&&(s=O(V([k(e,r-0,n-0)])[0],V([k(e-1,r-0,n-0)])[0],h),l=O(V([k(e,r-0,n-1)])[0],V([k(e-1,r-0,n-1)])[0],h),c=O(V([k(e,r-1,n-1)])[0],V([k(e-1,r-1,n-1)])[0],h),u=O(V([k(e,r-1,n-0)])[0],V([k(e-1,r-1,n-0)])[0],h),p()),d&&(s=O(V([k(e-0,r,n-0)])[0],V([k(e-0,r-1,n-0)])[0],d),l=O(V([k(e-0,r,n-1)])[0],V([k(e-0,r-1,n-1)])[0],d),c=O(V([k(e-1,r,n-1)])[0],V([k(e-1,r-1,n-1)])[0],d),u=O(V([k(e-1,r,n-0)])[0],V([k(e-1,r-1,n-0)])[0],d),p()),m&&(s=O(V([k(e-0,r-0,n)])[0],V([k(e-0,r-0,n-1)])[0],m),l=O(V([k(e-0,r-1,n)])[0],V([k(e-0,r-1,n-1)])[0],m),c=O(V([k(e-1,r-1,n)])[0],V([k(e-1,r-1,n-1)])[0],m),u=O(V([k(e-1,r-0,n)])[0],V([k(e-1,r-0,n-1)])[0],m),p()),f}function Z(t,e,r,n,i,a,o,s,l,c,u,f){var p=t;return f?(d&&"even"===t&&(p=null),q(p,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(p=null),q(p,l,s,o,a,i,n,r,e,c,u))}function X(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(d-M)?[T,d]:[d,M];$(e,A[0],A[1])}}var E=[[Math.min(S,M),Math.max(S,M)],[Math.min(T,z),Math.max(T,z)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(h.id),"x"===e?f.push([h.distRatio,0,0]):"y"===e?f.push([0,h.distRatio,0]):f.push([0,0,h.distRatio]))}else c=nt(1,"x"===e?x-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),c.length>0&&(r[i]="x"===e?X(null,c,a,o,r[i]):"y"===e?J(null,c,a,o,r[i]):K(null,c,a,o,r[i]),i++)}var d=t.caps[e];d.show&&d.fill&&(I(d.fill),r[i]="x"===e?X(null,[0,x-1],a,o,r[i]):"y"===e?J(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===g&&C(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=y,t._Ys=v,t._Zs=b}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:p,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../../stackgl_modules":1151,"../../components/colorscale":375,"../../lib/gl_format_color":521,"../../lib/str2rgbarray":550,"../../plots/gl3d/zip3":628}],884:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),f=a("z"),p=a("value");c&&c.length&&u&&u.length&&f&&f.length&&p&&p.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":373,"../../lib":525,"../../registry":657,"./attributes":881}],885:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":617,"./attributes":881,"./calc":882,"./convert":883,"./defaults":884}],886:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652,"../surface/attributes":1088}],887:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":371}],888:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_mesh3d,i=t("../../../stackgl_modules").delaunay_triangulate,a=t("../../../stackgl_modules").alpha_shape,o=t("../../../stackgl_modules").convex_hull,s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var p=f.prototype;function h(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}p.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},p.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,p=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=u(m(t.i),m(t.j),m(t.k))}else n=0===t.alphahull?o(p):t.alphahull>0?a(t.alphahull,p):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;oy):g=T>w,y=T;var M=c(w,A,k,T);M.pos=_,M.yc=(w+T)/2,M.i=x,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[k,A],v&&(M.orig_p=r[x]),d&&(M.tx=e.text[x]),m&&(M.htx=e.hovertext[x]),b.push(M)}else b.push({pos:_,empty:!0})}return e._extremes[l._id]=a.findExtremes(l,n.concat(p,f),{padded:!0}),b.length&&(b[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),b}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),s=function(t,e,r){var i=r._minDiff;if(!i){var a,s=t._fullData,l=[];for(i=1/0,a=0;a"+c.labels[b]+n.hoverLabelText(s,x,l.yhoverformat):((v=i.extendFlat({},p)).y0=v.y1=_,v.yLabelVal=x,v.yLabel=c.labels[b]+n.hoverLabelText(s,x,l.yhoverformat),v.name="",f.push(v),g[x]=v)}return f}function p(t,e,r,i){var a=t.cd,o=t.ya,l=a[0].trace,f=a[0].t,p=u(t,e,r,i);if(!p)return[];var h=a[p.index],d=p.index=h.i,m=h.dir;function g(t){return f.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var y=h.hi||l.hoverinfo,v=y.split("+"),b="all"===y,x=b||-1!==v.indexOf("y"),_=b||-1!==v.indexOf("text"),w=x?[g("open"),g("high"),g("low"),g("close")+" "+c[m]]:[];return _&&s(h,l,w),p.extraText=w.join("
"),p.y0=p.y1=o.c2p(h.yc,!0),[p]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?f(t,e,r,n):p(t,e,r,n)},hoverSplit:f,hoverOnPoints:p}},{"../../components/color":363,"../../components/fx":403,"../../constants/delta.js":481,"../../lib":525,"../../plots/cartesian/axes":576}],895:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":588,"./attributes":891,"./calc":892,"./defaults":893,"./hover":894,"./plot":897,"./select":898,"./style":899}],896:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var f=Math.min(s.length,l.length,c.length,u.length);return o&&(f=Math.min(f,i.minRowLength(o))),e._length=f,f}}},{"../../lib":525,"../../registry":657}],897:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],a=r.t;if(!0!==r.trace.visible||a.empty)e.remove();else{var c=a.tickLen,u=e.selectAll("path").data(i.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}},{"../../lib":525,"@plotly/d3":54}],898:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,f){function p(r,i){return n.coerce(t,e,l,r,i)}var h=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,f,p);o(e,f,p),Array.isArray(h)&&h.length||(e.visible=!1),c(e,h,"values",d),p("hoveron"),p("hovertemplate"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var m={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(p,"labelfont",m);var g={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(p,"tickfont",g)}},{"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"../../lib":525,"../../plots/array_container_defaults":571,"../../plots/domain":603,"../parcoords/merge_length":916,"./attributes":900}],904:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":900,"./base_plot":901,"./calc":902,"./defaults":903,"./plot":906}],905:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-interpolate").interpolateNumber,a=t("../../plot_api/plot_api"),o=t("../../components/fx"),s=t("../../lib"),l=s.strTranslate,c=t("../../components/drawing"),u=t("tinycolor2"),f=t("../../lib/svg_text_utils");function p(t,e,r,i){var a=e._context.staticPlot,o=t.map(F.bind(0,e,r)),u=i.selectAll("g.parcatslayer").data([null]);u.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var p=u.selectAll("g.trace.parcats").data(o,h),v=p.enter().append("g").attr("class","trace parcats");p.attr("transform",(function(t){return l(t.x,t.y)})),v.append("g").attr("class","paths");var b=p.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),h);b.attr("fill",(function(t){return t.model.color}));var w=b.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);_(w),b.attr("d",(function(t){return t.svgD})),w.empty()||b.sort(m),b.exit().remove(),b.on("mouseover",g).on("mouseout",y).on("click",x),v.append("g").attr("class","dimensions");var T=p.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),h);T.enter().append("g").attr("class","dimension"),T.attr("transform",(function(t){return l(t.x,0)})),T.exit().remove();var M=T.selectAll("g.category").data((function(t){return t.categories}),h),S=M.enter().append("g").attr("class","category");M.attr("transform",(function(t){return l(0,t.y)})),S.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),A(S);var z=M.selectAll("rect.bandrect").data((function(t){return t.bands}),h);z.each((function(){s.raiseToTop(this)})),z.attr("fill",(function(t){return t.color}));var I=z.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);z.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),k(I),z.exit().remove(),S.append("text").attr("class","catlabel").attr("pointer-events","none");var D=e._fullLayout.paper_bgcolor;M.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(D)).style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){c.font(n.select(this),t.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),e)})),S.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){c.font(n.select(this),t.parcatsViewModel.labelfont)})),M.selectAll("rect.bandrect").on("mouseover",E).on("mouseout",L),M.exit().remove(),T.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",C).on("drag",P).on("dragend",O)),p.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),p.exit().remove()}function h(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function m(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),E=n.mouse(f)[0];o.loneHover({trace:p,x:x-d.left+m.left,y:_-d.top+m.top,text:z,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:A,idealAlign:E1&&p.displayInd===f.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},b=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&b.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&b.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var x=b.join("
");return{trace:h,x:o*(i-e.left),y:s*(d-e.top),text:x,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:h.hovertemplate,hovertemplateLabels:v,eventData:[{data:h._input,fullData:h,count:m,category:g,probability:y}]}}function E(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron;if("color"===l?(!function(t){var e=n.select(t).datum(),r=T(e);w(r),r.each((function(){s.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=T(t);w(e),e.each((function(){s.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),M(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===l?e=z(r,a,this):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),f=c.categoryViewModel,p=f.parcatsViewModel,h=p.model.dimensions[f.model.dimensionInd],d=p.trace,m=l.y+l.height/2;p.dimensions.length>1&&h.displayInd===p.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=f.model.categoryLabel,y=c.parcatsViewModel.model.count,v=0;c.categoryViewModel.bands.forEach((function(t){t.color===c.color&&(v+=t.count)}));var b=f.model.count,x=0;p.pathSelection.each((function(t){t.model.color===c.color&&(x+=t.model.count)}));var _=v/y,w=v/x,A=v/b,k={countLabel:y,categoryLabel:g,probabilityLabel:_.toFixed(3)},T=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&T.push(["Count:",k.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(T.push("P(color \u2229 "+g+"): "+k.probabilityLabel),T.push("P("+g+" | color): "+w.toFixed(3)),T.push("P(color | "+g+"): "+A.toFixed(3)));var M=T.join("
"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:y,probability:_,categorycount:b,colorcount:x,bandcolorcount:v}]}}(r,a,this):"dimension"===l&&(e=function(t,e,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(z(t,e,this))})),i}(r,a,this)),e&&o.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r})}}function L(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(_(e.pathSelection),A(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(m),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):M(this,"plotly_unhover",n.event)}}function C(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var p=t.parcatsViewModel.dimensions[r],h=t.parcatsViewModel.dimensions[i];void 0!==p&&a.model.dragXh.x&&(a.model.displayInd=h.model.displayInd,h.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}j(t.parcatsViewModel),N(t.parcatsViewModel),R(t.parcatsViewModel),D(t.parcatsViewModel)}}function O(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=I(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),f=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[f],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):M(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),N(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){R(t.parcatsViewModel,!0),D(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function I(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),u+="l-"+r[s]+",0 ";return u+="Z"}function N(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function f(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=f(e),i=f(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var p=new Array(c.length),h=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(y.count/h):0;for(var v,b=new Array(n.length),x=0;x1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],f=t.model.maxCats,p=e.categories.length,h=e.count,d=t.height-8*(f-1),m=8*(f-p)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/h*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){p(r,t,n,e)}},{"../../components/drawing":385,"../../components/fx":403,"../../lib":525,"../../lib/svg_text_utils":551,"../../plot_api/plot_api":562,"@plotly/d3":54,"d3-interpolate":112,tinycolor2:309}],906:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},{"./parcats":905}],907:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plot_api/plot_template":565,"../../plots/cartesian/layout_attributes":589,"../../plots/domain":603,"../../plots/font_attributes":604}],908:[function(t,e,r){"use strict";var n=t("./constants"),i=t("@plotly/d3"),a=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=t("../../lib").strTranslate,c=n.bar.snapRatio;function u(t,e){return t*(1-c)+e*c}var f=n.bar.snapClose;function p(t,e){return t*(1-f)+e*f}function h(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*fe){p=r;break}}if(a=u,isNaN(a)&&(a=isNaN(f)||isNaN(p)?isNaN(f)?p:f:e-c[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var g=t.unitTickvals,v=t.unitToPaddedPx.invert(e);for(r=0;r=b[0]&&v<=b[1]){o.clickableOrdinalRange=b;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),x(t.parentNode)}function A(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",(function(t){i.event.preventDefault(),t.parent.inBrushDrag||A(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||v()})).call(i.behavior.drag().on("dragstart",(function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(A(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,v(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),x(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?x(t.parentNode,s):(s(),x(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function T(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(T)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,r){var i=t.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e,r){var i=r._context.staticPlot,a=t.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(d).call(m).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(k).attr("height",(function(t){return t.height-n.verticalPadding}));var s=t.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(t){return t.height})).call(b);var c=t.selectAll(".highlight").data(o);c.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(b)}(i,e,r)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?S(t.sort(T)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[h(0,r,t[0],[]),h(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":525,"../../lib/gup":522,"./constants":912,"@plotly/d3":54}],909:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":907,"./base_plot":910,"./calc":911,"./defaults":913}],910:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":488,"../../plots/get_data":612,"./plot":919,"@plotly/d3":54}],911:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale"),a=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),d.splice(f));var m=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:h}),g=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(m)&&m.length||(e.visible=!1),p(e,m,"values",g);var y={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",y),n.coerceFont(u,"tickfont",y),n.coerceFont(u,"rangefont",y),u("labelangle"),u("labelside"),u("unselected.line.color"),u("unselected.line.opacity")}},{"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"../../lib":525,"../../plots/array_container_defaults":571,"../../plots/cartesian/axes":576,"../../plots/domain":603,"./attributes":907,"./axisbrush":908,"./constants":912,"./merge_length":916}],914:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":525}],915:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function p(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[i].dim1.canvasX,o=i);0===s&&f(A,0,0,r.canvasWidth,r.canvasHeight);var h=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&no._length&&(S=S.slice(0,o._length));var E,L=o.tickvals;function C(t,e){return{val:t,text:E[e]}}function P(t,e){return t.val-e.val}if(Array.isArray(L)&&L.length){E=o.ticktext,Array.isArray(E)&&E.length?E.length>L.length?E=E.slice(0,L.length):L.length>E.length&&(L=L.slice(0,E.length)):E=L.map(a(o.tickformat));for(var O=1;O=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,p={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==N&&(u?a.hover(p):a.unhover&&a.unhover(p),N=f)}})),B.style("opacity",(function(t){return t.pick?0:1})),h.style("background","rgba(255, 255, 255, 0)");var j=h.selectAll("."+v.cn.parcoords).data(F,d);j.exit().remove(),j.enter().append("g").classed(v.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var V=j.selectAll("."+v.cn.parcoordsControlView).data(m,d);V.enter().append("g").classed(v.cn.parcoordsControlView,!0),V.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var U=V.selectAll("."+v.cn.yAxis).data((function(t){return t.dimensions}),d);U.enter().append("g").classed(v.cn.yAxis,!0),V.each((function(t){O(U,t,A)})),B.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=x(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),U.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),U.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;R.linePickActive(!1),t.x=Math.max(-v.overdrag,Math.min(t.model.width+v.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,U.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),O(U,e,A),U.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",c(t.x,0)),U.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!z(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,O(U,e,A),n.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!z(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),R.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),U.exit().remove();var H=U.selectAll("."+v.cn.axisOverlays).data(m,d);H.enter().append("g").classed(v.cn.axisOverlays,!0),H.selectAll("."+v.cn.axis).remove();var q=H.selectAll("."+v.cn.axis).data(m,d);q.enter().append("g").classed(v.cn.axis,!0),q.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return y.isOrdinal(t)?e:I(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(q.selectAll("text"),t.model.tickFont)})),q.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),q.selectAll("text").style("text-shadow",u.makeTextShadow(T)).style("cursor","default");var G=H.selectAll("."+v.cn.axisHeading).data(m,d);G.enter().append("g").classed(v.cn.axisHeading,!0);var W=G.selectAll("."+v.cn.axisTitle).data(m,d);W.enter().append("text").classed(v.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),W.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=P(t.model.labelAngle,t.model.labelSide),r=v.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=P(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var Y=H.selectAll("."+v.cn.axisExtent).data(m,d);Y.enter().append("g").classed(v.cn.axisExtent,!0);var Z=Y.selectAll("."+v.cn.axisExtentTop).data(m,d);Z.enter().append("g").classed(v.cn.axisExtentTop,!0),Z.attr("transform",c(0,-v.axisExtentOffset));var X=Z.selectAll("."+v.cn.axisExtentTopText).data(m,d);X.enter().append("text").classed(v.cn.axisExtentTopText,!0).call(C),X.text((function(t){return D(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var J=Y.selectAll("."+v.cn.axisExtentBottom).data(m,d);J.enter().append("g").classed(v.cn.axisExtentBottom,!0),J.attr("transform",(function(t){return c(0,t.model.height+v.axisExtentOffset)}));var K=J.selectAll("."+v.cn.axisExtentBottomText).data(m,d);K.enter().append("text").classed(v.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(C),K.text((function(t){return D(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),b.ensureAxisBrush(H,T,t)}},{"../../components/colorscale":375,"../../components/drawing":385,"../../lib":525,"../../lib/gup":522,"../../lib/svg_text_utils":551,"../../plots/cartesian/axes":576,"./axisbrush":908,"./constants":912,"./helpers":914,"./lines":915,"@plotly/d3":54,"color-rgba":87}],918:[function(t,e,r){"use strict";var n=t("./plot"),i=t("./regl_precompiled");Object.assign(n.reglPrecompiled,i),e.exports=n},{"./plot":919,"./regl_precompiled":920}],919:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl"),a=t("./helpers").isVisible,o={};function s(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var r=t._fullLayout;if(i(t,[],o)){var l={},c={},u={},f={},p=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=f[r]=n._fullInput.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()}));n(t,e,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{filterChanged:function(e,n,i){var a=c[e][n],o=i.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[s]){var p=a.constraintrange;l[s]=p||null}var h=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,h.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete h.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[f[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return s(t,e,r)-s(t,e,n)}}(r,c[e].filter(a));l[e].sort(n),c[e].filter((function(t){return!a(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[f[e]]])}})}}).reglPrecompiled=o},{"../../lib/prepare_regl":538,"./helpers":914,"./parcoords":917}],920:[function(t,e,r){"use strict";var n=t("../../generated/regl-codegen/453a70fefa48db31713162aeb1ac438cb8579f54504f3b23acf32128df3dfd45"),i=t("../../generated/regl-codegen/30680f8f6712ef1af5cf7547e0af35b036fb300c67b07967cf448492ff4de4d0"),a=t("../../generated/regl-codegen/a3970baf1d8cac9305ee830c7026550387343d4dde2353dd86a4d082c97d3470"),o=t("../../generated/regl-codegen/3fd666968f3ce90d1c048b7a9aab515f3ce387a5401a10f8b66121c9469d1c0d");e.exports={"453a70fefa48db31713162aeb1ac438cb8579f54504f3b23acf32128df3dfd45":n,"30680f8f6712ef1af5cf7547e0af35b036fb300c67b07967cf448492ff4de4d0":i,a3970baf1d8cac9305ee830c7026550387343d4dde2353dd86a4d082c97d3470:a,"3fd666968f3ce90d1c048b7a9aab515f3ce387a5401a10f8b66121c9469d1c0d":o}},{"../../generated/regl-codegen/30680f8f6712ef1af5cf7547e0af35b036fb300c67b07967cf448492ff4de4d0":491,"../../generated/regl-codegen/3fd666968f3ce90d1c048b7a9aab515f3ce387a5401a10f8b66121c9469d1c0d":493,"../../generated/regl-codegen/453a70fefa48db31713162aeb1ac438cb8579f54504f3b23acf32128df3dfd45":494,"../../generated/regl-codegen/a3970baf1d8cac9305ee830c7026550387343d4dde2353dd86a4d082c97d3470":499}],921:[function(t,e,r){"use strict";var n=t("./base_index");n.plot=t("./plot-strict"),e.exports=n},{"./base_index":909,"./plot-strict":918}],922:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),i=t("../../plots/domain").attributes,a=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=a({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:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({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:i({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:"angle",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":362,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/domain":603,"../../plots/font_attributes":604,"../../plots/template_attributes":652}],923:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":638}],924:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../../components/color"),o={};function s(t){return function(e,r){return!!e&&(!!(e=i(e)).isValid()&&(e=a.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function l(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r=0})),("funnelarea"===e.type?y:e.sort)&&a.sort((function(t,e){return e.v-t.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var c=0,u=0;u0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return i.coerce(t,e,a,r,n)}var u=l(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 p,h=c("text"),d=c("texttemplate");if(d||(p=c("textinfo",Array.isArray(h)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||p&&"none"!==p){var m=c("textposition");s(t,e,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(e,n,c);var g=c("hole");if(c("title.text")){var y=c("title.position",g?"middle center":"top center");g||"middle center"!==y||(e.title.position="top center"),i.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":525,"../../plots/domain":603,"../bar/defaults":671,"./attributes":922,"fast-isnumeric":186}],926:[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,bbox:t.bbox,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":399}],927:[function(t,e,r){"use strict";var n=t("../../lib");function i(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=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:f.hovertemplate||-1!==p.indexOf("name")?f.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,t.pts)||t.color,borderColor:g.castOption(_.bordercolor,t.pts),fontFamily:g.castOption(w.family,t.pts),fontSize:g.castOption(w.size,t.pts),fontColor:g.castOption(w.color,t.pts),nameLength:g.castOption(_.namelength,t.pts),textAlign:g.castOption(_.align,t.pts),hovertemplate:g.castOption(f.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[y(t,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:A}),t.bbox=A[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[y(t,f)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,i=e._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[y(o,i)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,i=e._fullData[c.index];e._dragging||!1===r.hovermode||(e._hoverdata=[y(t,i)],a.click(e,n.event))}))}function x(t,e,r){var n=g.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=g.castOption(t._input.textfont.color,e.pts));var i=g.castOption(t.insidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.insidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:i,size:a}}function _(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(f||h){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||d||f){var v=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||h)&&((a=A(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||p)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var b=0,x=0,_=0;_=1)break}return m[b]}function A(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:T(a,o/e),rotate:M(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:T(a,o/e),rotate:M(i+Math.PI/2)}}function T(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function z(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function E(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function L(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=P(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),f=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=C(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function C(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 P(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function O(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/i.aspectratio):(u=r.r,c=u*i.aspectratio),c*=(1+i.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var b=l.castOption(i,e.i,"texttemplate");if(b){var x=function(t){return{label:t.label,value:t.v,valueLabel:g.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:g.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(i,t.i,"customdata")}}(e),_=g.getFirstFilled(i.text,e.pts);(v(_)||""===_)&&(x.text=_),e.text=l.texttemplateString(b,x,t._fullLayout._d3locale,x,i._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._context.staticPlot,a=t._fullLayout,p=a._size;d("pie",a),_(e,t),O(e,p);var m=l.makeTraceGroups(a._pielayer,e,"trace").each((function(e){var d=n.select(this),m=e[0],y=m.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=g.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=z(r,i))}(e),d.attr("stroke-linejoin","round"),d.each((function(){var v=n.select(this).selectAll("g.slice").data(e);v.enter().append("g").classed("slice",!0),v.exit().remove();var _=[[[],[]],[[],[]]],A=!1;v.each((function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=y.index,_[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var c=m.cx,u=m.cy,p=n.select(this),d=p.selectAll("path.surface").data([i]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),p.call(b,t,e),y.pull){var v=+g.castOption(y.pull,i.pts)||0;v>0&&(c+=v*i.pxmid[0],u+=v*i.pxmid[1])}i.cxFinal=c,i.cyFinal=u;var k=y.hole;if(i.v===m.vTotal){var T="M"+(c+i.px0[0])+","+(u+i.px0[1])+C(i.px0,i.pxmid,!0,1)+C(i.pxmid,i.px0,!0,1)+"Z";k?d.attr("d","M"+(c+k*i.px0[0])+","+(u+k*i.px0[1])+C(i.px0,i.pxmid,!1,k)+C(i.pxmid,i.px0,!1,k)+"Z"+T):d.attr("d",T)}else{var M=C(i.px0,i.px1,!0,1);if(k){var S=1-k;d.attr("d","M"+(c+k*i.px1[0])+","+(u+k*i.px1[1])+C(i.px1,i.px0,!1,k)+"l"+S*i.px0[0]+","+S*i.px0[1]+M+"Z")}else d.attr("d","M"+c+","+u+"l"+i.px0[0]+","+i.px0[1]+M+"Z")}D(t,i,m);var z=g.castOption(y.textposition,i.pts),L=p.selectAll("g.slicetext").data(i.text&&"none"!==z?[0]:[]);L.enter().append("g").classed("slicetext",!0),L.exit().remove(),L.each((function(){var r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=l.ensureUniformFontSize(t,"outside"===z?function(t,e,r){var n=g.castOption(t.outsidetextfont.color,e.pts)||g.castOption(t.textfont.color,e.pts)||r.color,i=g.castOption(t.outsidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.outsidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(y,i,a.font):x(y,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,p).call(f.convertToTspans,t);var d,v=s.bBox(r.node());if("outside"===z)d=E(v,i);else if(d=w(v,i,m),"auto"===z&&d.scale<1){var b=l.ensureUniformFontSize(t,y.outsidetextfont);r.call(s.font,b),d=E(v=s.bBox(r.node()),i)}var _=d.textPosAngle,k=void 0===_?i.pxmid:I(m.r,_);if(d.targetX=c+k[0]*d.rCenter+(d.x||0),d.targetY=u+k[1]*d.rCenter+(d.y||0),R(d,v),d.outside){var T=d.targetY;i.yLabelMin=T-v.height/2,i.yLabelMid=T,i.yLabelMax=T+v.height/2,i.labelExtraX=0,i.labelExtraY=0,A=!0}d.fontSize=p.size,h(y.type,d,a),e[o].transform=d,l.setTransormAndDisplay(r,d)}))}function C(t,e,r,n){var a=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*m.r+","+n*m.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var k=n.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=l.templateString(i,y._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,y.title.font).call(f.convertToTspans,t),e="middle center"===y.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}}(m):L(m,p),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),A&&function(t,e){var r,n,i,a,o,s,l,c,u,f,p,h,d;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function y(t,e){return e.pxmid[1]-t.pxmid[1]}function v(t,r){r||(r={});var i,c,u,p,h=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,y=t.cyFinal+o(t.px0[1],t.px1[1]),v=h-d;if(v*l>0&&(t.labelExtraY=v),Array.isArray(e.pull))for(c=0;c=(g.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(v=u.cyFinal+o(u.px0[1],u.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=v):(m+t.labelExtraY-y)*l>0&&(i=3*s*Math.abs(c-f.indexOf(t)),(p=u.cxFinal+a(u.px0[0],u.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=p)))}for(n=0;n<2;n++)for(i=n?m:y,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(i),u=t[1-n][r],f=u.concat(c),h=[],p=0;pMath.abs(f)?s+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(a+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(v,y),A&&y.automargin){var T=s.bBox(d.node()),M=y.domain,S=p.w*(M.x[1]-M.x[0]),z=p.h*(M.y[1]-M.y[0]),C=(.5*S-m.r)/p.w,P=(.5*z-m.r)/p.h;i.autoMargin(t,"pie."+y.uid+".automargin",{xl:M.x[0]-C,xr:M.x[1]+C,yb:M.y[0]-P,yt:M.y[1]+P,l:Math.max(m.cx-m.r-T.left,0),r:Math.max(T.right-(m.cx+m.r),0),b:Math.max(T.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-T.top,0),pad:5})}}))}));setTimeout((function(){m.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:x,positionTitleOutside:L,prerenderTitles:_,layoutAreas:O,attachFxHandlers:b,computeTransform:R}},{"../../components/color":363,"../../components/drawing":385,"../../components/fx":403,"../../lib":525,"../../lib/svg_text_utils":551,"../../plots/plots":638,"../bar/constants":669,"../bar/uniform_text":683,"./event_data":926,"./helpers":927,"@plotly/d3":54}],932:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("./style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");a(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(i,t,e)}))}))}},{"../bar/uniform_text":683,"./style_one":933,"@plotly/d3":54}],933:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":363,"./helpers":927}],934:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":948}],935:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_pointcloud2d,i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,f=this.pickXYData=t.xy,p=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(f){if(n=f,e=f.length>>>1,p)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(h)r=h;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var m=i(t.marker.color),g=i(t.marker.border.color),y=t.opacity*t.marker.opacity;m[3]*=y,this.pointcloudOptions.color=m;var v=t.marker.blend;if(null===v){v=c.length<100||u.length<100}this.pointcloudOptions.blend=v,g[3]*=y,this.pointcloudOptions.borderColor=g;var b=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=b,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,A=x/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:A}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:A})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../../stackgl_modules":1151,"../../lib/str2rgbarray":550,"../../plots/cartesian/autorange":575,"../scatter/get_trace_color":958}],936:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),e._length=null}},{"../../lib":525,"./attributes":934}],937:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":615,"../scatter3d/calc":977,"./attributes":934,"./convert":935,"./defaults":936}],938:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,f=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,p=t("../../lib/extend").extendFlat,h=t("../../plot_api/edit_types").overrideAll;(e.exports=h({hoverinfo:p({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:p(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":362,"../../components/colorscale/attributes":370,"../../components/fx/attributes":394,"../../lib/extend":515,"../../plot_api/edit_types":558,"../../plot_api/plot_template":565,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/domain":603,"../../plots/font_attributes":604,"../../plots/template_attributes":652}],939:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../components/selections").prepSelect,u=t("../../lib"),f=t("../../registry");function p(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if(o&&"pan"!==i&&"zoom"!==i){s(o,a);var p={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},h={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:p,yaxis:h,fillRangeItems:u.noop},subplot:e,xaxes:[p],yaxes:[h],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;rv&&(v=a.source[e]),a.target[e]>v&&(v=a.target[e]);var b,x=v+1;t.node._count=x;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var A=_[e];for(b=0;b0&&s(z,x)&&s(E,x)&&(!w.hasOwnProperty(z)||!w.hasOwnProperty(E)||w[z]!==w[E])){w.hasOwnProperty(E)&&(E=w[E]),w.hasOwnProperty(z)&&(z=w[z]),E=+E,p[z=+z]=p[E]=!0;var L="";a.label&&a.label[e]&&(L=a.label[e]);var C=null;L&&h.hasOwnProperty(L)&&(C=h[L]),c.push({pointNumber:e,label:L,color:u?a.color[e]:a.color,customdata:f?a.customdata[e]:a.customdata,concentrationscale:C,source:z,target:E,value:+S}),M.source.push(z),M.target.push(E)}}var P=x+_.length,O=o(r.color),I=o(r.customdata),D=[];for(e=0;ex-1,childrenNodes:[],pointNumber:e,label:R,color:O?r.color[e]:r.color,customdata:I?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1}))}(P,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":375,"../../lib":525,"../../lib/gup":522,"strongly-connected-components":303}],941:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],942:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function f(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,p){function h(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(p.hoverlabel,t.hoverlabel),m=t.node,g=c.newContainer(e,"node");function y(t,e){return n.coerce(m,g,i.node,t,e)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",t.hoverinfo),l(m,g,y,d),y("hovertemplate");var v=p.colorway;y("color",g.label.map((function(t,e){return a.addOpacity(function(t){return v[t%v.length]}(e),.8)}))),y("customdata");var b=t.link||{},x=c.newContainer(e,"link");function _(t,e){return n.coerce(b,x,i.link,t,e)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(b,x,_,d),_("hovertemplate");var w,A=o(p.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(A,x.value.length)),_("customdata"),u(b,x,{name:"colorscales",handleItemDefaults:f}),s(e,p,h),h("orientation"),h("valueformat"),h("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),h("arrangement",w),n.coerceFont(h,"textfont",n.extendFlat({},p.font)),e._length=null}},{"../../components/color":363,"../../components/fx/hoverlabel_defaults":401,"../../lib":525,"../../plot_api/plot_template":565,"../../plots/array_container_defaults":571,"../../plots/domain":603,"./attributes":938,tinycolor2:309}],943:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":938,"./base_plot":939,"./calc":940,"./defaults":942,"./plot":944,"./select.js":946}],944:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("./render"),s=t("../../components/fx"),l=t("../../components/color"),c=t("./constants").cn,u=i._;function f(t){return""!==t}function p(t,e){return t.filter((function(t){return t.key===e.traceId}))}function h(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function m(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function y(t,e,r){e&&r&&p(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(b.bind(0,e,r,!1))}function v(t,e,r){e&&r&&p(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(x.bind(0,e,r,!1))}function b(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),i&&p(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&p(e,t).selectAll("."+c.sankeyNode).filter(g(t)).call(y)}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),i&&p(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&p(e,t).selectAll(c.sankeyNode).filter(g(t)).call(v)}function _(t,e){var r=t.hoverlabel||{},n=i.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,i=r._paper,p=r._size,m=0;m"),color:_(o,"bgcolor")||l.addOpacity(m.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:v,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});h(w,.85),d(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(v,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var a=r.node;a.originalEvent=n.event,t._hoverdata=[a],n.select(e).call(v,r,i),s.click(t,{target:!0})}}})}},{"../../components/color":363,"../../components/fx":403,"../../lib":525,"./constants":941,"./render":945,"@plotly/d3":54}],945:[function(t,e,r){"use strict";var n=t("d3-force"),i=t("d3-interpolate").interpolateNumber,a=t("@plotly/d3"),o=t("@plotly/d3-sankey"),s=t("@plotly/d3-sankey-circular"),l=t("./constants"),c=t("tinycolor2"),u=t("../../components/color"),f=t("../../components/drawing"),p=t("../../lib"),h=p.strTranslate,d=p.strRotate,m=t("../../lib/gup"),g=m.keyFun,y=m.repeat,v=m.unwrap,b=t("../../lib/svg_text_utils"),x=t("../../registry"),_=t("../../constants/alignment"),w=_.CAP_SHIFT,A=_.LINE_SPACING;function k(t,e,r){var n,i=v(e),a=i.trace,u=a.domain,f="h"===a.orientation,h=a.node.pad,d=a.node.thickness,m=t.width*(u.x[1]-u.x[0]),g=t.height*(u.y[1]-u.y[0]),y=i._nodes,b=i._links,x=i.circular;(n=x?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[m,g]:[g,m]).nodeWidth(d).nodePadding(h).nodeId((function(t){return t.pointNumber})).nodes(y).links(b);var _,w,A,k=n();for(var T in n.nodePadding()=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+h}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(y=k.nodes));n.update(k)}return{circular:x,key:r,trace:a,guid:p.randstr(),horizontal:f,width:m,height:g,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?g:m,dragPerpendicular:f?m:g,arrangement:a.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function T(t,e,r){var n=c(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:M,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function M(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r=t.width/2,n=t.circularPathData;return"top"===t.circularLinkType?"M "+(n.targetX-e)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"L"+(n.targetX-e)+" "+(n.targetY-r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-e)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"L"+(n.targetX-e)+" "+(n.targetY+r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var n=t.link.source.x1,a=t.link.target.x0-e,o=i(n,a),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,f=t.link.y1-t.link.width/2,p=t.link.y1+t.link.width/2,h="M"+n+","+c,d="C"+s+","+c+" "+l+","+f+" "+a+","+f,m="C"+l+","+p+" "+s+","+u+" "+n+","+u,g=e>0?"L"+(a+e)+","+(f+t.link.width/2):"";return h+d+(g+="L"+a+","+p)+m+"Z"}}function S(t,e){var r=c(e.color),n=l.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=p.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function z(t){t.attr("transform",(function(t){return h(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function E(t){t.call(z)}function L(t,e){t.call(E),e.attr("d",M())}function C(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function P(t){return t.link.width>1||t.linkLineWidth>0}function O(t){return h(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function I(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function D(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(p.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),p.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,i){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,a),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;el&&L[y].gap;)y--;for(b=L[y].s,m=L.length-1;m>y;m--)L[m].s=b;for(;lM[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],955:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),p=t("./line_defaults"),h=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults"),g=t("../../lib").coercePattern;e.exports=function(t,e,r,y){function v(r,i){return n.coerce(t,e,a,r,i)}var b=l(t,e,y,v);if(b||(e.visible=!1),e.visible){c(t,e,y,v),v("xhoverformat"),v("yhoverformat");var x=u(t,e,y,v),_=!x&&b=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.y)-m);return aY!=(N=I[P][1])>=Y&&(R=I[P-1][0],F=I[P][0],N-B&&(D=R+(F-R)*(Y-B)/(N-B),H=Math.min(H,D),q=Math.max(q,D)));H=Math.max(H,0),q=Math.min(q,p._length);var Z=s.defaultLine;return s.opacity(f.fillcolor)?Z=f.fillcolor:s.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:H,x1:q,y0:Y,y1:Y,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":363,"../../components/fx":403,"../../lib":525,"../../registry":657,"./get_trace_color":958}],960:[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":588,"./arrays_to_calcdata":947,"./attributes":948,"./calc":949,"./cross_trace_calc":953,"./cross_trace_defaults":954,"./defaults":955,"./format_labels":957,"./hover":959,"./marker_colorbar":966,"./plot":969,"./select":970,"./style":972,"./subtypes":973}],961:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){l||(l={});var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"../../lib":525}],962:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../../constants/numerical"),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,c=t("../../lib"),u=c.segmentsIntersect,f=c.constrain,p=t("./constants");e.exports=function(t,e){var r,i,o,h,d,m,g,y,v,b,x,_,w,A,k,T,M,S,z=e.trace||{},E=e.xaxis,L=e.yaxis,C="log"===E.type,P="log"===L.type,O=E._length,I=L._length,D=e.backoff,R=z.marker,F=e.connectGaps,B=e.baseTolerance,N=e.shape,j="linear"===N,V=z.fill&&"none"!==z.fill,U=[],H=p.minTolerance,q=t.length,G=new Array(q),W=0;function Y(r){var n=t[r];if(!n)return!1;var i=e.linearized?E.l2p(n.x):E.c2p(n.x),o=e.linearized?L.l2p(n.y):L.c2p(n.y);if(i===a){if(C&&(i=E.c2p(n.x,!0)),i===a)return!1;P&&o===a&&(i*=Math.abs(E._m*I*(E._m>0?s:l)/(L._m*O*(L._m>0?s:l)))),i*=1e3}if(o===a){if(P&&(o=L.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function Z(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function pt(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l);return s}}function ht(t){var e=t[0],r=t[1],n=e===G[W-1][0],i=r===G[W-1][1];if(!n||!i)if(W>1){var a=e===G[W-2][0],o=r===G[W-2][1];n&&(e===at||e===ot)&&a?o?W--:G[W-1]=t:i&&(r===st||r===lt)&&o?a?W--:G[W-1]=t:G[W++]=t}else G[W++]=t}function dt(t){G[W-1][0]!==t[0]&&G[W-1][1]!==t[1]&&ht([$,tt]),ht(t),et=null,$=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(W)if(et){var n=nt(et,e);n.length>1&&(dt(n[0]),G[W++]=n[1])}else rt=nt(G[W-1],e)[0],G[W++]=rt;else G[W++]=[K||e[0],Q||e[1]];var i=G[W-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?ht($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&ht([$,tt])),ht([K,Q])):$-K&&tt-Q&&ht([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&dt(nt(et,e)[0]),G[W++]=e;var a,o,s,l}for(r=0;rX(m,yt))break;o=m,(w=v[0]*y[0]+v[1]*y[1])>x?(x=w,h=m,g=!1):w<_&&(_=w,d=m,g=!0)}if(g?(gt(h),o!==d&>(d)):(d!==i&>(d),o!==h&>(h)),gt(o),r>=t.length||!m)break;gt(m),i=m}}else gt(h)}et&&ht([$||et[0],tt||et[1]]),U.push(G.slice(0,W))}var vt=N.slice(N.length-1);if(D&&"h"!==vt&&"v"!==vt){for(var bt=!1,xt=-1,_t=[],wt=0;wt=0?l=h:(l=h=p,p++),l0?Math.max(r,a):0}}},{"fast-isnumeric":186}],966:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],967:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":363,"../../components/colorscale/defaults":373,"../../components/colorscale/helpers":374,"./subtypes":973}],968:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":487,"../../lib":525}],969:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),p=t("../../lib/polygon").tester;function h(t,e,r,f,h,d,m){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),p=i[0].trace;if(!c.hasMarkers(p))return;var h=p.marker.maxdisplayed;if(0===h)return;var d=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),m=Math.ceil(d.length/h),g=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function v(t){return y?t.transition():t}var b=r.xaxis,x=r.yaxis,_=f[0].trace,w=_.line,A=n.select(d),k=o(A,"g","errorbars"),T=o(A,"g","lines"),M=o(A,"g","points"),S=o(A,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===_.visible){var z,E;v(A).style("opacity",_.opacity);var L=_.fill.charAt(_.fill.length-1);"x"!==L&&"y"!==L&&(L=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=A;var C,P,O="",I=[],D=_._prevtrace;D&&(O=D._prevRevpath||"",E=D._nextFill,I=D._polygons);var R,F,B,N,j,V,U,H="",q="",G=[],W=a.noop;if(z=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(E&&E.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=u(f,{xaxis:b,yaxis:x,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),U=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(f),t)v(r.style("opacity",0).attr("d",C).call(l.lineGroupStyle)).style("opacity",1);else{var i=v(r);i.attr("d",C),l.singleLineStyle(f,i)}}}}}var Y=T.selectAll(".js-line").data(G);v(Y.exit()).style("opacity",0).remove(),Y.each(W(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(W(!0)),l.setClipUrl(Y,r.layerClipId,t),G.length?(z?(z.datum(f),N&&V&&(L?("y"===L?N[1]=V[1]=x.c2p(0,!0):"x"===L&&(N[0]=V[0]=b.c2p(0,!0)),v(z).attr("d","M"+V+"L"+N+"L"+H.substr(1)).call(l.singleFillStyle,t)):v(z).attr("d",H+"Z").call(l.singleFillStyle,t))):E&&("tonext"===_.fill.substr(0,6)&&H&&O?("tonext"===_.fill?v(E).attr("d",H+"Z"+O+"Z").call(l.singleFillStyle,t):v(E).attr("d",H+"L"+O.substr(1)+"Z").call(l.singleFillStyle,t),_._polygons=_._polygons.concat(I)):(X(E),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=U):(z?X(z):E&&X(E),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),S.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),p=c.hasText(u),h=tt(u),d=et,m=et;if(f||p){var g=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[b._id+x._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?K:J:_&&!w&&(g=Q),f&&(d=g),p&&(m=g)}var A,k=(o=e.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);y&&k.call(l.pointStyle,u,t).call(l.translatePoints,b,x).style("opacity",0).transition().style("opacity",1),o.order(),f&&(A=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=v(i);l.translatePoint(e,a,b,x)?(l.singlePointStyle(e,a,u,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,b,x,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),y?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,h)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=v(e.select("text"));l.translatePoint(t,i,b,x)?r.layerClipId&&l.hideOutsideRangePoint(t,e,b,x,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.textPointStyle,u,t).each((function(t){var e=b.c2p(t.x),r=x.c2p(t.y);n.select(this).selectAll("tspan.line").each((function(){v(n.select(this)).attr({x:e,y:r})}))})),o.exit().remove()}(M,S,f);var Z=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Z,t),l.setClipUrl(S,Z,t)}function X(t){v(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,p,d=!a,m=!!a&&a.duration>0,g=f(t,e,r);((u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),m)?(c&&(p=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){p&&p()})).each("interrupt",(function(){p&&p()})).each((function(){i.selectAll("g.trace").each((function(r,n){h(t,n,e,r,g,this,a)}))}))):u.each((function(r,n){h(t,n,e,r,g,this,a)}));d&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":385,"../../lib":525,"../../lib/polygon":537,"../../registry":657,"./line_points":962,"./link_traces":964,"./subtypes":973,"@plotly/d3":54}],970:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var p=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=p),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,p)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function x(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return h[t]}function A(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",p||h);for(var d=["x","y","z"],m=0;m<3;++m){var g="projection."+d[m];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var y=n.getComponentMethod("errorbars","supplyDefaults");y(t,e,p||h||r,{axis:"z"}),y(t,e,p||h||r,{axis:"y",inherit:"z"}),y(t,e,p||h||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":525,"../../registry":657,"../scatter/line_defaults":961,"../scatter/marker_defaults":967,"../scatter/subtypes":973,"../scatter/text_defaults":974,"./attributes":976}],981:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":485,"../../plots/gl3d":617,"./attributes":976,"./calc":977,"./convert":979,"./defaults":980}],982:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/attributes":572,"../../plots/template_attributes":652,"../scatter/attributes":948}],983:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,p=e._length,h=new Array(p),d=!1;for(c=0;c")}return o}function v(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":525,"../scatter/hover":959}],988:[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:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":588,"../scatter/marker_colorbar":966,"../scatter/select":970,"../scatter/style":972,"./attributes":982,"./calc":983,"./defaults":984,"./event_data":985,"./format_labels":986,"./hover":987,"./plot":989}],989:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,f=i.getFromId(t,u.xaxis||"x"),p=i.getFromId(t,u.yaxis||"y"),h={xaxis:f,yaxis:p,plot:e.plot};for(s=0;s")}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":403,"../../constants/numerical":487,"../../lib":525,"../scatter/get_trace_color":958,"./attributes":990}],996:[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"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":608,"../scatter/marker_colorbar":966,"../scatter/style":972,"./attributes":990,"./calc":991,"./defaults":992,"./event_data":993,"./format_labels":994,"./hover":995,"./plot":997,"./select":998,"./style":999}],997:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,f=t("../scatter/subtypes"),p=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,i=t[0].trace,o=e[i.geo],f=o._subplot,p=i._length;if(Array.isArray(i.locations)){var h=i.locationmode,d="geojson-id"===h?s.extractTraceFeature(t):a(i,f.topojson);for(r=0;r=g,w=2*x,A={},k=l.makeCalcdata(e,"x"),T=v.makeCalcdata(e,"y"),M=s(e,l,"x",k),S=s(e,v,"y",T),z=M.vals,E=S.vals;e._x=z,e._y=E,e.xperiodalignment&&(e._origX=k,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=T,e._yStarts=S.starts,e._yEnds=S.ends);var L=new Array(w),C=new Array(x);for(r=0;r1&&i.extendFlat(s.line,h.linePositions(t,r,n));if(s.errorX||s.errorY){var l=h.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}s.text&&(i.extendFlat(s.text,{positions:n},h.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},h.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},h.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,L,z,E),I=d(t,b);return f(o,e),_?O.marker&&(P=O.marker.sizeAvg||Math.max(O.marker.size,3)):P=c(e,x),u(t,e,l,v,z,E,P),O.errorX&&y(e,l,O.errorX),O.errorY&&y(e,v,O.errorY),O.fill&&!I.fill2d&&(I.fill2d=!0),O.marker&&!I.scatter2d&&(I.scatter2d=!0),O.line&&!I.line2d&&(I.line2d=!0),!O.errorX&&!O.errorY||I.error2d||(I.error2d=!0),O.text&&!I.glText&&(I.glText=!0),O.marker&&(O.marker.snap=x),I.lineOptions.push(O.line),I.errorXOptions.push(O.errorX),I.errorYOptions.push(O.errorY),I.fillOptions.push(O.fill),I.markerOptions.push(O.marker),I.markerSelectedOptions.push(O.markerSel),I.markerUnselectedOptions.push(O.markerUnsel),I.textOptions.push(O.text),I.textSelectedOptions.push(O.textSel),I.textUnselectedOptions.push(O.textUnsel),I.selectBatch.push([]),I.unselectBatch.push([]),A._scene=I,A.index=I.count,A.x=z,A.y=E,A.positions=L,I.count++,[{x:!1,y:!1,t:A,trace:e}]}},{"../../constants/numerical":487,"../../lib":525,"../../plots/cartesian/align_period":573,"../../plots/cartesian/autorange":575,"../../plots/cartesian/axis_ids":580,"../scatter/calc":949,"../scatter/colorscale_calc":951,"./constants":1003,"./convert":1004,"./scene_update":1013,"@plotly/point-cluster":55}],1003:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],1004:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("svg-path-sdf"),a=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),p=t("../scatter/make_bubble_size_func"),h=t("./helpers"),d=t("./constants"),m=t("../../constants/interactions").DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=t("../../components/fx/helpers").appendArrayPointValue;function v(t,e){var r,i=t._fullLayout,a=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,p=o.family,h={},d=t._context.plotGlPixelRatio,m=e.texttemplate;if(m){h.text=[];var g=i._d3locale,v=Array.isArray(m),b=v?Math.min(m.length,a):a,x=v?function(t){return m[t]}:function(){return m};for(r=0;rd.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var p=n[0],h=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(c)?c.length>1?c[i]:c[0]:c,m=g[h],y=g[d],v=u?u/.8+1:0,b=-y*v-.5*y;o.offset[i]=[m*v/p,b/p]}}return o}}},{"../../components/drawing":385,"../../components/fx/helpers":399,"../../constants/interactions":486,"../../lib":525,"../../lib/gl_format_color":521,"../../plots/cartesian/axis_ids":580,"../../registry":657,"../scatter/make_bubble_size_func":965,"../scatter/subtypes":973,"./constants":1003,"./helpers":1008,"color-normalize":85,"fast-isnumeric":186,"svg-path-sdf":307}],1005:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),p=t("../scatter/line_defaults"),h=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,m){function g(r,i){return n.coerce(t,e,o,r,i)}var y=!!t.marker&&a.isOpenSymbol(t.marker.symbol),v=l.isBubble(t),b=c(t,e,m,g);if(b){u(t,e,m,g),g("xhoverformat"),g("yhoverformat");var x=b100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":1003}],1009:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,f=t.index,p={pointNumber:f,x:e[f],y:r[f]};p.tx=Array.isArray(o.text)?o.text[f]:o.text,p.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,p.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,p.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var h=o.textfont;h&&(p.ts=i.isArrayOrTypedArray(h.size)?h.size[f]:h.size,p.tc=Array.isArray(h.color)?h.color[f]:h.color,p.tf=Array.isArray(h.family)?h.family[f]:h.family);var d=o.marker;d&&(p.ms=i.isArrayOrTypedArray(d.size)?d.size[f]:d.size,p.mo=i.isArrayOrTypedArray(d.opacity)?d.opacity[f]:d.opacity,p.mx=i.isArrayOrTypedArray(d.symbol)?d.symbol[f]:d.symbol,p.ma=i.isArrayOrTypedArray(d.angle)?d.angle[f]:d.angle,p.mc=i.isArrayOrTypedArray(d.color)?d.color[f]:d.color);var m=d&&d.line;m&&(p.mlc=Array.isArray(m.color)?m.color[f]:m.color,p.mlw=i.isArrayOrTypedArray(m.width)?m.width[f]:m.width);var g=d&&d.gradient;g&&"none"!==g.type&&(p.mgt=Array.isArray(g.type)?g.type[f]:g.type,p.mgc=Array.isArray(g.color)?g.color[f]:g.color);var y=s.c2p(p.x,!0),v=l.c2p(p.y,!0),b=p.mrc||1,x=o.hoverlabel;x&&(p.hbg=Array.isArray(x.bgcolor)?x.bgcolor[f]:x.bgcolor,p.hbc=Array.isArray(x.bordercolor)?x.bordercolor[f]:x.bordercolor,p.hts=i.isArrayOrTypedArray(x.font.size)?x.font.size[f]:x.font.size,p.htc=Array.isArray(x.font.color)?x.font.color[f]:x.font.color,p.htf=Array.isArray(x.font.family)?x.font.family[f]:x.font.family,p.hnl=i.isArrayOrTypedArray(x.namelength)?x.namelength[f]:x.namelength);var _=o.hoverinfo;_&&(p.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(p.ht=Array.isArray(w)?w[f]:w);var A={};A[t.index]=p;var k=o._origX,T=o._origY,M=i.extendFlat({},t,{color:a(o,p),x0:y-b,x1:y+b,xLabelVal:k?k[f]:p.x,y0:v-b,y1:v+b,yLabelVal:T?T[f]:p.y,cd:A,distance:c,spikeDistance:u,hovertemplate:p.ht});return p.htx?M.text=p.htx:p.tx?M.text=p.tx:o.text&&(M.text=o.text),i.fillText(p,o,M),n.getComponentMethod("errorbars","hoverInfo")(p,o,M),M}e.exports={hoverPoints:function(t,e,r,n){var i,a,s,l,c,u,f,p,h,d,m=t.cd,g=m[0].t,y=m[0].trace,v=t.xa,b=t.ya,x=g.x,_=g.y,w=v.c2p(e),A=b.c2p(r),k=t.distance;if(g.tree){var T=v.p2c(w-k),M=v.p2c(w+k),S=b.p2c(A-k),z=b.p2c(A+k);i="x"===n?g.tree.range(Math.min(T,M),Math.min(b._rl[0],b._rl[1]),Math.max(T,M),Math.max(b._rl[0],b._rl[1])):g.tree.range(Math.min(T,M),Math.min(S,z),Math.max(T,M),Math.max(S,z))}else i=g.ids;var E=k;if("x"===n){var L=!!y.xperiodalignment,C=!!y.yperiodalignment;for(u=0;u=Math.min(P,O)&&w<=Math.max(P,O)?0:1/0}if(f=Math.min(I,D)&&A<=Math.max(I,D)?0:1/0}d=Math.sqrt(f*f+p*p),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=x[a=i[u]],c=_[a],f=v.c2p(l)-w,p=b.c2p(c)-A,(h=Math.sqrt(f*f+p*p))v.glText.length){var A=_-v.glText.length;for(m=0;mr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),v.line2d.update(v.lineOptions)),v.error2d){var T=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(T)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=s.repeat(null,_),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,c=v.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(v.fillOrder[e]=u);var f,p,h=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(d[p+1]);)p-=2;0!==d[f+1]&&(h=[d[f],0]),h=h.concat(d.slice(f,p+2)),0!==d[p+1]&&(h=h.concat([d[p],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(d[p]);)p-=2;0!==d[f]&&(h=[0,d[f+1]]),h=h.concat(d.slice(f,p+2)),0!==d[p]&&(h=h.concat([0,d[p+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(h=[],i=0,t.splitNull=!0,a=0;a-1;for(m=0;m<_;m++){var E=r[m][0],L=E.trace,C=E.t,P=C.index,O=L._length,I=C.x,D=C.y;if(L.selectedpoints||S||z){if(S||(S=!0),L.selectedpoints){var R=v.selectBatch[P]=s.selIndices2selPoints(L),F={};for(g=0;g")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,u=o[0].trace,f=t.xa,p=t.ya,h=t.subplot,d=[],m=l+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=h.map.queryRenderedFeatures(null,{layers:[m]});d=y.map((function(t){return t.id}))}var v=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),b=e-v;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=h.project([n,a]),l=o.x-f.c2p([b,a]),c=o.y-p.c2p([n,r]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var x=o[t.index],_=x.lonlat,w=[i.modHalf(_[0],360)+v,_[1]],A=f.c2p(w),k=p.c2p(w),T=x.mrc||1;t.x0=A-T,t.x1=A+T,t.y0=k-T,t.y1=k+T;var M={};M[u.subplot]={_subplot:h};var S=u._module.formatLabels(x,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=a(u,x),t.extraText=c(u,x,o[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:c}},{"../../components/fx":403,"../../constants/numerical":487,"../../lib":525,"../../plots/mapbox/constants":630,"../scatter/get_trace_color":958}],1022:[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("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":632,"../scatter/marker_colorbar":966,"../scattergeo/calc":991,"./attributes":1016,"./defaults":1018,"./event_data":1019,"./format_labels":1020,"./hover":1021,"./plot":1023,"./select":1024}],1023:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(t,e,r,n){this.type="scattermapbox",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol",cluster:a+e+"-cluster",clusterCount:a+e+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(t,e,r){var i={type:"geojson",data:e.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom}),this.subplot.map.addSource(this.sourceIds[t],i)},l.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},l.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter),this.subplot.addLayer(n,r)},l.update=function(t){var e=t[0].trace,r=this.subplot,n=r.map,a=i(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),c=!!this.clusterEnabled,u=this;function f(t){c?function(t){for(var e=o.cluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(u.layerIds[i])}t||n.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=o.nonCluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(u.layerIds[i]),t||n.removeSource(u.sourceIds[i])}}(t)}function p(t){l?function(t){t||u.addSource("circle",a.circle,e.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,n,a,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,f=new s(t,l.uid,c,u),p=i(t.gd,e),h=f.below=t.belowLookup["trace-"+l.uid];if(c)for(f.addSource("circle",p.circle,l.cluster),r=0;r")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":959}],1030:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":641,"../scatter/marker_colorbar":966,"../scatter/select":970,"../scatter/style":972,"./attributes":1025,"./calc":1026,"./defaults":1027,"./format_labels":1028,"./hover":1029,"./plot":1031}],1031:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),o=e.xaxis,s=e.yaxis,l={xaxis:o,yaxis:s,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},c=e.radialAxis,u=e.angularAxis,f=0;f=c&&(v.marker.cluster=d.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=_),v.line&&_.length>1&&l.extendFlat(v.line,s.linePositions(t,h,_)),v.text&&(l.extendFlat(v.text,{positions:_},s.textPosition(t,h,v.text,v.marker)),l.extendFlat(v.textSel,{positions:_},s.textPosition(t,h,v.text,v.markerSel)),l.extendFlat(v.textUnsel,{positions:_},s.textPosition(t,h,v.text,v.markerUnsel))),v.fill&&!p.fill2d&&(p.fill2d=!0),v.marker&&!p.scatter2d&&(p.scatter2d=!0),v.line&&!p.line2d&&(p.line2d=!0),v.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(v.line),p.fillOptions.push(v.fill),p.markerOptions.push(v.marker),p.markerSelectedOptions.push(v.markerSel),p.markerUnselectedOptions.push(v.markerUnsel),p.textOptions.push(v.text),p.textSelectedOptions.push(v.textSel),p.textUnselectedOptions.push(v.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),d.x=w,d.y=A,d.rawx=w,d.rawy=A,d.r=g,d.theta=y,d.positions=_,d._scene=p,d.index=p.count,p.count++}})),a(t,e,r)}},e.exports.reglPrecompiled={}},{"../../lib":525,"../scattergl/constants":1003,"../scattergl/convert":1004,"../scattergl/plot":1010,"../scattergl/scene_update":1013,"@plotly/point-cluster":55,"fast-isnumeric":186}],1039:[function(t,e,r){"use strict";var n=t("./plot"),i=t("./regl_precompiled"),a=t("../scattergl/regl_precompiled");Object.assign(n.reglPrecompiled,i),Object.assign(n.reglPrecompiled,a),e.exports=n},{"../scattergl/regl_precompiled":1012,"./plot":1038,"./regl_precompiled":1040}],1040:[function(t,e,r){arguments[4][1012][0].apply(r,arguments)},{"../../generated/regl-codegen/3e771157d23b4793771f65d83e6387262ed73d488209157f19a7fa027bddd71b":492,"../../generated/regl-codegen/49e82bba439f1d9d441c17ba252d05640bc63fefdf22d1219993633af7730210":495,"../../generated/regl-codegen/6a5d6bd29c15cf7614221b94c3f384df47c2c46fbe4456e8c57b5cd14c84d923":496,"../../generated/regl-codegen/8902aff2b23b600f8103bcc84a8af2999d28795208aedadc2db06f921f9c7034":497,"../../generated/regl-codegen/8fad2284703471df7c0e0d0a7b96d983e8c53f6d707dd55d5921c1eab71f6623":498,"../../generated/regl-codegen/bfc540da96a87fcc039073cb37b45e6b81ef5ee6ef3529d726ceed8336354019":500,"../../generated/regl-codegen/cbf700f001fff25b649fba9c37fa0dc6631c1cdee318ad49473d28ec10dcee81":501,"../../generated/regl-codegen/db1b82c68771e7f5012fad1fbdae7ff23b526e58d2995bf6dd2cf30024e0f41d":502,"../../generated/regl-codegen/dbd1cc9126a137a605df67dc0706e55116f04e33b4545a80042031752de5aef5":503,"../../generated/regl-codegen/fe5b6844077cde1bdd7273f4495969fad93500c26a69b62e74ec2664c447bcc7":504,dup:1012}],1041:[function(t,e,r){arguments[4][1015][0].apply(r,arguments)},{"./base_index":1033,"./plot_strict":1039,dup:1015}],1042:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("../scatter/attributes"),s=t("../../plots/attributes"),l=o.line;e.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:i({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:a({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:a({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:a({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o.fillcolor,hoverinfo:a({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../lib/extend":515,"../../plots/attributes":572,"../../plots/template_attributes":652,"../scatter/attributes":948}],1043:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../scatter/colorscale_calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection"),l=t("../scatter/calc").calcMarkerSize;e.exports=function(t,e){for(var r=t._fullLayout,c=e.subplot,u=r[c].realaxis,f=r[c].imaginaryaxis,p=u.makeCalcdata(e,"real"),h=f.makeCalcdata(e,"imag"),d=e._length,m=new Array(d),g=0;g")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":959}],1047:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:t("../../plots/smith"),categories:["smith","symbols","showLegend","scatter-like"],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").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/smith":648,"../scatter/marker_colorbar":966,"../scatter/select":970,"../scatter/style":972,"./attributes":1042,"./calc":1043,"./defaults":1044,"./format_labels":1045,"./hover":1046,"./plot":1048}],1048:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM,a=t("../../plots/smith/helpers").smith;e.exports=function(t,e,r){for(var o=e.layers.frontplot.select("g.scatterlayer"),s=e.xaxis,l=e.yaxis,c={xaxis:s,yaxis:l,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},u=0;u"),o.hovertemplate=p.hovertemplate,a}function b(t,e){y.push(t._hovertitle+": "+e)}}},{"../scatter/hover":959}],1055:[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":653,"../scatter/marker_colorbar":966,"../scatter/select":970,"../scatter/style":972,"./attributes":1049,"./calc":1050,"./defaults":1051,"./event_data":1052,"./format_labels":1053,"./hover":1054,"./plot":1056}],1056:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=e.xaxis,o=e.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},l=e.layers.frontplot.select("g.scatterlayer"),c=0;cp?x.sizeAvg||Math.max(x.size,3):a(e,b),h=0;ha&&l||i-1,C=!0;if(o(b)||!!h.selectedpoints||L){var P=h._length;if(h.selectedpoints){m.selectBatch=h.selectedpoints;var O=h.selectedpoints,I={};for(l=0;l1&&(u=m[v-1],p=g[v-1],d=y[v-1]),e=0;eu?"-":"+")+"x")).replace("y",(f>p?"-":"+")+"y")).replace("z",(h>d?"-":"+")+"z");var E=function(){v=0,M=[],S=[],z=[]};(!v||v2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function h(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,f={};function d(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),y=d(e._Zs,"zaxis");if(f.meshgrid=[m,g,y],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var v=g[0],b=p(m),x=p(y),_=new Array(b.length*x.length),w=0,A=0;A=0};y?(r=Math.min(g.length,b.length),l=function(t){return T(g[t])&&M(t)},f=function(t){return String(g[t])}):(r=Math.min(v.length,b.length),l=function(t){return T(v[t])&&M(t)},f=function(t){return String(v[t])}),_&&(r=Math.min(r,x.length));for(var S=0;S1){for(var C=a.randstr(),P=0;P"),name:T||I("name")?v.name:void 0,color:k("hoverlabel.bgcolor")||b.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:T,hovertemplateLabels:C,eventData:l};g&&(F.x0=z-i.rInscribed*i.rpx1,F.x1=z+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),y&&(F.x=z,F.idealAlign=z<0?"left":"right");var B=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:B}),l[0].bbox=B[0],d._hasHoverLabel=!0}if(y){var N=t.select("path.surface");p.styleOne(N,i,v,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,v,p.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var i=r._fullLayout,a=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,p.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),d._hasHoverLabel=!1),y){var l=t.select("path.surface");p.styleOne(l,s,a,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,a=r._fullData[d.index],s=g&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),h=c.isEntry(t)?c.findEntryWithChild(m,u):c.findEntryWithLevel(m,u),y=c.getPtId(h),v={points:[f(t,a,p.eventDataKeys)],event:n.event};s||(v.nextLevel=y);var b=l.triggerHandler(r,"plotly_"+d.type+"click",v);if(!1!==b&&e.hovermode&&(r._hoverdata=[f(t,a,p.eventDataKeys)],o.click(r,n.event)),!s&&!1!==b&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,e._tracePreGUI[a.uid],{level:a.level});var x={data:[{level:y}],traces:[d.index]},_={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),i.call("animate",r,x,_)}}))}},{"../../components/fx":403,"../../components/fx/helpers":399,"../../lib":525,"../../lib/events":514,"../../registry":657,"../pie/helpers":927,"./helpers":1082,"@plotly/d3":54}],1082:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var i=e?[n.data[e]]:[n];return r.listPath(n,e).concat(i)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":363,"../../lib":525,"../../lib/setcursor":546,"../pie/helpers":927}],1083:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":966,"./attributes":1076,"./base_plot":1077,"./calc":1078,"./defaults":1080,"./layout_attributes":1084,"./layout_defaults":1085,"./plot":1086,"./style":1087}],1084:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1085:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":525,"./layout_attributes":1084}],1086:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-hierarchy"),a=t("d3-interpolate").interpolate,o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../bar/uniform_text"),u=c.recordMinTextSize,f=c.clearMinTextSize,p=t("../pie/plot"),h=t("../pie/helpers").getRotationAngle,d=p.computeTransform,m=p.transformInsideText,g=t("./style").styleOne,y=t("../bar/style").resizeText,v=t("./fx"),b=t("./constants"),x=t("./helpers");function _(t,e,c,f){var p=t._context.staticPlot,y=t._fullLayout,_=!y.uniformtext.mode&&x.hasTransition(f),A=n.select(c).selectAll("g.slice"),k=e[0],T=k.trace,M=k.hierarchy,S=x.findEntryWithLevel(M,T.level),z=x.getMaxDepth(T),E=y._size,L=T.domain,C=E.w*(L.x[1]-L.x[0]),P=E.h*(L.y[1]-L.y[0]),O=.5*Math.min(C,P),I=k.cx=E.l+E.w*(L.x[1]+L.x[0])/2,D=k.cy=E.t+E.h*(1-L.y[0])-P/2;if(!S)return A.remove();var R=null,F={};_&&A.each((function(t){F[x.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&x.isEntry(t)&&(R=t)}));var B=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),N=S.height+1,j=0,V=z;k.hasMultipleRoots&&x.isHierarchyRoot(S)&&(B=B.slice(1),N-=1,j=1,V+=1),B=B.filter((function(t){return t.y1<=V}));var U=h(T.rotation);U&&B.forEach((function(t){t.x0+=U,t.x1+=U}));var H=Math.min(N,z),q=function(t){return(t-j)/H*O},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},W=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,I,D)},Y=function(t){return I+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Z=function(t){return D+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(A=A.data(B,x.getPtId)).enter().append("g").classed("slice",!0),_?A.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=x.getPtId(t),n=F[r],i=F[x.getPtId(S)];if(i){var o=(t.x1>i.x1?2*Math.PI:0)+U;e=t.rpx1X?2*Math.PI:0)+U;e={x0:i,x1:i}}else e={rpx0:O,rpx1:O},s.extendFlat(e,Q(t));else e={rpx0:0,rpx1:0};else e={x0:U,x1:U};return a(e,n)}(t);return function(t){return W(e(t))}})):f.attr("d",W),c.call(v,S,t,e,{eventDataKeys:b.eventDataKeys,transitionTime:b.CLICK_TRANSITION_TIME,transitionEasing:b.CLICK_TRANSITION_EASING}).call(x.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),f.call(g,i,T);var h=s.ensureSingle(c,"g","slicetext"),w=s.ensureSingle(h,"text","",(function(t){t.attr("data-notex",1)})),A=s.ensureUniformFontSize(t,x.determineTextFont(T,i,y.font));w.text(r.formatSliceLabel(i,S,T,e,y)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,A).call(l.convertToTspans,t);var M=o.bBox(w.node());i.transform=m(M,i,k),i.transform.targetX=Y(i),i.transform.targetY=Z(i);var z=function(t,e){var r=t.transform;return d(r,e),r.fontSize=A.size,u(T.type,r,y),s.getTextTransform(r)};_?w.transition().attrTween("transform",(function(t){var e=function(t){var e,r=F[x.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},R)if(t.parent)if(X){var i=t.x1>X?2*Math.PI:0;e.x0=e.x1=i}else s.extendFlat(e,Q(t));else e.x0=e.x1=U;else e.x0=e.x1=U;var o=a(e.transform.textPosAngle,t.transform.textPosAngle),l=a(e.rpx1,t.rpx1),c=a(e.x0,t.x0),f=a(e.x1,t.x1),p=a(e.transform.scale,n.scale),h=a(e.transform.rotate,n.rotate),d=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,m=a(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=c(t),i=f(t),a=function(t){return m(Math.pow(t,d))}(t),s={pxmid:G(e,(r+i)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:a,x:n.x,y:n.y}};return u(T.type,n,y),{transform:{targetX:Y(s),targetY:Z(s),scale:p(t),rotate:h(t),rCenter:a}}}}(t);return function(t){return z(e(t),M)}})):w.attr("transform",z(i,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&x.hasTransition(r);(f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),u)?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){_(t,e,this,r)}))}))):(a.each((function(e){_(t,e,this,r)})),s.uniformtext.mode&&y(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&a.exit().remove()},r.formatSliceLabel=function(t,e,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!(a||o&&"none"!==o))return"";var l=i.separators,c=n[0],u=t.data.data,f=c.hierarchy,p=x.isHierarchyRoot(t),h=x.getParent(f,t),d=x.getValue(t);if(!a){var m,g=o.split("+"),y=function(t){return-1!==g.indexOf(t)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(x.formatValue(u.v,l)),!p){y("current path")&&v.push(x.getPath(t.data));var b=0;y("percent parent")&&b++,y("percent entry")&&b++,y("percent root")&&b++;var _=b>1;if(b){var w,A=function(t){m=x.formatPercent(w,l),_&&(m+=" of "+t),v.push(m)};y("percent parent")&&!p&&(w=d/x.getValue(h),A("parent")),y("percent entry")&&(w=d/x.getValue(e),A("entry")),y("percent root")&&(w=d/x.getValue(f),A("root"))}}return y("text")&&(m=s.castOption(r,u.i,"text"),s.isValidTextValue(m)&&v.push(m)),v.join("
")}var k=s.castOption(r,u.i,"texttemplate");if(!k)return"";var T={};u.label&&(T.label=u.label),u.hasOwnProperty("v")&&(T.value=u.v,T.valueLabel=x.formatValue(u.v,l)),T.currentPath=x.getPath(t.data),p||(T.percentParent=d/x.getValue(h),T.percentParentLabel=x.formatPercent(T.percentParent,l),T.parent=x.getPtLabel(h)),T.percentEntry=d/x.getValue(e),T.percentEntryLabel=x.formatPercent(T.percentEntry,l),T.entry=x.getPtLabel(e),T.percentRoot=d/x.getValue(f),T.percentRootLabel=x.formatPercent(T.percentRoot,l),T.root=x.getPtLabel(f),u.hasOwnProperty("color")&&(T.color=u.color);var M=s.castOption(r,u.i,"text");return(s.isValidTextValue(M)||""===M)&&(T.text=M),T.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(k,T,i._d3locale,T,r._meta||{})}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../bar/style":681,"../bar/uniform_text":683,"../pie/helpers":927,"../pie/plot":931,"./constants":1079,"./fx":1081,"./helpers":1082,"./style":1087,"@plotly/d3":54,"d3-hierarchy":111,"d3-interpolate":112}],1087:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":363,"../../lib":525,"../bar/uniform_text":683,"@plotly/d3":54}],1088:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=e.exports=c(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},{"../../components/color":363,"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plot_api/edit_types":558,"../../plots/attributes":572,"../../plots/cartesian/axis_format_attributes":579,"../../plots/template_attributes":652}],1089:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":371}],1090:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_surface3d,i=t("../../../stackgl_modules").ndarray,a=t("../../../stackgl_modules").ndarray_linear_interpolate.d2,o=t("../heatmap/interp2d"),s=t("../heatmap/find_empties"),l=t("../../lib").isArrayOrTypedArray,c=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),f=t("../../components/colorscale").extractOpts;function p(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var h=p.prototype;h.getXat=function(t,e,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},h.getYat=function(t,e,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},h.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},h.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!=o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?t.textLabel=s[i][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var d=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(t,e){if(t0){r=d[n];break}return r}function v(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=y(r),++r1?n:1},h.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),f=[1/e,0,0,0,1/r,0,0,0,1],p=0;p0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1097:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),h=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var m=d.concat(h(r).map((function(){return c((d[0]||[""]).length)}))),g=e.domain,y=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),v=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),b=e.header.values.length?m[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],x=r.length?r[0].map((function(){return e.cells.height})):[],_=b.reduce(s,0),w=p(x,v-_+n.uplift),A=f(p(b,_),[]),k=f(w,A),T={},M=e._fullInput.columnorder.concat(h(r.map((function(t,e){return e})))),S=m.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1})),z=S.reduce(s,0);S=S.map((function(t){return t/z*y}));var E=Math.max(o(e.header.line.width),o(e.cells.line.width)),L={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:y,maxLineWidth:E,height:v,columnOrder:M,groupHeight:v,rowBlocks:k,headerRowBlocks:A,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:m}),gdColumns:m.map((function(t){return t[0]})),gdColumnsOriginalOrder:m.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(t,e){var r=T[t];return T[t]=(r||0)+1,{key:t+"__"+T[t],label:t,specIndex:e,xIndex:M[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return L.columns.forEach((function(t){t.calcdata=L,t.x=u(t)})),L}},{"../../lib/extend":515,"./constants":1096,"fast-isnumeric":186}],1098:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":515}],1099:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var f,p,h=u?"":A(t.calcdata.cells.prefix,e,r)||"",d=u?"":A(t.calcdata.cells.suffix,e,r)||"",m=u?null:A(t.calcdata.cells.format,e,r)||null,g=h+(m?a(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(f=w(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===f?w(g):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var y=(" "===n.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=D(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(L(t,r,e,c,n.prevPages,n,0),L(t,r,e,c,n.prevPages,n,1),b(r,t))}}function E(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(T);return z(t,f,l),s.scrollY===u}}function L(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));x(t,e,a,r),i[o]=n[o]})))}function C(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+a)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(I)}}function P(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=B(o),c=o.key-l.firstRowIndex,f=l.rows[c].rowHeight,p=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:f,h=Math.max(p,f);h-l.rows[c].rowHeight&&(l.rows[c].rowHeight=h,t.selectAll("."+n.cn.columnCell).call(I),z(null,t.filter(T),0),b(r,a,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return u(O(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),a)})),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function I(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+R(e,1/0)}),0),r=R(B(t),t.key);return u(0,r+e)})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function D(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":370,"../../lib/extend":515,"../../plots/domain":603,"../../plots/template_attributes":652,"../pie/attributes":922,"../sunburst/attributes":1076,"./constants":1105}],1103:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":638}],1104:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1078}],1105:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1106:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,f=c.handleDefaults;e.exports=function(t,e,r,c){function p(r,a){return n.coerce(t,e,i,r,a)}var h=p("labels"),d=p("parents");if(h&&h.length&&d&&d.length){var m=p("values");m&&m.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),"squarify"===p("tiling.packing")&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var g=p("text");p("texttemplate"),e.texttemplate||p("textinfo",Array.isArray(g)?"text+label":"label"),p("hovertext"),p("hovertemplate");var y=p("pathbar.visible");s(t,e,c,p,"auto",{hasPathbar:y,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var v=-1!==e.textposition.indexOf("bottom");p("marker.line.width")&&p("marker.line.color",c.paper_bgcolor);var b=p("marker.colors");(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?f(t,e,c,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(b||[]).length);var x=2*e.textfont.size;p("marker.pad.t",v?x/4:x),p("marker.pad.l",x/4),p("marker.pad.r",x/4),p("marker.pad.b",v?x:x/4),e._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},y&&(p("pathbar.thickness",e.pathbar.textfont.size+2*l),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),o(e,c,p),e._length=null}else e.visible=!1}},{"../../components/color":363,"../../components/colorscale":375,"../../lib":525,"../../plots/domain":603,"../bar/constants":669,"../bar/defaults":671,"./attributes":1102}],1107:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../sunburst/helpers"),a=t("../bar/uniform_text").clearMinTextSize,o=t("../bar/style").resizeText,s=t("./plot_one");e.exports=function(t,e,r,l,c){var u,f,p=c.type,h=c.drawDescendants,d=t._fullLayout,m=d["_"+p+"layer"],g=!r;(a(p,d),(u=m.selectAll("g.trace."+p).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(p,!0),u.order(),!d.uniformtext.mode&&i.hasTransition(r))?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){m.selectAll("g.trace").each((function(e){s(t,e,this,r,h)}))}))):(u.each((function(e){s(t,e,this,r,h)})),d.uniformtext.mode&&o(t,m.selectAll(".trace"),p));g&&u.exit().remove()}},{"../bar/style":681,"../bar/uniform_text":683,"../sunburst/helpers":1082,"./plot_one":1116,"@plotly/d3":54}],1108:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx");e.exports=function(t,e,r,p,h){var d=h.barDifY,m=h.width,g=h.height,y=h.viewX,v=h.viewY,b=h.pathSlice,x=h.toMoveInsideSlice,_=h.strTransform,w=h.hasTransition,A=h.handleSlicesExit,k=h.makeUpdateSliceInterpolator,T=h.makeUpdateTextInterpolator,M={},S=t._context.staticPlot,z=t._fullLayout,E=e[0],L=E.trace,C=E.hierarchy,P=m/L._entryDepth,O=u.listPath(r.data,"id"),I=s(C.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(I=I.filter((function(t){var e=O.indexOf(t.data.id);return-1!==e&&(t.x0=P*e,t.x1=P*(e+1),t.y0=d,t.y1=d+g,t.onPathbar=!0,!0)}))).reverse(),(p=p.data(I,u.getPtId)).enter().append("g").classed("pathbar",!0),A(p,!0,M,[m,g],b),p.order();var D=p;w&&(D=D.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),D.each((function(s){s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-Math.min(m,g)/2),s._hoverY=v(s.y1-g/2);var p=n.select(this),h=i.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?h.transition().attrTween("d",(function(t){var e=k(t,!0,M,[m,g]);return function(t){return b(e(t))}})):h.attr("d",b),p.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),h.call(l,s,L,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(p,"g","slicetext"),A=i.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),E=i.ensureUniformFontSize(t,u.determineTextFont(L,s,z.font,{onPathbar:!0}));A.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,E).call(o.convertToTspans,t),s.textBB=a.bBox(A.node()),s.transform=x(s,{fontSize:E.size,onPathbar:!0}),s.transform.fontSize=E.size,w?A.transition().attrTween("transform",(function(t){var e=T(t,!0,M,[m,g]);return function(t){return _(e(t))}})):A.attr("transform",_(s))}))}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../sunburst/fx":1081,"../sunburst/helpers":1082,"./constants":1105,"./partition":1114,"./style":1117,"@plotly/d3":54}],1109:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx"),p=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,h,d){var m=d.width,g=d.height,y=d.viewX,v=d.viewY,b=d.pathSlice,x=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,A=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,T=d.makeUpdateTextInterpolator,M=d.prevEntry,S=t._context.staticPlot,z=t._fullLayout,E=e[0].trace,L=-1!==E.textposition.indexOf("left"),C=-1!==E.textposition.indexOf("right"),P=-1!==E.textposition.indexOf("bottom"),O=!P&&!E.marker.pad.t||P&&!E.marker.pad.b,I=s(r,[m,g],{packing:E.tiling.packing,squarifyratio:E.tiling.squarifyratio,flipX:E.tiling.flip.indexOf("x")>-1,flipY:E.tiling.flip.indexOf("y")>-1,pad:{inner:E.tiling.pad,top:E.marker.pad.t,left:E.marker.pad.l,right:E.marker.pad.r,bottom:E.marker.pad.b}}).descendants(),D=1/0,R=-1/0;I.forEach((function(t){var e=t.depth;e>=E._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(D=Math.min(D,e),R=Math.max(R,e))})),h=h.data(I,u.getPtId),E._maxVisibleLayers=isFinite(R)?R-D+1:0,h.enter().append("g").classed("slice",!0),A(h,!1,{},[m,g],b),h.order();var F=null;if(w&&M){var B=u.getPtId(M);h.each((function(t){null===F&&u.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return F||{x0:0,x1:m,y0:0,y1:g}},j=h;return w&&(j=j.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),j.each((function(s){var h=u.isHeader(s,E);s._x0=y(s.x0),s._x1=y(s.x1),s._y0=v(s.y0),s._y1=v(s.y1),s._hoverX=y(s.x1-E.marker.pad.r),s._hoverY=v(P?s.y1-E.marker.pad.b/2:s.y0+E.marker.pad.t/2);var d=n.select(this),A=i.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?A.transition().attrTween("d",(function(t){var e=k(t,!1,N(),[m,g]);return function(t){return b(e(t))}})):A.attr("d",b),d.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),A.call(l,s,E,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h?O?"":u.getPtLabel(s)||"":p(s,r,E,e,z)||"";var M=i.ensureSingle(d,"g","slicetext"),I=i.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)})),D=i.ensureUniformFontSize(t,u.determineTextFont(E,s,z.font));I.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",C?"end":L||h?"start":"middle").call(a.font,D).call(o.convertToTspans,t),s.textBB=a.bBox(I.node()),s.transform=x(s,{fontSize:D.size,isHeader:h}),s.transform.fontSize=D.size,w?I.transition().attrTween("transform",(function(t){var e=T(t,!1,N(),[m,g]);return function(t){return _(e(t))}})):I.attr("transform",_(s))})),F}},{"../../components/drawing":385,"../../lib":525,"../../lib/svg_text_utils":551,"../sunburst/fx":1081,"../sunburst/helpers":1082,"../sunburst/plot":1086,"./constants":1105,"./partition":1114,"./style":1117,"@plotly/d3":54}],1110:[function(t,e,r){"use strict";e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o-1?L+O:-(P+O):0,D={x0:C,x1:C,y0:I,y1:I+P},R=function(t,e,r){var n=y.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},N={},j=null,V=function(t,e){return e?B[p(t)]:N[p(t)]},U=function(t,e,r,n){if(e)return B[p(b)]||D;var i=N[y.level]||r;return function(t){return t.data.depth-x.data.depth=(n-=(v?g:g.r)-s)){var b=(r+n)/2;r=b,n=b}var x;f?i<(x=a-(v?g:g.b))&&x"===tt?(l.x-=a,c.x-=a,u.x-=a,f.x-=a):"/"===tt?(u.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),$(l),$(f),$(o),$(c),$(u),$(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(f.x,f.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:et,makeUpdateSliceInterpolator:nt,makeUpdateTextInterpolator:it,handleSlicesExit:at,hasTransition:T,strTransform:ot}):w.remove()}},{"../../lib":525,"../bar/constants":669,"../bar/plot":678,"../bar/uniform_text":683,"../sunburst/helpers":1082,"./constants":1105,"./draw_ancestors":1108,"@plotly/d3":54,"d3-interpolate":112}],1117:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,f=u.i,p=u.color,h=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(h&&p===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=a.castOption(r,f,"marker.line.color")||i.defaultLine,l=a.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var m=r.marker.depthfade;if(m){var g,y=i.combine(i.addOpacity(r._backgroundColor,.75),p);if(!0===m){var v=o.getMaxDepth(r);g=isFinite(v)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else g=e.data.depth-r._entryDepth,r._atRootLevel||g++;if(g>0)for(var b=0;b0){var x,_,w,A,k,T=t.xa,M=t.ya;"h"===d.orientation?(k=e,x="y",w=M,_="x",A=T):(k=r,x="x",w=T,_="y",A=M);var S=h[t.index];if(k>=S.span[0]&&k<=S.span[1]){var z=i.extendFlat({},t),E=A.c2p(k,!0),L=s.getKdeValue(S,d,k),C=s.getPositionOnKdePath(S,d,E),P=w._offset,O=w._length;z[x+"0"]=C[0],z[x+"1"]=C[1],z[_+"0"]=z[_+"1"]=E,z[_+"Label"]=_+": "+a.hoverLabelText(A,k,d[_+"hoverformat"])+", "+h[0].t.labels.kde+" "+L.toFixed(3);for(var I=0,D=0;D")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;if(i(n))return n;if(i(a)&&o)return a}(p,g),[u]}function k(t){return n(m,t,p[d+"hoverformat"])}}},{"../../components/color":363,"../../constants/delta.js":481,"../../plots/cartesian/axes":576,"../bar/hover":674}],1140:[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"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":588,"../bar/select":679,"./attributes":1133,"./calc":1134,"./cross_trace_calc":1136,"./defaults":1137,"./event_data":1138,"./hover":1139,"./layout_attributes":1141,"./layout_defaults":1142,"./plot":1143,"./style":1144}],1141:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1142:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0&&(g+=p?"M"+f[0]+","+d[1]+"V"+d[0]:"M"+f[1]+","+d[0]+"H"+f[0]),"between"!==h&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":363,"../../components/drawing":385,"../../constants/interactions":486,"../bar/style":681,"../bar/uniform_text":683,"@plotly/d3":54}],1145:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return f;case"first":return p;case"last":return h;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return p(t)>s};case">=":return function(t){return p(t)>=s};case"[]":return function(t){var e=p(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=p(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=p(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=p(t);return es[1]};case"](":return function(t){var e=p(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=p(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(p(t))};case"}{":return function(t){return-1===s.indexOf(p(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),p),b={},x={},_=0;d?(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},y=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},y=function(t,e){var r=b[t.astr][e];t.get().push(r)}),k(g);for(var w=o(e.transforms,r),A=0;A1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)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 i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * diff --git a/dist/plotly-with-meta.js b/dist/plotly-with-meta.js index 15fbf2d567b..046e2ecbf63 100644 --- a/dist/plotly-with-meta.js +++ b/dist/plotly-with-meta.js @@ -1,5 +1,5 @@ /** -* plotly.js v2.16.4 +* plotly.js v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -127639,6 +127639,8 @@ function setActive(gd, sliderGroup, sliderOpts, index, doCallback, doTransition) } function attachGripEvents(item, gd, sliderGroup) { + if(gd._context.staticPlot) return; + var node = sliderGroup.node(); var $gd = d3.select(gd); @@ -233973,7 +233975,7 @@ function getSortFunc(opts, d2c) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.16.4'; +exports.version = '2.16.5'; },{}],1133:[function(_dereq_,module,exports){ (function (global){(function (){ diff --git a/dist/plotly.js b/dist/plotly.js index 9b623d65ce6..8bfa0477832 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -1,5 +1,5 @@ /** -* plotly.js v2.16.4 +* plotly.js v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -126451,6 +126451,8 @@ function setActive(gd, sliderGroup, sliderOpts, index, doCallback, doTransition) } function attachGripEvents(item, gd, sliderGroup) { + if(gd._context.staticPlot) return; + var node = sliderGroup.node(); var $gd = d3.select(gd); @@ -227423,7 +227425,7 @@ function getSortFunc(opts, d2c) { 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.16.4'; +exports.version = '2.16.5'; },{}],1133:[function(_dereq_,module,exports){ (function (global){(function (){ diff --git a/dist/plotly.min.js b/dist/plotly.min.js index 9cc14d3b0d1..22f6fe06604 100644 --- a/dist/plotly.min.js +++ b/dist/plotly.min.js @@ -1,5 +1,5 @@ /** -* plotly.js v2.16.4 +* plotly.js v2.16.5 * Copyright 2012-2022, Plotly, Inc. * All rights reserved. * Licensed under the MIT license @@ -34,7 +34,7 @@ object-assign * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs */ -var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=i():!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:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(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 h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":256,"./lib/epsilon":257,"./lib/geojson":258,"./lib/intersecter":259,"./lib/segment-chainer":261,"./lib/segment-selector":262}],256:[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")}}}},{}],257:[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 i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],258:[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]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),p=e.pointsSame(s,u);if(h&&p)return n;var d=!h&&e.pointBetween(o,c,u),m=!p&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;d&&(p||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var p=c(h),d=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function g(){if(d){var t=u(h,d);if(t)return t}return!!m&&u(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var v,y=g();if(y){var x;if(t)(x=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)x=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=x?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)v=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:v,below:v};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=p.insert(n.node({ev:h}))}else{var b=h.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},a.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));case 5:case 10:case 11:case 12:case 7:default:return null}},a.prototype.scan_ifd=function(t,e,r){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],m=h,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:f,data_offset:h+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=a,e.exports.get_orientation=function(t){var e=0;try{return new a(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}},{}],265:[function(t,e,r){"use strict";var n=t("./common").readUInt16BE,i=t("./common").readUInt32BE;function a(t,e){if(t.length<4+e)return null;var r=i(t,e);return t.length>4&15,i=15&t[4],a=t[5]>>4&15,o=n(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),i=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>i.height||n.width===i.height&&n.height>i.width?n:i),s=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n1&&(h.variants=f.variants),f.orientation&&(h.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=t.length){var p=a(t,f.exif_location.offset),d=t.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),m=s.get_orientation(d);m>0&&(h.orientation=m)}return h}}}}}}},{"../common":263,"../exif_utils":264,"../miaf_utils":265}],267:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("BM");e.exports=function(t){if(!(t.length<26)&&i(t,0,o))return{width:a(t,18),height:a(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":263}],268:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");e.exports=function(t){if(!(t.length<10)&&(i(t,0,o)||i(t,0,s)))return{width:a(t,6),height:a(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":263}],269:[function(t,e,r){"use strict";var n=t("../common").readUInt16LE;e.exports=function(t){var e=n(t,0),r=n(t,2),i=n(t,4);if(0===e&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":263}],270:[function(t,e,r){"use strict";var n=t("../common").readUInt16BE,i=t("../common").str2arr,a=t("../common").sliceEq,o=t("../exif_utils"),s=i("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var r,i,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;r=n(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(t,e,s)&&(i=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=i),c}e+=r}}},{"../common":263,"../exif_utils":264}],271:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(t){if(!(t.length<24)&&i(t,0,o)&&i(t,12,s))return{width:a(t,16),height:a(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":263}],272:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&i(t,0,o))return{width:a(t,18),height:a(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":263}],273:[function(t,e,r){"use strict";function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||u(t,e+8):"VP8L"===p&&d>=9?r=r||f(t,e+8):"VP8X"===p&&d>=10?r=r||h(t,e+8):"EXIF"===p&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":263,"../exif_utils":264}],276:[function(t,e,r){"use strict";e.exports={avif:t("./parse_sync/avif"),bmp:t("./parse_sync/bmp"),gif:t("./parse_sync/gif"),ico:t("./parse_sync/ico"),jpeg:t("./parse_sync/jpeg"),png:t("./parse_sync/png"),psd:t("./parse_sync/psd"),svg:t("./parse_sync/svg"),tiff:t("./parse_sync/tiff"),webp:t("./parse_sync/webp")}},{"./parse_sync/avif":266,"./parse_sync/bmp":267,"./parse_sync/gif":268,"./parse_sync/ico":269,"./parse_sync/jpeg":270,"./parse_sync/png":271,"./parse_sync/psd":272,"./parse_sync/svg":273,"./parse_sync/tiff":274,"./parse_sync/webp":275}],277:[function(t,e,r){"use strict";var n=t("./lib/parsers_sync");e.exports=function(t){return function(t){for(var e=Object.keys(n),r=0;r1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function T(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(b.groups=x=t.map((function(t,c){var u=x[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(x[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},v.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},v.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},v.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>v.precisionThreshold||e.scale[1]*e.viewport.height>v.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=v.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},v.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var d=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),d||(e.passes[f]=d={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},v.defaults,t)),null!=t.thickness&&(d.thickness=parseFloat(t.thickness)),null!=t.opacity&&(d.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(d.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(d.overlay=!!t.overlay,f=D}));(I=I.slice(0,R)).push(D)}for(var F=function(t){var e=k.slice(2*z,2*I[t]).concat(D?k.slice(2*D):[]),r=(d.hole||[]).map((function(e){return e-D+(I[t]-z)})),n=c(e,r);n=n.map((function(e){return e+z+(e+zt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),g&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=u(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var p=v.float32(t);return i({data:p,usage:"dynamic"}),a({data:v.fract32(t,p),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},b.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function p(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},u.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nk))&&(s.lower||!(T>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||J(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(t)||J(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=et[t.usage]),"primitive"in t&&(n=at[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(f,e,r,n,i,o,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){K(s).forEach(o)}}}function m(t){for(var e=Z.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,p(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function C(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;P.call(r);var a=L();return"number"==typeof t?M(a,0|t,"number"==typeof e?0|e:0|t):t?(I(r,t),S(a,t)):M(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),E(a,3553),O(r,3553),R(),C(a),o.profile&&(i.stats.size=T(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new z(3553);return yt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=v();return c(o,i),o.width=0,o.height=0,p(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,D(i),d(o,3553,e,r,a),R(),k(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l=0;i.mipmask>>l;++l){var c=a>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return R(),o.profile&&(i.stats.size=T(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=h.texInfo;for(P.call(l),s=0;6>s;++s)m[s]=L();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(m[0],t),S(m[1],e),S(m[2],r),S(m[3],n),S(m[4],i),S(m[5],a);else if(I(l,t),u(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(m[s],h),S(m[s],t[s]);else for(s=0;6>s;++s)S(m[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(m[s],t,t);for(c(h,m[0]),h.mipmask=l.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,h.internalformat=m[0].internalformat,f.width=m[0].width,f.height=m[0].height,D(h),s=0;6>s;++s)E(m[s],34069+s);for(O(l,34067),R(),o.profile&&(h.stats.size=T(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)C(m[s]);return f}var h=new z(34067);yt[h.id]=h,a.cubeCount++;var m=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=v();return c(a,h),a.width=0,a.height=0,p(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,D(h),d(a,34069+t,r,n,i),R(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,D(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return R(),o.profile&&(h.stats.size=T(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);O(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){K(k).forEach(g)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,K(k).forEach((function(e){e.framebuffer=t.createFramebuffer(),v(e)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r=h.byteLength?c.subdata(h):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=i.create(u,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else i.getBuffer(u)?(f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(u.buffer)?(f.buffer=i.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?tt[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;ct&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);K(c).forEach(e),c={},K(u).forEach(e),u={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var p=o[e];if(p&&(p.refCount++,!a))return p;var d=new s(n,e);return r.shaderCount++,l(d,i,a),p||(o[e]=d),h.push(d),H(d,{destroy:function(){if(d.refCount--,0>=d.refCount){t.deleteProgram(d.program);var e=h.indexOf(d);h.splice(e,1),r.shaderCount--}0>=o[d.vertId].refCount&&(t.deleteShader(u[d.vertId]),delete u[d.vertId],delete f[d.fragId][d.vertId]),Object.keys(f[d.fragId]).length||(t.deleteShader(c[d.fragId]),delete c[d.fragId],delete f[d.fragId])}})},restore:function(){c={},u={};for(var t=0;t>>e|t<<32-e}function P(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function I(t){return Array.prototype.slice.call(t)}function O(t){return I(t).join("")}function z(t){function e(){var t=[],e=[];return H((function(){t.push.apply(t,I(arguments))}),{def:function(){var r="v"+i++;return e.push(r),0>>4&15)+"0123456789abcdef".charAt(15&e);return r}(function(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,c,u,f,h,p,d=8*t.length;for(t=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),e[d>>5]|=128<<24-d%32,e[15+(d+64>>9<<4)]=d,u=0;uf;f++){var m;if(16>f)r[f]=e[f+u];else h=f,p=P(p=C(p=r[f-2],17)^C(p,19)^p>>>10,r[f-7]),m=C(m=r[f-15],7)^C(m,18)^m>>>3,r[h]=P(P(p,m),r[f-16]);h=P(P(P(P(c,h=C(h=o,6)^C(h,11)^C(h,25)),o&s^~o&l),kt[f]),r[f]),p=P(c=C(c=d,2)^C(c,13)^C(c,22),d&n^d&i^n&i),c=l,l=s,s=o,o=P(a,h),a=i,i=n,n=d,d=P(h,p)}t[0]=P(d,t[0]),t[1]=P(n,t[1]),t[2]=P(i,t[2]),t[3]=P(a,t[3]),t[4]=P(o,t[4]),t[5]=P(s,t[5]),t[6]=P(l,t[6]),t[7]=P(c,t[7])}for(e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t){for(var e,r,n="",i=-1;++i=e&&56320<=r&&57343>=r&&(e=65536+((1023&e)<<10)+(1023&r),i++),127>=e?n+=String.fromCharCode(e):2047>=e?n+=String.fromCharCode(192|e>>>6&31,128|63&e):65535>=e?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):2097151>=e&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(r))),n[e])?n[e].apply(null,o):(r=Function.apply(null,a.concat(r)),n&&(n[e]=r),r.apply(null,o))}}}function D(t){return Array.isArray(t)||J(t)||l(t)}function R(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",a,".createStream(",34962,",",i,".buffer);","}else{",u,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",u,");","}"),l}))})),o}function M(t,e,n,i,o){function s(t){var e=c[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,m,g,s],");")}p&&"null"!==p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[d,g,v,m+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[d,m,g]+");")}p&&"null"!==p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,h=n.draw,p=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),h.elementsActive&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",rt?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),d=i("primitive"),m=i("offset"),g=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");$&&(s=i("instances"),l=t.instancing);var v=p+".type",y=h.elements&&B(h.elements)&&!h.vaoActive;$&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function q(t,e,r,n,i){return i=(e=_()).proc("body",i),$&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function Y(t,e,r,n){P(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),O(t,e,r,n.attributes,(function(){return!0}))),U(t,e,r,n.uniforms,(function(){return!0}),!1),V(t,e,e,r)}function W(t,e,r,n){function i(){return!0}t.batchId="a1",P(t,e),O(t,e,r,n.attributes,i),U(t,e,r,n.uniforms,i,!1),V(t,e,e,r)}function Z(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}P(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&S(t,u,r.context),r.needsFramebuffer&&E(t,u,r.framebuffer),C(t,u,r.state,i),r.profile&&i(r.profile)&&I(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),O(t,c,r,n.attributes,a),O(t,u,r,n.attributes,i)),U(t,c,r,n.uniforms,a,!1),U(t,u,r,n.uniforms,i,!0),V(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return q(W,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function X(t,r){function n(e){var n=r.shader[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.shader,"."+e,n):i.set(a.shader,"."+e,t.link(n,{stable:!0})))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;if(S(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),R(Object.keys(r.state)).forEach((function(e){var n=r.state[e],o=n.append(t,i);g(o)?o.forEach((function(r,n){isNaN(r)?i.set(t.next[e],"["+n+"]",r):i.set(t.next[e],"["+n+"]",t.link(r,{stable:!0}))})):B(n)?i.set(a.next,"."+e,t.link(o,{stable:!0})):i.set(a.next,"."+e,o)})),I(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.draw,"."+e,n):i.set(a.draw,"."+e,t.link(n),{stable:!0}))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.map((function(e){return isNaN(e)?e:t.link(e,{stable:!0})}))+"]"),i.set(a.uniforms,"["+t.link(e.id(n),{stable:!0})+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new K).forEach((function(t){i.set(a,"."+t,n[t])}))})),r.scopeVAO){var s=r.scopeVAO.append(t,i);isNaN(s)?i.set(a.vao,".targetVAO",s):i.set(a.vao,".targetVAO",t.link(s,{stable:!0}))}n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=bt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height||(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=bt[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){K(u).forEach(o)},restore:function(){K(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},wt=[];wt[6408]=4,wt[6407]=3;var Tt=[];Tt[5121]=1,Tt[5126]=4,Tt[36193]=2;var kt=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],At=["x","y","z","w"],Mt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),St={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Et={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Lt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ct={cw:2304,ccw:2305},Pt=new F(!1,!1,!1,(function(){}));return function(t){function e(){if(0===K.length)T&&T.update(),et=null;else{et=Y.next(e),f();for(var t=K.length-1;0<=t;--t){var r=K[t];r&&r(I,null,0)}g.flush(),T&&T.update()}}function r(){!et&&0=K.length&&n()}}}}function u(){var t=Z.viewport,e=Z.scissor_box;t[0]=t[1]=e[0]=e[1]=0,I.viewportWidth=I.framebufferWidth=I.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,I.viewportHeight=I.framebufferHeight=I.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){I.tick+=1,I.time=m(),u(),q.procs.poll()}function h(){B.refresh(),u(),q.procs.refresh(),T&&T.update()}function m(){return(W()-M)/1e3}if(!(t=i(t)))return null;var g=t.gl,v=g.getContextAttributes();g.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)rt(H({framebuffer:t.framebuffer.faces[e]},t),l);else rt(t,l);else l(0,t)},prop:G.define.bind(null,1),context:G.define.bind(null,2),this:G.define.bind(null,3),draw:s({}),buffer:function(t){return z.create(t,34962,!1,!1)},elements:function(t){return D.create(t,!1)},texture:B.create2D,cube:B.createCube,renderbuffer:N.create,framebuffer:j.create,framebufferCube:j.createCube,vao:R.createVAO,attributes:v,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=Q;break;case"restore":r=$;break;case"destroy":r=tt}return r.push(e),{cancel:function(){for(var t=0;t2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(a(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(a(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],288:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),a=t("./_stream_writable");t("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)o.endEmitted?w(t,new _):S(t,o,e,!0);else if(o.ended)w(t,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?S(t,o,e,!1):P(t,o)):S(t,o,e,!1)}else n||(o.reading=!1,P(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(C,t))}function C(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function P(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(N,e,t))}function N(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){w(this,new b("_read()"))},A.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",g),n.removeListener("data",h),f=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function l(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",u);var f=!1;function h(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==j(i.pipes,t))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(e){c("onerror",e),g(),t.removeListener("error",p),0===a(t,"error")&&w(t,e)}function d(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",d),t.once("finish",m),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?L(this):i.reading||r.nextTick(z,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(O,this),n},A.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(O,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new m("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,P(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":287,"./_stream_duplex":288,"./internal/streams/destroy":295,"./internal/streams/state":299,"./internal/streams/stream":300,_process:278,buffer:85,inherits:231,"util-deprecate":331}],293:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=t("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[h].read();null!==r&&(t[u]=null,t[o]=null,t[s]=null,e(p(r,!1)))}}function m(t){r.nextTick(d,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(p(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(p(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),g);e.exports=function(t){var e,r=Object.create(v,(i(e={},h,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[h].read();n?(r[u]=null,r[o]=null,r[s]=null,t(p(n,!1))):(r[o]=t,r[s]=e)},writable:!0}),e));return r[u]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[o]=null,r[s]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(p(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":296,_process:278}],294:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0==(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&o.forEach(c),a||(o.forEach(c),i(n))}))}));return e.reduce(u)}},{"../../../errors":287,"./end-of-stream":296}],299:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},{"../../../errors":287}],300:[function(t,e,r){e.exports=t("events").EventEmitter},{events:84}],301:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=f,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":285}],302:[function(t,e,r){(function(r,n){(function(){var r=t("assert"),i=t("debug")("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),t._bytes=o,t._skipBytes=s,e&&(t._passthrough=l);e?t._transform=u:t._write=c};function a(t){i("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||a(this),i("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function s(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function l(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function c(t,e,r){this._parserInit||a(this),i("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function u(t,e,r){this._parserInit||a(this),i("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function f(t,e,r,a){if(t._parserBytesLeft-=e.length,i("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return a;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(e=n.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];e&&s.push(e),r&&s.push(r);var l=o.length>s.length;l&&s.push(p(a));var c=o.apply(t,s);if(!l||a===c)return a}}var h=p((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return f(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return f(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function p(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:278,assert:75,buffer:85,debug:303}],303:[function(t,e,r){(function(n){(function(){function i(){var t;try{t=r.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(r=e.exports=t("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))})),t.splice(a,0,n)},r.save=function(t){try{null==t?r.storage.removeItem("debug"):r.storage.debug=t}catch(t){}},r.load=i,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(i())}).call(this)}).call(this,t("_process"))},{"./debug":304,_process:278}],304:[function(t,e,r){var n;function i(t){function e(){if(e.enabled){var t=e,i=+new Date,a=i-(n||i);t.diff=a,t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===l&&!1===isNaN(t))return e.long?s(r=t,o,"day")||s(r,a,"hour")||s(r,i,"minute")||s(r,n,"second")||r+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=a)return Math.round(t/a)+"h";if(t>=i)return Math.round(t/i)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],306:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],v=[],y=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),v.push(s[x]),y+=s[x].length,o[x]=f.length,x===e){l.length=d;break}}f.push(g);var b=new Array(y);for(d=0;d1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,p=void 0===h?0:h,d=t.largeArcFlag,m=void 0===d?0:d,g=t.sweepFlag,v=void 0===g?0:g,y=[];if(0===u||0===f)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var T=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);T>1&&(u*=Math.sqrt(T),f*=Math.sqrt(T));var k=function(t,e,r,n,a,o,l,c,u,f,h,p){var d=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(h,2),v=Math.pow(p,2),y=d*m-d*v-m*g;y<0&&(y=0),y/=d*v+m*g;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*p,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,T=(h-x)/a,k=(p-b)/o,A=(-h-x)/a,M=(-p-b)/o,S=s(1,0,T,k),E=s(T,k,A,M);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,f,m,v,x,b,_,w),A=n(k,4),M=A[0],S=A[1],E=A[2],L=A[3],C=Math.abs(L)/(i/4);Math.abs(1-C)<1e-7&&(C=1);var P=Math.max(Math.ceil(C),1);L/=P;for(var I=0;Ie[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":70,assert:75,"is-svg-path":238,"normalize-svg-path":310,"parse-svg-path":250}],310:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,p=0,d=0,m=t.length;d4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=p),r.push(g)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":308}],311:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=c.width=e.w||e.width||200,f=c.height=e.h||e.height||200);var h=Math.min(r,f),p=e.stroke||0,d=e.viewbox||e.viewBox||i(t),m=[r/(d[2]-d[0]),f/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",p&&("number"!=typeof p&&(p=1),u.strokeStyle=p>0?"white":"black",u.lineWidth=Math.abs(p));if(u.translate(.5*r,.5*f),u.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var v=new Path2D(t);u.fill(v),p&&u.stroke(v)}else{var y=a(t);o(u,y),u.fill(),p&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":82,"draw-svg-path":126,"is-svg-path":238,"parse-svg-path":250,"svg-path-bounds":309}],312:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},l=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":278,timers:312}],313:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(p=e.r,d=e.g,m=e.b,i={r:255*C(p,255),g:255*C(d,255),b:255*C(m,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),c=z(e.v),i=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),u=z(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var p,d,m;return a=L(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%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,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.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=L(t),this._roundA=a(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=a(360*t.h),r=a(100*t.s),n=a(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=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[O(a(t).toString(16)),O(a(e).toString(16)),O(a(r).toString(16)),O(D(n))];if(i&&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:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[h(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 i=c(t);r="#"+p(i._r,i._g,i._b,i._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(v,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,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(A,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,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]:z(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:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!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":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=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"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function O(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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 U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],314:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=i(t));for(var r=0,n=e.length;ro&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=l(t,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,u=f(e),h=t.objects,p={};function d(t){return u(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in h)p[c]=m(h[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=u(t[0],0);++r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":319}],321:[function(t,e,r){"use strict";var n=t("../value/is"),i={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},{"../value/is":327}],322:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":318,"./is":323}],323:[function(t,e,r){"use strict";var n=t("../function/is"),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!i.test(a.call(t))}},{"../function/is":317}],324:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":321}],325:[function(t,e,r){"use strict";var n=t("../value/is"),i=t("../object/is"),a=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},{"../object/is":321,"../value/is":327}],326:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":318,"./is":327}],327:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],328:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),i=t("dup"),a=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,f=c.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function y(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return v(t);case"int16":return y(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}return null},r.mallocArrayBuffer=p,r.mallocUint8=d,r.mallocUint16=m,r.mallocUint32=g,r.mallocInt8=v,r.mallocInt16=y,r.mallocInt32=x,r.mallocFloat32=r.mallocFloat=b,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=T,r.mallocBigInt64=k,r.mallocDataView=A,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":81,buffer:85,dup:128}],329:[function(t,e,r){var n=/[\'\"]/;e.exports=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},{}],330:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var p,d=f[a.year-f[0]];for(p=0;p<13;p++){var m=d&1<<12-p?30:29;if(l>13;!g||p=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":347,"object-assign":247}],336:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":347,"object-assign":247}],337:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":347,"object-assign":247}],338:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":347,"object-assign":247}],339:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":347,"object-assign":247}],340:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":347,"object-assign":247}],341:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":347,"object-assign":247}],342:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":347,"object-assign":247}],344:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":347,"object-assign":247}],345:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":347,"object-assign":247}],346:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":347,"object-assign":247}],347:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":247}],348:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(p(t,n))for(;i.length1},x=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(A));return A+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){p=1,d=m;for(var E=this.daysInMonth(h,p);d>E;E=this.daysInMonth(h,p))p++,d-=E}return f>-1?this.fromJD(f):this.newDate(h,p,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":347,"object-assign":247}],349:[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}]},{}],350:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=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:i({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",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.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",a.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:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":484,"../../plot_api/plot_template":555,"../../plots/cartesian/constants":573,"../../plots/font_attributes":594,"./arrow_paths":349}],351:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+h,m=p-h,g=3*t.startarrowsize*t.arrowwidth||0,v=g+h,y=g-h;if(c===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,v),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=s?v+s:v,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,v),ppadminus:Math.max(f,m,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([a,o],t)}},{"../../lib":515,"../../plots/cartesian/axes":566,"./draw":356}],352:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],h=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,Z=["x","y"],X=0;X1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],J=dt?it._offset+it._length*Q:J=T.l+T.w*Q):(Q=1-e[et],J=dt?it._offset+it._length*Q:J=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var mt=e["a"+et];if(tt=ot*q(.5,e.xanchor)-st*q(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ft.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ft.tail=T.t+T.h*mt):ft.tail=T.l+T.w*mt:ft.tail=it._offset+it.r2p(mt),K=tt}else ft.tail=J+mt,K=tt+mt;ft.text=ft.tail+tt;var vt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,vt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-vt;yt>0?(ft.tail+=yt,ft.text+=yt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*q($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(A-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(D-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:N+bt-1,y:N+_t}).call(u.setClipUrl,U?L:null,t);else{var wt=N+_t-m.top,Tt=N+bt-m.left;G.call(h.positionText,Tt,wt).call(u.setClipUrl,U?L:null,t)}V.select("rect").call(u.setRect,N,N,A,D),j.call(u.setRect,F/2,F/2,B-F,H-F),R.call(u.setTranslate,Math.round(C.x.text-B/2),Math.round(C.y.text-H/2)),O.attr({transform:"rotate("+P+","+C.x.text+","+C.y.text+")"});var kt,At=function(r,n){I.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,p=C.y.tail+n,m=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(P,m,b),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),L=+j.attr("width"),z=+j.attr("height"),D=m-.5*L,F=D+L,B=b-.5*z,N=B+z,U=[[D,B,D,N],[D,N,F,N],[F,N,F,B],[F,B,D,B]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,p,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var V=e.arrowwidth,H=e.arrowcolor,q=e.arrowside,G=I.append("g").style({opacity:c.opacity(H)}).classed("annotation-arrow-g",!0),Y=G.append("path").attr("d","M"+h+","+p+"L"+l+","+f).style("stroke-width",V+"px").call(c.stroke,c.rgb(H));if(g(Y,q,e),k.annotationPosition&&Y.node().parentNode&&!a){var W=l,Z=f;if(e.standoff){var X=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-p,2));W+=e.standoff*(h-l)/X,Z+=e.standoff*(p-f)/X}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(p-Z),transform:s(W,Z)}).style("stroke-width",V+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);J=t.x,K=t.y,v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",s(t,r)),O.attr({transform:"rotate("+P+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&At(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=O.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),At(t,r);else{if(a)return;var i,o;if(v)i=y(v,t,"x",T,e);else{var l=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(c+t/T.w,l,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=d.align(f-r/T.h,u,0,1,e.yanchor)}S("x",i),S("y",o),v&&x||(n=d.getCursor(v?.5:i,x?.5:o,e.xanchor,e.yanchor))}O.attr({transform:s(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Y(n))},doneFn:function(){p(R),i.call("_guiRelayout",t,E());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=0,x=e.indexOf("end")>=0,b=d.backoff*g+r.standoff,_=m.backoff*v+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(h=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void z();if(b){if(b*b>w*w+T*T)return void z();var k=b*Math.cos(f),A=b*Math.sin(f);u.x+=k,u.y+=A,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void z();var M=_*Math.cos(f),S=_*Math.sin(f);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),L="";if(E1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":616,"../annotations/draw":356}],363:[function(t,e,r){"use strict";var n=t("../../registry"),i=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 a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ct=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ct*c.roundUp(lt/ct,[2,5,10]),(Math.abs(q.start)/q.size+1e-6)%1<2e-6&&(it.tick0=0)}it.dtick=ot}it.domain=o?[rt+I/R.h,rt+K-I/R.h]:[rt+P/R.w,rt+K-P/R.w],it.setScale(),t.attr("transform",u(Math.round(R.l),Math.round(R.t)));var ut,ft=t.select("."+A.cbtitleunshift).attr("transform",u(-Math.round(R.l),-Math.round(R.t))),ht=it.ticklabelposition,pt=it.title.font.size,dt=t.select("."+A.cbaxis),mt=0,gt=0;function vt(n,i){var a={propContainer:it,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:D._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&at||!o&&!at)&&("top"===j&&(t=P+R.l+R.w*O,e=I+R.t+R.h*(1-rt-K)+3+.75*pt),"bottom"===j&&(t=P+R.l+R.w*O,e=I+R.t+R.h*(1-rt)-3-.25*pt),"right"===j&&(e=I+R.t+R.h*z+3+.75*pt,t=P+R.l+R.w*rt),vt(it._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!at||o&&at){var a,l=t.select("."+A.cbtitle),f=l.select("text"),h=[-M/2,M/2],d=l.select(".h"+it._id+"title-math-group").node(),m=15.6;if(f.node()&&(m=parseInt(f.node().style.fontSize,10)*w),d?(a=p.bBox(d),gt=a.width,(mt=a.height)>m&&(h[1]-=(mt-m)/2)):f.node()&&!f.classed(A.jsPlaceholder)&&(a=p.bBox(f.node()),gt=a.width,mt=a.height),o){if(mt){if(mt+=5,"top"===j)it.domain[1]-=mt/R.h,h[1]*=-1;else{it.domain[0]+=mt/R.h;var v=g.lineCount(f);h[1]+=(1-v)*m}l.attr("transform",u(h[0],h[1])),it.setScale()}}else gt&&("right"===j&&(it.domain[0]+=(gt+pt/2)/R.w),l.attr("transform",u(h[0],h[1])),it.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",o?u(0,Math.round(R.h*(1-it.domain[1]))):u(Math.round(R.w*it.domain[0]),0)),dt.attr("transform",o?u(0,Math.round(-R.t)):u(Math.round(-R.l),0));var y=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(Y);y.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),y.exit().remove();var x=U.map(it.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var s=[0===a?U[0]:(Y[a]+Y[a-1])/2,a===Y.length-1?U[1]:(Y[a]+Y[a+1])/2].map(it.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,x[0],x[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(Z,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)p.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=H(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var b=t.select("."+A.cblines).selectAll("path."+A.cbline).data(B.color&&B.width?W:[]);b.enter().append("path").classed(A.cbline,!0),b.exit().remove(),b.each((function(t){var e=Q,r=Math.round(it.c2p(t))+B.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+Z).call(p.lineGroupStyle,B.width,V(t),B.dash)})),dt.selectAll("g."+it._id+"tick,path").remove();var _=Q+Z+(M||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(it),k=s.getTickSigns(it)[2];return s.drawTicks(r,it,{vals:"inside"===it.ticks?s.clipEnds(it,T):T,layer:dt,path:s.makeTickPath(it,_,k),transFn:s.makeTransTickFn(it)}),s.drawLabels(r,it,{vals:T,layer:dt,transFn:s.makeTransTickLabelFn(it),labelFns:s.makeLabelFns(it,_)})},function(){if(o&&!at||!o&&at){var t,i,a=it.position||0,s=it._offset+it._length/2;if("right"===j)i=s,t=R.l+R.w*a+10+pt*(it.showticklabels?1:.5);else if(t=s,"bottom"===j&&(i=R.t+R.h*a+10+(-1===ht.indexOf("inside")?it.tickfont.size:0)+("intside"!==it.ticks&&e.ticklen||0)),"top"===j){var l=N.text.split("
").length;i=R.t+R.h*a+10-Z-w*pt*l}vt((o?"h":"v")+it._id+"title",{avoid:{selection:n.select(r).selectAll("g."+it._id+"tick"),side:j,offsetTop:o?0:R.t,offsetLeft:o?R.l:0,maxShift:o?D.width:D.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=Z+M/2;-1===ht.indexOf("inside")&&(n=p.bBox(dt.node()),s+=o?n.width:n.height),ut=ft.select("text");var c=0,f=o&&"top"===j,m=!o&&"right"===j,g=0;if(ut.node()&&!ut.classed(A.jsPlaceholder)){var y,x=ft.select(".h"+it._id+"title-math-group").node();x&&(o&&at||!o&&!at)?(c=(n=p.bBox(x)).width,y=n.height):(c=(n=p.bBox(ft.node())).right-R.l-(o?Q:nt),y=n.bottom-R.t-(o?nt:Q),o||"top"!==j||(s+=n.height,g=n.height)),m&&(ut.attr("transform",u(c/2+pt/2,0)),c*=2),s=Math.max(s,o?c:y)}var b=2*(o?P:I)+s+S+M/2,w=0;!o&&N.text&&"bottom"===C&&z<=0&&(b+=w=b/2,g+=w),D._hColorbarMoveTitle=w,D._hColorbarMoveCBTitle=g;var F=S+M;t.select("."+A.cbbg).attr("x",(o?Q:nt)-F/2-(o?P:0)).attr("y",(o?nt:Q)-(o?J:I+g-w)).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(J+F,2)).call(d.fill,E).call(d.stroke,e.bordercolor).style("stroke-width",S);var B=m?Math.max(c-10,0):0;if(t.selectAll("."+A.cboutline).attr("x",(o?Q:nt+P)+B).attr("y",(o?nt+I-J:Q)+(f?mt:0)).attr(o?"width":"height",Math.max(Z,2)).attr(o?"height":"width",Math.max(J-(o?2*I+mt:2*P+B),2)).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":M}),t.attr("transform",u(R.l-(o?$*b:0),R.t-(o?0:(1-tt)*b-g))),!o&&(S||i(E).getAlpha()&&!i.equals(D.paper_bgcolor,E))){var U=dt.selectAll("text"),V=U[0].length,H=t.select("."+A.cbbg).node(),q=p.bBox(H),G=p.getTranslate(t);U.each((function(t,e){var r=V-1;if(0===e||e===r){var n,i=p.bBox(this),a=p.getTranslate(this);if(e===r){var o=i.right+a.x;(n=q.right+G.x+nt-S-2+O-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=q.left+G.x+nt+S+2-s)<0&&(n=0)}n&&(V<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var Y={},W=T[L],X=k[L],K=T[C],et=k[C],rt=b-Z;o?("pixels"===h?(Y.y=z,Y.t=J*K,Y.b=J*et):(Y.t=Y.b=0,Y.yt=z+l*K,Y.yb=z-l*et),"pixels"===_?(Y.x=O,Y.l=b*W,Y.r=b*X):(Y.l=rt*W,Y.r=rt*X,Y.xl=O-v*W,Y.xr=O+v*X)):("pixels"===h?(Y.x=O,Y.l=J*W,Y.r=J*X):(Y.l=Y.r=0,Y.xl=O+l*W,Y.xr=O-l*X),"pixels"===_?(Y.y=1-z,Y.t=b*K,Y.b=b*et):(Y.t=rt*K,Y.b=rt*et,Y.yt=z-v*K,Y.yb=z+v*et)),a.autoMargin(r,e._id,Y)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,f)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":483,"../../lib":515,"../../lib/extend":505,"../../lib/setcursor":536,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"../../plots/cartesian/axis_defaults":568,"../../plots/cartesian/layout_attributes":579,"../../plots/cartesian/position_defaults":582,"../../plots/plots":628,"../../registry":647,"../color":367,"../colorscale/helpers":378,"../dragelement":386,"../drawing":389,"../titles":476,"./constants":369,"@plotly/d3":58,tinycolor2:313}],372:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":515}],373:[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":368,"./defaults":370,"./draw":371,"./has_colorbar":372}],374:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var p=a+"auto",d=a+"min",m=a+"max",g=a+"mid",v=(s(h+p),s(h+d),s(h+m),{});v[d]=v[m]=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:v},x[d]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},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"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":532,"../../lib/sort_object_keys":538,"../colorbar/attributes":368,"./scales.js":382}],375:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),h=!1!==f.auto,p=f.min,d=f.max,m=f.mid,g=function(){return i.aggNums(Math.min,null,l)},v=function(){return i.aggNums(Math.max,null,l)};(void 0===p?p=g():h&&(p=u._colorAx&&n(p)?Math.min(p,g()):g()),void 0===d?d=v():h&&(d=u._colorAx&&n(d)?Math.max(d,v()):v()),h&&void 0!==m&&(d-m>m-p?p=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":515,"./helpers":378,"fast-isnumeric":190}],376:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=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,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],384:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":515}],385:[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)}},{}],386:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var 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)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,h,p,d,m,g=t.gd,v=1,y=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,a?(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)y&&(v=Math.max(v-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(v,p),!m){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)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":515,"../../plots/cartesian/constants":573,"./align":383,"./cursor":384,"./unhover":387,"has-hover":228,"has-passive-events":229,"mouse-event-offset":242}],387:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":503,"../../lib/events":504,"../../lib/throttle":542,"../fx/constants":401}],388:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],389:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,h=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),v=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,x=e.exports={};function b(t,e,r){var n=e.fillpattern,i=n&&x.getPatternAttr(n.shape,0,"");if(i){var a=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=x.getPatternAttr(n.size,0,8),u=x.getPatternAttr(n.solidity,0,.3),f=e.uid;x.pattern(t,"point",r,f,i,l,u,void 0,n.fillmode,a,o,s)}else e.fillcolor&&t.call(c.fill,e.fillcolor)}x.font=function(t,e,r,n){i.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(c.fill,n)},x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},x.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);x.translatePoint(t,i,e,r)}))},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){x.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},x.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.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},x.singleFillStyle=function(t,e){var r=n.select(t.node());b(t,((r.data()[0]||[])[0]||{}).trace||{},e)},x.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&b(r,t[0].trace,e)}))};var _=t("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,x.symbolBackOffs[r]=e.backoff||0,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function T(t,e,r,n){var i=t%100;return x.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(o(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=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var k={x1:1,x2:0,y1:0,y2:0},A={x1:0,x2:0,y1:1,y2:0},M=a("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:A},verticalreversed:{node:"linearGradient",attrs:A,reversed:!0}};x.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=S[a],h=new Array(u),p=0;p=100;var f=rt(t,r),h=G(t,r);e.attr("d",T(u,l,f,h))}var p,d,m,g=!1;if(t.so)m=s.outlierwidth,d=s.outliercolor,p=o.outliercolor;else{var v=(s||{}).width;m=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,g=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,p).style({"stroke-width":(m||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:m)+"px");var y=o.gradient,b=t.mgt;b?g=!0:b=y&&y.type,i.isArrayOrTypedArray(b)&&(b=b[0],S[b]||(b=0));var _=o.pattern,w=_&&x.getPatternAttr(_.shape,t.i,"");if(b&&"none"!==b){var k=t.mgc;k?g=!0:k=y.color;var A=r.uid;g&&(A+="-"+t.i),x.gradient(e,a,A,b,[[0,k],[1,p]],"fill")}else if(w){var M=x.getPatternAttr(_.bgcolor,t.i,null),E=x.getPatternAttr(_.fgcolor,t.i,null),L=_.fgopacity,C=x.getPatternAttr(_.size,t.i,8),P=x.getPatternAttr(_.solidity,t.i,.3),I=t.mcc||i.isArrayOrTypedArray(_.shape)||i.isArrayOrTypedArray(_.bgcolor)||i.isArrayOrTypedArray(_.size)||i.isArrayOrTypedArray(_.solidity),O=r.uid;I&&(O+="-"+t.i),x.pattern(e,"point",a,O,w,C,P,t.mcc,_.fillmode,M,E,L)}else c.fill(e,p);m&&c.stroke(e,d)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,h=void 0!==u,p=void 0!==f;(i.isArrayOrTypedArray(c)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:e:p?f:m*e});var d=a.color,g=o.color,v=s.color;(g||v)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?g||e:v||e});var y=a.size,x=o.size,b=s.size,_=void 0!==x,w=void 0!==b;return l.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},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",T(x.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}x.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=C(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,t.tf||e.textfont.family,g,v).text(c).call(h.convertToTspans,r).call(L,m,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=C(t,e);c.fill(i,a);var u=l.traceIs(e,"bar-like");L(i,o,s,t.mrc2||t.mrc,u)}))}};var P,I;function O(t,e,r){return r&&(t=N(t)),e?D(t[1]):z(t[0])}function z(t){var e=n.round(t,2);return P=e,e}function D(t){var e=n.round(t,2);return I=e,e}function R(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,h=3*c*(l+c),p=3*l*(l+c);return[[z(e[0]+(h&&u/h)),D(e[1]+(h&&f/h))],[z(e[0]-(p&&u/p)),D(e[1]-(p&&f/p))]]}x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||b>=f&&b<=c)&&(_<=h&&_>=u||_>=h&&_<=u)&&(t=[b,_])}return t}x.steps=function(t){var e=F[t]||B;return function(t){for(var r="M"+z(t[0][0])+","+D(t[0][1]),n=t.length,i=1;i=1e4&&(x.savedBBoxes={},j=0),r&&(x.savedBBoxes[r]=g),j++,i.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",V(e,r))},x.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}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},x.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}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var H=/\s*sc.*/;x.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(H,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var q=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(q);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},x.getMarkerStandoff=G;var Y,W,Z,X,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,c=e._yA;if(!l||!c)return 90;r=l.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var u,f=t.lonlat[0],h=t.lonlat[1],p=e._geo.project([f,h+1e-5]),d=e._geo.project([f+1e-5,h]),m=Q(d[1]-n,d[0]-r),g=Q(p[1]-n,p[0]-r);if("north"===a)u=i/180*Math.PI;else if("previous"===a){var v=f/180*Math.PI,y=h/180*Math.PI,x=Y/180*Math.PI,b=W/180*Math.PI,_=x-v,w=$(b)*tt(_),T=tt(b)*$(y)-$(b)*tt(y)*$(_);u=-Q(w,T)-Math.PI,Y=f,W=h}var k=et(m,[$(u),0]),A=et(g,[tt(u),0]);i=Q(k[1]+A[1],k[0]+A[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var M=r-Z,S=n-X,E=e.line&&e.line.shape||"",L=E.slice(E.length-1);"h"===L&&(S=0),"v"===L&&(M=0),i+=Q(S,M)/Math.PI*180+90}else i=null}return Z=r,X=n,J=t.i,K=e.uid,i}x.getMarkerAngle=rt},{"../../components/fx/helpers":403,"../../constants/alignment":483,"../../constants/interactions":490,"../../constants/xmlns_namespaces":492,"../../lib":515,"../../lib/svg_text_utils":541,"../../registry":647,"../../traces/scatter/make_bubble_size_func":953,"../../traces/scatter/subtypes":961,"../color":367,"../colorscale":379,"./symbol_defs":390,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:313}],390:[function(t,e,r){"use strict";var n,i,a,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,h=Math.cos,p=Math.sin;function d(t){return null===t}function m(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=h(t),i=p(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,d=0,m=s(r),g="",v=0;v0;e.each((function(e){var f,h=e[0].trace,p=h.error_x||{},d=h.error_y||{};h.ids&&(f=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||p.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,f);if(g.exit().remove(),e.length){p.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=d.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="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(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(p.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(p.copy_ystyle?d:p).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":961,"../drawing":389,"@plotly/d3":58,"fast-isnumeric":190}],397:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":367,"@plotly/d3":58}],398:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":505,"../../plots/font_attributes":594,"./layout_attributes":408}],399:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||ot<0||ot>w[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=ot+w[0]._offset,V="xval"in e?v.flat(l,e.xval):v.p2c(_,at),H="yval"in e?v.flat(l,e.yval):v.p2c(w,ot),!i(V[0])||!i(H[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(G=0;Gtt&&(et.splice(0,tt),ct=et[0].distance),y&&0!==B&&0===et.length){$.distance=B,$.index=!1;var f=W._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=B}))),f&&f.length){var h,d=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];i(m.x0)&&i(m.y0)&&(h=ht(m),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>h.spikeDistance)&&(nt.vLinePoint=h))}var g=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(g.length){var x=g[0];i(x.x0)&&i(x.y0)&&(h=ht(x),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>h.spikeDistance)&&(nt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;Mt--)Ct(et[Mt]);et=St,gt()}var Pt=t._hoverdata,It=[],Ot=j(t),zt=U(t);for(q=0;q1||et.length>1)||"closest"===P&&it&&et.length>1,Wt=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),Zt=I(et,{gd:t,hovermode:P,rotateLabels:Yt,bgColor:Wt,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});v.isUnifiedHover(P)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,h=t.size(),p=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(f=-1),p[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?T:1)/2,pmin:0,pmax:i?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<=h;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(s=v.length-1;s>=0;s--)v[s].dp+=i;for(g.push.apply(g,v),p.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(a=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(s=b.length-1;s>=0;s--){var _=b[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Zt,Yt?"xa":"ya",u),z(Zt,Yt,u._invScaleX,u._invScaleY));if(s&&s.tagName){var Xt=g.getComponentMethod("annotations","hasClickToShow")(t,It);f(n.select(s),Xt?"pointer":"")}if(!s||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:V,yvals:H})}(t,e,r,a,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=I(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var v=i._fullLayout[m.scene]._scene.container,y=v.offsetLeft,x=v.offsetTop;u+=y,f+=y,h+=x,d+=x}c.bbox={x0:u+o,x1:f+o,y0:h+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;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,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function I(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var T=e.fontFamily||y.HOVERFONT,k=e.fontSize||y.HOVERFONTSIZE,A=t[0],E=A.xa,L=A.ya,P=a.charAt(0),I=P+"Label",z=A[I];if(void 0===z&&"multicategory"===E.type)for(var D=0;Di.width-b?(g=i.width-b,e.attr("d","M"+(b-M)+",0L"+b+","+x+M+"v"+x+(2*S+y.height)+"H-"+b+"V"+x+M+"H"+(b-2*M)+"Z")):e.attr("d","M0,0L"+M+","+x+M+"H"+(S+y.width/2)+"v"+x+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+x+M+"H-"+M+"Z")}else{var _,C,P;"right"===L.side?(_="start",C=1,P="",g=E._offset+E._length):(_="end",C=-1,P="-",g=E._offset),v=L._offset+(A.y0+A.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+P+M+","+M+"V"+(S+y.height/2)+"h"+P+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+P+M+"V-"+M+"Z");var I,O=y.height/2,D=F-y.top-O,R="clip"+i._uid+"commonlabel"+L._id;if(g=0?st:lt+ft=0?lt:xt+ft=0?at:ot+ht=0?ot:bt+ht=0,"top"!==t.idealAlign&&G||!Y?G?(I+=R/2,t.anchor="start"):t.anchor="middle":(I-=R/2,t.anchor="end");else if(t.pos=I,G=P+D/2+W<=B,Y=P-D/2-W>=0,"left"!==t.idealAlign&&G||!Y)if(G)P+=D/2,t.anchor="start";else{t.anchor="middle";var Z=W/2,X=P+Z-B,J=P-Z;X>0&&(P-=X),J<0&&(P+=-J)}else P-=D/2,t.anchor="end";w.attr("text-anchor",t.anchor),E&&A.attr("text-anchor",t.anchor),e.attr("transform",s(P,I)+(c?l(_):""))})),_t}function O(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(h[c+"other"]=h[c+"Val"],h[c+"otherLabel"]=h[c+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}function z(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(M+S),p=f+c*(t.txwidth+S),d=0,m=t.offset,g="middle"===s;g&&(f-=t.tx2width/2,p+=t.txwidth/2+S),e&&(m*=-A,d=t.offset*k),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*M+d)+","+o(M+m)+"v"+o(t.by/2-M)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*M+d)+"V"+o(m-M)+"Z");var v=d+f,y=m+t.ty0-t.by/2+S,x=t.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==s?(i.attr("text-anchor","start"),v=g?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===x&&"end"!==s&&(i.attr("text-anchor","end"),v=g?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(v),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(p+c*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,a(p+(c-1)*t.tx2width/2+d),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function D(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}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:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+m.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 h=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"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 R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var d=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,v,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(g=c.pointerX,v=c.pointerY):(g=n._offset+y.x,v=i._offset+y.y);var x,b,_=a.readability(y.color,d)<1.5?p.contrast(d):y.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||_,A=m.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,b=g),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),x=l.l+M*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?T:-T),cy:v,r:T,fill:k}).classed("spikeline",!0)}if(f){var E,L,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(E=c.pointerX,L=c.pointerY):(E=n._offset+C.x,L=i._offset+C.y);var P,I,O=a.readability(C.color,d)<1.5?p.contrast(d):C.color,z=n.spikemode,D=n.spikethickness,R=n.spikecolor||O,F=m.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(P=F,I=L),-1!==z.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==n.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function V(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],h=c[1],p=u[0],d=u[1];return{x:f,y:h,width:p-f,height:d-h,top:Math.min(h,d),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(h,d)}}},{"../../lib":515,"../../lib/events":504,"../../lib/override_cursor":526,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"../../registry":647,"../color":367,"../dragelement":386,"../drawing":389,"../legend/defaults":419,"../legend/draw":420,"./constants":401,"./helpers":403,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:313}],405:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.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":515,"../color":367,"./helpers":403}],406:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":515,"./layout_attributes":408}],407:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":515,"../dragelement":386,"./attributes":398,"./calc":399,"./click":400,"./constants":401,"./defaults":402,"./helpers":403,"./hover":404,"./layout_attributes":408,"./layout_defaults":409,"./layout_global_defaults":410,"@plotly/d3":58}],408:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes"),a=i({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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),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":594,"./constants":401}],409:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":515,"./hoverlabel_defaults":405,"./hovermode_defaults":406,"./layout_attributes":408}],410:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":515,"./hoverlabel_defaults":405,"./layout_attributes":408}],411:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("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:a({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"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),h=0;h1){if(!h&&!p&&!d)"independent"===k("pattern")&&(h=!0);g._hasSubplotGrid=h;var x,b,_="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),g._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,v,_)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,h=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(d){var x=h.subplots||[];l=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1===_&&(e.legend=void 0),(!1!==_||f.uirevision)&&(p("uirevision",e.uirevision),!1!==_)){p("bgcolor",e.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,T,k,A=i.coerceFont(p,"font",e.font),M="h"===p("orientation");if(M?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(T=1.1,k="bottom"):(T=-.1,k="top")):(w=1.02,T=1,k="auto"),p("traceorder",x),c.isGrouped(e.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",T),p("yanchor",k),p("valign"),i.noneOrAll(f,h,["x","y"]),p("title.text")){p("title.side",M?"left":"top");var S=i.extendFlat({},A,{size:i.bigFont(A.size)});i.coerceFont(p,"title.font",S)}}}},{"../../lib":515,"../../plot_api/plot_template":555,"../../plots/attributes":562,"../../plots/layout_attributes":619,"../../registry":647,"./attributes":417,"./helpers":423}],420:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),p=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,g=d.FROM_TL,v=d.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function w(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function T(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(c.font,a).text(h?k(n,d):n);var g=r.itemwidth+2*p.itemGap;f.positionText(m,g,0),h?m.call(f.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(k(n,d)).call(M,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),c=h.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):M(m,t,e,r)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function A(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.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||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function M(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,h,d=s.size*m;if(o){var g=c.bBox(o);u=g.height,h=g.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var v=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(v),x=v.node();if(u=d*y,h=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(h+=2*p.itemGap),f.positionText(v,l+p.titlePad,l+d);else{var b=2*p.itemGap+r.itemwidth;i.groupTitle&&(b=p.itemGap,h-=r.itemwidth),f.positionText(v,b,-d*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=d,i.height=Math.max(u,16)+3,i.width=h)}(e,r,n,i)}))}function S(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function E(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,d=e._inHover;d?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var m=f.hiddenlabels||[];if(!(d||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),a.autoMargin(t,"legend");var k=i.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),L=i.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),C=i.ensureSingle(k,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var P=i.ensureSingle(k,"g","scrollbox"),I=e.title;if(e._titleWidth=0,e._titleHeight=0,I.text){var O=i.ensureSingle(P,"text","legendtitletext");O.attr("text-anchor","start").call(c.font,I.font).text(I.text),M(O,P,t,e,1)}else P.selectAll(".legendtitletext").remove();var z=i.ensureSingle(k,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),D=P.selectAll("g.groups").data(s);D.enter().append("g").attr("class","groups"),D.exit().remove();var R=D.selectAll("g.traces").data(i.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(T,t,e)})).call(x,t,e).each((function(){d||n.select(this).call(A,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=b.isVertical(i),l=b.isGrouped(i),u="fraction"===i.entrywidthmode,f=i.borderwidth,h=2*f,d=p.itemGap,m=i.itemwidth+2*d,g=2*(f+d),v=E(i),y=i.y<0||0===i.y&&"top"===v,x=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,T={};i._maxHeight=Math.max(y||x?a.height/2:o.h,30);var k=0;i._width=0,i._height=0;var A=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+A[0],f+A[1]+i._height+e/2+d),i._height+=e,i._width=Math.max(i._width,t[0].width)})),k=m+i._width,i._width+=d+m+h,i._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var M=S(i),L=i.x<0||0===i.x&&"right"===M,C=i.x>1||1===i.x&&"left"===M,P=x||y,I=a.width/2;i._maxWidth=Math.max(L?P&&"left"===M?o.l+o.w:I:C?P&&"right"===M?o.r+o.w:I:o.w,2*m);var O=0,z=0;r.each((function(t){var e=_(t,i,m);O=Math.max(O,e),z+=e})),k=null;var D=0;if(l){var R=0,F=0,B=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,i,m),a=r[0].height;c.setTranslate(this,A[0],A[1]+f+d+a/2+e),e+=a,t=Math.max(t,n),T[r[0].trace.legendgroup]=t}));var r=t+d;F>0&&r+f+F>i._maxWidth?(D=Math.max(D,F),F=0,B+=R+w,R=e):R=Math.max(R,e),c.setTranslate(this,F,B),F+=r})),i._width=Math.max(D,F)+f,i._height=B+R+g}else{var N=r.size(),j=z+h+(N-1)*d=i._maxWidth&&(D=Math.max(D,q),V=0,H+=U,i._height+=U,U=0),c.setTranslate(this,A[0]+f+V,A[1]+f+H+e/2+d),q=V+r+d,V+=n,U=Math.max(U,e)})),j?(i._width=V+h,i._height=U+g):(i._width=Math.max(D,q)+h,i._height+=U+g)}}i._width=Math.ceil(Math.max(i._width+A[0],i._titleWidth+2*(f+p.titlePad))),i._height=Math.ceil(Math.max(i._height+A[1],i._titleHeight+2*(f+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,Y=G.legendText||G.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=t[0].trace.legendgroup,o=_(t,i,m);l&&""!==a&&(o=T[a]);var f=Y?m:k||o;s||u||(f+=d/2),c.setRect(e,0,-r/2,f,r)}))}(t,D,R,e)},function(){var s,u,m,y,x=f._size,b=e.borderwidth;if(!d){if(function(t){var e=t._fullLayout.legend,r=S(e),n=E(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*v[r],b:e._effHeight*v[n],t:e._effHeight*g[n]})}(t))return;var _=x.l+x.w*e.x-g[S(e)]*e._width,T=x.t+x.h*(1-e.y)-g[E(e)]*e._effHeight;if(f.margin.autoexpand){var A=_,M=T;_=i.constrain(_,0,f.width-e._width),T=i.constrain(T,0,f.height-e._effHeight),_!==A&&i.log("Constrain legend.x to make legend fit inside graph"),T!==M&&i.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(k,_,T)}if(z.on(".drag",null),k.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var I=e._effHeight;d&&(I=e._height),C.attr({width:e._width-b,height:I-b,x:b/2,y:b/2}),c.setTranslate(P,0,0),L.select("rect").attr({width:e._width-2*b,height:I-2*b,x:b,y:b}),c.setClipUrl(P,h,t),c.setRect(z,0,0,0,0),delete e._scrollY}else{var O,D,R,F=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*p.scrollBarMargin,N=e._height-e._effHeight,j=B/N,U=Math.min(e._scrollY||0,N);C.attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-b,x:b/2,y:b/2}),L.select("rect").attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-2*b,x:b,y:b+U}),c.setClipUrl(P,h,t),q(U,F,j),k.on("wheel",(function(){q(U=i.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==U&&U!==N&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;O="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,N)}(R,O,D),F,j))}));z.call(V);var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(O=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,q(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,N)}(R,O,D),F,j))}));P.call(H)}function q(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(P,0,-r),c.setRect(z,e._width,p.scrollBarMargin+r*i,p.scrollBarWidth,n),L.select("rect").attr("y",b+r)}t._context.edits.legendPosition&&(k.classed("cursor-move",!0),l.init({element:k.node(),gd:t,prepFn:function(){var t=c.getTranslate(k);m=t.x,y=t.y},moveFn:function(t,r){var n=m+t,i=y+r;c.setTranslate(k,n,i),s=l.align(n,0,x.l,x.l+x.w,e.xanchor),u=l.align(i,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=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}));i.size()>0&&w(t,k,i,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":483,"../../lib":515,"../../lib/events":504,"../../lib/svg_text_utils":541,"../../plots/plots":628,"../../registry":647,"../color":367,"../dragelement":386,"../drawing":389,"./constants":418,"./get_legend_data":421,"./handle_click":422,"./helpers":423,"./style":425,"@plotly/d3":58}],421:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,h={},p=0,d=0;function m(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rA&&(k=A)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var M=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var v=e._fullLayout;r||(r=v.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function T(t,a,o){var u=t[0].trace,f=u.marker||{},h=f.line||{},p=o?u.visible&&u.type===o:i.traceIs(u,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var p=a.mcc;if(!r._inHover&&"mc"in a){var d=c(f),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),p=s.tryColorscale(f,"")(m)}var v=p||a.mc||f.color,y=f.pattern,x=y&&s.getPatternAttr(y.shape,0,"");if(x){var b=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,k=g(y.size,8,10),A=g(y.solidity,.5,1),M="legend-"+u.uid;i.call(s.pattern,"legend",e,M,x,k,A,p,y.fillmode,b,_,T)}else i.call(l.fill,v);o&&l.stroke(i,a.mlc||h.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,p=w(h(u.width,o.pts),u,5,2),d=a.minExtend(s,{marker:{line:{width:p}}});d.marker.line.color=u.color;var m=a.minExtend(o,{trace:d});f(c,m,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.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,i=t[0].trace,o=[];if(i.visible)switch(i.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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),h=c(i),p=h.colorscale,m=h.reversescale;if(p){if(!r){var g=p.length;u=0===o?p[m?g-1:0][1]:1===o?p[m?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(v)?v[o]||v[0]:v}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(m,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&r&&(a=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(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,i,o=m(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,p=o.showGradientFill,g=o.anyFill,v=o.anyLine,y=t[0],b=y.trace,_=c(b),T=_.colorscale,k=_.reversescale,A=u.hasMarkers(b)||!g?"M5,0":v?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(l||p?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+x+"v6h-"+x+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+b.uid;s.gradient(t,e,r,d(k),T,"fill")}})),f||h){var E=w(void 0,b.line,10,5);i=a.minExtend(b,{line:{width:E}}),r=[a.minExtend(y,{trace:i})]}var L=M.select(".legendlines").selectAll("path").data(f||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",A+(h?"l"+x+",0.0001":"h"+x)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+b.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,i,o=m(t),l=o.anyFill,c=o.anyLine,f=o.showLine,h=o.showMarker,p=t[0],d=p.trace,g=!h&&!c&&!l&&u.hasText(d);function v(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(h||g||f){var b={},w={};if(h){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",a.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",a.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:v("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[a.minExtend(p,b)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var k=n.select(this).select("g.legendpoints"),A=k.selectAll("path.scatterpts").data(h?r:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),A.exit().remove(),A.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var M=k.selectAll("g.pointtext").data(g?r:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),M.exit().remove(),M.selectAll("text").call(s.textPointStyle,i,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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":515,"../../registry":647,"../../traces/pie/helpers":915,"../../traces/pie/style_one":921,"../../traces/scatter/subtypes":961,"../color":367,"../colorscale/helpers":378,"../drawing":389,"./constants":418,"@plotly/d3":58}],426:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":428}],427:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h=c._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(i=0;i1?(I=["toggleHover"],O=["resetViews"]):v?(P=["zoomInGeo","zoomOutGeo"],I=["hoverClosestGeo"],O=["resetGeo"]):g?(I=["hoverClosest3d"],O=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(P=["zoomInMapbox","zoomOutMapbox"],I=["toggleHover"],O=["resetViewMapbox"]):b?I=["hoverClosestGl2d"]:y?I=["hoverClosestPie"]:A?(I=["hoverClosestCartesian","hoverCompareCartesian"],O=["resetViewSankey"]):I=["toggleHover"];m&&(I=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t=0;k--){var A=r.append("path").attr(g).style("opacity",k?.1:v).call(o.stroke,x).call(o.fill,y).call(s.dashLine,k?"solid":_,k?4+b:b);if(d(A,t,a),w){var M=l(t.layout,"selections",a);A.style({cursor:"move"});var S={element:A.node(),plotinfo:p,gd:t,editHelpers:M,isActiveSelection:!0},E=n(c,t);i(E,A,S)}else A.style("pointer-events",k?"all":"none");T[k]=A}var L=T[0];T[1].node().addEventListener("click",(function(){return function(t,e){if(!h(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void m(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=m,f(t)}}(t,L)}))}(t._fullLayout._selectionLayer)}function d(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function m(t){h(t)&&(t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t)))}e.exports={draw:f,drawOne:p,activateLastSelection:function(t){if(!h(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=m,f(t)}}},{"../../plot_api/plot_template":555,"../color":367,"../drawing":389,"../shapes/display_outlines":461,"../shapes/draw_newshape/helpers":466,"../shapes/handle_outline":468,"../shapes/helpers":469}],451:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":505,"../../drawing/attributes":388}],452:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],453:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,i=t("../../shapes/handle_outline").clearOutline,a=t("../../shapes/draw_newshape/helpers"),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,f=e.plotinfo,h=f.xaxis,p=f.yaxis,d=e.isActiveSelection,m=e.dragmode,g=(c.layout||{}).selections||[];if(!n(m)&&void 0!==d){var v=c._fullLayout._activeSelectionIndex;if(v-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){Y(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=K(_))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=p(r),l=m(r);if(s||l){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&i._fullLayout._outlining)s&&(c=T(f,t)),c&&a.call("_guiRelayout",i,{shapes:c}),l&&!U(t)&&(u=k(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:u}).then((function(){e&&A(i)}))),i._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Z(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Z),c=r.map(Z);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,pt=et[0].yref;if(nt&&pt){var dt=ct(et);ut([C(t,nt,"x"),C(t,pt,"y")])($,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),h._reselect=!1}if(!a&&h._deselect){var mt=h._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!x){var r=A.clickmode;L.done(At).then((function(){if(L.clear(At),2===t){for(bt.remove(),K=0;K-1&&V(e,k,n.xaxes,n.yaxes,n.subplot,n,bt),"event"===r&&ft(k,void 0);l.click(k,e)})).catch(M.error)}},n.doneFn=function(){kt.remove(),L.done(At).then((function(){L.clear(At),!S&&J&&n.selectionDefs&&(J.subtract=xt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Z)),(S||x)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(Mt),b&&ft(k,at)})).catch(M.error)}},clearOutline:x,clearSelectionsCache:W,selectOnClick:V}},{"../../lib":515,"../../lib/clear_gl_canvases":499,"../../lib/polygon":527,"../../lib/throttle":542,"../../plot_api/subroutines":556,"../../plots/cartesian/axis_ids":570,"../../registry":647,"../color":367,"../dragelement/helpers":385,"../drawing":389,"../fx":407,"../fx/helpers":403,"../shapes/constants":459,"../shapes/display_outlines":461,"../shapes/draw_newshape/helpers":466,"../shapes/draw_newshape/newshapes":467,"../shapes/handle_outline":468,"../shapes/helpers":469,"./constants":448,"./draw":450,"./draw_newselection/newselections":453,"./helpers":454,"point-in-polygon/nested":254,polybooljs:255}],457:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{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":484,"../../lib/extend":505,"../../plot_api/plot_template":555,"../../traces/scatter/attributes":936,"../annotations/attributes":350,"../drawing/attributes":388}],458:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),d=p<0?Math.abs(p)+c:c,m=h>0?h+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,p=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=f)));return p>=h?[h,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;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===E&&(t[0][0]="M"),e[S]=t,T(),k())}}()}}function B(t,r){!function(t,r){if(e.length)for(var n=0;nx?(k=f,E="y0",A=x,L="y1"):(k=x,E="y1",A=f,L="y0");X(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),Z.moveFn="move"===O?J:K,Z.altKey=n.altKey},doneFn:function(){if(y(t))return;p(e),$(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(y(t))return;$(s)}};function X(r){if(y(t))O=null;else if(R)O="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";p(e,l),O=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;z?B("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(q(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else z?B("xanchor",r.xanchor=G(b+n)):(B("x0",r.x0=G(c+n)),B("x1",r.x1=G(v+n))),D?B("yanchor",r.yanchor=Y(T+i)):(B("y0",r.y0=Y(f+i)),B("y1",r.y1=Y(x+i)));e.attr("d",g(t,r)),Q(s,r)}function K(n,i){if(F){var a=function(t){return t},o=a,l=a;z?B("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(q(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===O){var u=c+n,h=D?f-i:f+i;B("x0",r.x0=z?u:G(u)),B("y0",r.y0=D?h:Y(h))}else if("resize-over-end-point"===O){var p=v+n,d=D?x-i:x+i;B("x1",r.x1=z?p:G(p)),B("y1",r.y1=D?d:Y(d))}}else{var y=function(t){return-1!==O.indexOf(t)},_=y("n"),j=y("s"),V=y("w"),W=y("e"),Z=_?k+i:k,X=j?A+i:A,J=V?M+n:M,K=W?S+n:S;D&&(_&&(Z=k-i),j&&(X=A-i)),(!D&&X-Z>10||D&&Z-X>10)&&(B(E,r[E]=D?Z:Y(Z)),B(L,r[L]=D?X:Y(X))),K-J>10&&(B(C,r[C]=z?J:G(J)),B(P,r[P]=z?K:G(K)))}e.attr("d",g(t,r)),Q(s,r)}function Q(t,e){(z||D)&&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 a=H(z?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=q(D?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),z&&D){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(Z),W.node().onmousemove=X}(t,z,l,e,r,O):!0===l.editable&&z.style("pointer-events",P||c.opacity(S)*M<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!x(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,z)}))}}function _(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 w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){x(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!x(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&lp&&(t="X"),t}));return a>p&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d}))}(e,s,c);if("pixel"===e.xsizemode){var b=s(e.xanchor);u=b+e.x0,f=b+e.x1}else u=s(e.x0),f=s(e.x1);if("pixel"===e.ysizemode){var _=c(e.yanchor);h=_-e.y0,p=_-e.y1}else h=c(e.y0),p=c(e.y1);if("line"===d)return"M"+u+","+h+"L"+f+","+p;if("rect"===d)return"M"+u+","+h+"H"+f+"V"+p+"H"+u+"Z";var w=(u+f)/2,T=(h+p)/2,k=Math.abs(w-u),A=Math.abs(T-h),M="A"+k+","+A,S=w+k+","+T;return"M"+S+M+" 0 1,1 "+(w+","+(T-A))+M+" 0 0,1 "+S+"Z"}},{"../../lib":515,"../../plots/cartesian/axes":566,"./constants":459}],470:[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":577,"./attributes":457,"./calc_autorange":458,"./defaults":460,"./draw":462,"./draw_newshape/defaults":465}],471:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps: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:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt: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":505,"../../plot_api/edit_types":548,"../../plot_api/plot_template":555,"../../plots/animation_attributes":560,"../../plots/font_attributes":594,"../../plots/pad_attributes":627,"./constants":472}],472:[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}},{}],473:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function L(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 C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,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=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,v);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform",l(v[0],v[1]))}}}return R.call(F),O&&(E?R.on(".opacity",null):(A=0,M=!0,R.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?o.call("_guiRestyle",t,v,e,x):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),R.classed("js-placeholder",M),T}}},{"../../constants/alignment":483,"../../constants/interactions":490,"../../lib":515,"../../lib/svg_text_utils":541,"../../plots/plots":628,"../../registry":647,"../color":367,"../drawing":389,"@plotly/d3":58,"fast-isnumeric":190}],477:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":505,"../../plot_api/edit_types":548,"../../plot_api/plot_template":555,"../../plots/font_attributes":594,"../../plots/pad_attributes":627,"../color/attributes":366}],478:[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"}}},{}],479:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(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,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":515,"../../plots/array_container_defaults":561,"./attributes":477,"./constants":478}],480:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function p(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||v(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(M,i,h,p),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),v(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function v(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=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(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,g=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=v.headerHeight+f.gapButtonHeader:d=v.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+g+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(s,l){var c=n.select(this);c.call(y,o,s,t).call(M,o,b),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,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(v.openWidth,v.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,p=i.active;if(u)for(s=0,l=0;l0?[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(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,p);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,E=g+v;E+M>c&&(E=c-M);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>T,P=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,O=d+m,z=g;O+P>l&&(O=l-P);var D=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:O,y:z,width:P,height:I}),this._vbarYMin=z+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=C?f+P+.5:f+.5,N=h-.5,j=k?p+M+.5:p+.5,U=o._topdefs.selectAll("#"+R).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||C){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=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(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":515,"../color":367,"../drawing":389,"@plotly/d3":58}],483:[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"}}},{}],484:[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(" ")}}},{}],485:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],486:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],487:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],488:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],489:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],490:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],491:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],492:[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}},{}],493:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],495:[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}},{}],496:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,h,p,d,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(u=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":522}],497:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(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(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(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],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),L=Number(T[11]||0);if(c){if(2===k.length)return u;var C;k=Number(k);try{var P=g.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===A.charAt(A.length-1);A=parseInt(A,10),C=P.newDate(k,P.toMonthIndex(k,A,I),M)}else C=P.newDate(k,Number(A),M)}catch(t){return u}return C?(C.toJD()-m)*f+S*h+E*p+L*d:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),A-=1;var O=new Date(Date.UTC(2e3,A,M,S,E));return O.setUTCFullYear(k),O.getUTCMonth()!==A||O.getUTCDate()!==M?u:O.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=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*h,A=5*p;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/f)+m,E=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=v("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a("%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 s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,E=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function C(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(E,(function(){return L[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var I=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+m,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+I);return c.setUTCMonth(c.getUTCMonth()+e)+n-I},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,p=c-a,d=u*u+f*f,m=h*h+p*p,g=Math.min(l(u,f,d,i-t,a-e),l(u,f,d,o-t,c-e),l(h,p,m,t-i,e-a),l(h,p,m,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var p=h(c);p;){if((c+=p+r)>f)return;p=h(c)}for(p=h(f);p;){if(c>(f-=p+r))return;p=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,p=s;f0?p=i:h=i,f++}return a}},{"./mod":522}],511:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,p,d,m=t.color,g=l(m),v=l(e),y=o.extractOpts(t),x=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=g?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=v?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||v)for(var b=0;b1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],515:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var p=t("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var d=t("./mod");f.mod=d.mod,f.modHalf=d.modHalf;var m=t("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var g=t("./dates");f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var v=t("./search");f.findBin=v.findBin,f.sorterAsc=v.sorterAsc,f.sorterDes=v.sorterDes,f.distinctVals=v.distinctVals,f.roundUp=v.roundUp,f.sort=v.sort,f.findIndexOfMin=v.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var x=t("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=t("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=t("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");f.log=k.log,f.warn=k.warn,f.error=k.error;var A=t("./regex");f.counterRegex=A.counter;var M=t("./throttle");f.throttle=M.throttle,f.throttleDone=M.done,f.clearThrottle=M.clear;var S=t("./dom");function E(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.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},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return z.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var D={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return B.apply(D,arguments)};var R={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,h,p="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||p||m||d,v=s;if((p||d)&&(v=v.substring(1)),(m||d)&&(v=v.substring(0,v.length-1)),g){if(void 0===(c=e[v]))return""}else for(h=3;h=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var N=2e9;f.seedPseudoRandom=function(){N=2e9},f.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?f.pseudoRandom():N/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.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;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.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)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":491,"./anchor_utils":495,"./angles":496,"./array":497,"./clean_number":498,"./clear_responsive":500,"./coerce":501,"./dates":502,"./dom":503,"./extend":505,"./filter_unique":506,"./filter_visible":507,"./geometry2d":510,"./identity":513,"./increment":514,"./is_plain_object":516,"./keyed_container":517,"./localize":518,"./loggers":519,"./make_trace_groups":520,"./matrix":521,"./mod":522,"./nested_property":523,"./noop":524,"./notifier":525,"./preserve_drawing_buffer":529,"./push_unique":530,"./regex":532,"./relative_attr":533,"./relink_private":534,"./search":535,"./sort_object_keys":538,"./stats":539,"./throttle":542,"./to_log_range":543,"@plotly/d3":58,"d3-format":112,"d3-time-format":120,"fast-isnumeric":190}],516:[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).hasOwnProperty("hasOwnProperty")}},{}],517:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":553,"./notifier":525}],520:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":58}],521:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],523:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,h,p,d,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,v)))if(cu||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":491,"./matrix":521}],528:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e,a){var o=t._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[],cachedCode:a||{}})}catch(t){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":537,regl:284}],529:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":190,"is-mobile":234}],530:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}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 a,o,f=0,h=e.length,p=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":497,"fast-isnumeric":190}],540:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":89}],541:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var M=t.text(),S=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&M.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),S?(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 a,o,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2!==h&&3!==h)return void i.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(a):MathJax.typeset([a])},d=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,d,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),d(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}(S[2],o,(function(n,i,o){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return I(),void e();var l=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:P,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",h=s.select("g");h.attr({fill:f,stroke:f});var p=h.node().getBoundingClientRect(),d=p.width,g=p.height;(d>c||g>u)&&(s.style("overflow","hidden"),d=(p=s.node().getBoundingClientRect()).width,g=p.height);var v=+t.attr("x"),y=+t.attr("y"),x=-(r||t.node().getBoundingClientRect().height)/4;if("y"===P[0])l.attr({transform:"rotate("+[-90,v,y]+")"+a(-d/2,x-g/2)});else if("l"===P[0])y=x-g/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))v=0,y=x;else{var b=t.attr("text-anchor");v-=d*("middle"===b?.5:"end"===b?1:0),y=y+x-g/2}s.attr({x:v,y:y}),m&&m.call(t,l),e(l)}))}))):I(),t}function I(){C.empty()||(P=t.attr("class")+"-math",C.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}x.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(v),C=0;C|>|>)/g;var f=[["$","$"],["\\(","\\)"]];var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//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&&E(n)}var A=/(^|;)\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"],i="...".length,a=t.split(v),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,d-i)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(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)):M[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==m.indexOf(i)&&-1!==m.indexOf(a)?e:""}function C(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(v),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.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)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],543:[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":190}],544:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":596,"topojson-client":316}],545:[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"}}},{}],546:[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"}}},{}],547:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&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 a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),d(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;e0)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;n1&&a.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 a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(g,v),p(t),!0)}var x,b,_,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),E=e.get(),L=E||[],C=u(v,f).get(),P=[],I=-1,O=L.length;for(x=0;xL.length-(A?0:1))a.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?P.push(_):A?("add"===k&&(k={}),L.splice(_,0,k),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,k),-1===I&&(I=_);else for(b=0;b=0;x--)L.splice(P[x],1),C&&C.splice(P[x],1);if(L.length?E||e.set(L):e.set(null),m)return!1;if(h(g,v),d!==i){var z;if(-1===I)z=S;else{for(O=Math.max(L.length,O),z=[],x=0;x=I);x++)z.push(_);for(x=I;x=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,h=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(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 i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&H(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(M)),s.push(h.rehover,h.redrag,h.reselect),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[p.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function H(t,e){var r=e?function(t){var r=[];for(var n in e){var i=p.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return p.draw(t,r,{skipTitle:!0})}:function(t){return p.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,h=F(l._preGUI,c),d=Object.keys(e),m=p.list(t),g=o.extendDeepAll({},e),v={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof O.parts[D];)D--;var B=O.parts[D],N=O.parts[D-1]+"."+B,U=O.parts.slice(0,D).join("."),V=s(t.layout,U).get(),H=s(l,U).get(),W=O.get();if(void 0!==z){M[I]=z,S[I]="reverse"===B?z:R(W);var X=f.getLayoutValObject(l,O.parts);if(X&&X.impliedEdits&&null!==z)for(var J in X.impliedEdits)E(o.relativeAttr(I,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(I))if(z){E("autosize",null);var K="height"===I?"width":"height";E(K,l[K])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)E("width",z?null:l.width),E("height",z?null:l.height);else if(N.match(q))P(N),s(l,U+"._inputRange").set(null);else if(N.match(G)){P(N),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(Y)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var $="linear"===H.type&&"log"===z,tt="log"===H.type&&"linear"===z;if($||tt){if(L&&L.range)if(H.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&E(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),E(U+".range[0]",Math.log(et)/Math.LN10),E(U+".range[1]",Math.log(rt)/Math.LN10)):(E(U+".range[0]",Math.pow(10,et)),E(U+".range[1]",Math.pow(10,rt)))}else E(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[O.parts[0]]&&"radialaxis"===O.parts[1]&&delete l[O.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,H,z,E),u.getComponentMethod("images","convertCoords")(t,H,z,E)}else E(U+".autorange",!0),E(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,I).get(),it=(z||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,E),u.getComponentMethod("images","convertCoords")(t,nt,it,E)}var at=b.containerArrayMatch(I);if(at){r=at.array,n=at.index;var ot=at.property,st=X||{editType:"calc"};""!==n&&""===ot&&(b.isAddVal(z)?S[I]=null:b.isRemoveVal(z)?S[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(A,st),v[r]||(v[r]={});var lt=v[r][n];lt||(lt=v[r][n]={}),lt[ot]=z,delete e[I]}else"reverse"===B?(V.range?V.range.reverse():(E(U+".autorange",!0),V.range=[1,0]),H.autorange?A.calc=!0:A.plot=!0):("dragmode"===I&&(!1===z&&!1!==W||!1!==z&&!1===W)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===z||"select"===z)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?A.plot=!0:X?T.update(A,X):A.calc=!0,O.set(z))}}for(r in v){b.applyContainerArrayChanges(t,h(a,r),v[r],A,h)||(A.plot=!0)}for(var ct in C){var ut=(L=p.getFromId(t,ct))&&L._constraintGroup;if(ut)for(var ft in A.calc=!0,ut)C[ft]||(p.getFromId(t,ft)._constraintShrinkable=!0)}return(Z(t)||e.height||e.width)&&(A.plot=!0),(A.plot||A.calc)&&(A.layoutReplot=!0),{flags:A,rangesAltered:C,undoit:S,redoit:M,eventData:g}}function Z(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function X(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=N(t,o.extendFlat({},e),a),l=s.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):l.fullReplot?p.push(r._doPlot):(p.push(h.previousPromises),V(t,f,u)||h.supplyDefaults(t),l.style&&p.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&H(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(M)),p.push(h.rehover,h.redrag,h.reselect),c.add(t,X,[t,s.undoit,u.undoit,s.traces],X,[t,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(p,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}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(a,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,h.transition(t,e.frame.data,e.frame.layout,_.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 d,m,g=0;function v(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:v(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&A.push(m);y=A}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(u[m]||d[m]||{}).name,v=e[n].name,y=u[g]||d[g];g&&v&&"number"==typeof v&&y&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(u[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},p.push({frame:h.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=0;n--){if("number"==typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,s],p=[t,a];return c&&c.add(t,l,f,u,p),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,h=[e,l],p=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function x(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return v(i,e,s)},r.getLayoutValObject=function(t,e){return v(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":515,"../plots/attributes":562}],556:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,g=d.clean,v=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function x(t){var e,i,s,u,d,m,g=t._fullLayout,v=g._size,x=v.p,_=h.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return a.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:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:v.l+v.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 A=[],M=[],S=[],E=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var L=s.xaxis.domain,C=s.yaxis.domain,P=s.plotgroup;if(y(L,C,S)){var I=P.node(),O=s.bg=o.ensureSingle(P,"rect","bg");I.insertBefore(O.node(),I.childNodes[0]),M.push(i)}else P.select("rect.bg").remove(),S.push([L,C]),E||(A.push(i),M.push(i))}var z,D,R,F,B,N,j,U,V,H,q,G,Y,W=g._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){g._plots[t].bg=n.select(this)})),e=0;eT?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 a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:p,layout:h},""),u.length)return u.map(v)}},{"../lib":515,"../plots/attributes":562,"../plots/plots":628,"./plot_config":553,"./plot_schema":554,"./plot_template":555}],558:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=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,h,p,d;function m(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},p=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function v(t,r){return o.coerce(e,g,f,t,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=o.extendFlat({},h);x?A.width=x:null===e.width&&n(d.width)&&(A.width=d.width),b?A.height=b:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function h(){i.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=a.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),h(),t(T?p:s.encodeJSON(p))}if(h(),"svg"===y)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(k,r,A,M).then(S).then(E).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":515,"../plots/plots":628,"../snapshot/helpers":651,"../snapshot/svgtoimg":653,"../snapshot/tosvg":655,"../version":1132,"./plot_api":552,"fast-isnumeric":190}],559:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hx.length&&i.push(d("unused",a,v.concat(x.length)));var A,M,S,E,L,C=x.length,P=Array.isArray(k);if(P&&(C=Math.min(C,k.length)),2===b.dimensions)for(M=0;Mx[M].length&&i.push(d("unused",a,v.concat(M,x[M].length)));var I=x[M].length;for(A=0;A<(P?Math.min(I,k[M].length):I);A++)S=P?k[M][A]:k,E=y[M][A],L=x[M][A],n.validate(E,S)?L!==E&&L!==+E&&i.push(d("dynamic",a,v.concat(M,A),E,L)):i.push(d("value",a,v.concat(M,A),E))}else i.push(d("array",a,v.concat(M),y[M]));else for(M=0;M1&&p.push(d("object","layout"))),i.supplyDefaults(m);for(var g=m._fullData,v=r.length,y=0;y0&&Math.round(f)===f))return{vals:i};c=f}for(var h=e.calendar,p="start"===l,d="end"===l,m=t[r+"period0"],g=a(m,h)||0,v=[],y=[],x=[],b=i.length,_=0;_A;)k=o(k,-c,h);for(;k<=A;)k=o(k,c,h);T=o(k,-c,h)}else{for(k=g+(w=Math.round((A-g)/u))*u;k>A;)k-=u;for(;k<=A;)k+=u;T=k-u}v[_]=p?T:d?k:(T+k)/2,y[_]=T,x[_]=k}return{vals:v,starts:y,ends:x}}},{"../../constants/numerical":491,"../../lib":515,"fast-isnumeric":190}],564:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],565:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=m(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=u[0].val,g=f[0].val;for(r=1;r0&&((T=E-s(x)-l(b))>L?k/T>C&&(_=x,w=b,C=k/T):k/E>C&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},C=k/E));if(h===g){var P=h-1,I=h+1;if(M)if(0===h)i=[0,1];else{var O=(h>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,O/E));i=h>0?[0,z]:[z,0]}else i=S?[Math.max(0,P),Math.max(1,I)]:[P,I]}else M?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(e,x.val,b.val))/(E-s(_)-l(w)),i=[_.val-C*s(_),w.val+C*l(w)];return v&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),L=A(r.vpadminus||r.vpad);if(!T){if(h=1/0,p=-1/0,w)for(n=0;n0&&(h=a),a>p&&a-o&&(h=a),a>p&&a=I;n--)P(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function h(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":389,"../../constants/numerical":491,"../../lib":515,"../../registry":647,"./axis_ids":570,"@plotly/d3":58,"fast-isnumeric":190}],566:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),p=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),g=m.ONEMAXYEAR,v=m.ONEAVGYEAR,y=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,A=m.ONEWEEK,M=m.ONEDAY,S=M/2,E=m.ONEHOUR,L=m.ONEMIN,C=m.ONESEC,P=m.MINUS_SIGN,I=m.BADNUM,O={K:"zeroline"},z={K:"gridline",L:"path"},D={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},B={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},N=t("../../constants/alignment"),j=N.MID_SHIFT,U=N.CAP_SHIFT,V=N.LINE_SPACING,H=N.OPPOSITE_SIDE,q=e.exports={};q.setConvert=t("./set_convert");var G=t("./axis_autotype"),Y=t("./axis_ids"),W=Y.idSort,Z=Y.isLinked;q.id2name=Y.id2name,q.name2id=Y.name2id,q.cleanId=Y.cleanId,q.list=Y.list,q.listIds=Y.listIds,q.getFromId=Y.getFromId,q.getFromTrace=Y.getFromTrace;var X=t("./autorange");q.getAutoRange=X.getAutoRange,q.findExtremes=X.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}q.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},q.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},q.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==q.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=q.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},q.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:q.getFromId(e,r).cleanPos)(t)},q.redrawComponents=function(t,e){e=e||q.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;ur&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},q.saveRangeInitial=function(t,e){for(var r=q.list(t,"",!0),n=!1,i=0;i.3*h||u(n)||u(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=q.tickIncrement(t,"M6","reverse")+1.5*M:a.exactMonths>.8?t=q.tickIncrement(t,"M1","reverse")+15.5*M:t-=S;var l=q.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,v,c,a)),g=y,0;g<=u;)g=q.tickIncrement(g,v,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(g,0,a),size:v,_dataSpan:u-c}},q.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=q.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,q.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),f=c?e.dtick:+e.dtick.substring(1),h=u?t.dtick:+t.dtick.substring(1);c&&u?tt(f,h)?f===2*A&&h===2*M&&(t.dtick=A):f===2*A&&h===3*M?t.dtick=A:f!==A||(e._input.minor||{}).nticks?et(f/h,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=M:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":tt(f,h)?f>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,h)||(t.dtick=et(f/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},q.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,q.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!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=q.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=E,o&&!n&&t.dtick=(O?0:1);z--){var D=!z;z?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var R=z?t:s.extendFlat({},t,t.minor);if(D?q.prepMinorTicks(R,t,e):q.prepTicks(R,e),"array"!==R.tickmode){var F=J(u),B=F[0],N=F[1],j=i(R.dtick),U="log"===a&&!(j||"L"===R.dtick.charAt(0)),V=q.tickFirst(R,e);if(z){if(t._tmin=V,V=N:W<=N;W=q.tickIncrement(W,Z,f,o)){if(z&&H++,R.rangebreaks&&!f){if(W=p)break}if(C.length>d||W===Y)break;Y=W;var X={value:W};z?(U&&W!==(0|W)&&(X.simpleLabel=!0),l>1&&H%l&&(X.skipLabel=!0),C.push(X)):(X.minor=!0,P.push(X))}}else z?(C=[],m=nt(t)):(P=[],L=nt(t))}if(O&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=C.map((function(t){return t.value})),Q=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,h=0;f>=y?h=u>=y&&u<=g?u:v:r===b&&f>=_?h=u>=_&&u<=x?u:b:f>=k?h=u>=k&&u<=w?u:T:r===A&&f>=A?h=A:f>=M?h=M:r===S&&f>=S?h=S:r===E&&f>=E&&(h=E),h>=u&&(h=u,s=!0);var p=i+h;if(e.rangebreaks&&h>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(i*(1-L)+L*p)!==I&&d++}(h*=d/84)||(t[n].drop=!0),s&&u>A&&(h=u)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(C,t,t._definedDelta),t.rangebreaks){var at="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=C.length-1;r>-1;r--)if(C[r].drop)C.splice(r,1);else{C[r].value=It(C[r].value,t);var lt=t.c2p(C[r].value);(at?st>lt-ot:stp||utp&&(ct.periodX=p),ut10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&a<=10||e>=15*M)t._tickround="d";else if(e>=L&&a<=16||e>=E)t._tickround="M";else if(e>=C&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(mt(t.exponentformat)&&!gt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function pt(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}}q.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>v)e/=v,n=a(10),t.dtick="M"+12*ft(e,n,it);else if(o>T)e/=T,t.dtick="M"+ft(e,1,at);else if(o>M){if(t.dtick=ft(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=q.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>E?t.dtick=ft(e,E,at):o>L?t.dtick=ft(e,L,ot):o>C?t.dtick=ft(e,C,ot):(n=a(10),t.dtick=ft(e,n,it))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=a(10),t.dtick="L"+ft(e,n,it)}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))):Pt(t)?(t.tick0=0,n=1,t.dtick=ft(e,n,ut)):(t.tick0=0,n=a(10),t.dtick=ft(e,n,it));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},q.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ct:lt,f=t+.01*o,h=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},q.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=vt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),p=t.exponentformat;"power"===p||mt(p)&>(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":P)+h+"",e.fontSize*=1.25):("e"===p||"E"===p)&&h>2?e.text="1"+p+(f>0?"+":P)+h:(e.text=vt(Math.pow(10,l),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,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,c,m):"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),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Pt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=vt(e.x,t,i,n);else{var a=e.x/180;if(0===a)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,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=vt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,c,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=vt(e.x,t,i,n)}(t,o,0,c,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},q.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return q.hoverLabelText(t,n,r)+" - "+q.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=q.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":P+o:o};var dt=["f","p","n","\u03bc","m","","k","M","G","T"];function mt(t){return"SI"===t||"B"===t}function gt(t){return t>14||t<-15}function vt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=q.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};ht(h),o=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,P);var p,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":mt(l)&&(t+=dt[c/3+5]));return a?P+t:t}function yt(t,e){if(t){var r=Object.keys(B).reduce((function(t,r){return-1!==e.indexOf(r)&&B[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function xt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),p.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var v=e._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),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[m]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==c._dfltTitle[d]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=h),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}it&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(yt(n,e.automargin),yt(i,e.automargin)),a.autoMargin(t,At(e),n),a.autoMargin(t,Mt(e),i),a.autoMargin(t,St(e),s)})),r.skipTitle||it&&"bottom"===e.side||rt.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+wt(e);else{var s=Ot(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"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,d,m=q.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,p="top"===e.side?m-r:m+r):(p=e._offset+e._length/2,f="right"===e.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(d={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var v=h.getTranslate(g.node().parentNode);d.offsetLeft=v.x,d.offsetTop=v.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:d,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function at(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=kt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},q.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},q.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},q.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=h*U,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=h*(1-U));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(bt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(bt(e)))}},q.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},q.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,d=0,m=h?t.ticklen:0;if(f?m*=-1:u&&(m=0),h&&(p+=m,r)){var g=s.deg2rad(r);p=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(h||t.showline)&&(p+=.2*t.tickfont.size);var v,y,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(f?-1:1),labelShift:d},T=0,k=t.side,A=t._id.charAt(0),M=t.tickangle;if("x"===A)b=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(b*=-1),v=d*b,y=e+p*b,x=_?1:-.2,90===Math.abs(M)&&(f?x+=j:x=-90===M&&"bottom"===k?U:90===M&&"top"===k?j:.5,T=j/2*(M/90)),w.xFn=function(t){return t.dx+v+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(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"===A){if(b=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(b*=-1),v=p,y=d*b,x=0,f||90!==Math.abs(M)||(x=-90===M&&"left"===k||90===M&&"right"===k?U:.5),f){var S=i(M)?+M:0;if(0!==S){var E=s.deg2rad(S);T=Math.abs(Math.sin(E))*U*b,x=0}}w.xFn=function(t){return t.dx+e-(v+t.fontSize*x)*b+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*j},w.anchorFn=function(t,e){return i(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},q.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,_t);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),zt(e,[R]),o.attr("transform",r.transFn)},q.drawGrid=function(t,e,r){r=r||{};var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&q.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;v--){var y=v?m:g;if(y){var x=y.selectAll("path."+i).data(v?s:o,_t);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}zt(e,[z,D])},q.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=q.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.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 W(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),zt(e,[O])},q.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(t){return t.text})),d=r.labelFns,m=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[f],v=r.layer.selectAll("g."+f).data(e.showticklabels?p:[],_t),y=[];function x(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),u=d.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),p=c.lineCount(o),m=V*t.fontSize,g=d.heightFn(t,i(a)?+a:0,(p-1)*m);if(g&&(f+=l(0,g)),s.empty()){var v=o.select("text");v.attr({transform:f,"text-anchor":u}),v.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var y=h.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(y,0))}}))}v.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,d.xFn(e),d.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){x(r,m)}))):x(r,m)})),zt(e,[F]),v.exit().remove(),r.repositionOnUpdate&&v.each((function(t){n.select(this).select("text").call(c.positionText,d.xFn(t),d.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),p=Math.max(l,c),d=e.side,m=1/0,g=-1/0;for(var y in v.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=h.bBox(r.node()),s=0;o?(a.right>p||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},x(v,g+1?g:m);var b=null;e._selections&&(e._selections[f]=v);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(b=90,_.push((function(){x(v,g)}))):_.push((function(){if(x(v,m),p.length&&"x"===u&&!i(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){b=0;var t,n=0,a=[];if(v.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=kt(this),o=h.bBox(i.node());a.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,l=Math.abs((p[o-1].x-p[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},d=f("top"),g=f("left"),y=f("right"),_=f("bottom")||g||d||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=b(o[s])){u=g;break}var f=i("pattern",u);if(f===g)for(s=0;s<2;s++)(c=b(o[s]))&&(e.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case g: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 v: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 h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]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 a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":647,"./constants":573}],571:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*x)||T)for(r=0;rO&&FP&&(P=F);h/=(P-C)/(2*I),C=l.l2r(C),P=l.l2r(P),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,i,a)}function V(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 H(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(t){I&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),I=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/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 Y(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},h={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(H(i),2!==t||vt||qt(),gt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Pt),o.indexOf("event")>-1&&p.click(i,r,e.id);else if(1===t&&vt){var s=m?O:I,c="s"===m||"w"===v?0:1,f=s._name+".range["+c+"]",h=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),d="left",g="middle";if(s.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===v&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(bt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+_t)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(_t,n),Tt.r=Math.max(_t,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>P||o>P?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,_t>n?Tt.l=_t-a:Tt.r=_t+a),Lt.attr("d",G(Tt))):s();else if(nt.isSubplotConstrained)if(a>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Lt.attr("d",G(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;um[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":515,"fast-isnumeric":190}],583:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":586}],584:[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 i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":483}],585:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,p=t("../../constants/numerical"),d=p.FP_SAFE,m=p.BADNUM,g=p.LOG_CLIP,v=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,A=T.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",p=r.charAt(0);function E(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return m}function L(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function C(e,r,n){return c(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function I(e){if(S(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 m}function O(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=O(t);return void 0!==e?e:s(t)?+t:void 0}function D(t){return s(t)?+t:O(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===p;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?R(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?E:f,t.l2c="log"===t.type?M:f,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(E(t,e))}:B,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=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return E(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=E,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=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(N(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=I,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=O,t.l2r=t.c2r=f,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(i=0;id&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),f="y"===p;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(s=0;su&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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 g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,h=!!e.yr1,p=[];if(f){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),g=d[1]-d[0],v=m[1]-m[0];p[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*v/g),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(h){var y=a.simpleMap(e.yr0,l.r2l),x=a.simpleMap(e.yr1,l.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),l.range[0]=i.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/p[2]:1,T=h?u/p[3]:1,k=f?p[0]:0,A=h?p[1]:0,M=f?p[0]/p[2]*c:0,S=h?p[1]/p[3]*u:0,E=i._offset-M,L=l._offset-S;n.clipRect.call(o.setTranslate,k,A).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,E,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":389,"../../lib":515,"../../registry":647,"./axes":566,"@plotly/d3":58}],591:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],h={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(c,l)){var p=a(c),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),d.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,u=n.domain,f=n.projection,h=n.lonaxis,p=n.lataxis,d=h._ax,m=p._ax,v=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(i[n]||s[n])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],h=function(t){return t?l:[]},p=0;pu*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance);u&&l.clipAngle(u-w.clipPad);return l}(n),y=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],x=n.center||{},b=f.rotation||{},_=h.range||[],T=p.range||[];if(n.fitbounds){d._length=y[1][0]-y[0][0],m._length=y[1][1]-y[0][1],d.range=g(r,d),m.range=g(r,m);var k=(d.range[0]+d.range[1])/2,A=(m.range[0]+m.range[1])/2;if(n._isScoped)x={lon:k,lat:A};else if(n._isClipped){x={lon:k,lat:A},b={lon:k,lat:A,roll:b.roll};var M=f.type,S=w.lonaxisSpan[M]/2||180,L=w.lataxisSpan[M]/2||90;_=[k-S,k+S],T=[A-L,A+L]}else x={lon:k,lat:A},b={lon:k,lat:b.lat,roll:b.roll}}v.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(f.parallels);var C=E(_,T);v.fitExtent(y,C);var P=this.bounds=v.getBounds(C),I=this.fitScale=v.scale(),O=v.translate();if(n.fitbounds){var z=v.getBounds(E(d.range,m.range)),D=Math.min((P[1][0]-P[0][0])/(z[1][0]-z[0][0]),(P[1][1]-P[0][1])/(z[1][1]-z[0][1]));isFinite(D)?v.scale(D*I):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else v.scale(f.scale*I);var R=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(v.translate([O[0]+(R[0]-O[0]),O[1]+(R[1]-O[1])]).clipExtent(P),n._isAlbersUsa){var F=v([x.lon,x.lat]),B=v.translate();v.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(t){delete a[t],delete o[t],n.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(A(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};m.setConvert(l,r);var c=m.calcTicks(l);e.isScoped||"lonaxis"!==t||c.pop();for(var u=c.length,f=new Array(u),h=0;h-1&&b(n.event,i,[r.xaxis],[r.yaxis],r.id,u),s.indexOf("event")>-1&&p.click(i,n.event))}))}function f(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},c.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":367,"../../components/dragelement":386,"../../components/drawing":389,"../../components/fx":407,"../../components/selections":455,"../../lib":515,"../../lib/geo_location_utils":508,"../../lib/topojson_utils":544,"../../registry":647,"../cartesian/autorange":565,"../cartesian/axes":566,"../plots":628,"./constants":596,"./zoom":601,"@plotly/d3":58,"d3-geo":114,"d3-geo-projection":113,"topojson-client":316}],598:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./geo"),o="geo",s=i(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.geo,s=0;s0&&P<0&&(P+=360);var I,O,z,D=(C+P)/2;if(!p){var R=d?f.projRotate:[D,0,0];I=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&x)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!x&&void 0)&&r("oceancolor")}(p?(O=-96.6,z=38.7):(O=d?D:I,z=(L[0]+L[1])/2),r("center.lon",O),r("center.lat",z),m&&(r("projection.tilt"),r("projection.distance")),g)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!x&&void 0)&&r("landcolor"),r("showlakes",!!x&&void 0)&&r("lakecolor"),r("showrivers",!!x&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&x)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",x),r("subunitcolor"),r("subunitwidth")),d||r("showframe",x)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):v?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":515,"../get_data":602,"../subplot_defaults":641,"./constants":596,"./layout_attributes":599}],601:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],f={},h={};function p(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,c._preGUI,f);var r=i.nestedProperty(u,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),h[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",h)}function h(t,e){var r=u(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render(!0);var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(t,e,i)})),r}function p(t,e){var r,i,a,o,s,h,p,d,m,g=u(0,e);function v(t){return e.invert(t)}function y(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=v(r)})).on("zoom",(function(){if(h=n.mouse(this),function(t){var r=v(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?v(h)&&(d=v(h),p=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(p),o=p):s=v(r=h),m=!0,t.render(!0);var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),m&&f(t,e,y)})),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=u(0,e),o=function(t){var e=0,r=arguments.length,i=[];for(;++ed?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/d)*s-p,i=Math.sqrt(d*d-f*f));var m=180-a-2*p,g=(Math.atan2(h,u)-Math.atan2(c,i))*s,v=(Math.atan2(h,u)-Math.atan2(c,-i))*s;return b(r[0],r[1],a,g)<=b(r[0],r[1],m,v)?[a,g,r[2]]:[m,v,r[2]]}function b(t,e,r,n){var i=_(r-t),a=_(n-e);return Math.sqrt(i*i+a*a)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[a]=t[a]*l-t[s]*c,i[s]=t[s]*l+t[a]*c,i}function T(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(g(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n).999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":367,"../../../lib":515,"../../../registry":647,"../../get_data":602,"../../subplot_defaults":641,"./axis_defaults":610,"./layout_attributes":613}],613:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":515,"../../../lib/extend":505,"../../domain":593,"./axis_attributes":609}],614:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":540}],615:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var h=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/h)}for(var p=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=p,u.tickmode=f}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),b(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),u=null,h=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(T.valueLabel=p.hoverLabelText(e._mockAxis,e._mockAxis.d2l(h.traceCoordinate[3]),t.valuehoverformat),S.push("value: "+T.valueLabel),h.textLabel&&S.push(h.textLabel),x=S.join("
")):x=h.textLabel;var E={x:h.traceCoordinate[0],y:h.traceCoordinate[1],z:h.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};d.appendArrayPointValue(E,_,w),t._module.eventData&&(E=_._module.eventData(E,h,_,{},w));var L={points:[E]};if(e.fullSceneLayout.hovermode){var C=[];d.loneHover({trace:_,x:(.5+.5*y[0]/y[3])*s,y:(.5-.5*y[1]/y[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:x,name:u.name,color:d.castHoverOption(_,w,"bgcolor")||u.color,borderColor:d.castHoverOption(_,w,"bordercolor"),fontFamily:d.castHoverOption(_,w,"font.family"),fontSize:d.castHoverOption(_,w,"font.size"),fontColor:d.castHoverOption(_,w,"font.color"),nameLength:d.castHoverOption(_,w,"namelength"),textAlign:d.castHoverOption(_,w,"align"),hovertemplate:f.castOption(_,w,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,T),eventData:[E]},{container:n,gd:r,inOut_bbox:C}),E.bbox=C[0]}h.buttons&&h.distance<5?r.emit("plotly_click",L):r.emit("plotly_hover",L),this.oldEventData=L}else d.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,p=0;p<(u||l.length);p++)if(f.isArrayOrTypedArray(l[p]))for(var d=0;dg[1][a])g[0][a]=-1,g[1][a]=1;else{var L=g[1][a]-g[0][a];g[0][a]-=L/32,g[1][a]+=L/32}if("reversed"===s.autorange){var C=g[0][a];g[0][a]=g[1][a],g[1][a]=C}}else{var P=s.range;g[0][a]=s.r2l(P[0]),g[1][a]=s.r2l(P[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),v[a]=g[1][a]-g[0][a],this.glplot.setBounds(a,{min:g[0][a]*h[a],max:g[1][a]*h[a]})}var I=c.aspectmode;if("cube"===I)d=[1,1,1];else if("manual"===I){var O=c.aspectratio;d=[O.x,O.y,O.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(a=0;a<3;++a){var D=y[l=(s=c[k[a]]).type];z[a]=Math.pow(D.acc,1/D.count)/h[a]}d="data"===I||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}c.aspectratio.x=u.aspectratio.x=d[0],c.aspectratio.y=u.aspectratio.y=d[1],c.aspectratio.z=u.aspectratio.z=d[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var B=this.container.style;B.position="absolute",B.left=F.l+R.x[0]*F.w+"px",B.top=F.t+(1-R.y[1])*F.h+"px",B.width=F.w*(R.x[1]-R.x[0])+"px",B.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),h=l||c;if(h){var p={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),p[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),p[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,p),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",h={x:0,y:0,z:1},p={};p[c]=h;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,p),a.up=h,f.nestedProperty(d,c).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d",{willReadFrequently:!0}),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];p.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(this._mockAxis,t)},e.exports=_},{"../../../stackgl_modules":1133,"../../components/fx":407,"../../lib":515,"../../lib/show_no_webgl_msg":537,"../../lib/str2rgbarray":540,"../../plots/cartesian/axes":566,"../../registry":647,"./layout/convert":611,"./layout/spikes":614,"./layout/tick_marks":615,"./project":616,"has-passive-events":229,"webgl-context":332}],618:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;aOpenStreetMap
contributors',a=['\xa9 Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":538}],621:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":515}],622:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),i=t("../../lib"),a=i.strTranslate,o=i.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),c=t("@plotly/d3"),u=t("../../components/drawing"),f=t("../../lib/svg_text_utils"),h=t("./mapbox"),p=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==p.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots.mapbox;if(n.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(p.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;l_/2){var w=v.split("|").join("
");x.text(w).attr("data-unformatted",w).call(f.convertToTspans,t),b=u.bBox(x.node())}x.attr("transform",a(-3,8-b.height)),y.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;b.width+6>_&&(T=_/(b.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];y.attr("transform",a(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){p(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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(){b.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},b.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"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,b.linkSubplots(h,l,f,n),b.cleanPlot(h,l,f,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a1&&(r.l/=v,r.r/=v)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:x,size:r.l+g},r:{val:_,size:r.r+g},b:{val:T,size:r.b+g},t:{val:w,size:r.t+g}},m[e]=1}else delete d[e],delete m[e];if(!n._replotting)return b.doAutoMargin(t)}},b.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,h=a.t,d=a.b,m=e._pushmargin,g=e._pushmarginIds,v=e.minreducedwidth,y=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var x in m)g[x]||delete m[x];for(var _ in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:d}},m){var w=m[_].l||{},T=m[_].b||{},k=w.val,A=w.size,M=T.val,S=T.size;for(var E in m){if(o(A)&&m[E].r){var L=m[E].r.val,P=m[E].r.size;if(L>k){var I=(A*L+(P-r)*k)/(L-k),O=(P*(1-k)+(A-r)*(1-L))/(L-k);I+O>c+f&&(c=I,f=O)}}if(o(S)&&m[E].t){var z=m[E].t.val,D=m[E].t.size;if(z>M){var R=(S*z+(D-n)*M)/(z-M),F=(D*(1-M)+(S-n)*(1-z))/(z-M);R+F>d+h&&(d=R,h=F)}}}}}var B=u.constrain(r-a.l-a.r,2,v),N=u.constrain(n-a.t-a.b,2,y),j=Math.max(0,r-B),U=Math.max(0,n-N);if(j){var V=(c+f)/j;V>1&&(c/=V,f/=V)}if(U){var H=(d+h)/U;H>1&&(d/=H,h/=H)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(h),i.b=Math.round(d),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&b.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var q=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}b.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},b.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&b.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,c,f),i=0;i1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+h(u(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h);n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f);return[e,r,n,i]}(p),b=x[2]-x[0],_=x[3]-x[1],w=h/f,T=Math.abs(_/b);w>T?(d=f,y=(h-(m=f*T))/n.h/2,g=[o[0],o[1]],v=[s[0]+y,s[1]-y]):(m=h,y=(f-(d=h/T))/n.w/2,g=[o[0]+y,o[1]-y],v=[s[0],s[1]]),this.xLength2=d,this.yLength2=m,this.xDomain2=g,this.yDomain2=v;var k,A=this.xOffset2=n.l+n.w*g[0],M=this.yOffset2=n.t+n.h*(1-v[1]),S=this.radius=d/b,E=this.innerRadius=this.getHole(e)*S,L=this.cx=A-S*x[0],C=this.cy=M+S*x[3],P=this.cxx=L-A,I=this.cyy=C-M,O=i.side;"counterclockwise"===O?(k=O,O="top"):"clockwise"===O&&(k=O,O="bottom"),this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:O,_trueSide:k,domain:[E/n.w,S/n.w]}),this.angularAxis=this.mockAxis(t,e,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:v});var z=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",z).attr("transform",l(P,I)),r.frontplot.attr("transform",l(A,M)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",z).attr("transform",l(L,C)).call(c.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=o.extendFlat({},r,n);return d(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);p(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*o,t[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=this.getRadial(e);m(r,n);var a=n.range;i.range=a.slice(),i._input.range=a.slice(),n._rl=[n.r2l(a[0],null,"gregorian"),n.r2l(a[1],null,"gregorian")]},N.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getRadial(e),m=D(r.getSector(e)[0],360),g=r.radialAxis,v=u90&&m<=270&&(g.tickangle=180);var x=y?function(t){var e=O(r,C([t.x,0]));return l(e[0]-f,e[1]-p)}:function(t){return l(g.l2p(t.x)+u,0)},b=y?function(t){return I(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},_=j(d);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),v){g.setScale();var w=0,T=y?(g.tickvals||[]).filter((function(t){return t>=0})).map((function(t){return h.tickText(g,t,!0,!1)})):h.calcTicks(g),k=y?T:h.clipEnds(g,T),A=h.getTickSigns(g)[2];y&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(A=-A),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:T,layer:i["radial-axis"],path:h.makeTickPath(g,0,A),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:k,layer:i["radial-grid"],path:b,transFn:o.noop,crisp:!1}),h.drawLabels(n,g,{vals:T,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?F(U(R(d.angle),r.vangles)):d.angle,S=l(f,p),E=S+s(-M);V(i["radial-axis"],v&&(d.showticklabels||d.ticks),{transform:E}),V(i["radial-grid"],v&&d.showgrid,{transform:y?"":S}),V(i["radial-line"].select("line"),v&&d.showline,{x1:y?-a:u,y1:0,x2:a,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=this.getRadial(e),l=this.id+"title",c=0;if(s.title){var f=u.bBox(this.layers["radial-axis"].node()).height,h=s.title.font.size,p=s.side;c="top"===p?h:"counterclockwise"===p?-(f+.4*h):f+.8*h}var d=void 0!==r?r:this.radialAxisAngle,m=R(d),g=Math.cos(m),v=Math.sin(m),y=a+i/2*g+c*v,b=o-i/2*v+c*g;this.layers["radial-axis-title"]=x.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:z(n,"Click to enter radial axis title"),attributes:{x:y,y:b,"text-anchor":"middle"},transform:{rotate:-d}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var v=g?function(t){var e=O(r,C([0,t.x]));return Math.atan2(e[0]-f,e[1]-p)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=F(m.tick0),m.dtick=F(m.dtick));var y=function(t){return l(f+a*Math.cos(t),p-a*Math.sin(t))},x=g?function(t){var e=O(r,C([0,t.x]));return l(e[0],e[1])}:function(t){return y(v(t))},b=g?function(t){var e=O(r,C([0,t.x])),n=Math.atan2(e[0]-f,e[1]-p)-Math.PI/2;return l(e[0],e[1])+s(-F(n))}:function(t){var e=v(t);return y(e)+s(-F(e))},_=g?function(t){return P(r,t.x,0,1/0)}:function(t){var e=v(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+u*r,p-u*n]+"L"+[f+a*r,p-a*n]},w=h.makeLabelFns(m,0).labelStandoff,T={xFn:function(t){var e=v(t);return Math.cos(e)*w},yFn:function(t){var e=v(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=v(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=v(t);return-.5*(1+Math.sin(n))*r}},k=j(d);r.angularTickLayout!==k&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=k);var A,S=g?[1/0].concat(m.tickvals||[]).map((function(t){return h.tickText(m,t,!0,!1)})):h.calcTicks(m);if(g&&(S[0].text="\u221e",S[0].fontSize*=1.75),"linear"===e.gridshape?(A=S.map(v),o.angleDelta(A[0],A[1])<0&&(A=A.slice().reverse())):A=null,r.vangles=A,"category"===m.type&&(S=S.filter((function(t){return o.isAngleInsideSector(v(t),r.sectorInRad)}))),m.visible){var E="inside"===m.ticks?-1:1,L=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+E*L+",0h"+E*m.ticklen,transFn:b,crisp:!1}),h.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:_,transFn:o.noop,crisp:!1}),h.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:T})}V(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(f,p)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,r,s=this,c=s.isSmith,u=s.gd,f=s.layers,h=t._zoomlayer,p=S.MINZOOM,d=S.OFFEDGE,m=s.radius,x=s.innerRadius,T=s.cx,k=s.cy,A=s.cxx,M=s.cyy,L=s.sectorInRad,C=s.vangles,P=s.radialAxis,I=E.clampTiny,O=E.findXYatLength,z=E.findEnclosingVertexAngles,D=S.cornerHalfWidth,R=S.cornerLen/2,F=g.makeDragger(f,"path","maindrag",!1===t.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(T,k)),F.onmousemove=function(t){y.hover(u,t,s.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=s.id},F.onmouseout=function(t){u._dragging||v.unhover(u,t)};var B,N,j,U,V,H,q,G,Y,W={element:F,gd:u,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Z(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Z(t-A,e-M)}function J(t,e){return Math.atan2(M-e,t-A)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function Q(t,e){if(0===t)return s.pathSector(2*D);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,m)),o=a-D,l=a+D;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(l,i)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function $(t,e,r){if(0===t)return s.pathSector(2*D);var n,i,a=K(t,e),o=K(t,r),l=I((a[0]+o[0])/2),c=I((a[1]+o[1])/2);if(l&&c){var u=c/l,f=-1/u,h=O(D,u,l,c);n=O(R,f,h[0][0],h[0][1]),i=O(R,f,h[1][0],h[1][1])}else{var p,d;c?(p=R,d=D):(p=D,d=R),n=[[l-p,c-d],[l+p,c-d]],i=[[l-p,c+d],[l+p,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,m),x),tp?(t-1&&1===t&&_(e,u,[s.xaxis],[s.yaxis],s.id,W),r.indexOf("event")>-1&&y.click(u,e,s.id)}W.prepFn=function(t,n,a){var l=u._fullLayout.dragmode,f=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var p=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,r=u._fullLayout._invScaleY;var d=o.apply3DTransform(p)(n-f.left,a-f.top);if(B=d[0],N=d[1],C){var v=E.findPolygonOffset(m,L[0],L[1],C);B+=A+v[0],N+=M+v[1]}switch(l){case"zoom":W.clickFn=st,c||(W.moveFn=C?it:rt,W.doneFn=at,function(){j=null,U=null,V=s.pathSubplot(),H=!1;var t=u._fullLayout[s.id];q=i(t.bgcolor).getLuminance(),(G=g.makeZoombox(h,q,T,k,V)).attr("fill-rule","evenodd"),Y=g.makeCorners(h,T,k),w(u)}());break;case"select":case"lasso":b(t,n,a,W,l)}},v.init(W)},N.updateRadialDrag=function(t,e,r){var i=this,c=i.gd,u=i.layers,f=i.radius,h=i.innerRadius,p=i.cx,d=i.cy,m=i.radialAxis,y=S.radialDragBoxSize,x=y/2;if(m.visible){var b,_,T,M=R(i.radialAxisAngle),E=m._rl,L=E[0],C=E[1],P=E[r],I=.75*(E[1]-E[0])/(1-i.getHole(e))/f;r?(b=p+(f+x)*Math.cos(M),_=d-(f+x)*Math.sin(M),T="radialdrag"):(b=p+(h-x)*Math.cos(M),_=d-(h-x)*Math.sin(M),T="radialdrag-inner");var O,z,D,B=g.makeRectDragger(u,T,"crosshair",-x,-x,y,y),N={element:B,gd:c};!1===t.dragmode&&(N.dragmode=!1),V(n.select(B),m.visible&&h0==(r?D>L:Dn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0?1:0}function i(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function a(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function o(t,e){return e*t.radius}e.exports={smith:i,reactanceArc:function(t,e,r,n){var s=a(t,i([r,e])),l=s[0],c=s[1],u=a(t,i([n,e])),f=u[0],h=u[1];if(0===e)return["M"+l+","+c,"L"+f+","+h].join(" ");var p=o(t,1/Math.abs(e));return["M"+l+","+c,"A"+p+","+p+" 0 0,"+(e<0?1:0)+" "+f+","+h].join(" ")},resistanceArc:function(t,e,r,s){var l=o(t,1/(e+1)),c=a(t,i([e,r])),u=c[0],f=c[1],h=a(t,i([e,s])),p=h[0],d=h[1];if(n(r)!==n(s)){var m=a(t,i([e,0]));return["M"+u+","+f,"A"+l+","+l+" 0 0,"+(00){for(var n=[],i=0;i=u&&(h.min=0,d.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function m(t,e,r,n){var i=h[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var p=o("color"),d=p!==i.color.dflt?p:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,v=o("title.text",g);e._hovertitle=v===g?v:m,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:d}),o("min"),u(t,e,o,"linear"),l(t,e,o,"linear"),s(t,e,o,"linear"),c(t,e,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:d}),o("tickangle"),o("tickformat")),f(t,e,o,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:h,handleDefaults:d,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":367,"../../lib":515,"../../plot_api/plot_template":555,"../cartesian/line_grid_defaults":581,"../cartesian/prefix_suffix_defaults":583,"../cartesian/tick_label_defaults":587,"../cartesian/tick_mark_defaults":588,"../cartesian/tick_value_defaults":589,"../subplot_defaults":641,"./layout_attributes":644}],646:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o.strTranslate,l=o._,c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,p=t("../plots"),d=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/fx"),v=t("../../components/dragelement/helpers"),y=v.freeMode,x=v.rectMode,b=t("../../components/titles"),_=t("../../components/selections").prepSelect,w=t("../../components/selections").selectOnClick,T=t("../../components/selections").clearOutline,k=t("../../components/selections").clearSelectionsCache,A=t("../cartesian/constants");function M(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=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iE*b?i=(a=b)*E:a=(i=x)/E,o=v*i/x,l=y*a/b,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*k-_,_-w-2*T],domain:[m-o/2,m+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:[g-l/2,g+l/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var A=p.yaxis.domain[0],M=p.aaxis=h({},t.aaxis,{range:[w,_-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+l*E],anchor:"free",position:0,_id:"y",_length:i});f(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},t.baxis,{range:[_-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(S,p.graphDiv._fullLayout),S.setScale();var L=p.caxis=h({},t.caxis,{range:[_-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+l*E],anchor:"free",position:0,_id:"y",_length:i});f(L,p.graphDiv._fullLayout),L.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",C),p.layers.plotbg.select("path").attr("d",C);var P="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",P);var I=s(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),p.clipDefRelative.select("path").attr("transform",null);var O=s(r-S._offset,n+a);p.layers.baxis.attr("transform",O),p.layers.bgrid.attr("transform",O);var z=s(r+i/2,n)+"rotate(30)"+s(0,-M._offset);p.layers.aaxis.attr("transform",z),p.layers.agrid.attr("transform",z);var D=s(r+i/2,n)+"rotate(-30)"+s(0,-L._offset);p.layers.caxis.attr("transform",D),p.layers.cgrid.attr("transform",D),p.drawAxes(!0),p.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",L.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,i=this.aaxis,a=this.baxis,o=this.caxis;if(this.drawAx(i),this.drawAx(a),this.drawAx(o),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=b.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=b.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*a.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=b.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(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"}})}},S.drawAx=function(t){var e,r=this.graphDiv,n=t._name,i=n.charAt(0),a=t._id,s=this.layers[n],l=i+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+a+"tick").remove(),this[l]=c),t.setScale();var u=d.calcTicks(t),f=d.clipEnds(t,u),h=d.makeTransTickFn(t),p=d.getTickSigns(t)[2],m=o.deg2rad(30),g=p*(t.linewidth||1)/2,v=p*t.ticklen,y=this.w,x=this.h,b="b"===i?"M0,"+g+"l"+Math.sin(m)*v+","+Math.cos(m)*v:"M"+g+",0l"+Math.cos(m)*v+","+-Math.sin(m)*v,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[i];d.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:s,path:b,transFn:h,crisp:!1}),d.drawGrid(r,t,{vals:f,layer:this.layers[i+"grid"],path:_,transFn:h,crisp:!1}),d.drawLabels(r,t,{vals:u,layer:s,transFn:h,labelFns:d.makeLabelFns(t,0,30)})};var L=A.MINZOOM/2+.87,C="m-0.87,.5h"+L+"v3h-"+(L+5.2)+"l"+(L/2+2.6)+",-"+(.87*L+4.5)+"l2.6,1.5l-"+L/2+","+.87*L+"Z",P="m0.87,.5h-"+L+"v3h"+(L+5.2)+"l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-2.6,1.5l"+L/2+","+.87*L+"Z",I="m0,1l"+L/2+","+.87*L+"l2.6,-1.5l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-"+(L/2+2.6)+","+(.87*L+4.5)+"l2.6,1.5l"+L/2+",-"+.87*L+"Z",O=!0;function z(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,f,h,p,d,v,b,T,k,M=this,S=M.layers.plotbg.select("path").node(),L=M.graphDiv,D=L._fullLayout._zoomlayer;function R(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=L._fullLayout.clickmode;z(L),2===t&&(L.emit("plotly_doubleclick",null),a.call("_guiRelayout",L,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,L,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&g.click(L,e,M.id)}function B(t,e){return 1-e/M.h}function N(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function j(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(i,a){var o=r+i*t,s=n+a*e,l=Math.max(0,Math.min(1,B(0,n),B(0,s))),c=Math.max(0,Math.min(1,N(r,n),N(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),m=(l/2+u)*M.w,g=(1-l/2-c)*M.w,y=(m+g)/2,x=g-m,_=(1-l)*M.h,w=_-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),b=!0),L.emit("plotly_relayouting",R(p))}function V(){z(L),p!==f&&(a.call("_guiRelayout",L,R(p)),O&&L.data&&L._context.showTips&&(o.notifier(l(L,"Double-click to zoom back out"),"long"),O=!1))}function H(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(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),a=i.indexOf(p.a),l=i.indexOf(p.b),c=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[a],b:i[l],c:i[c]},e=(f.a-p.a)*M.yaxis._m,t=(f.c-p.c-f.b+p.b)*M.xaxis._m);var h=s(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var d=s(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[p.a,M.sum-p.b-p.c],M.baxis.range=[M.sum-p.a-p.c,p.b],M.caxis.range=[M.sum-p.a-p.b,p.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,M),L.emit("plotly_relayouting",R(p))}function q(){a.call("_guiRelayout",L,R(p))}this.dragOptions={element:S,gd:L,plotinfo:{id:M.id,domain:L._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(a,l,u){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=L._fullLayout._invScaleX,e=L._fullLayout._invScaleY;var m=M.dragOptions.dragmode=L._fullLayout.dragmode;y(m)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===m?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(t,e,a){var l=S.getBoundingClientRect();r=e-l.left,n=a-l.top,L._fullLayout._calcInverseTransform(L);var u=L._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=f,h=M.aaxis.range[1]-f.a,d=i(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),v="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",b=!1,T=D.append("path").attr("class","zoombox").attr("transform",s(M.x0,M.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),k=D.append("path").attr("class","zoombox-corners").attr("transform",s(M.x0,M.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(L)}(0,l,u)):"pan"===m?(M.dragOptions.moveFn=H,M.dragOptions.clickFn=F,M.dragOptions.doneFn=q,f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=f,M.clearOutline(L)):(x(m)||y(m))&&_(a,l,u,M.dragOptions,m)}},S.onmousemove=function(t){g.hover(L,t,M.id),L._fullLayout._lasthover=S,L._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){L._dragging||m.unhover(L,t)},m.init(this.dragOptions)}},{"../../components/color":367,"../../components/dragelement":386,"../../components/dragelement/helpers":385,"../../components/drawing":389,"../../components/fx":407,"../../components/selections":455,"../../components/titles":476,"../../lib":515,"../../lib/extend":505,"../../registry":647,"../cartesian/axes":566,"../cartesian/constants":573,"../cartesian/set_convert":585,"../plots":628,"@plotly/d3":58,tinycolor2:313}],647:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=l.extendFlat,h=l.extendDeepAll;function p(t){var e=t.name,i=t.categories,a=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 i in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(i,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(f[p[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":367,"../components/drawing":389,"../constants/xmlns_namespaces":492,"../lib":515,"@plotly/d3":58}],656:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rf+c||!n(u))}for(var p=0;pa))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return i(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)?e0?e+=r:u<0&&(e-=r)}return e}function z(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,_+(i-e)/(i-r)-1)}var D=t[f+"a"],R=t[h+"a"];m=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=n.getDistanceFunction(i,p,d,(function(t){return(p(t)+d(t))/2}));if(n.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==c){k||(L=function(t){return Math.min(A(t),t.p-y.bargroupwidth/2)},C=function(t){return Math.max(M(t),t.p+y.bargroupwidth/2)});var B=g[t.index],N=v.base?B.b+B.s:B.s;t[h+"0"]=t[h+"1"]=R.c2p(B[h],!0),t[h+"LabelVal"]=N;var j=y.extents[y.extents.round(B.p)];t[f+"0"]=D.c2p(x?L(B):j[0],!0),t[f+"1"]=D.c2p(x?C(B):j[1],!0);var U=void 0!==B.orig_p;return t[f+"LabelVal"]=U?B.orig_p:B.p,t.labelLabel=l(D,t[f+"LabelVal"],v[f+"hoverformat"]),t.valueLabel=l(R,t[h+"LabelVal"],v[h+"hoverformat"]),t.baseLabel=l(R,B.b,v[h+"hoverformat"]),t.spikeDistance=(function(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,w+(i-e)/(i-r)-1)}(B)+function(t){return P(A(t),M(t),w)}(B))/2,t[f+"Spike"]=D.c2p(B.p,!0),o(B,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,i=s(t,e);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(t,e,r,n,a){var o=u(t,e,r,n,a);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=f(l,c),i.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":367,"../../components/fx":407,"../../constants/numerical":491,"../../lib":515,"../../plots/cartesian/axes":566,"../../registry":647,"./helpers":663}],665:[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":578,"../scatter/marker_colorbar":954,"./arrays_to_calcdata":656,"./attributes":657,"./calc":658,"./cross_trace_calc":660,"./defaults":661,"./event_data":662,"./hover":664,"./layout_attributes":666,"./layout_defaults":667,"./plot":668,"./select":669,"./style":671}],666:[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"}}},{}],667:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,f={},h=s("barmode"),p=0;p0}function S(t){return"auto"===t?0:t}function E(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor||"end",u="end"===c,f="start"===c,h=((a.leftToRight||0)+1)/2,p=1-h,d=i.width,m=i.height,g=Math.abs(e-t),v=Math.abs(n-r),y=g>2*_&&v>2*_?_:0;g-=2*y,v-=2*y;var x=S(l);"auto"!==l||d<=g&&m<=v||!(d>g||m>v)||(d>v||m>g)&&d.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)};B=G(B,N,D),N=G(N,B,D),j=G(j,U,!D),U=G(U,j,!D)}var Y=A(a.ensureSingle(I,"path"),P,g,v);if(Y.style("vector-effect","non-scaling-stroke").attr("d",isNaN((N-B)*(U-j))||V&&t._context.staticPlot?"M0,0Z":"M"+B+","+j+"V"+U+"H"+N+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&R){var W=l.makePointStyleFns(f);l.singlePointStyle(c,Y,f,W,t)}!function(t,e,r,n,i,s,c,f,p,g,v){var w,T=e.xaxis,M=e.yaxis,C=t._fullLayout;function P(e,r,n){return a.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var I=n[0].trace,O="h"===I.orientation,z=function(t,e,r,n,i){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,i){var o=e[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,c,f,h,p="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;g?(l="y",c=i,f="x",h=n):(l="x",c=n,f="y",h=i);function v(t){return u(h,h.c2l(t),!0).text}var y=e[r],x={};x.label=y.p,x.labelLabel=x[l+"Label"]=(_=y.p,u(c,c.c2l(_),!0).text);var _;var w=a.castOption(o,y.i,"text");(0===w||w)&&(x.text=w);x.value=y.s,x.valueLabel=x[f+"Label"]=v(y.s);var T={};b(T,o,y.i),(p||void 0===T.x)&&(T.x=g?x.value:x.label);(p||void 0===T.y)&&(T.y=g?x.label:x.value);(p||void 0===T.xLabel)&&(T.xLabel=g?x.valueLabel:x.labelLabel);(p||void 0===T.yLabel)&&(T.yLabel=g?x.labelLabel:x.valueLabel);d&&(x.delta=+y.rawS||y.s,x.deltaLabel=v(x.delta),x.final=y.v,x.finalLabel=v(x.final),x.initial=x.final-x.delta,x.initialLabel=v(x.initial));m&&(x.value=y.s,x.valueLabel=v(x.value),x.percentInitial=y.begR,x.percentInitialLabel=a.formatPercent(y.begR),x.percentPrevious=y.difR,x.percentPreviousLabel=a.formatPercent(y.difR),x.percentTotal=y.sumR,x.percenTotalLabel=a.formatPercent(y.sumR));var k=a.castOption(o,y.i,"customdata");k&&(x.customdata=k);return a.texttemplateString(s,x,t._d3locale,T,x,o._meta||{})}(t,e,r,n,i):s.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function c(t){return u(o?r:n,+t,!0).text}var f,h=i.textinfo,p=t[e],d=h.split("+"),m=[],g=function(t){return-1!==d.indexOf(t)};g("label")&&m.push((v=t[e].p,u(o?n:r,v,!0).text));var v;g("text")&&(0===(f=a.castOption(i,p.i,"text"))||f)&&m.push(f);if(s){var y=+p.rawS||p.s,x=p.v,b=x-y;g("initial")&&m.push(c(b)),g("delta")&&m.push(c(y)),g("final")&&m.push(c(x))}if(l){g("value")&&m.push(c(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(f=a.formatPercent(p.begR),w&&(f+=" of initial"),m.push(f)),g("percent previous")&&(f=a.formatPercent(p.difR),w&&(f+=" of previous"),m.push(f)),g("percent total")&&(f=a.formatPercent(p.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(e,r,n,i):m.getValue(s.text,r);return m.coerceString(y,o)}(C,n,i,T,M);w=function(t,e){var r=m.getValue(t.textposition,e);return m.coerceEnumerated(x,r)}(I,i);var D="stack"===g.mode||"relative"===g.mode,R=n[i],F=!D||R._outmost;if(!z||"none"===w||(R.isBlank||s===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var B=C.font,N=d.getBarColor(n[i],I),j=d.getInsideTextFont(I,i,B,N),U=d.getOutsideTextFont(I,i,B),V=r.datum();O?"log"===T.type&&V.s0<=0&&(s=T.range[0]=G*(X/Y):X>=Y*(Z/G);G>0&&Y>0&&(J||K||Q)?w="inside":(w="outside",H.remove(),H=null)}else w="inside";if(!H){W=a.ensureUniformFontSize(t,"outside"===w?U:j);var $=(H=P(r,z,W)).attr("transform");if(H.attr("transform",""),q=l.bBox(H.node()),G=q.width,Y=q.height,H.attr("transform",$),G<=0||Y<=0)return void H.remove()}var tt,et,rt=I.textangle;"outside"===w?(et="both"===I.constraintext||"outside"===I.constraintext,tt=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,f=i.height,h=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:h>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/f):Math.min(1,h/u));var m=S(c),g=E(i,m),v=(s?g.x:g.y)/2,y=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,A=0,M=s?k(e,t):k(r,n);s?(b=e-M*o,T=M*v):(w=n+M*o,A=-M*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:A,scale:d,rotate:m}}(s,c,f,p,q,{isHorizontal:O,constrained:et,angle:rt})):(et="both"===I.constraintext||"inside"===I.constraintext,tt=L(s,c,f,p,q,{isHorizontal:O,constrained:et,angle:rt,anchor:I.insidetextanchor}));tt.fontSize=W.size,h("histogram"===I.type?"bar":I.type,tt,C),R.transform=tt;var nt=A(H,C,g,v);a.setTransormAndDisplay(nt,tt)}(t,e,I,r,p,B,N,j,U,g,v),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),w,C,f.xcalendar,f.ycalendar)}));var j=!1===f.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,I,e,g)},toMoveInsideBar:L}},{"../../components/color":367,"../../components/drawing":389,"../../components/fx/helpers":403,"../../lib":515,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"../../registry":647,"./attributes":657,"./constants":659,"./helpers":663,"./style":671,"./uniform_text":673,"@plotly/d3":58,"fast-isnumeric":190}],669:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:m,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?function(t,e,r){a.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var i,s=n.select(this);if(t.selected){i=o.ensureUniformFontSize(r,g(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,i,t):(d(r,i,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},{"../../components/color":367,"../../components/drawing":389,"../../lib":515,"../../registry":647,"./attributes":657,"./helpers":663,"./uniform_text":673,"@plotly/d3":58}],672:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("../../lib").coercePattern;e.exports=function(t,e,r,s,l){var c=r("marker.color",s),u=i(t,"marker");u&&a(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":367,"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"../../lib":515}],673:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");function a(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=a(t),i=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=oh.range[1]&&(x+=Math.PI);if(n.getClosest(c,(function(t){return m(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/v)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var b=c[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return o(b,u,t),s(_,u,f,t),t.hovertemplate=u.hovertemplate,t.color=a(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":407,"../../lib":515,"../../plots/polar/helpers":630,"../bar/hover":664,"../scatterpolar/hover":1015}],678:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":631,"../bar/select":669,"../bar/style":671,"../scatter/marker_colorbar":954,"../scatterpolar/format_labels":1014,"./attributes":674,"./calc":675,"./defaults":676,"./hover":677,"./layout_attributes":679,"./layout_defaults":680,"./plot":681}],679:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],680:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a,o={};function s(r,o){return n.coerce(t[a]||{},e[a],i,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var f=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,i,c,u,f,e,r)};return function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),p=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(p,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),p=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(i(o)&&i(s)&&i(p)&&i(d)&&o!==s&&p!==d){var m=u.c2g(t.s1),g=(p+d)/2;t.ct=[l.c2p(m*Math.cos(g)),c.c2p(m*Math.sin(g))],e=h(o,s,p,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":389,"../../lib":515,"../../plots/polar/helpers":630,"@plotly/d3":58,"fast-isnumeric":190}],682:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,c=n.marker,u=c.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,xhoverformat:o("x"),yhoverformat:o("y"),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({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},c.angle,{arrayOk:!1,editType:"calc"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":366,"../../lib/extend":505,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642,"../bar/attributes":657,"../scatter/attributes":936}],683:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../plots/cartesian/align_period"),o=t("../../lib"),s=t("../../constants/numerical").BADNUM,l=o._;e.exports=function(t,e){var r,c,y,x,b,_,w,T=t._fullLayout,k=i.getFromId(t,e.xaxis||"x"),A=i.getFromId(t,e.yaxis||"y"),M=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(y=k,x="x",b=A,_="y",w=!!e.yperiodalignment):(y=A,x="y",b=k,_="x",w=!!e.xperiodalignment);var E,L,C,P,I,O,z=function(t,e,r,i){var s,l=e+"0"in t,c="d"+e in t;if(e in t||l&&c){var u=r.makeCalcdata(t,e);return[a(t,r,e,u).vals,u]}s=l?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:i;for(var f="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]),h=t._length,p=new Array(h),d=0;dE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return y.d2c((e[t]||[])[r])},H=1/0,q=-1/0;for(r=0;r=E.q1&&E.q3>=E.med){var Y=V("lowerfence");E.lf=Y!==s&&Y<=E.q1?Y:p(E,C,P);var W=V("upperfence");E.uf=W!==s&&W>=E.q3?W:d(E,C,P);var Z=V("mean");E.mean=Z!==s?Z:P?o.mean(C,P):(E.q1+E.q3)/2;var X=V("sd");E.sd=Z!==s&&X>=0?X:P?o.stdev(C,P,E.mean):E.q3-E.q1,E.lo=m(E),E.uo=g(E);var J=V("notchspan");J=J!==s&&J>0?J:v(E,P),E.ln=E.med-J,E.un=E.med+J;var K=E.lf,Q=E.uf;e.boxpoints&&C.length&&(K=Math.min(K,C[0]),Q=Math.max(Q,C[P-1])),e.notched&&(K=Math.min(K,E.ln),Q=Math.max(Q,E.un)),E.min=K,E.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),$=E.med!==s?E.med:E.q1!==s?E.q3!==s?(E.q1+E.q3)/2:E.q1:E.q3!==s?E.q3:0,E.med=$,E.q1=E.q3=$,E.lf=E.uf=$,E.mean=E.sd=$,E.ln=E.un=$,E.min=E.max=$}H=Math.min(H,E.min),q=Math.max(q,E.max),E.pts2=L.filter(j),M.push(E)}}e._extremes[y._id]=i.findExtremes(y,[H,q],{padded:!0})}else{var tt=y.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ft;if((E={}).pos=E[_]=B[r],L=E.pts=nt[r].sort(f),P=(C=E[x]=L.map(h)).length,E.min=C[0],E.max=C[P-1],E.mean=o.mean(C,P),E.sd=o.stdev(C,P,E.mean),E.med=o.interp(C,.5),P%2&&(lt||ct))lt?(ut=C.slice(0,P/2),ft=C.slice(P/2+1)):ct&&(ut=C.slice(0,P/2+1),ft=C.slice(P/2)),E.q1=o.interp(ut,.5),E.q3=o.interp(ft,.5);else E.q1=o.interp(C,.25),E.q3=o.interp(C,.75);E.lf=p(E,C,P),E.uf=d(E,C,P),E.lo=m(E),E.uo=g(E);var ht=v(E,P);E.ln=E.med-ht,E.un=E.med+ht,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=L.filter(j),M.push(E)}e._extremes[y._id]=i.findExtremes(y,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:T[S],dPos:N,posLetter:_,valLetter:x,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean \xb1 \u03c3:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},T[S]++,M):[{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 h(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 d(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 m(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function v(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":491,"../../lib":515,"../../plots/cartesian/align_period":563,"../../plots/cartesian/axes":566,"fast-isnumeric":190}],684:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,f=e._fullLayout,h=o._id,p=h.charAt(0),d=[],m=0;for(s=0;s1,b=1-f[t+"gap"],_=1-f[t+"groupgap"];for(s=0;s0){var q=E.pointpos,G=E.jitter,Y=E.marker.size/2,W=0;q+G>=0&&((W=V*(q+G))>M?(H=!0,j=Y,B=W):W>R&&(j=Y,B=M)),W<=M&&(B=M);var Z=0;q-G<=0&&((Z=-V*(q-G))>S?(H=!0,U=Y,N=Z):Z>F&&(U=Y,N=S)),Z<=S&&(N=S)}else B=M,N=S;var X=new Array(c.length);for(l=0;l0?(g="v",v=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",v=Math.min(_)):v=0;if(v){e._length=v;var S=r("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(r("x0",0),r("dx",1)):"h"===S&&0===y&&(r("y0",0),r("dy",1)):"v"===S&&0===x?r("x0"):"h"===S&&0===y&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function f(t,e,r,i){var a=i.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(a+"points",l);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.angle"),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,i){function s(r,i){return n.coerce(t,e,c,r,i)}if(u(t,e,s,i),!1!==e.visible){o(t,e,i,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(e.line.color,.5));var h=!1;if(l){var p=s("mean"),d=s("sd");p&&p.length&&(h=!0,d&&d.length&&(h="sd"))}s("boxmean",h),s("whiskerwidth"),s("width"),s("quartilemethod");var m=!1;if(l){var g=s("notchspan");g&&g.length&&(m=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(m=!0);s("notched",m)&&s("notchwidth"),f(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,c,t)}for(var o=0;ot.lo&&(x.so=!0)}return a}));h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,o,s)}function l(t,e,r,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,f=a.bPos,h=a.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+f,!0),i=c.l2p(e-o)+h,a=c.l2p(e+s)+h,d=u?(i+a)/2:c.l2p(e)+h,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),v=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+i+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+m+","+i+"L"+v+","+d+"Z":"")):n.select(this).attr("d","M"+i+","+m+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+i+","+m+"L"+d+","+v+"Z":""))}))}e.exports={plot:function(t,e,r,a){var c=e.xaxis,u=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(t){var e,r,i=n.select(this),a=t[0],f=a.t,h=a.trace;(f.wdPos=f.bdPos*h.whiskerwidth,!0!==h.visible||f.empty)?i.remove():("h"===h.orientation?(e=u,r=c):(e=c,r=u),o(i,{pos:e,val:r},h,f),s(i,{x:c,y:u},h,f),l(i,{pos:e,val:r},h,f))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":389,"../../lib":515,"@plotly/d3":58}],692:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=L>0?Math.ceil:Math.floor,O=L>0?Math.min:Math.max,z=L>0?Math.max:Math.min,D=P(S+C),R=I(E-C),F=[[f=M(S)]];for(a=D;a*L=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],706:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,c,u,f,h,p,d,m,g,v,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],T=b._boundarylines=[],k=t["_"+r],A=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var M=t._xctrl,S=t._yctrl,E=M[0].length,L=M.length,C=t._a.length,P=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function O(n){var i,a,o,s,l,c,u,f,p,d,m,g,v=[],y=[],x={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(P-2,a))),s=a-o,x.length=P,x.crossLength=C,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(p=t.dxydi([],i-1,o,0,s),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),v.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),v.push(f[0]),y.push(f[1]),l=f;else for(i=t.a2i(n),c=Math.floor(Math.max(0,Math.min(C-2,i))),u=i-c,x.length=C,x.crossLength=P,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),v.push(l[0]+m[0]/3),y.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),v.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),v.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=e,x.axis=b,x.crossAxis=A,x.value=n,x.constvar=r,x.index=h,x.x=v,x.y=y,x.smoothing=A.smoothing,x}function z(n){var i,a,o,s,l,c=[],u=[],f={};if(f.length=x.length,f.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(P-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(e){return t.evalxy([],e,n)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ix.length-1||_.push(i(z(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(h=u;hx.length-1||m<0||m>x.length-1))for(g=x[s],v=x[m],a=0;ax[x.length-1]||w.push(i(O(d),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&T.push(i(z(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(z(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(t,e){return t-e})))[0],f=c[1],h=u;h<=f;h++)p=b.tick0+b.dtick*h,_.push(i(O(p),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(h=u-1;hx[x.length-1]||w.push(i(O(d),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&T.push(i(O(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(O(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":505,"../../plots/cartesian/axes":566}],707:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],721:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=c.strRotate,f=c.strTranslate,h=t("../../constants/alignment");function p(t,e,r,s,l,c){var u="const-"+l+"-lines",f=r.selectAll("."+u).data(c);f.enter().append("path").classed(u,!0).style("vector-effect","non-scaling-stroke"),f.each((function(r){var s=r,l=s.x,c=s.y,u=a([],l,t.c2p),f=a([],c,e.c2p),h="M"+o(u,f,s.smoothing);n.select(this).attr("d",h).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")})),f.exit().remove()}function d(t,e,r,a,o,c,h,p){var d=c.selectAll("text."+p).data(h);d.enter().append("text").classed(p,!0);var m=0,g={};return d.each((function(o,c){var h;if("auto"===o.axis.tickangle)h=s(a,e,r,o.xy,o.dxy);else{var p=(o.axis.tickangle+180)*Math.PI/180;h=s(a,e,r,o.xy,[Math.cos(p),Math.sin(p)])}c||(g={angle:h.angle,flip:h.flip});var d=(o.endAnchor?-1:1)*h.flip,v=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),y=i.bBox(this);v.attr("transform",f(h.p[0],h.p[1])+u(h.angle)+f(o.axis.labelpadding*d,.3*y.height)),m=Math.max(m,y.width+o.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,r,i){var l=e.xaxis,u=e.yaxis,f=t._fullLayout._clips;c.makeTraceGroups(i,r,"trace").each((function(e){var r=n.select(this),i=e[0],h=i.trace,m=h.aaxis,g=h.baxis,y=c.ensureSingle(r,"g","minorlayer"),x=c.ensureSingle(r,"g","majorlayer"),b=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",h.opacity),p(l,u,x,m,"a",m._gridlines),p(l,u,x,g,"b",g._gridlines),p(l,u,y,m,"a",m._minorgridlines),p(l,u,y,g,"b",g._minorgridlines),p(l,u,b,m,"a-boundary",m._boundarylines),p(l,u,b,g,"b-boundary",g._boundarylines);var w=d(t,l,u,h,i,_,m._labels,"a-label"),T=d(t,l,u,h,i,_,g._labels,"b-label");!function(t,e,r,n,i,a,o,l){var u,f,h,p,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),g=c.aggNums(Math.min,null,r.b),y=c.aggNums(Math.max,null,r.b);u=.5*(d+m),f=g,h=r.ab2xy(u,f,!0),p=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,i,a,h,r.dxydb_rough(u,f)));v(t,e,r,n,h,p,r.aaxis,i,a,o,"a-title"),u=d,f=.5*(g+y),h=r.ab2xy(u,f,!0),p=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,i,a,h,r.dxyda_rough(u,f)));v(t,e,r,n,h,p,r.baxis,i,a,l,"b-title")}(t,_,h,i,l,u,w,T),function(t,e,r,n,i){var s,l,u,f,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var p=c.ensureSingle(h,"path","carpetboundary"),d=e.clipsegments,m=[];for(f=0;f90&&y<270,b=n.select(this);b.text(h.title.text).call(l.convertToTspans,t),x&&(_=(-l.lineCount(b)+g)*m*a-_),b.attr("transform",f(e.p[0],e.p[1])+u(e.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,h.title.font)})),b.exit().remove()}},{"../../components/drawing":389,"../../constants/alignment":483,"../../lib":515,"../../lib/svg_text_utils":541,"./makepath":718,"./map_1d_array":719,"./orient_text":720,"@plotly/d3":58}],722:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,f=t.aaxis,h=t.baxis,p=e[0],d=e[c-1],m=r[0],g=r[u-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=v*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,m-=b,g+=b,t.isVisible=function(t,e){return t>p&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,f.smoothing,h.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,h.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,p,d,m=0,g=0,v=[];ne[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(p=u-2,d=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):d=s-(p=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,f,p,h,d),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,f,p,h,d),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":535,"./compute_control_points":710,"./constants":711,"./create_i_derivative_evaluator":712,"./create_j_derivative_evaluator":713,"./create_spline_evaluator":714}],723:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function f(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":515}],724:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":515}],725:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":366,"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/template_attributes":642,"../scattergeo/attributes":978}],726:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var f=0;f")}(t,f,o),[t]}},{"../../lib":515,"../../plots/cartesian/axes":566,"./attributes":725}],730:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":598,"../heatmap/colorbar":804,"./attributes":725,"./calc":726,"./defaults":727,"./event_data":728,"./hover":729,"./plot":731,"./select":732,"./style":733}],731:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],i=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?a.extractTraceFeature(t):o(r,i.topojson),f=[],h=[],p=0;p=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":620,"./convert":735}],739:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642,"../mesh3d/attributes":876}],740:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&h===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),h=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],747:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("./make_color_map"),a=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=i(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:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":379,"./end_plus":755,"./make_color_map":760}],748:[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}}},{}],749:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var h,p,d,m=e.contours,g=r("contours.operation");(m._operation=c[g],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,m),"="===g?h=m.showlines=!0:(h=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),h)&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,p,f)}},{"../../components/color":367,"../../constants/filter_ops":487,"./label_defaults":759,"fast-isnumeric":190}],750:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":487,"fast-isnumeric":190}],751:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],752:[function(t,e,r){"use strict";var n=t("../../lib");function i(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,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":515,"./constraint_mapping":750,"./end_plus":755}],755:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],756:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(f,r,e),p=[s(t,e,[-h[0],-h[1]])],d=t.z.length,m=t.z[0].length,g=e.slice(),v=h.slice();for(c=0;c<1e4;c++){if(f>20?(f=i.CHOOSESADDLE[f][(h[0]||h[1])<0?0:1],t.crossings[u]=i.SADDLEREMAINDER[f]):delete t.crossings[u],!(h=i.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}p.push(s(t,e,h)),e[0]+=h[0],e[1]+=h[1],u=e.join(","),a(p[p.length-1],p[p.length-2],o,l)&&p.pop();var y=h[0]&&(e[0]<0||e[0]>m-2)||h[1]&&(e[1]<0||e[1]>d-2);if(e[0]===g[0]&&e[1]===g[1]&&h[0]===v[0]&&h[1]===v[1]||r&&y)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,A,M,S,E,L,C,P,I,O,z=a(p[0],p[p.length-1],o,l),D=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((x=F[c])=B&&x+F[b]M&&S--,t.edgepaths[S]=L.concat(p,E));break}V||(t.edgepaths[M]=p.concat(E))}for(M=0;Mt?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,a,o,s,l,c,u,f,h=t[0].z,p=h.length,d=h[0].length,m=2===p||2===d;for(r=0;r=0&&(n=y,s=l):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,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;f+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}h=s,(d=-1===p.indexOf(h))&&(h=p[0],f+="Z")}for(h=0;hn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*o);if(h<1||p<1)return 1/0;var d=v.EDGECOST*(1/(h-1)+1/(p-1));d+=v.ANGLECOST*c*c;for(var m=s-u,g=l-f,y=s+u,x=l+f,b=0;b2*v.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(h<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),f=Math.cos(c),h=function(t,e){return[s+t*f-e*u,l+t*u+e*f]},p=[h(-a/2,-o/2),h(-a/2,o/2),h(a/2,o/2),h(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(p)},r.drawLabels=function(t,e,r,a,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.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,h=t._input.contours;if(u>f&&(r.start=h.start=f,f=r.end=h.end=u,u=r.start),!(r.size>0))c=u===f?1:a(u,f,t.ncontours).dtick,h.size=r.size=c}}},{"../../lib":515,"../../plots/cartesian/axes":566}],764:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,a=r.contours,s=r.line,l=a.size||1,c=a.start,u="constraint"===a.type,f=!u&&"lines"===a.coloring,h=!u&&"fill"===a.coloring,p=f||h?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?p(t.level):s.color,s.dash)}));var d=a.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(f?p(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(h){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),p(t.level+.5*l)})),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",p(m-.5*l))}})),a(t)}},{"../../components/drawing":389,"../heatmap/style":814,"./make_color_map":760,"@plotly/d3":58}],765:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":377,"./label_defaults":759}],766:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../contour/attributes":744,"../heatmap/attributes":801}],767:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),f=t("../carpet/lookup_carpetid"),h=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=f(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),u(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,u,f,h,p,d,m,g=e._carpetTrace,v=g.aaxis,y=g.baxis;v._minDtick=0,y._minDtick=0,i.isArray1D(e.z)&&a(e,v,y,"a","b",["z"]);r=e._a=e._a||e.a,h=e._b=e._b||e.b,r=r?v.makeCalcdata(e,"_a"):[],h=h?y.makeCalcdata(e,"_b"):[],u=e.a0||0,f=e.da||1,p=e.b0||0,d=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(m),s(m,e._emptypoints);var x=i.maxRowLength(m),b="scaled"===e.xtype?"":r,_=c(e,b,u,f,x,v),w="scaled"===e.ytype?"":h,T=c(e,w,p,d,m.length,y),k={a:_,b:T,z:m};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:m,containerStr:"",cLetter:"z"});return[k]}(t,e);return h(e,e._z),m}}},{"../../components/colorscale/calc":375,"../../lib":515,"../carpet/lookup_carpetid":717,"../contour/set_contours":763,"../heatmap/clean_2d_array":803,"../heatmap/convert_column_xyz":805,"../heatmap/find_empties":807,"../heatmap/interp2d":810,"../heatmap/make_bound_array":812,"./defaults":768}],768:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,a,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":515,"../contour/constraint_defaults":749,"../contour/contours_defaults":751,"../contour/style_defaults":765,"../heatmap/xyz_defaults":816,"./attributes":766}],769:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":578,"../contour/colorbar":747,"../contour/style":764,"./attributes":766,"./calc":767,"./defaults":768,"./plot":770}],770:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../carpet/map_1d_array"),a=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),f=t("../contour/constants"),h=t("../contour/convert_to_constraints"),p=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),m=t("../carpet/lookup_carpetid"),g=t("../carpet/axis_aligned_line");function v(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,b){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),T=r[0],k=T.trace,A=k._carpetTrace=m(t,k),M=t.calcdata[A.index][0];if(A.visible&&"legendonly"!==A.visible){var S=T.a,E=T.b,L=k.contours,C=p(L,e,T),P="constraint"===L.type,I=L._operation,O=P?"="===I?"lines":"fill":L.coloring,z=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];l(C);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);c(C,D,R);var F,B,N,j,U=C;"constraint"===L.type&&(U=h(C,I)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r=0;j--)F=M.clipsegments[j],B=i([],F.x,_.c2p),N=i([],F.y,w.c2p),B.reverse(),N.reverse(),V.push(a(B,N,F.bicubic));var H="M"+V.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,f,h,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(h=0;h=0&&(h=L,d=m):Math.abs(f[1]-h[1])=0&&(h=L,d=m):s.log("endpt to newendpt is not vert. or horz.",f,h,L)}if(d>=0)break;y+=S(f,h),f=h}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(b=-1===x.indexOf(u))&&(u=x[0],y+=S(f,h)+"Z",f=null)}for(u=0;ug&&(n.max=g);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/I),f.LABELMAX),a=0;a0?+p[u]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:v},properties:y})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(u=1;u<_.length;u++)T.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:f},c.heatmap.layout.visibility="visible",c}},{"../../components/color":367,"../../components/colorscale":379,"../../constants/numerical":491,"../../lib":515,"../../lib/geojson_utils":509,"fast-isnumeric":190}],774:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":377,"../../lib":515,"./attributes":771}],775:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],776:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover").hoverPoints,a=t("../scattermapbox/hover").getExtraText;e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var f=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(f,f.c2l(u.z),"hover").text}return s.extraText=a(c,u,l[0].t.labels),[s]}}},{"../../plots/cartesian/axes":566,"../scattermapbox/hover":1007}],777:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":620,"./convert":773}],779:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),l.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(i))return i;if(n(a)&&o)return a}(u,h),[l]}}},{"../../components/color":367,"../../lib":515,"../bar/hover":664}],787:[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"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":578,"../bar/select":669,"./attributes":780,"./calc":781,"./cross_trace_calc":783,"./defaults":784,"./event_data":785,"./hover":786,"./layout_attributes":788,"./layout_defaults":789,"./plot":790,"./style":791}],788:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],789:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":367,"../../components/drawing":389,"../../constants/interactions":490,"../bar/style":671,"../bar/uniform_text":673,"@plotly/d3":58}],792:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":505,"../../plots/attributes":562,"../../plots/domain":593,"../../plots/template_attributes":642,"../pie/attributes":910}],793:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":628}],794:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":912}],795:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}var u=c("labels"),f=c("values"),h=s(u,f),p=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),p){e._length=p,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,m=c("text"),g=c("texttemplate");if(g||(d=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||d&&"none"!==d){var v=c("textposition");o(t,e,l,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":515,"../../plots/domain":593,"../bar/defaults":661,"../pie/defaults":913,"./attributes":792}],796:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":921,"./attributes":792,"./base_plot":793,"./calc":794,"./defaults":795,"./layout_attributes":797,"./layout_defaults":798,"./plot":799,"./style":800}],797:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":917}],798:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":515,"./layout_attributes":797}],799:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../../lib"),o=a.strScale,s=a.strTranslate,l=t("../../lib/svg_text_utils"),c=t("../bar/plot").toMoveInsideBar,u=t("../bar/uniform_text"),f=u.recordMinTextSize,h=u.clearMinTextSize,p=t("../pie/helpers"),d=t("../pie/plot"),m=d.attachFxHandlers,g=d.determineInsideTextFont,v=d.layoutAreas,y=d.prerenderTitles,x=d.positionTitleOutside,b=d.formatSliceLabel;function _(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._context.staticPlot,u=t._fullLayout;h("funnelarea",u),y(e,t),v(e,u._size),a.makeTraceGroups(u._funnelarealayer,e,"trace").each((function(e){var h=n.select(this),d=e[0],v=d.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o=Math.pow(i,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var f,h,p=[];for(p.push(u()),f=t.length-1;f>-1;f--)if(!(h=t[f]).hidden){var d=h.v/l;c+=d,p.push(u())}var m=1/0,g=-1/0;for(f=0;f-1;f--)if(!(h=t[f]).hidden){var A=p[k+=1][0],M=p[k][1];h.TL=[-A,M],h.TR=[A,M],h.BL=w,h.BR=T,h.pxmid=(S=h.TR,E=h.BR,[.5*(S[0]+E[0]),.5*(S[1]+E[1])]),w=h.TL,T=h.TR}var S,E}(e),h.each((function(){var h=n.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=v.index;var h=d.cx,y=d.cy,x=n.select(this),w=x.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),x.call(m,t,e);var T="M"+(h+o.TR[0])+","+(y+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",T),b(t,o,d);var k=p.castOption(v.textposition,o.pts),A=x.selectAll("g.slicetext").data(o.text&&"none"!==k?[0]:[]);A.enter().append("g").classed("slicetext",!0),A.exit().remove(),A.each((function(){var r=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=a.ensureUniformFontSize(t,g(v,o,u.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,p).call(l.convertToTspans,t);var d,m,x,b=i.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+y,w=Math.max(o.TL[1],o.TR[1])+y;m=Math.max(o.TL[0],o.BL[0])+h,x=Math.min(o.TR[0],o.BR[0])+h,(d=c(m,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,f(v.type,d,u),e[s].transform=d,a.setTransormAndDisplay(r,d)}))}}));var y=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);y.enter().append("g").classed("titletext",!0),y.exit().remove(),y.each((function(){var e=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),r=v.title.text;v._meta&&(r=a.templateString(r,v._meta)),e.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,v.title.font).call(l.convertToTspans,t);var c=x(d,u._size);e.attr("transform",s(c.x,c.y)+o(Math.min(1,c.scale))+s(c.tx,c.ty))}))}))}))}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../bar/plot":668,"../bar/uniform_text":673,"../pie/helpers":915,"../pie/plot":919,"@plotly/d3":58}],800:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../pie/style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");a(t,e,"funnelarea"),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(i,t,e)}))}))}},{"../bar/uniform_text":673,"../pie/style_one":921,"@plotly/d3":58}],801:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../lib/extend").extendFlat;e.exports=u({z:{valType:"data_array",editType:"calc"},x:u({},n.x,{impliedEdits:{xtype:"array"}}),x0:u({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:u({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:u({},n.y,{impliedEdits:{ytype:"array"}}),y0:u({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:u({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:u({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:u({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:u({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:u({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:u({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:u({},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"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:a({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:u({},i.showlegend,{dflt:!1})},{transforms:void 0},c("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/font_attributes":594,"../../plots/template_attributes":642,"../scatter/attributes":936}],802:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),f=t("./interp2d"),h=t("./find_empties"),p=t("./make_bound_array"),d=t("../../constants/numerical").BADNUM;function m(t){for(var e=[],r=t.length,n=0;nD){O("x scale is not linear");break}}if(x.length&&"fast"===P){var R=(x[x.length-1]-x[0])/(x.length-1),F=Math.abs(R/100);for(k=0;kF){O("y scale is not linear");break}}}var B=i.maxRowLength(T),N="scaled"===e.xtype?"":r,j=p(e,N,g,v,B,M),U="scaled"===e.ytype?"":x,V=p(e,U,b,_,T.length,S);C||(e._extremes[M._id]=a.findExtremes(M,j),e._extremes[S._id]=a.findExtremes(S,V));var H={x:j,y:V,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(H.orig_x=y),e.yperiodalignment&&w&&(H.orig_y=w),N&&N.length===j.length-1&&(H.xCenter=N),U&&U.length===V.length-1&&(H.yCenter=U),L&&(H.xRanges=A.xRanges,H.yRanges=A.yRanges,H.pts=A.pts),E||l(t,e,{vals:T,cLetter:"z"}),E&&e.contours&&"heatmap"===e.contours.coloring){var q={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};H.xfill=p(q,N,g,v,B,M),H.yfill=p(q,U,b,_,T.length,S)}return[H]}},{"../../components/colorscale/calc":375,"../../constants/numerical":491,"../../lib":515,"../../plots/cartesian/align_period":563,"../../plots/cartesian/axes":566,"../../registry":647,"../histogram2d/calc":835,"./clean_2d_array":803,"./convert_column_xyz":805,"./find_empties":807,"./interp2d":810,"./make_bound_array":812}],803:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,f,h;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":515}],808:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l){l||(l={});var c,u,f,h,p=l.isContour,d=t.cd[0],m=d.trace,g=t.xa,v=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,T=d.zmask,k=m.zhoverformat,A=y,M=x;if(!1!==t.index){try{f=Math.round(t.index[1]),h=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=b[0].length||h<0||h>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(p){var S;for(A=[2*y[0]-y[1]],S=1;Sm&&(v=Math.max(v,Math.abs(t[a][o]-d)/(g-m))))}return v}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":515}],811:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){t("texttemplate");var r=n.extendFlat({},e.font,{color:"auto",size:"auto"});n.coerceFont(t,"textfont",r)}},{"../../lib":515}],812:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,f=[],h=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!p&&"category"!==s.type){var m=e.length;if(!(m<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||d)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;u0;)_=w.c2p(R[S]),S--;for(_0;)M=T.c2p(F[S]),S--;if(MGt||Gt>T._length))for(E=Ut;EWt||Wt>w._length)){var Zt=u({x:Yt,y:qt},I,t._fullLayout);Zt.x=Yt,Zt.y=qt;var Xt=P.z[S][E];void 0===Xt?(Zt.z="",Zt.zLabel=""):(Zt.z=Xt,Zt.zLabel=s.tickText(Ft,Xt,"hover").text);var Jt=P.text&&P.text[S]&&P.text[S][E];void 0!==Jt&&!1!==Jt||(Jt=""),Zt.text=Jt;var Kt=l.texttemplateString(Dt,Zt,t._fullLayout._d3locale,Zt,I._meta||{});if(Kt){var Qt=Kt.split("
"),$t=Qt.length,te=0;for(L=0;L<$t;L++)te=Math.max(te,Qt[L].length);Ht.push({l:$t,c:te,t:Kt,x:Wt,y:Gt,z:Xt})}}}}var ee=I.textfont,re=ee.family,ne=ee.size,ie=t._fullLayout.font.size;if(!ne||"auto"===ne){var ae=1/0,oe=1/0,se=0,le=0;for(L=0;L0&&(a=!0);for(var l=0;la){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),c=d(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,h=-.1*e,p=t-h,d=r[0],m=r[1],g=Math.min(f(d+h,d+p,n,a),f(m+h,m+p,n,a)),v=Math.min(f(d+c,d+h,n,a),f(m+c,m+h,n,a));if(g>v&&vo){var y=s===i?1:6,x=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),z.start=r.l2r(j),F||i.nestedProperty(e,v+".start").set(z.start)}var U=b.end,V=r.r2l(O.end),H=void 0!==V;if((b.endFound||H)&&V!==r.r2l(U)){var q=H?V:i.aggNums(Math.max,null,d);z.end=r.l2r(q),H||i.nestedProperty(e,v+".start").set(z.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[v]=i.extendFlat({},e[v]||{}),delete e._input[G],delete e[G]),[z,d]}e.exports={calc:function(t,e){var r,a,p,d,m=[],g=[],v="h"===e.orientation,y=o.getFromId(t,v?e.yaxis:e.xaxis),x=v?"y":"x",b={x:"y",y:"x"}[x],_=e[x+"calendar"],w=e.cumulative,T=h(t,e,y,x),k=T[0],A=T[1],M="string"==typeof k.size,S=[],E=M?S:k,L=[],C=[],P=[],I=0,O=e.histnorm,z=e.histfunc,D=-1!==O.indexOf("density");w.enabled&&D&&(O=O.replace(/ ?density$/,""),D=!1);var R,F="max"===z||"min"===z?null:0,B=l.count,N=c[O],j=!1,U=function(t){return y.r2c(t,0,_)};for(i.isArrayOrTypedArray(e[b])&&"count"!==z&&(R=e[b],j="avg"===z,B=l[z]),r=U(k.start),p=U(k.end)+(r-o.tickIncrement(r,k.size,!1,_))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),Q=[],$=0,tt=K-1;for(r=0;r=$;r--)if(g[r]){tt=r;break}for(r=$;r<=tt;r++)if(n(m[r])&&n(g[r])){var et={p:m[r],s:g[r],b:0};w.enabled||(et.pts=P[r],Y?et.ph0=et.ph1=P[r].length?A[P[r][0]]:m[r]:(e._computePh=!0,et.ph0=q(S[r]),et.ph1=q(S[r+1],!0))),Q.push(et)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,k.size,!1,_)-Q[0].p),s(Q,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(Q,e,X),Q},calcAllAutoBins:h}},{"../../lib":515,"../../plots/cartesian/axes":566,"../../registry":647,"../bar/arrays_to_calcdata":656,"./average":822,"./bin_functions":824,"./bin_label_vals":825,"./norm_functions":833,"fast-isnumeric":190}],827:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],828:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),a=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=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,h,p,d,m,g,v=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,a){var o=t.uid+"__"+a;r||(r=o);var s=function(t,r){return i.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",c=v[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],L=[],C=[],P="string"==typeof w.size,I="string"==typeof A.size,O=[],z=[],D=P?O:w,R=I?z:A,F=0,B=[],N=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),H="max"===U||"min"===U?null:0,q=a.count,G=o[j],Y=!1,W=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==U&&(Y="avg"===U,q=a[U]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-i.tickIncrement(K,J,!1,v))/1e6;for(r=K;r=0&&p=0&&d-1,flipY:L.tiling.flip.indexOf("y")>-1,orientation:L.tiling.orientation,pad:{inner:L.tiling.pad},maxDepth:L._maxDepth}).descendants(),z=1/0,D=-1/0;O.forEach((function(t){var e=t.depth;e>=L._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(z=Math.min(z,e),D=Math.max(D,e))})),p=p.data(O,u.getPtId),L._maxVisibleLayers=isFinite(D)?D-z+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[m,g],x),p.order();var R=null;if(w&&M){var F=u.getPtId(M);p.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return R||{x0:0,x1:m,y0:0,y1:g}},N=p;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-L.tiling.pad),s._hoverY=y(I?s.y1-L.tiling.pad/2:s.y0+L.tiling.pad/2);var p=n.select(this),d=i.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?d.transition().attrTween("d",(function(t){var e=k(t,!1,B(),[m,g],{orientation:L.tiling.orientation,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1});return function(t){return x(e(t))}})):d.attr("d",x),p.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),d.call(l,s,L,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h(s,r,L,e,E)||"";var T=i.ensureSingle(p,"g","slicetext"),M=i.ensureSingle(T,"text","",(function(t){t.attr("data-notex",1)})),O=i.ensureUniformFontSize(t,u.determineTextFont(L,s,E.font));M.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":C?"start":"middle").call(a.font,O).call(o.convertToTspans,t),s.textBB=a.bBox(M.node()),s.transform=b(s,{fontSize:O.size}),s.transform.fontSize=O.size,w?M.transition().attrTween("transform",(function(t){var e=A(t,!1,B(),[m,g]);return function(t){return _(e(t))}})):M.attr("transform",_(s))})),R}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../sunburst/fx":1063,"../sunburst/helpers":1064,"../sunburst/plot":1068,"../treemap/constants":1087,"./partition":851,"./style":853,"@plotly/d3":58}],848:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":954,"./attributes":843,"./base_plot":844,"./calc":845,"./defaults":846,"./layout_attributes":849,"./layout_defaults":850,"./plot":852,"./style":853}],849:[function(t,e,r){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],850:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("iciclecolorway",e.colorway),r("extendiciclecolors")}},{"../../lib":515,"./layout_attributes":849}],851:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),i=t("../treemap/flip_tree");e.exports=function(t,e,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&i(f,e,{swapXY:s,flipX:a,flipY:o}),f}},{"../treemap/flip_tree":1092,"d3-hierarchy":115}],852:[function(t,e,r){"use strict";var n=t("../treemap/draw"),i=t("./draw_descendants");e.exports=function(t,e,r,a){return n(t,e,r,a,{type:"icicle",drawDescendants:i})}},{"../treemap/draw":1089,"./draw_descendants":847}],853:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");o(t,e,"icicle"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":367,"../../lib":515,"../bar/uniform_text":673,"@plotly/d3":58}],854:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,f=Math.floor((e-o.x0)/s.dx),h=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[h][f]:s._hasSource&&(u=s._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,h,1,1).data),u){var p,d=o.hi||s.hoverinfo;if(d){var m=d.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(p=!0)}var g,v=a.colormodel[s.colormodel],y=v.colormodel||s.colormodel,x=y.length,b=s._scaler(u),_=v.suffix,w=[];(s.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(s.hovertext)&&Array.isArray(s.hovertext[h])?g=s.hovertext[h][f]:Array.isArray(s.text)&&Array.isArray(s.text[h])&&(g=s.text[h][f]);var T=c.c2p(o.y0+(h+.5)*s.dy),k=o.x0+(f+.5)*s.dx,A=o.y0+(h+.5)*s.dy,M="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(t,{index:[h,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:T,y1:T,color:b,xVal:k,xLabelVal:k,yVal:A,yLabelVal:A,zLabelVal:M,text:g,hovertemplateLabels:{zLabel:M,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":407,"../../lib":515,"./constants":856}],861:[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":578,"./attributes":854,"./calc":855,"./defaults":857,"./event_data":858,"./hover":860,"./plot":862,"./style":863}],862:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.strTranslate,o=t("../../constants/xmlns_namespaces"),s=t("./constants"),l=i.isIOS()||i.isSafari()||i.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,f=e.yaxis,h=!(l||t._context._exportedPlot);i.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),l=e[0],c=l.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&h)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=p;var d,m,g,v,y,x,b=l.z,_=l.x0,w=l.y0,T=l.w,k=l.h,A=c.dx,M=c.dy;for(x=0;void 0===d&&x0;)m=u.c2p(_+x*A),x--;for(x=0;void 0===v&&x0;)y=f.c2p(w+x*M),x--;if(mI[0];if(O||z){var D=d+S/2,R=v+E/2;C+="transform:"+a(D+"px",R+"px")+"scale("+(O?-1:1)+","+(z?-1:1)+")"+a(-D+"px",-R+"px")+";"}}L.attr("style",C);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",{willReadFrequently:!0});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=B((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",{willReadFrequently:!0}).getImageData(0,0,T,k).data;t=B((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}L.attr({"xlink:href":t,height:E,width:S,x:d,y:v})}));t._promises.push(F)}function B(t){var e=document.createElement("canvas");e.width=S,e.height=E;var r,n=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return i.constrain(Math.round(u.c2p(_+t*A)-d),0,S)},o=function(t){return i.constrain(Math.round(f.c2p(w+t*M)-v),0,E)},h=s.colormodel[c.colormodel],p=h.colormodel||c.colormodel,m=h.fmt;for(x=0;x0}function T(t){t.each((function(t){y.stroke(n.select(this),t.line.color)})).each((function(t){y.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),a={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(i,a,v,t,e)}return m(i,a,l,s,n),g(i,a,l,s),a}function A(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function M(t,e,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(p.convertToTspans,i).call(f.font,e),f.bBox(o.node())}function S(t,e,r,n,i,a){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=o.aggNums(a,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,m){var g,v=t._fullLayout;w(r)&&m&&(g=m()),o.makeTraceGroups(v._indicatorlayer,e,"trace").each((function(e){var m,E,L,C,P,I=e[0].trace,O=n.select(this),z=I._hasGauge,D=I._isAngular,R=I._isBullet,F=I.domain,B={w:v._size.w*(F.x[1]-F.x[0]),h:v._size.h*(F.y[1]-F.y[0]),l:v._size.l+v._size.w*F.x[0],r:v._size.r+v._size.w*(1-F.x[1]),t:v._size.t+v._size.h*(1-F.y[1]),b:v._size.b+v._size.h*F.y[0]},N=B.l+B.w/2,j=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,H=I.align||"center";if(E=j,z){if(D&&(m=N,E=j+U/2,L=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*V)}),R){var q=h.bulletPadding,G=1-h.bulletNumberDomainSize+q;m=B.l+(G+(1-G)*b[H])*B.w,L=function(t){return A(t,(h.bulletNumberDomainSize-q)*B.w,B.h)}}}else m=B.l+b[H]*B.w,L=function(t){return A(t,B.w,B.h)};!function(t,e,r,i){var c,u,h,m=r[0].trace,g=i.numbersX,v=i.numbersY,T=m.align||"center",A=x[T],E=i.transitionOpts,L=i.onComplete,C=o.ensureSingle(e,"g","numbers"),P=[];m._hasNumber&&P.push("number");m._hasDelta&&(P.push("delta"),"left"===m.delta.position&&P.reverse());var I=C.selectAll("text").data(P);function O(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}I.enter().append("text"),I.attr("text-anchor",(function(){return A})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var z,D=m.mode+m.align;m._hasDelta&&(z=function(){var e=k(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},c=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},h=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(r[0]));var g=C.select("text.delta");function v(){g.text(c(l(r[0]),i)).call(y.fill,h(r[0])).call(p.convertToTspans,t)}return g.call(f.font,m.delta.font).call(y.fill,h({delta:m._deltaLastValue})),w(E)?g.transition().duration(E.duration).ease(E.easing).tween("text",(function(){var t=n.select(this),e=l(r[0]),o=m._deltaLastValue,s=O(m.delta.valueformat,i,o,e),u=a(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(y.fill,h({delta:u(e)}))}})).each("end",(function(){v(),L&&L()})).each("interrupt",(function(){v(),L&&L()})):v(),u=M(c(l(r[0]),i),m.delta.font,A,t),g}(),D+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,D+=m.delta.increasing.symbol+m.delta.decreasing.symbol,h=u);m._hasNumber&&(!function(){var e=k(t,{tickformat:m.number.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=C.select("text.number");function u(){var e="number"==typeof r[0].y?s+i(r[0].y)+o:"-";l.text(e).call(f.font,m.number.font).call(p.convertToTspans,t)}w(E)?l.transition().duration(E.duration).ease(E.easing).each("end",(function(){u(),L&&L()})).each("interrupt",(function(){u(),L&&L()})).attrTween("text",(function(){var t=n.select(this),e=a(r[0].lastY,r[0].y);m._lastValue=r[0].y;var l=O(m.number.valueformat,i,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}})):u(),c=M(s+i(r[0].y)+o,m.number.font,A,t)}(),D+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,h=c);if(m._hasDelta&&m._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],N=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*m.delta.font.size;"left"===m.delta.position&&(R=S(m,"deltaPos",0,-1*(c.width*b[m.align]+u.width*(1-b[m.align])+j),D,Math.min),F=B[1]-N[1],h={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=S(m,"deltaPos",0,c.width*(1-b[m.align])+u.width*b[m.align]+j,D,Math.max),F=B[1]-N[1],h={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,h={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,h={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),z.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&C.attr("transform",(function(){var t=i.numbersScaler(h);D+=t[2];var e,r=S(m,"numbersScale",1,t[0],D,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?v-r*h.bottom:v-r*(h.top+h.bottom)/2,m._numbersTop=r*h.top+e;var n=h[T];"center"===T&&(n=(h.left+h.right)/2);var a=g-r*n;return a=S(m,"numbersTranslate",0,a,D,Math.max),l(a,e)+s(r)}))}(t,O,e,{numbersX:m,numbersY:E,numbersScaler:L,transitionOpts:r,onComplete:g}),z&&(C={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},P={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var Y=O.selectAll("g.angular").data(D?e:[]);Y.exit().remove();var W=O.selectAll("g.angularaxis").data(D?e:[]);W.exit().remove(),D&&function(t,e,r,a){var o,s,f,h,p=r[0].trace,m=a.size,g=a.radius,v=a.innerRadius,y=a.gaugeBg,x=a.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,A=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function L(t){var e=p.gauge.axis.range[0],r=(t-e)/(p.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function C(t){return n.svg.arc().innerRadius((v+g)/2-t/2*(g-v)).outerRadius((v+g)/2+t/2*(g-v)).startAngle(-E)}function P(t){t.attr("d",(function(t){return C(t.thickness).startAngle(L(t.range[0])).endAngle(L(t.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(b[0],b[1])),A.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),A.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},O={},z=d.makeLabelFns(o,0).labelStandoff;O.xFn=function(t){var e=I(t);return Math.cos(e)*z},O.yFn=function(t){var e=I(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(z+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},O.anchorFn=function(t){var e=I(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},O.heightFn=function(t,e,r){var n=I(t);return-.5*(1+Math.sin(n))*r};var D=function(t){return l(b[0]+g*Math.cos(t),b[1]-g*Math.sin(t))};f=function(t){return D(I(t))};if(s=d.calcTicks(o),h=d.getTickSigns(o)[2],o.visible){h="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:A,path:"M"+h*R+",0h"+h*o.ticklen,transFn:function(t){var e=I(t);return D(e)+"rotate("+-c(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:A,transFn:f,labelFns:O})}var F=[y].concat(p.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(P).call(T),B.exit().remove();var N=C(p.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([p.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var U=j.select("path");w(M)?(U.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(V=N,H=L(r[0].lastY),q=L(r[0].y),function(){var t=i(H,q);return function(e){return V.endAngle(t(e))()}})),p._lastValue=r[0].y):U.attr("d","number"==typeof r[0].y?N.endAngle(L(r[0].y)):"M0,0Z");var V,H,q;U.call(T),j.exit().remove(),F=[];var G=p.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var Y=_.selectAll("g.threshold-arc").data(F);Y.enter().append("g").classed("threshold-arc",!0).append("path"),Y.select("path").call(P).call(T),Y.exit().remove();var W=_.selectAll("g.gauge-outline").data([x]);W.enter().append("g").classed("gauge-outline",!0).append("path"),W.select("path").call(P).call(T),W.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Y,layer:W,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var Z=O.selectAll("g.bullet").data(R?e:[]);Z.exit().remove();var X=O.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,s,c,u=r[0].trace,f=n.gauge,p=n.layer,m=n.gaugeBg,g=n.gaugeOutline,v=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(v.l,v.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var A=v.h,M=u.gauge.bar.thickness*A,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);(i=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),s=d.getTickSigns(i)[2],c=v.t+v.h,i.visible&&(d.drawTicks(t,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:p,path:d.makeTickPath(i,c,s),transFn:o}),d.drawLabels(t,i,{vals:a,layer:p,transFn:o,labelFns:d.makeLabelFns(i,c)}));function L(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*A})).attr("height",(function(t){return t.thickness*A}))}var C=[m].concat(u.gauge.steps),P=f.selectAll("g.bg-bullet").data(C);P.enter().append("g").classed("bg-bullet",!0).append("rect"),P.select("rect").call(L).call(T),P.exit().remove();var I=f.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",M).attr("y",(A-M)/2).call(T),w(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);I.exit().remove();var O=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),z=f.selectAll("g.threshold-bullet").data(O);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*A).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*A).call(y.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),z.exit().remove();var D=f.selectAll("g.gauge-outline").data([g]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(L).call(T),D.exit().remove()}(t,0,e,{gauge:Z,layer:X,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var J=O.selectAll("text.title").data(e);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?x.right:x[I.title.align]})).text(I.title.text).call(f.font,I.title.font).call(p.convertToTspans,t),J.attr("transform",(function(){var t,e=B.l+B.w*b[I.title.align],r=h.titlePadding,n=f.bBox(J.node());if(z){if(D)if(I.gauge.axis.visible)t=f.bBox(W.node()).top-r-n.bottom;else t=B.t+B.h/2-U/2-n.bottom-r;R&&(t=E-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)}else t=I._numbersTop-r-n.bottom;return l(e,t)}))}))}},{"../../components/color":367,"../../components/drawing":389,"../../constants/alignment":483,"../../lib":515,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"../../plots/cartesian/axis_defaults":568,"../../plots/cartesian/layout_attributes":579,"../../plots/cartesian/position_defaults":582,"./constants":867,"@plotly/d3":58,"d3-interpolate":116}],871:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plot_api/edit_types":548,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642,"../mesh3d/attributes":876}],872:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){C();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[p]:L(d,m,v);h[p]=x>-1?x:I(d,m,v,R(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function B(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,i),N(e[1][3],n,i),N(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):a<3&&V(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],p=B(h,u,n,i),d=B(h,f,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,f,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],p=B(f,u,n,i),d=B(h,u,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function H(t,e,r,n){var i=!1,a=U(e),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]];if(m)i=F(t,[c,u,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=B(h,c,r,n),d=B(h,u,r,n),g=B(h,f,r,n);i=F(null,[p,d,g],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],p=B(f,c,r,n),d=B(f,u,r,n),g=B(h,u,r,n),v=B(h,c,r,n);m?(i=F(t,[c,v,p],[e[l[0]],-1,-1])||i,i=F(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,d,g,v],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],p=B(u,c,r,n),d=B(f,c,r,n),g=B(h,c,r,n);m?(i=F(t,[c,p,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,p],[e[l[0]],-1,-1])||i):i=F(null,[p,d,g],[-1,-1,-1])||i,s=!0}})),i)}function q(t,e,r,n,i,a,o,s,l,c,u){var f=!1;return d&&(D(t,"A")&&(f=H(null,[e,r,n,a],c,u)||f),D(t,"B")&&(f=H(null,[r,n,i,l],c,u)||f),D(t,"C")&&(f=H(null,[r,a,o,l],c,u)||f),D(t,"D")&&(f=H(null,[n,a,s,l],c,u)||f),D(t,"E")&&(f=H(null,[r,n,a,l],c,u)||f)),m&&(f=H(t,[r,n,a,l],c,u)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function Y(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,c,u,f=!1,h=function(){f=V(t,[s,l,c],[-1,-1,-1],i,a)||f,f=V(t,[c,u,s],[-1,-1,-1],i,a)||f},p=o[0],d=o[1],m=o[2];return p&&(s=O(U([k(e,r-0,n-0)])[0],U([k(e-1,r-0,n-0)])[0],p),l=O(U([k(e,r-0,n-1)])[0],U([k(e-1,r-0,n-1)])[0],p),c=O(U([k(e,r-1,n-1)])[0],U([k(e-1,r-1,n-1)])[0],p),u=O(U([k(e,r-1,n-0)])[0],U([k(e-1,r-1,n-0)])[0],p),h()),d&&(s=O(U([k(e-0,r,n-0)])[0],U([k(e-0,r-1,n-0)])[0],d),l=O(U([k(e-0,r,n-1)])[0],U([k(e-0,r-1,n-1)])[0],d),c=O(U([k(e-1,r,n-1)])[0],U([k(e-1,r-1,n-1)])[0],d),u=O(U([k(e-1,r,n-0)])[0],U([k(e-1,r-1,n-0)])[0],d),h()),m&&(s=O(U([k(e-0,r-0,n)])[0],U([k(e-0,r-0,n-1)])[0],m),l=O(U([k(e-0,r-1,n)])[0],U([k(e-0,r-1,n-1)])[0],m),c=O(U([k(e-1,r-1,n)])[0],U([k(e-1,r-1,n-1)])[0],m),u=O(U([k(e-1,r-0,n)])[0],U([k(e-1,r-0,n-1)])[0],m),h()),f}function Z(t,e,r,n,i,a,o,s,l,c,u,f){var h=t;return f?(d&&"even"===t&&(h=null),q(h,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(h=null),q(h,l,s,o,a,i,n,r,e,c,u))}function X(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(d-M)?[A,d]:[d,M];$(e,T[0],T[1])}}var L=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(p.id),"x"===e?f.push([p.distRatio,0,0]):"y"===e?f.push([0,p.distRatio,0]):f.push([0,0,p.distRatio]))}else c=nt(1,"x"===e?b-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),c.length>0&&(r[i]="x"===e?X(null,c,a,o,r[i]):"y"===e?J(null,c,a,o,r[i]):K(null,c,a,o,r[i]),i++)}var d=t.caps[e];d.show&&d.fill&&(z(d.fill),r[i]="x"===e?X(null,[0,b-1],a,o,r[i]):"y"===e?J(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===g&&P(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=v,t._Ys=y,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../../stackgl_modules":1133,"../../components/colorscale":379,"../../lib/gl_format_color":511,"../../lib/str2rgbarray":540,"../../plots/gl3d/zip3":618}],874:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),f=a("z"),h=a("value");c&&c.length&&u&&u.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":377,"../../lib":515,"../../registry":647,"./attributes":871}],875:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":607,"./attributes":871,"./calc":872,"./convert":873,"./defaults":874}],876:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642,"../surface/attributes":1070}],877:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":375}],878:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_mesh3d,i=t("../../../stackgl_modules").delaunay_triangulate,a=t("../../../stackgl_modules").alpha_shape,o=t("../../../stackgl_modules").convex_hull,s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=u(m(t.i),m(t.j),m(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;ov):g=A>w,v=A;var M=c(w,T,k,A);M.pos=_,M.yc=(w+A)/2,M.i=b,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[k,T],y&&(M.orig_p=r[b]),d&&(M.tx=e.text[b]),m&&(M.htx=e.hovertext[b]),x.push(M)}else x.push({pos:_,empty:!0})}return e._extremes[l._id]=a.findExtremes(l,n.concat(h,f),{padded:!0}),x.length&&(x[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),s=function(t,e,r){var i=r._minDiff;if(!i){var a,s=t._fullData,l=[];for(i=1/0,a=0;a"+c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat):((y=i.extendFlat({},h)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat),y.name="",f.push(y),g[b]=y)}return f}function h(t,e,r,i){var a=t.cd,o=t.ya,l=a[0].trace,f=a[0].t,h=u(t,e,r,i);if(!h)return[];var p=a[h.index],d=h.index=p.i,m=p.dir;function g(t){return f.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var v=p.hi||l.hoverinfo,y=v.split("+"),x="all"===v,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+c[m]]:[];return _&&s(p,l,w),h.extraText=w.join("
"),h.y0=h.y1=o.c2p(p.yc,!0),[h]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?f(t,e,r,n):h(t,e,r,n)},hoverSplit:f,hoverOnPoints:h}},{"../../components/color":367,"../../components/fx":407,"../../constants/delta.js":485,"../../lib":515,"../../plots/cartesian/axes":566}],885:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":578,"./attributes":881,"./calc":882,"./defaults":883,"./hover":884,"./plot":887,"./select":888,"./style":889}],886:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var f=Math.min(s.length,l.length,c.length,u.length);return o&&(f=Math.min(f,i.minRowLength(o))),e._length=f,f}}},{"../../lib":515,"../../registry":647}],887:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],a=r.t;if(!0!==r.trace.visible||a.empty)e.remove();else{var c=a.tickLen,u=e.selectAll("path").data(i.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}},{"../../lib":515,"@plotly/d3":58}],888:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,f){function h(r,i){return n.coerce(t,e,l,r,i)}var p=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,f,h);o(e,f,h),Array.isArray(p)&&p.length||(e.visible=!1),c(e,p,"values",d),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var m={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(h,"labelfont",m);var g={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(h,"tickfont",g)}},{"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"../../lib":515,"../../plots/array_container_defaults":561,"../../plots/domain":593,"../parcoords/merge_length":907,"./attributes":890}],894:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":890,"./base_plot":891,"./calc":892,"./defaults":893,"./plot":896}],895:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-interpolate").interpolateNumber,a=t("../../plot_api/plot_api"),o=t("../../components/fx"),s=t("../../lib"),l=s.strTranslate,c=t("../../components/drawing"),u=t("tinycolor2"),f=t("../../lib/svg_text_utils");function h(t,e,r,i){var a=e._context.staticPlot,o=t.map(F.bind(0,e,r)),u=i.selectAll("g.parcatslayer").data([null]);u.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var h=u.selectAll("g.trace.parcats").data(o,p),y=h.enter().append("g").attr("class","trace parcats");h.attr("transform",(function(t){return l(t.x,t.y)})),y.append("g").attr("class","paths");var x=h.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),p);x.attr("fill",(function(t){return t.model.color}));var w=x.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);_(w),x.attr("d",(function(t){return t.svgD})),w.empty()||x.sort(m),x.exit().remove(),x.on("mouseover",g).on("mouseout",v).on("click",b),y.append("g").attr("class","dimensions");var A=h.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),p);A.enter().append("g").attr("class","dimension"),A.attr("transform",(function(t){return l(t.x,0)})),A.exit().remove();var M=A.selectAll("g.category").data((function(t){return t.categories}),p),S=M.enter().append("g").attr("class","category");M.attr("transform",(function(t){return l(0,t.y)})),S.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),T(S);var E=M.selectAll("rect.bandrect").data((function(t){return t.bands}),p);E.each((function(){s.raiseToTop(this)})),E.attr("fill",(function(t){return t.color}));var z=E.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);E.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),k(z),E.exit().remove(),S.append("text").attr("class","catlabel").attr("pointer-events","none");var D=e._fullLayout.paper_bgcolor;M.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(D)).style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){c.font(n.select(this),t.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),e)})),S.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){c.font(n.select(this),t.parcatsViewModel.labelfont)})),M.selectAll("rect.bandrect").on("mouseover",L).on("mouseout",C),M.exit().remove(),A.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",P).on("drag",I).on("dragend",O)),h.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),h.exit().remove()}function p(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function m(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),L=n.mouse(f)[0];o.loneHover({trace:h,x:b-d.left+m.left,y:_-d.top+m.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:L1&&h.displayInd===f.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,v=m/u.parcatsViewModel.model.count,y={countLabel:m,categoryLabel:g,probabilityLabel:v.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",y.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+y.categoryLabel+"):",y.probabilityLabel].join(" "));var b=x.join("
");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:y,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:v}]}}function L(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron;if("color"===l?(!function(t){var e=n.select(t).datum(),r=A(e);w(r),r.each((function(){s.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=A(t);w(e),e.each((function(){s.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),M(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===l?e=E(r,a,this):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),f=c.categoryViewModel,h=f.parcatsViewModel,p=h.model.dimensions[f.model.dimensionInd],d=h.trace,m=l.y+l.height/2;h.dimensions.length>1&&p.displayInd===h.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=f.model.categoryLabel,v=c.parcatsViewModel.model.count,y=0;c.categoryViewModel.bands.forEach((function(t){t.color===c.color&&(y+=t.count)}));var x=f.model.count,b=0;h.pathSelection.each((function(t){t.model.color===c.color&&(b+=t.model.count)}));var _=y/v,w=y/b,T=y/x,k={countLabel:v,categoryLabel:g,probabilityLabel:_.toFixed(3)},A=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&A.push(["Count:",k.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(A.push("P(color \u2229 "+g+"): "+k.probabilityLabel),A.push("P("+g+" | color): "+w.toFixed(3)),A.push("P(color | "+g+"): "+T.toFixed(3)));var M=A.join("
"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:v,probability:_,categorycount:x,colorcount:b,bandcolorcount:y}]}}(r,a,this):"dimension"===l&&(e=function(t,e,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(E(t,e,this))})),i}(r,a,this)),e&&o.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r})}}function C(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(_(e.pathSelection),T(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(m),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):M(this,"plotly_unhover",n.event)}}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var h=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[i];void 0!==h&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}j(t.parcatsViewModel),N(t.parcatsViewModel),R(t.parcatsViewModel),D(t.parcatsViewModel)}}function O(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=z(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),f=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[f],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):M(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),N(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){R(t.parcatsViewModel,!0),D(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function z(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),u+="l-"+r[s]+",0 ";return u+="Z"}function N(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function f(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=f(e),i=f(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var h=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(v.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],f=t.model.maxCats,h=e.categories.length,p=e.count,d=t.height-8*(f-1),m=8*(f-h)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}},{"../../components/drawing":389,"../../components/fx":407,"../../lib":515,"../../lib/svg_text_utils":541,"../../plot_api/plot_api":552,"@plotly/d3":58,"d3-interpolate":116,tinycolor2:313}],896:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},{"./parcats":895}],897:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plot_api/plot_template":555,"../../plots/cartesian/layout_attributes":579,"../../plots/domain":593,"../../plots/font_attributes":594}],898:[function(t,e,r){"use strict";var n=t("./constants"),i=t("@plotly/d3"),a=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=t("../../lib").strTranslate,c=n.bar.snapRatio;function u(t,e){return t*(1-c)+e*c}var f=n.bar.snapClose;function h(t,e){return t*(1-f)+e*f}function p(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*fe){h=r;break}}if(a=u,isNaN(a)&&(a=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-c[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var g=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=x[0]&&y<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),b(t.parentNode)}function T(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",(function(t){i.event.preventDefault(),t.parent.inBrushDrag||T(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(i.behavior.drag().on("dragstart",(function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),b(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?b(t.parentNode,s):(s(),b(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function A(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(A)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,r){var i=t.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e,r){var i=r._context.staticPlot,a=t.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(d).call(m).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(k).attr("height",(function(t){return t.height-n.verticalPadding}));var s=t.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(t){return t.height})).call(x);var c=t.selectAll(".highlight").data(o);c.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(x)}(i,e,r)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?S(t.sort(A)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[p(0,r,t[0],[]),p(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":515,"../../lib/gup":512,"./constants":902,"@plotly/d3":58}],899:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":897,"./base_plot":900,"./calc":901,"./defaults":903}],900:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":492,"../../plots/get_data":602,"./plot":909,"@plotly/d3":58}],901:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale"),a=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),d.splice(f));var m=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:p}),g=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(m)&&m.length||(e.visible=!1),h(e,m,"values",g);var v={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",v),n.coerceFont(u,"tickfont",v),n.coerceFont(u,"rangefont",v),u("labelangle"),u("labelside"),u("unselected.line.color"),u("unselected.line.opacity")}},{"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"../../lib":515,"../../plots/array_container_defaults":561,"../../plots/cartesian/axes":566,"../../plots/domain":593,"./attributes":897,"./axisbrush":898,"./constants":902,"./merge_length":907}],904:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":515}],905:[function(t,e,r){"use strict";var n=t("./base_index");n.plot=t("./plot"),e.exports=n},{"./base_index":899,"./plot":909}],906:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[i].dim1.canvasX,o=i);0===s&&f(T,0,0,r.canvasWidth,r.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&no._length&&(S=S.slice(0,o._length));var L,C=o.tickvals;function P(t,e){return{val:t,text:L[e]}}function I(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){L=o.ticktext,Array.isArray(L)&&L.length?L.length>C.length?L=L.slice(0,C.length):C.length>L.length&&(C=C.slice(0,L.length)):L=C.map(a(o.tickformat));for(var O=1;O=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==N&&(u?a.hover(h):a.unhover&&a.unhover(h),N=f)}})),B.style("opacity",(function(t){return t.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var j=p.selectAll("."+y.cn.parcoords).data(F,d);j.exit().remove(),j.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var U=j.selectAll("."+y.cn.parcoordsControlView).data(m,d);U.enter().append("g").classed(y.cn.parcoordsControlView,!0),U.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var V=U.selectAll("."+y.cn.yAxis).data((function(t){return t.dimensions}),d);V.enter().append("g").classed(y.cn.yAxis,!0),U.each((function(t){O(V,t,T)})),B.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=b(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),V.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),V.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;R.linePickActive(!1),t.x=Math.max(-y.overdrag,Math.min(t.model.width+y.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,V.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),O(V,e,T),V.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",c(t.x,0)),V.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,O(V,e,T),n.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),R.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),V.exit().remove();var H=V.selectAll("."+y.cn.axisOverlays).data(m,d);H.enter().append("g").classed(y.cn.axisOverlays,!0),H.selectAll("."+y.cn.axis).remove();var q=H.selectAll("."+y.cn.axis).data(m,d);q.enter().append("g").classed(y.cn.axis,!0),q.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return v.isOrdinal(t)?e:z(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(q.selectAll("text"),t.model.tickFont)})),q.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),q.selectAll("text").style("text-shadow",u.makeTextShadow(A)).style("cursor","default");var G=H.selectAll("."+y.cn.axisHeading).data(m,d);G.enter().append("g").classed(y.cn.axisHeading,!0);var Y=G.selectAll("."+y.cn.axisTitle).data(m,d);Y.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),Y.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=I(t.model.labelAngle,t.model.labelSide),r=y.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=I(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var W=H.selectAll("."+y.cn.axisExtent).data(m,d);W.enter().append("g").classed(y.cn.axisExtent,!0);var Z=W.selectAll("."+y.cn.axisExtentTop).data(m,d);Z.enter().append("g").classed(y.cn.axisExtentTop,!0),Z.attr("transform",c(0,-y.axisExtentOffset));var X=Z.selectAll("."+y.cn.axisExtentTopText).data(m,d);X.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(P),X.text((function(t){return D(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var J=W.selectAll("."+y.cn.axisExtentBottom).data(m,d);J.enter().append("g").classed(y.cn.axisExtentBottom,!0),J.attr("transform",(function(t){return c(0,t.model.height+y.axisExtentOffset)}));var K=J.selectAll("."+y.cn.axisExtentBottomText).data(m,d);K.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(P),K.text((function(t){return D(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),x.ensureAxisBrush(H,A,t)}},{"../../components/colorscale":379,"../../components/drawing":389,"../../lib":515,"../../lib/gup":512,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"./axisbrush":898,"./constants":902,"./helpers":904,"./lines":906,"@plotly/d3":58,"color-rgba":91}],909:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl"),a=t("./helpers").isVisible,o={};function s(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var r=t._fullLayout;if(i(t,[],o)){var l={},c={},u={},f={},h=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=f[r]=n._fullInput.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()}));n(t,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,n,i){var a=c[e][n],o=i.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[s]){var h=a.constraintrange;l[s]=h||null}var p=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete p.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[f[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return s(t,e,r)-s(t,e,n)}}(r,c[e].filter(a));l[e].sort(n),c[e].filter((function(t){return!a(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[f[e]]])}})}}).reglPrecompiled=o},{"../../lib/prepare_regl":528,"./helpers":904,"./parcoords":908}],910:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),i=t("../../plots/domain").attributes,a=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=a({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:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({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:i({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:"angle",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":366,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/domain":593,"../../plots/font_attributes":594,"../../plots/template_attributes":642}],911:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":628}],912:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../../components/color"),o={};function s(t){return function(e,r){return!!e&&(!!(e=i(e)).isValid()&&(e=a.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function l(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r=0})),("funnelarea"===e.type?v:e.sort)&&a.sort((function(t,e){return e.v-t.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var c=0,u=0;u0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return i.coerce(t,e,a,r,n)}var u=l(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 h,p=c("text"),d=c("texttemplate");if(d||(h=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||h&&"none"!==h){var m=c("textposition");s(t,e,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(e,n,c);var g=c("hole");if(c("title.text")){var v=c("title.position",g?"middle center":"top center");g||"middle center"!==v||(e.title.position="top center"),i.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":515,"../../plots/domain":593,"../bar/defaults":661,"./attributes":910,"fast-isnumeric":190}],914:[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,bbox:t.bbox,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":403}],915:[function(t,e,r){"use strict";var n=t("../../lib");function i(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=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:f.hovertemplate||-1!==h.indexOf("name")?f.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,t.pts)||t.color,borderColor:g.castOption(_.bordercolor,t.pts),fontFamily:g.castOption(w.family,t.pts),fontSize:g.castOption(w.size,t.pts),fontColor:g.castOption(w.color,t.pts),nameLength:g.castOption(_.namelength,t.pts),textAlign:g.castOption(_.align,t.pts),hovertemplate:g.castOption(f.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[v(t,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[v(t,f)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,i=e._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[v(o,i)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,i=e._fullData[c.index];e._dragging||!1===r.hovermode||(e._hoverdata=[v(t,i)],a.click(e,n.event))}))}function b(t,e,r){var n=g.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=g.castOption(t._input.textfont.color,e.pts));var i=g.castOption(t.insidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.insidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:i,size:a}}function _(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)v(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)v(Math.PI*(g+1),"tan")}if(f||p){for(g=4;g>=-4;g-=2)v(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)v(Math.PI*(g+.5),"rad")}}if(s||d||f){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/y,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||p)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||h)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:A(a,o/e),rotate:M(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:A(a,o/e),rotate:M(i+Math.PI/2)}}function A(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function L(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function C(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),f=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=P(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function P(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 I(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function O(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/i.aspectratio):(u=r.r,c=u*i.aspectratio),c*=(1+i.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var x=l.castOption(i,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:g.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:g.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(i,t.i,"customdata")}}(e),_=g.getFirstFilled(i.text,e.pts);(y(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,i._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._context.staticPlot,a=t._fullLayout,h=a._size;d("pie",a),_(e,t),O(e,h);var m=l.makeTraceGroups(a._pielayer,e,"trace").each((function(e){var d=n.select(this),m=e[0],v=m.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=g.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(e),d.attr("stroke-linejoin","round"),d.each((function(){var y=n.select(this).selectAll("g.slice").data(e);y.enter().append("g").classed("slice",!0),y.exit().remove();var _=[[[],[]],[[],[]]],T=!1;y.each((function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=v.index,_[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var c=m.cx,u=m.cy,h=n.select(this),d=h.selectAll("path.surface").data([i]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),h.call(x,t,e),v.pull){var y=+g.castOption(v.pull,i.pts)||0;y>0&&(c+=y*i.pxmid[0],u+=y*i.pxmid[1])}i.cxFinal=c,i.cyFinal=u;var k=v.hole;if(i.v===m.vTotal){var A="M"+(c+i.px0[0])+","+(u+i.px0[1])+P(i.px0,i.pxmid,!0,1)+P(i.pxmid,i.px0,!0,1)+"Z";k?d.attr("d","M"+(c+k*i.px0[0])+","+(u+k*i.px0[1])+P(i.px0,i.pxmid,!1,k)+P(i.pxmid,i.px0,!1,k)+"Z"+A):d.attr("d",A)}else{var M=P(i.px0,i.px1,!0,1);if(k){var S=1-k;d.attr("d","M"+(c+k*i.px1[0])+","+(u+k*i.px1[1])+P(i.px1,i.px0,!1,k)+"l"+S*i.px0[0]+","+S*i.px0[1]+M+"Z")}else d.attr("d","M"+c+","+u+"l"+i.px0[0]+","+i.px0[1]+M+"Z")}D(t,i,m);var E=g.castOption(v.textposition,i.pts),C=h.selectAll("g.slicetext").data(i.text&&"none"!==E?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=l.ensureUniformFontSize(t,"outside"===E?function(t,e,r){var n=g.castOption(t.outsidetextfont.color,e.pts)||g.castOption(t.textfont.color,e.pts)||r.color,i=g.castOption(t.outsidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.outsidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(v,i,a.font):b(v,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,h).call(f.convertToTspans,t);var d,y=s.bBox(r.node());if("outside"===E)d=L(y,i);else if(d=w(y,i,m),"auto"===E&&d.scale<1){var x=l.ensureUniformFontSize(t,v.outsidetextfont);r.call(s.font,x),d=L(y=s.bBox(r.node()),i)}var _=d.textPosAngle,k=void 0===_?i.pxmid:z(m.r,_);if(d.targetX=c+k[0]*d.rCenter+(d.x||0),d.targetY=u+k[1]*d.rCenter+(d.y||0),R(d,y),d.outside){var A=d.targetY;i.yLabelMin=A-y.height/2,i.yLabelMid=A,i.yLabelMax=A+y.height/2,i.labelExtraX=0,i.labelExtraY=0,T=!0}d.fontSize=h.size,p(v.type,d,a),e[o].transform=d,l.setTransormAndDisplay(r,d)}))}function P(t,e,r,n){var a=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*m.r+","+n*m.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var k=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=v.title.text;v._meta&&(i=l.templateString(i,v._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,v.title.font).call(f.convertToTspans,t),e="middle center"===v.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}}(m):C(m,h),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),T&&function(t,e){var r,n,i,a,o,s,l,c,u,f,h,p,d;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,c,u,h,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-d;if(y*l>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(g.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=y):(m+t.labelExtraY-v)*l>0&&(i=3*s*Math.abs(c-f.indexOf(t)),(h=u.cxFinal+a(u.px0[0],u.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=h)))}for(n=0;n<2;n++)for(i=n?m:v,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(i),u=t[1-n][r],f=u.concat(c),p=[],h=0;hMath.abs(f)?s+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(a+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(y,v),T&&v.automargin){var A=s.bBox(d.node()),M=v.domain,S=h.w*(M.x[1]-M.x[0]),E=h.h*(M.y[1]-M.y[0]),P=(.5*S-m.r)/h.w,I=(.5*E-m.r)/h.h;i.autoMargin(t,"pie."+v.uid+".automargin",{xl:M.x[0]-P,xr:M.x[1]+P,yb:M.y[0]-I,yt:M.y[1]+I,l:Math.max(m.cx-m.r-A.left,0),r:Math.max(A.right-(m.cx+m.r),0),b:Math.max(A.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-A.top,0),pad:5})}}))}));setTimeout((function(){m.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:O,attachFxHandlers:x,computeTransform:R}},{"../../components/color":367,"../../components/drawing":389,"../../components/fx":407,"../../lib":515,"../../lib/svg_text_utils":541,"../../plots/plots":628,"../bar/constants":659,"../bar/uniform_text":673,"./event_data":914,"./helpers":915,"@plotly/d3":58}],920:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("./style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");a(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(i,t,e)}))}))}},{"../bar/uniform_text":673,"./style_one":921,"@plotly/d3":58}],921:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":367,"./helpers":915}],922:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":936}],923:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_pointcloud2d,i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,f=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,p=t.indices,d=this.bounds;if(f){if(n=f,e=f.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var m=i(t.marker.color),g=i(t.marker.border.color),v=t.opacity*t.marker.opacity;m[3]*=v,this.pointcloudOptions.color=m;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,g[3]*=v,this.pointcloudOptions.borderColor=g;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,T=b/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:T}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:T})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../../stackgl_modules":1133,"../../lib/str2rgbarray":540,"../../plots/cartesian/autorange":565,"../scatter/get_trace_color":946}],924:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),e._length=null}},{"../../lib":515,"./attributes":922}],925:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":605,"../scatter3d/calc":965,"./attributes":922,"./convert":923,"./defaults":924}],926:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,f=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,h=t("../../lib/extend").extendFlat,p=t("../../plot_api/edit_types").overrideAll;(e.exports=p({hoverinfo:h({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":366,"../../components/colorscale/attributes":374,"../../components/fx/attributes":398,"../../lib/extend":505,"../../plot_api/edit_types":548,"../../plot_api/plot_template":555,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/domain":593,"../../plots/font_attributes":594,"../../plots/template_attributes":642}],927:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../components/selections").prepSelect,u=t("../../lib"),f=t("../../registry");function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if(o&&"pan"!==i&&"zoom"!==i){s(o,a);var h={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:h,yaxis:p,fillRangeItems:u.noop},subplot:e,xaxes:[h],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;ry&&(y=a.source[e]),a.target[e]>y&&(y=a.target[e]);var x,b=y+1;t.node._count=b;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var T=_[e];for(x=0;x0&&s(E,b)&&s(L,b)&&(!w.hasOwnProperty(E)||!w.hasOwnProperty(L)||w[E]!==w[L])){w.hasOwnProperty(L)&&(L=w[L]),w.hasOwnProperty(E)&&(E=w[E]),L=+L,h[E=+E]=h[L]=!0;var C="";a.label&&a.label[e]&&(C=a.label[e]);var P=null;C&&p.hasOwnProperty(C)&&(P=p[C]),c.push({pointNumber:e,label:C,color:u?a.color[e]:a.color,customdata:f?a.customdata[e]:a.customdata,concentrationscale:P,source:E,target:L,value:+S}),M.source.push(E),M.target.push(L)}}var I=b+_.length,O=o(r.color),z=o(r.customdata),D=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:R,color:O?r.color[e]:r.color,customdata:z?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1}))}(I,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":379,"../../lib":515,"../../lib/gup":512,"strongly-connected-components":307}],929:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],930:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function f(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,h){function p(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(h.hoverlabel,t.hoverlabel),m=t.node,g=c.newContainer(e,"node");function v(t,e){return n.coerce(m,g,i.node,t,e)}v("label"),v("groups"),v("x"),v("y"),v("pad"),v("thickness"),v("line.color"),v("line.width"),v("hoverinfo",t.hoverinfo),l(m,g,v,d),v("hovertemplate");var y=h.colorway;v("color",g.label.map((function(t,e){return a.addOpacity(function(t){return y[t%y.length]}(e),.8)}))),v("customdata");var x=t.link||{},b=c.newContainer(e,"link");function _(t,e){return n.coerce(x,b,i.link,t,e)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,T=o(h.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(T,b.value.length)),_("customdata"),u(x,b,{name:"colorscales",handleItemDefaults:f}),s(e,h,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},h.font)),e._length=null}},{"../../components/color":367,"../../components/fx/hoverlabel_defaults":405,"../../lib":515,"../../plot_api/plot_template":555,"../../plots/array_container_defaults":561,"../../plots/domain":593,"./attributes":926,tinycolor2:313}],931:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":926,"./base_plot":927,"./calc":928,"./defaults":930,"./plot":932,"./select.js":934}],932:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("./render"),s=t("../../components/fx"),l=t("../../components/color"),c=t("./constants").cn,u=i._;function f(t){return""!==t}function h(t,e){return t.filter((function(t){return t.key===e.traceId}))}function p(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function m(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function v(t,e,r){e&&r&&h(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(x.bind(0,e,r,!1))}function y(t,e,r){e&&r&&h(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(b.bind(0,e,r,!1))}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),i&&h(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&h(e,t).selectAll("."+c.sankeyNode).filter(g(t)).call(v)}function b(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),i&&h(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&h(e,t).selectAll(c.sankeyNode).filter(g(t)).call(y)}function _(t,e){var r=t.hoverlabel||{},n=i.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,i=r._paper,h=r._size,m=0;m"),color:_(o,"bgcolor")||l.addOpacity(m.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});p(w,.85),d(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var a=r.node;a.originalEvent=n.event,t._hoverdata=[a],n.select(e).call(y,r,i),s.click(t,{target:!0})}}})}},{"../../components/color":367,"../../components/fx":407,"../../lib":515,"./constants":929,"./render":933,"@plotly/d3":58}],933:[function(t,e,r){"use strict";var n=t("d3-force"),i=t("d3-interpolate").interpolateNumber,a=t("@plotly/d3"),o=t("@plotly/d3-sankey"),s=t("@plotly/d3-sankey-circular"),l=t("./constants"),c=t("tinycolor2"),u=t("../../components/color"),f=t("../../components/drawing"),h=t("../../lib"),p=h.strTranslate,d=h.strRotate,m=t("../../lib/gup"),g=m.keyFun,v=m.repeat,y=m.unwrap,x=t("../../lib/svg_text_utils"),b=t("../../registry"),_=t("../../constants/alignment"),w=_.CAP_SHIFT,T=_.LINE_SPACING;function k(t,e,r){var n,i=y(e),a=i.trace,u=a.domain,f="h"===a.orientation,p=a.node.pad,d=a.node.thickness,m=t.width*(u.x[1]-u.x[0]),g=t.height*(u.y[1]-u.y[0]),v=i._nodes,x=i._links,b=i.circular;(n=b?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[m,g]:[g,m]).nodeWidth(d).nodePadding(p).nodeId((function(t){return t.pointNumber})).nodes(v).links(x);var _,w,T,k=n();for(var A in n.nodePadding()=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=k.nodes));n.update(k)}return{circular:b,key:r,trace:a,guid:h.randstr(),horizontal:f,width:m,height:g,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?g:m,dragPerpendicular:f?m:g,arrangement:a.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function A(t,e,r){var n=c(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:M,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function M(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r=t.width/2,n=t.circularPathData;return"top"===t.circularLinkType?"M "+(n.targetX-e)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"L"+(n.targetX-e)+" "+(n.targetY-r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-e)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"L"+(n.targetX-e)+" "+(n.targetY+r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var n=t.link.source.x1,a=t.link.target.x0-e,o=i(n,a),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,f=t.link.y1-t.link.width/2,h=t.link.y1+t.link.width/2,p="M"+n+","+c,d="C"+s+","+c+" "+l+","+f+" "+a+","+f,m="C"+l+","+h+" "+s+","+u+" "+n+","+u,g=e>0?"L"+(a+e)+","+(f+t.link.width/2):"";return p+d+(g+="L"+a+","+h)+m+"Z"}}function S(t,e){var r=c(e.color),n=l.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function E(t){t.attr("transform",(function(t){return p(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function L(t){t.call(E)}function C(t,e){t.call(L),e.attr("d",M())}function P(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function I(t){return t.link.width>1||t.linkLineWidth>0}function O(t){return p(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function z(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function D(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,i){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,a),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),C(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;el&&C[v].gap;)v--;for(x=C[v].s,m=C.length-1;m>v;m--)C[m].s=x;for(;lM[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],943:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),p=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults"),g=t("../../lib").coercePattern;e.exports=function(t,e,r,v){function y(r,i){return n.coerce(t,e,a,r,i)}var x=l(t,e,v,y);if(x||(e.visible=!1),e.visible){c(t,e,v,y),y("xhoverformat"),y("yhoverformat");var b=u(t,e,v,y),_=!b&&x=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-m);return aW!=(N=z[I][1])>=W&&(R=z[I-1][0],F=z[I][0],N-B&&(D=R+(F-R)*(W-B)/(N-B),H=Math.min(H,D),q=Math.max(q,D)));H=Math.max(H,0),q=Math.min(q,h._length);var Z=s.defaultLine;return s.opacity(f.fillcolor)?Z=f.fillcolor:s.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:H,x1:q,y0:W,y1:W,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":367,"../../components/fx":407,"../../lib":515,"../../registry":647,"./get_trace_color":946}],948:[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":578,"./arrays_to_calcdata":935,"./attributes":936,"./calc":937,"./cross_trace_calc":941,"./cross_trace_defaults":942,"./defaults":943,"./format_labels":945,"./hover":947,"./marker_colorbar":954,"./plot":957,"./select":958,"./style":960,"./subtypes":961}],949:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){l||(l={});var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"../../lib":515}],950:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../../constants/numerical"),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,c=t("../../lib"),u=c.segmentsIntersect,f=c.constrain,h=t("./constants");e.exports=function(t,e){var r,i,o,p,d,m,g,v,y,x,b,_,w,T,k,A,M,S,E=e.trace||{},L=e.xaxis,C=e.yaxis,P="log"===L.type,I="log"===C.type,O=L._length,z=C._length,D=e.backoff,R=E.marker,F=e.connectGaps,B=e.baseTolerance,N=e.shape,j="linear"===N,U=E.fill&&"none"!==E.fill,V=[],H=h.minTolerance,q=t.length,G=new Array(q),Y=0;function W(r){var n=t[r];if(!n)return!1;var i=e.linearized?L.l2p(n.x):L.c2p(n.x),o=e.linearized?C.l2p(n.y):C.c2p(n.y);if(i===a){if(P&&(i=L.c2p(n.x,!0)),i===a)return!1;I&&o===a&&(i*=Math.abs(L._m*z*(L._m>0?s:l)/(C._m*O*(C._m>0?s:l)))),i*=1e3}if(o===a){if(I&&(o=C.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function Z(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function ht(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l);return s}}function pt(t){var e=t[0],r=t[1],n=e===G[Y-1][0],i=r===G[Y-1][1];if(!n||!i)if(Y>1){var a=e===G[Y-2][0],o=r===G[Y-2][1];n&&(e===at||e===ot)&&a?o?Y--:G[Y-1]=t:i&&(r===st||r===lt)&&o?a?Y--:G[Y-1]=t:G[Y++]=t}else G[Y++]=t}function dt(t){G[Y-1][0]!==t[0]&&G[Y-1][1]!==t[1]&&pt([$,tt]),pt(t),et=null,$=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(Y)if(et){var n=nt(et,e);n.length>1&&(dt(n[0]),G[Y++]=n[1])}else rt=nt(G[Y-1],e)[0],G[Y++]=rt;else G[Y++]=[K||e[0],Q||e[1]];var i=G[Y-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?pt($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&pt([$,tt])),pt([K,Q])):$-K&&tt-Q&&pt([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&dt(nt(et,e)[0]),G[Y++]=e;var a,o,s,l}for(r=0;rX(m,vt))break;o=m,(w=y[0]*v[0]+y[1]*v[1])>b?(b=w,p=m,g=!1):w<_&&(_=w,d=m,g=!0)}if(g?(gt(p),o!==d&>(d)):(d!==i&>(d),o!==p&>(p)),gt(o),r>=t.length||!m)break;gt(m),i=m}}else gt(p)}et&&pt([$||et[0],tt||et[1]]),V.push(G.slice(0,Y))}var yt=N.slice(N.length-1);if(D&&"h"!==yt&&"v"!==yt){for(var xt=!1,bt=-1,_t=[],wt=0;wt=0?l=p:(l=p=h,h++),l0?Math.max(r,a):0}}},{"fast-isnumeric":190}],954:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],955:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":367,"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"./subtypes":961}],956:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":491,"../../lib":515}],957:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function p(t,e,r,f,p,d,m){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!c.hasMarkers(h))return;var p=h.marker.maxdisplayed;if(0===p)return;var d=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),m=Math.ceil(d.length/p),g=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return v?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(d),k=o(T,"g","errorbars"),A=o(T,"g","lines"),M=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===_.visible){var E,L;y(T).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,I,O="",z=[],D=_._prevtrace;D&&(O=D._prevRevpath||"",L=D._nextFill,z=D._polygons);var R,F,B,N,j,U,V,H="",q="",G=[],Y=a.noop;if(E=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(L&&L.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=u(f,{xaxis:x,yaxis:b,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",P),l.singleLineStyle(f,i)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(E?(E.datum(f),N&&U&&(C?("y"===C?N[1]=U[1]=b.c2p(0,!0):"x"===C&&(N[0]=U[0]=x.c2p(0,!0)),y(E).attr("d","M"+U+"L"+N+"L"+H.substr(1)).call(l.singleFillStyle,t)):y(E).attr("d",H+"Z").call(l.singleFillStyle,t))):L&&("tonext"===_.fill.substr(0,6)&&H&&O?("tonext"===_.fill?y(L).attr("d",H+"Z"+O+"Z").call(l.singleFillStyle,t):y(L).attr("d",H+"L"+O.substr(1)+"Z").call(l.singleFillStyle,t),_._polygons=_._polygons.concat(z)):(X(L),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=V):(E?X(E):L&&X(L),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),S.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),h=c.hasText(u),p=tt(u),d=et,m=et;if(f||h){var g=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?K:J:_&&!w&&(g=Q),f&&(d=g),h&&(m=g)}var T,k=(o=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(l.pointStyle,u,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,x,b)?(l.singlePointStyle(e,a,u,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,x,b,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,x,b)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.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()}(M,S,f);var Z=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Z,t),l.setClipUrl(S,Z,t)}function X(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,h,d=!a,m=!!a&&a.duration>0,g=f(t,e,r);((u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),m)?(c&&(h=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(t,n,e,r,g,this,a)}))}))):u.each((function(r,n){p(t,n,e,r,g,this,a)}));d&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":389,"../../lib":515,"../../lib/polygon":527,"../../registry":647,"./line_points":950,"./link_traces":952,"./subtypes":961,"@plotly/d3":58}],958:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return p[t]}function T(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||p);for(var d=["x","y","z"],m=0;m<3;++m){var g="projection."+d[m];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,h||p||r,{axis:"z"}),v(t,e,h||p||r,{axis:"y",inherit:"z"}),v(t,e,h||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":515,"../../registry":647,"../scatter/line_defaults":949,"../scatter/marker_defaults":955,"../scatter/subtypes":961,"../scatter/text_defaults":962,"./attributes":964}],969:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":489,"../../plots/gl3d":607,"./attributes":964,"./calc":965,"./convert":967,"./defaults":968}],970:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/template_attributes":642,"../scatter/attributes":936}],971:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e._length,p=new Array(h),d=!1;for(c=0;c")}return o}function y(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":515,"../scatter/hover":947}],976:[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:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":578,"../scatter/marker_colorbar":954,"../scatter/select":958,"../scatter/style":960,"./attributes":970,"./calc":971,"./defaults":972,"./event_data":973,"./format_labels":974,"./hover":975,"./plot":977}],977:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,f=i.getFromId(t,u.xaxis||"x"),h=i.getFromId(t,u.yaxis||"y"),p={xaxis:f,yaxis:h,plot:e.plot};for(s=0;s")}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":407,"../../constants/numerical":491,"../../lib":515,"../scatter/get_trace_color":946,"./attributes":978}],984:[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"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":598,"../scatter/marker_colorbar":954,"../scatter/style":960,"./attributes":978,"./calc":979,"./defaults":980,"./event_data":981,"./format_labels":982,"./hover":983,"./plot":985,"./select":986,"./style":987}],985:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,f=t("../scatter/subtypes"),h=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,i=t[0].trace,o=e[i.geo],f=o._subplot,h=i._length;if(Array.isArray(i.locations)){var p=i.locationmode,d="geojson-id"===p?s.extractTraceFeature(t):a(i,f.topojson);for(r=0;r=g,w=2*b,T={},k=l.makeCalcdata(e,"x"),A=y.makeCalcdata(e,"y"),M=s(e,l,"x",k),S=s(e,y,"y",A),E=M.vals,L=S.vals;e._x=E,e._y=L,e.xperiodalignment&&(e._origX=k,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=A,e._yStarts=S.starts,e._yEnds=S.ends);var C=new Array(w),P=new Array(b);for(r=0;r1&&i.extendFlat(s.line,p.linePositions(t,r,n));if(s.errorX||s.errorY){var l=p.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}s.text&&(i.extendFlat(s.text,{positions:n},p.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},p.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},p.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,C,E,L),z=d(t,x);return f(o,e),_?O.marker&&(I=O.marker.sizeAvg||Math.max(O.marker.size,3)):I=c(e,b),u(t,e,l,y,E,L,I),O.errorX&&v(e,l,O.errorX),O.errorY&&v(e,y,O.errorY),O.fill&&!z.fill2d&&(z.fill2d=!0),O.marker&&!z.scatter2d&&(z.scatter2d=!0),O.line&&!z.line2d&&(z.line2d=!0),!O.errorX&&!O.errorY||z.error2d||(z.error2d=!0),O.text&&!z.glText&&(z.glText=!0),O.marker&&(O.marker.snap=b),z.lineOptions.push(O.line),z.errorXOptions.push(O.errorX),z.errorYOptions.push(O.errorY),z.fillOptions.push(O.fill),z.markerOptions.push(O.marker),z.markerSelectedOptions.push(O.markerSel),z.markerUnselectedOptions.push(O.markerUnsel),z.textOptions.push(O.text),z.textSelectedOptions.push(O.textSel),z.textUnselectedOptions.push(O.textUnsel),z.selectBatch.push([]),z.unselectBatch.push([]),T._scene=z,T.index=z.count,T.x=E,T.y=L,T.positions=C,z.count++,[{x:!1,y:!1,t:T,trace:e}]}},{"../../constants/numerical":491,"../../lib":515,"../../plots/cartesian/align_period":563,"../../plots/cartesian/autorange":565,"../../plots/cartesian/axis_ids":570,"../scatter/calc":937,"../scatter/colorscale_calc":939,"./constants":991,"./convert":992,"./scene_update":1e3,"@plotly/point-cluster":59}],991:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],992:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("svg-path-sdf"),a=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),p=t("./helpers"),d=t("./constants"),m=t("../../constants/interactions").DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,i=t._fullLayout,a=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,h=o.family,p={},d=t._context.plotGlPixelRatio,m=e.texttemplate;if(m){p.text=[];var g=i._d3locale,y=Array.isArray(m),x=y?Math.min(m.length,a):a,b=y?function(t){return m[t]}:function(){return m};for(r=0;rd.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var h=n[0],p=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(c)?c.length>1?c[i]:c[0]:c,m=g[p],v=g[d],y=u?u/.8+1:0,x=-v*y-.5*v;o.offset[i]=[m*y/h,x/h]}}return o}}},{"../../components/drawing":389,"../../components/fx/helpers":403,"../../constants/interactions":490,"../../lib":515,"../../lib/gl_format_color":511,"../../plots/cartesian/axis_ids":570,"../../registry":647,"../scatter/make_bubble_size_func":953,"../scatter/subtypes":961,"./constants":991,"./helpers":996,"color-normalize":89,"fast-isnumeric":190,"svg-path-sdf":311}],993:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),p=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,m){function g(r,i){return n.coerce(t,e,o,r,i)}var v=!!t.marker&&a.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),x=c(t,e,m,g);if(x){u(t,e,m,g),g("xhoverformat"),g("yhoverformat");var b=x100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":991}],997:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var p=o.textfont;p&&(h.ts=i.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.tc=Array.isArray(p.color)?p.color[f]:p.color,h.tf=Array.isArray(p.family)?p.family[f]:p.family);var d=o.marker;d&&(h.ms=i.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.mo=i.isArrayOrTypedArray(d.opacity)?d.opacity[f]:d.opacity,h.mx=i.isArrayOrTypedArray(d.symbol)?d.symbol[f]:d.symbol,h.ma=i.isArrayOrTypedArray(d.angle)?d.angle[f]:d.angle,h.mc=i.isArrayOrTypedArray(d.color)?d.color[f]:d.color);var m=d&&d.line;m&&(h.mlc=Array.isArray(m.color)?m.color[f]:m.color,h.mlw=i.isArrayOrTypedArray(m.width)?m.width[f]:m.width);var g=d&&d.gradient;g&&"none"!==g.type&&(h.mgt=Array.isArray(g.type)?g.type[f]:g.type,h.mgc=Array.isArray(g.color)?g.color[f]:g.color);var v=s.c2p(h.x,!0),y=l.c2p(h.y,!0),x=h.mrc||1,b=o.hoverlabel;b&&(h.hbg=Array.isArray(b.bgcolor)?b.bgcolor[f]:b.bgcolor,h.hbc=Array.isArray(b.bordercolor)?b.bordercolor[f]:b.bordercolor,h.hts=i.isArrayOrTypedArray(b.font.size)?b.font.size[f]:b.font.size,h.htc=Array.isArray(b.font.color)?b.font.color[f]:b.font.color,h.htf=Array.isArray(b.font.family)?b.font.family[f]:b.font.family,h.hnl=i.isArrayOrTypedArray(b.namelength)?b.namelength[f]:b.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var T={};T[t.index]=h;var k=o._origX,A=o._origY,M=i.extendFlat({},t,{color:a(o,h),x0:v-x,x1:v+x,xLabelVal:k?k[f]:h.x,y0:y-x,y1:y+x,yLabelVal:A?A[f]:h.y,cd:T,distance:c,spikeDistance:u,hovertemplate:h.ht});return h.htx?M.text=h.htx:h.tx?M.text=h.tx:o.text&&(M.text=o.text),i.fillText(h,o,M),n.getComponentMethod("errorbars","hoverInfo")(h,o,M),M}e.exports={hoverPoints:function(t,e,r,n){var i,a,s,l,c,u,f,h,p,d,m=t.cd,g=m[0].t,v=m[0].trace,y=t.xa,x=t.ya,b=g.x,_=g.y,w=y.c2p(e),T=x.c2p(r),k=t.distance;if(g.tree){var A=y.p2c(w-k),M=y.p2c(w+k),S=x.p2c(T-k),E=x.p2c(T+k);i="x"===n?g.tree.range(Math.min(A,M),Math.min(x._rl[0],x._rl[1]),Math.max(A,M),Math.max(x._rl[0],x._rl[1])):g.tree.range(Math.min(A,M),Math.min(S,E),Math.max(A,M),Math.max(S,E))}else i=g.ids;var L=k;if("x"===n){var C=!!v.xperiodalignment,P=!!v.yperiodalignment;for(u=0;u=Math.min(I,O)&&w<=Math.max(I,O)?0:1/0}if(f=Math.min(z,D)&&T<=Math.max(z,D)?0:1/0}d=Math.sqrt(f*f+h*h),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=b[a=i[u]],c=_[a],f=y.c2p(l)-w,h=x.c2p(c)-T,(p=Math.sqrt(f*f+h*h))y.glText.length){var T=_-y.glText.length;for(m=0;mr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),y.line2d.update(y.lineOptions)),y.error2d){var A=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(A)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=s.repeat(null,_),y.fill2d&&(y.fillOptions=y.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,c=y.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(y.fillOrder[e]=u);var f,h,p=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(d[h+1]);)h-=2;0!==d[f+1]&&(p=[d[f],0]),p=p.concat(d.slice(f,h+2)),0!==d[h+1]&&(p=p.concat([d[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(d[h]);)h-=2;0!==d[f]&&(p=[0,d[f+1]]),p=p.concat(d.slice(f,h+2)),0!==d[h]&&(p=p.concat([0,d[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],i=0,t.splitNull=!0,a=0;a-1;for(m=0;m<_;m++){var L=r[m][0],C=L.trace,P=L.t,I=P.index,O=C._length,z=P.x,D=P.y;if(C.selectedpoints||S||E){if(S||(S=!0),C.selectedpoints){var R=y.selectBatch[I]=s.selIndices2selPoints(C),F={};for(g=0;g")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,u=o[0].trace,f=t.xa,h=t.ya,p=t.subplot,d=[],m=l+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var v=p.map.queryRenderedFeatures(null,{layers:[m]});d=v.map((function(t){return t.id}))}var y=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-y;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=p.project([n,a]),l=o.x-f.c2p([x,a]),c=o.y-h.c2p([n,r]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var b=o[t.index],_=b.lonlat,w=[i.modHalf(_[0],360)+y,_[1]],T=f.c2p(w),k=h.c2p(w),A=b.mrc||1;t.x0=T-A,t.x1=T+A,t.y0=k-A,t.y1=k+A;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(b,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=a(u,b),t.extraText=c(u,b,o[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:c}},{"../../components/fx":407,"../../constants/numerical":491,"../../lib":515,"../../plots/mapbox/constants":620,"../scatter/get_trace_color":946}],1008:[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("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":622,"../scatter/marker_colorbar":954,"../scattergeo/calc":979,"./attributes":1002,"./defaults":1004,"./event_data":1005,"./format_labels":1006,"./hover":1007,"./plot":1009,"./select":1010}],1009:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(t,e,r,n){this.type="scattermapbox",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol",cluster:a+e+"-cluster",clusterCount:a+e+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(t,e,r){var i={type:"geojson",data:e.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom}),this.subplot.map.addSource(this.sourceIds[t],i)},l.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},l.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter),this.subplot.addLayer(n,r)},l.update=function(t){var e=t[0].trace,r=this.subplot,n=r.map,a=i(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),c=!!this.clusterEnabled,u=this;function f(t){c?function(t){for(var e=o.cluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(u.layerIds[i])}t||n.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=o.nonCluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(u.layerIds[i]),t||n.removeSource(u.sourceIds[i])}}(t)}function h(t){l?function(t){t||u.addSource("circle",a.circle,e.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,n,a,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,f=new s(t,l.uid,c,u),h=i(t.gd,e),p=f.below=t.belowLookup["trace-"+l.uid];if(c)for(f.addSource("circle",h.circle,l.cluster),r=0;r")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":947}],1016:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":631,"../scatter/marker_colorbar":954,"../scatter/select":958,"../scatter/style":960,"./attributes":1011,"./calc":1012,"./defaults":1013,"./format_labels":1014,"./hover":1015,"./plot":1017}],1017:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),o=e.xaxis,s=e.yaxis,l={xaxis:o,yaxis:s,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},c=e.radialAxis,u=e.angularAxis,f=0;f=c&&(y.marker.cluster=d.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&l.extendFlat(y.line,s.linePositions(t,p,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(t,p,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(t,p,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(t,p,y.text,y.markerUnsel))),y.fill&&!h.fill2d&&(h.fill2d=!0),y.marker&&!h.scatter2d&&(h.scatter2d=!0),y.line&&!h.line2d&&(h.line2d=!0),y.text&&!h.glText&&(h.glText=!0),h.lineOptions.push(y.line),h.fillOptions.push(y.fill),h.markerOptions.push(y.marker),h.markerSelectedOptions.push(y.markerSel),h.markerUnselectedOptions.push(y.markerUnsel),h.textOptions.push(y.text),h.textSelectedOptions.push(y.textSel),h.textUnselectedOptions.push(y.textUnsel),h.selectBatch.push([]),h.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=v,d.positions=_,d._scene=h,d.index=h.count,h.count++}})),a(t,e,r)}},e.exports.reglPrecompiled={}},{"../../lib":515,"../scattergl/constants":991,"../scattergl/convert":992,"../scattergl/plot":999,"../scattergl/scene_update":1e3,"@plotly/point-cluster":59,"fast-isnumeric":190}],1026:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("../scatter/attributes"),s=t("../../plots/attributes"),l=o.line;e.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:i({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:a({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:a({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:a({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o.fillcolor,hoverinfo:a({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../lib/extend":505,"../../plots/attributes":562,"../../plots/template_attributes":642,"../scatter/attributes":936}],1027:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../scatter/colorscale_calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection"),l=t("../scatter/calc").calcMarkerSize;e.exports=function(t,e){for(var r=t._fullLayout,c=e.subplot,u=r[c].realaxis,f=r[c].imaginaryaxis,h=u.makeCalcdata(e,"real"),p=f.makeCalcdata(e,"imag"),d=e._length,m=new Array(d),g=0;g")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":947}],1031:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:t("../../plots/smith"),categories:["smith","symbols","showLegend","scatter-like"],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").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/smith":638,"../scatter/marker_colorbar":954,"../scatter/select":958,"../scatter/style":960,"./attributes":1026,"./calc":1027,"./defaults":1028,"./format_labels":1029,"./hover":1030,"./plot":1032}],1032:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM,a=t("../../plots/smith/helpers").smith;e.exports=function(t,e,r){for(var o=e.layers.frontplot.select("g.scatterlayer"),s=e.xaxis,l=e.yaxis,c={xaxis:s,yaxis:l,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},u=0;u"),o.hovertemplate=h.hovertemplate,a}function x(t,e){v.push(t._hovertitle+": "+e)}}},{"../scatter/hover":947}],1039:[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":643,"../scatter/marker_colorbar":954,"../scatter/select":958,"../scatter/style":960,"./attributes":1033,"./calc":1034,"./defaults":1035,"./event_data":1036,"./format_labels":1037,"./hover":1038,"./plot":1040}],1040:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=e.xaxis,o=e.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},l=e.layers.frontplot.select("g.scatterlayer"),c=0;ch?b.sizeAvg||Math.max(b.size,3):a(e,x),p=0;pa&&l||i-1,P=!0;if(o(x)||!!p.selectedpoints||C){var I=p._length;if(p.selectedpoints){m.selectBatch=p.selectedpoints;var O=p.selectedpoints,z={};for(l=0;l1&&(u=m[y-1],h=g[y-1],d=v[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var L=function(){y=0,M=[],S=[],E=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,f={};function d(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),v=d(e._Zs,"zaxis");if(f.meshgrid=[m,g,v],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var y=g[0],x=h(m),b=h(v),_=new Array(x.length*b.length),w=0,T=0;T=0};v?(r=Math.min(g.length,x.length),l=function(t){return A(g[t])&&M(t)},f=function(t){return String(g[t])}):(r=Math.min(y.length,x.length),l=function(t){return A(y[t])&&M(t)},f=function(t){return String(y[t])}),_&&(r=Math.min(r,b.length));for(var S=0;S1){for(var P=a.randstr(),I=0;I"),name:A||z("name")?y.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:A,hovertemplateLabels:P,eventData:l};g&&(F.x0=E-i.rInscribed*i.rpx1,F.x1=E+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),v&&(F.x=E,F.idealAlign=E<0?"left":"right");var B=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:B}),l[0].bbox=B[0],d._hasHoverLabel=!0}if(v){var N=t.select("path.surface");h.styleOne(N,i,y,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,y,h.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var i=r._fullLayout,a=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,h.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),d._hasHoverLabel=!1),v){var l=t.select("path.surface");h.styleOne(l,s,a,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,a=r._fullData[d.index],s=g&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),p=c.isEntry(t)?c.findEntryWithChild(m,u):c.findEntryWithLevel(m,u),v=c.getPtId(p),y={points:[f(t,a,h.eventDataKeys)],event:n.event};s||(y.nextLevel=v);var x=l.triggerHandler(r,"plotly_"+d.type+"click",y);if(!1!==x&&e.hovermode&&(r._hoverdata=[f(t,a,h.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,e._tracePreGUI[a.uid],{level:a.level});var b={data:[{level:v}],traces:[d.index]},_={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),i.call("animate",r,b,_)}}))}},{"../../components/fx":407,"../../components/fx/helpers":403,"../../lib":515,"../../lib/events":504,"../../registry":647,"../pie/helpers":915,"./helpers":1064,"@plotly/d3":58}],1064:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var i=e?[n.data[e]]:[n];return r.listPath(n,e).concat(i)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":367,"../../lib":515,"../../lib/setcursor":536,"../pie/helpers":915}],1065:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":954,"./attributes":1058,"./base_plot":1059,"./calc":1060,"./defaults":1062,"./layout_attributes":1066,"./layout_defaults":1067,"./plot":1068,"./style":1069}],1066:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1067:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":515,"./layout_attributes":1066}],1068:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-hierarchy"),a=t("d3-interpolate").interpolate,o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../bar/uniform_text"),u=c.recordMinTextSize,f=c.clearMinTextSize,h=t("../pie/plot"),p=t("../pie/helpers").getRotationAngle,d=h.computeTransform,m=h.transformInsideText,g=t("./style").styleOne,v=t("../bar/style").resizeText,y=t("./fx"),x=t("./constants"),b=t("./helpers");function _(t,e,c,f){var h=t._context.staticPlot,v=t._fullLayout,_=!v.uniformtext.mode&&b.hasTransition(f),T=n.select(c).selectAll("g.slice"),k=e[0],A=k.trace,M=k.hierarchy,S=b.findEntryWithLevel(M,A.level),E=b.getMaxDepth(A),L=v._size,C=A.domain,P=L.w*(C.x[1]-C.x[0]),I=L.h*(C.y[1]-C.y[0]),O=.5*Math.min(P,I),z=k.cx=L.l+L.w*(C.x[1]+C.x[0])/2,D=k.cy=L.t+L.h*(1-C.y[0])-I/2;if(!S)return T.remove();var R=null,F={};_&&T.each((function(t){F[b.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&b.isEntry(t)&&(R=t)}));var B=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),N=S.height+1,j=0,U=E;k.hasMultipleRoots&&b.isHierarchyRoot(S)&&(B=B.slice(1),N-=1,j=1,U+=1),B=B.filter((function(t){return t.y1<=U}));var V=p(A.rotation);V&&B.forEach((function(t){t.x0+=V,t.x1+=V}));var H=Math.min(N,E),q=function(t){return(t-j)/H*O},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},Y=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,z,D)},W=function(t){return z+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Z=function(t){return D+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(T=T.data(B,b.getPtId)).enter().append("g").classed("slice",!0),_?T.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=b.getPtId(t),n=F[r],i=F[b.getPtId(S)];if(i){var o=(t.x1>i.x1?2*Math.PI:0)+V;e=t.rpx1X?2*Math.PI:0)+V;e={x0:i,x1:i}}else e={rpx0:O,rpx1:O},s.extendFlat(e,Q(t));else e={rpx0:0,rpx1:0};else e={x0:V,x1:V};return a(e,n)}(t);return function(t){return Y(e(t))}})):f.attr("d",Y),c.call(y,S,t,e,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),f.call(g,i,A);var p=s.ensureSingle(c,"g","slicetext"),w=s.ensureSingle(p,"text","",(function(t){t.attr("data-notex",1)})),T=s.ensureUniformFontSize(t,b.determineTextFont(A,i,v.font));w.text(r.formatSliceLabel(i,S,A,e,v)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,T).call(l.convertToTspans,t);var M=o.bBox(w.node());i.transform=m(M,i,k),i.transform.targetX=W(i),i.transform.targetY=Z(i);var E=function(t,e){var r=t.transform;return d(r,e),r.fontSize=T.size,u(A.type,r,v),s.getTextTransform(r)};_?w.transition().attrTween("transform",(function(t){var e=function(t){var e,r=F[b.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},R)if(t.parent)if(X){var i=t.x1>X?2*Math.PI:0;e.x0=e.x1=i}else s.extendFlat(e,Q(t));else e.x0=e.x1=V;else e.x0=e.x1=V;var o=a(e.transform.textPosAngle,t.transform.textPosAngle),l=a(e.rpx1,t.rpx1),c=a(e.x0,t.x0),f=a(e.x1,t.x1),h=a(e.transform.scale,n.scale),p=a(e.transform.rotate,n.rotate),d=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,m=a(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=c(t),i=f(t),a=function(t){return m(Math.pow(t,d))}(t),s={pxmid:G(e,(r+i)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:a,x:n.x,y:n.y}};return u(A.type,n,v),{transform:{targetX:W(s),targetY:Z(s),scale:h(t),rotate:p(t),rCenter:a}}}}(t);return function(t){return E(e(t),M)}})):w.attr("transform",E(i,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&b.hasTransition(r);(f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),u)?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){_(t,e,this,r)}))}))):(a.each((function(e){_(t,e,this,r)})),s.uniformtext.mode&&v(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&a.exit().remove()},r.formatSliceLabel=function(t,e,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!(a||o&&"none"!==o))return"";var l=i.separators,c=n[0],u=t.data.data,f=c.hierarchy,h=b.isHierarchyRoot(t),p=b.getParent(f,t),d=b.getValue(t);if(!a){var m,g=o.split("+"),v=function(t){return-1!==g.indexOf(t)},y=[];if(v("label")&&u.label&&y.push(u.label),u.hasOwnProperty("v")&&v("value")&&y.push(b.formatValue(u.v,l)),!h){v("current path")&&y.push(b.getPath(t.data));var x=0;v("percent parent")&&x++,v("percent entry")&&x++,v("percent root")&&x++;var _=x>1;if(x){var w,T=function(t){m=b.formatPercent(w,l),_&&(m+=" of "+t),y.push(m)};v("percent parent")&&!h&&(w=d/b.getValue(p),T("parent")),v("percent entry")&&(w=d/b.getValue(e),T("entry")),v("percent root")&&(w=d/b.getValue(f),T("root"))}}return v("text")&&(m=s.castOption(r,u.i,"text"),s.isValidTextValue(m)&&y.push(m)),y.join("
")}var k=s.castOption(r,u.i,"texttemplate");if(!k)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=b.formatValue(u.v,l)),A.currentPath=b.getPath(t.data),h||(A.percentParent=d/b.getValue(p),A.percentParentLabel=b.formatPercent(A.percentParent,l),A.parent=b.getPtLabel(p)),A.percentEntry=d/b.getValue(e),A.percentEntryLabel=b.formatPercent(A.percentEntry,l),A.entry=b.getPtLabel(e),A.percentRoot=d/b.getValue(f),A.percentRootLabel=b.formatPercent(A.percentRoot,l),A.root=b.getPtLabel(f),u.hasOwnProperty("color")&&(A.color=u.color);var M=s.castOption(r,u.i,"text");return(s.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(k,A,i._d3locale,A,r._meta||{})}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../bar/style":671,"../bar/uniform_text":673,"../pie/helpers":915,"../pie/plot":919,"./constants":1061,"./fx":1063,"./helpers":1064,"./style":1069,"@plotly/d3":58,"d3-hierarchy":115,"d3-interpolate":116}],1069:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":367,"../../lib":515,"../bar/uniform_text":673,"@plotly/d3":58}],1070:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=e.exports=c(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},{"../../components/color":367,"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plot_api/edit_types":548,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642}],1071:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":375}],1072:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_surface3d,i=t("../../../stackgl_modules").ndarray,a=t("../../../stackgl_modules").ndarray_linear_interpolate.d2,o=t("../heatmap/interp2d"),s=t("../heatmap/find_empties"),l=t("../../lib").isArrayOrTypedArray,c=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),f=t("../../components/colorscale").extractOpts;function h(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=h.prototype;p.getXat=function(t,e,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},p.getYat=function(t,e,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},p.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},p.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!=o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?t.textLabel=s[i][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var d=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(t,e){if(t0){r=d[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=v(r),++r1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1079:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var m=d.concat(p(r).map((function(){return c((d[0]||[""]).length)}))),g=e.domain,v=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),y=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),x=e.header.values.length?m[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return e.cells.height})):[],_=x.reduce(s,0),w=h(b,y-_+n.uplift),T=f(h(x,_),[]),k=f(w,T),A={},M=e._fullInput.columnorder.concat(p(r.map((function(t,e){return e})))),S=m.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1})),E=S.reduce(s,0);S=S.map((function(t){return t/E*v}));var L=Math.max(o(e.header.line.width),o(e.cells.line.width)),C={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:L,height:y,columnOrder:M,groupHeight:y,rowBlocks:k,headerRowBlocks:T,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:m}),gdColumns:m.map((function(t){return t[0]})),gdColumnsOriginalOrder:m.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(t,e){var r=A[t];return A[t]=(r||0)+1,{key:t+"__"+A[t],label:t,specIndex:e,xIndex:M[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return C.columns.forEach((function(t){t.calcdata=C,t.x=u(t)})),C}},{"../../lib/extend":505,"./constants":1078,"fast-isnumeric":190}],1080:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":505}],1081:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var f,h,p=u?"":T(t.calcdata.cells.prefix,e,r)||"",d=u?"":T(t.calcdata.cells.suffix,e,r)||"",m=u?null:T(t.calcdata.cells.format,e,r)||null,g=p+(m?a(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(f=w(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===f?w(g):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===n.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=D(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(C(t,r,e,c,n.prevPages,n,0),C(t,r,e,c,n.prevPages,n,1),x(r,t))}}function L(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(A);return E(t,f,l),s.scrollY===u}}function C(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));b(t,e,a,r),i[o]=n[o]})))}function P(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+a)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(z)}}function I(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=B(o),c=o.key-l.firstRowIndex,f=l.rows[c].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:f,p=Math.max(h,f);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+n.cn.columnCell).call(z),E(null,t.filter(A),0),x(r,a,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return u(O(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),a)})),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function z(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+R(e,1/0)}),0),r=R(B(t),t.key);return u(0,r+e)})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function D(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/domain":593,"../../plots/template_attributes":642,"../pie/attributes":910,"../sunburst/attributes":1058,"./constants":1087}],1085:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":628}],1086:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1060}],1087:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1088:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,f=c.handleDefaults;e.exports=function(t,e,r,c){function h(r,a){return n.coerce(t,e,i,r,a)}var p=h("labels"),d=h("parents");if(p&&p.length&&d&&d.length){var m=h("values");m&&m.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),"squarify"===h("tiling.packing")&&h("tiling.squarifyratio"),h("tiling.flip"),h("tiling.pad");var g=h("text");h("texttemplate"),e.texttemplate||h("textinfo",Array.isArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate");var v=h("pathbar.visible");s(t,e,c,h,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition");var y=-1!==e.textposition.indexOf("bottom");h("marker.line.width")&&h("marker.line.color",c.paper_bgcolor);var x=h("marker.colors");(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?f(t,e,c,h,{prefix:"marker.",cLetter:"c"}):h("marker.depthfade",!(x||[]).length);var b=2*e.textfont.size;h("marker.pad.t",y?b/4:b),h("marker.pad.l",b/4),h("marker.pad.r",b/4),h("marker.pad.b",y?b:b/4),e._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},v&&(h("pathbar.thickness",e.pathbar.textfont.size+2*l),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),o(e,c,h),e._length=null}else e.visible=!1}},{"../../components/color":367,"../../components/colorscale":379,"../../lib":515,"../../plots/domain":593,"../bar/constants":659,"../bar/defaults":661,"./attributes":1084}],1089:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../sunburst/helpers"),a=t("../bar/uniform_text").clearMinTextSize,o=t("../bar/style").resizeText,s=t("./plot_one");e.exports=function(t,e,r,l,c){var u,f,h=c.type,p=c.drawDescendants,d=t._fullLayout,m=d["_"+h+"layer"],g=!r;(a(h,d),(u=m.selectAll("g.trace."+h).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(h,!0),u.order(),!d.uniformtext.mode&&i.hasTransition(r))?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){m.selectAll("g.trace").each((function(e){s(t,e,this,r,p)}))}))):(u.each((function(e){s(t,e,this,r,p)})),d.uniformtext.mode&&o(t,m.selectAll(".trace"),h));g&&u.exit().remove()}},{"../bar/style":671,"../bar/uniform_text":673,"../sunburst/helpers":1064,"./plot_one":1098,"@plotly/d3":58}],1090:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx");e.exports=function(t,e,r,h,p){var d=p.barDifY,m=p.width,g=p.height,v=p.viewX,y=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,k=p.makeUpdateSliceInterpolator,A=p.makeUpdateTextInterpolator,M={},S=t._context.staticPlot,E=t._fullLayout,L=e[0],C=L.trace,P=L.hierarchy,I=m/C._entryDepth,O=u.listPath(r.data,"id"),z=s(P.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(z=z.filter((function(t){var e=O.indexOf(t.data.id);return-1!==e&&(t.x0=I*e,t.x1=I*(e+1),t.y0=d,t.y1=d+g,t.onPathbar=!0,!0)}))).reverse(),(h=h.data(z,u.getPtId)).enter().append("g").classed("pathbar",!0),T(h,!0,M,[m,g],x),h.order();var D=h;w&&(D=D.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),D.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-Math.min(m,g)/2),s._hoverY=y(s.y1-g/2);var h=n.select(this),p=i.ensureSingle(h,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?p.transition().attrTween("d",(function(t){var e=k(t,!0,M,[m,g]);return function(t){return x(e(t))}})):p.attr("d",x),h.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),p.call(l,s,C,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(h,"g","slicetext"),T=i.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),L=i.ensureUniformFontSize(t,u.determineTextFont(C,s,E.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,L).call(o.convertToTspans,t),s.textBB=a.bBox(T.node()),s.transform=b(s,{fontSize:L.size,onPathbar:!0}),s.transform.fontSize=L.size,w?T.transition().attrTween("transform",(function(t){var e=A(t,!0,M,[m,g]);return function(t){return _(e(t))}})):T.attr("transform",_(s))}))}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../sunburst/fx":1063,"../sunburst/helpers":1064,"./constants":1087,"./partition":1096,"./style":1099,"@plotly/d3":58}],1091:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx"),h=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,p,d){var m=d.width,g=d.height,v=d.viewX,y=d.viewY,x=d.pathSlice,b=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,T=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,A=d.makeUpdateTextInterpolator,M=d.prevEntry,S=t._context.staticPlot,E=t._fullLayout,L=e[0].trace,C=-1!==L.textposition.indexOf("left"),P=-1!==L.textposition.indexOf("right"),I=-1!==L.textposition.indexOf("bottom"),O=!I&&!L.marker.pad.t||I&&!L.marker.pad.b,z=s(r,[m,g],{packing:L.tiling.packing,squarifyratio:L.tiling.squarifyratio,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1,pad:{inner:L.tiling.pad,top:L.marker.pad.t,left:L.marker.pad.l,right:L.marker.pad.r,bottom:L.marker.pad.b}}).descendants(),D=1/0,R=-1/0;z.forEach((function(t){var e=t.depth;e>=L._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(D=Math.min(D,e),R=Math.max(R,e))})),p=p.data(z,u.getPtId),L._maxVisibleLayers=isFinite(R)?R-D+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[m,g],x),p.order();var F=null;if(w&&M){var B=u.getPtId(M);p.each((function(t){null===F&&u.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return F||{x0:0,x1:m,y0:0,y1:g}},j=p;return w&&(j=j.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),j.each((function(s){var p=u.isHeader(s,L);s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-L.marker.pad.r),s._hoverY=y(I?s.y1-L.marker.pad.b/2:s.y0+L.marker.pad.t/2);var d=n.select(this),T=i.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?T.transition().attrTween("d",(function(t){var e=k(t,!1,N(),[m,g]);return function(t){return x(e(t))}})):T.attr("d",x),d.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(l,s,L,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p?O?"":u.getPtLabel(s)||"":h(s,r,L,e,E)||"";var M=i.ensureSingle(d,"g","slicetext"),z=i.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)})),D=i.ensureUniformFontSize(t,u.determineTextFont(L,s,E.font));z.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":C||p?"start":"middle").call(a.font,D).call(o.convertToTspans,t),s.textBB=a.bBox(z.node()),s.transform=b(s,{fontSize:D.size,isHeader:p}),s.transform.fontSize=D.size,w?z.transition().attrTween("transform",(function(t){var e=A(t,!1,N(),[m,g]);return function(t){return _(e(t))}})):z.attr("transform",_(s))})),F}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../sunburst/fx":1063,"../sunburst/helpers":1064,"../sunburst/plot":1068,"./constants":1087,"./partition":1096,"./style":1099,"@plotly/d3":58}],1092:[function(t,e,r){"use strict";e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o-1?C+O:-(I+O):0,D={x0:P,x1:P,y0:z,y1:z+I},R=function(t,e,r){var n=v.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},N={},j=null,U=function(t,e){return e?B[h(t)]:N[h(t)]},V=function(t,e,r,n){if(e)return B[h(x)]||D;var i=N[v.level]||r;return function(t){return t.data.depth-b.data.depth=(n-=(y?g:g.r)-s)){var x=(r+n)/2;r=x,n=x}var b;f?i<(b=a-(y?g:g.b))&&b"===tt?(l.x-=a,c.x-=a,u.x-=a,f.x-=a):"/"===tt?(u.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),$(l),$(f),$(o),$(c),$(u),$(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(f.x,f.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:et,makeUpdateSliceInterpolator:nt,makeUpdateTextInterpolator:it,handleSlicesExit:at,hasTransition:A,strTransform:ot}):w.remove()}},{"../../lib":515,"../bar/constants":659,"../bar/plot":668,"../bar/uniform_text":673,"../sunburst/helpers":1064,"./constants":1087,"./draw_ancestors":1090,"@plotly/d3":58,"d3-interpolate":116}],1099:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,f=u.i,h=u.color,p=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(p&&h===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=a.castOption(r,f,"marker.line.color")||i.defaultLine,l=a.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var m=r.marker.depthfade;if(m){var g,v=i.combine(i.addOpacity(r._backgroundColor,.75),h);if(!0===m){var y=o.getMaxDepth(r);g=isFinite(y)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else g=e.data.depth-r._entryDepth,r._atRootLevel||g++;if(g>0)for(var x=0;x0){var b,_,w,T,k,A=t.xa,M=t.ya;"h"===d.orientation?(k=e,b="y",w=M,_="x",T=A):(k=r,b="x",w=A,_="y",T=M);var S=p[t.index];if(k>=S.span[0]&&k<=S.span[1]){var E=i.extendFlat({},t),L=T.c2p(k,!0),C=s.getKdeValue(S,d,k),P=s.getPositionOnKdePath(S,d,L),I=w._offset,O=w._length;E[b+"0"]=P[0],E[b+"1"]=P[1],E[_+"0"]=E[_+"1"]=L,E[_+"Label"]=_+": "+a.hoverLabelText(T,k,d[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+C.toFixed(3);for(var z=0,D=0;D")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;if(i(n))return n;if(i(a)&&o)return a}(h,g),[u]}function k(t){return n(m,t,h[d+"hoverformat"])}}},{"../../components/color":367,"../../constants/delta.js":485,"../../plots/cartesian/axes":566,"../bar/hover":664}],1122:[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"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":578,"../bar/select":669,"./attributes":1115,"./calc":1116,"./cross_trace_calc":1118,"./defaults":1119,"./event_data":1120,"./hover":1121,"./layout_attributes":1123,"./layout_defaults":1124,"./plot":1125,"./style":1126}],1123:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1124:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0&&(g+=h?"M"+f[0]+","+d[1]+"V"+d[0]:"M"+f[1]+","+d[0]+"H"+f[0]),"between"!==p&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":367,"../../components/drawing":389,"../../constants/interactions":490,"../bar/style":671,"../bar/uniform_text":673,"@plotly/d3":58}],1127:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return f;case"first":return h;case"last":return p;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),x={},b={},_=0;d?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),k(g);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)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 i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){(function(){ +var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t("./lib/segment-chainer"),l=t("./lib/segment-selector"),c=t("./lib/geojson"),u=!1,f=a();function h(t,e,r){var i=n.segments(t),a=n.segments(e),o=r(n.combine(i,a));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=i():!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:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(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 h(t,e,n.selectUnion)},intersect:function(t,e){return h(t,e,n.selectIntersect)},difference:function(t,e){return h(t,e,n.selectDifference)},differenceRev:function(t,e){return h(t,e,n.selectDifferenceRev)},xor:function(t,e){return h(t,e,n.selectXor)}},"object"==typeof window&&(window.PolyBool=n),e.exports=n},{"./lib/build-log":256,"./lib/epsilon":257,"./lib/geojson":258,"./lib/intersecter":259,"./lib/segment-chainer":261,"./lib/segment-selector":262}],256:[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")}}}},{}],257:[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 i=r[0],a=r[1],o=n[0],s=n[1],l=e[0];return(o-i)*(e[1]-a)-(s-a)*(l-i)>=-t},pointBetween:function(e,r,n){var i=e[1]-r[1],a=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-t)},pointsSameX:function(e,r){return Math.abs(e[0]-r[0])t!=o-i>t&&(a-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],258:[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]),i=1;i0}))}function u(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),p=e.pointsSame(s,u);if(h&&p)return n;var d=!h&&e.pointBetween(o,c,u),m=!p&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;d&&(p||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),0===f.alongB&&(-1===f.alongA?l(n,o):0===f.alongA?l(n,f.pt):1===f.alongA&&l(n,s));return!1}for(var f=[];!a.isEmpty();){var h=a.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var p=c(h),d=p.before?p.before.ev:null,m=p.after?p.after.ev:null;function g(){if(d){var t=u(h,d);if(t)return t}return!!m&&u(h,m)}r&&r.tempStatus(h.seg,!!d&&d.seg,!!m&&m.seg);var v,y=g();if(y){var x;if(t)(x=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(y.seg.myFill.above=!y.seg.myFill.above);else y.seg.otherFill=h.seg.myFill;r&&r.segmentUpdate(y.seg),h.other.remove(),h.remove()}if(a.getHead()!==h){r&&r.rewind(h.seg);continue}if(t)x=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=x?!h.seg.myFill.below:h.seg.myFill.below;else if(null===h.seg.otherFill)v=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?o:i,h.seg.otherFill={above:v,below:v};r&&r.status(h.seg,!!d&&d.seg,!!m&&m.seg),h.other.status=p.insert(n.node({ev:h}))}else{var b=h.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(b.prev)&&s.exists(b.next)&&u(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!h.primary){var _=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=_}f.push(h.seg)}a.getHead().remove()}return r&&r.done(),f}return t?{addRegion:function(t){for(var n,i,a,o=t[t.length-1],l=0;l0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.read_uint16=function(t){var e=this.input;if(t+2>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?256*e[t]+e[t+1]:e[t]+256*e[t+1]},a.prototype.read_uint32=function(t){var e=this.input;if(t+4>e.length)throw n("unexpected EOF","EBADDATA");return this.big_endian?16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]:e[t]+256*e[t+1]+65536*e[t+2]+16777216*e[t+3]},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));case 5:case 10:case 11:case 12:case 7:default:return null}},a.prototype.scan_ifd=function(t,e,r){var a=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw n("unexpected EOF","EBADDATA");for(var d=[],m=h,g=0;g0&&(this.ifds_to_read.push({id:s,offset:d[0]}),p=!0),!1===r({is_big_endian:this.big_endian,ifd:t,tag:s,format:l,count:c,entry_offset:e+this.start,data_length:f,data_offset:h+this.start,value:d,is_subifd_link:p}))return void(this.aborted=!0);e+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},e.exports.ExifParser=a,e.exports.get_orientation=function(t){var e=0;try{return new a(t,0,t.length).each((function(t){if(0===t.ifd&&274===t.tag&&Array.isArray(t.value))return e=t.value[0],!1})),e}catch(t){return-1}}},{}],265:[function(t,e,r){"use strict";var n=t("./common").readUInt16BE,i=t("./common").readUInt32BE;function a(t,e){if(t.length<4+e)return null;var r=i(t,e);return t.length>4&15,i=15&t[4],a=t[5]>>4&15,o=n(t,6),l=8,c=0;ce.width||t.width===e.width&&t.height>e.height?t:e})),i=r.reduce((function(t,e){return t.height>e.height||t.height===e.height&&t.width>e.width?t:e})),n.width>i.height||n.width===i.height&&n.height>i.width?n:i),s=1;e.transforms.forEach((function(t){var e={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===t.type&&(s=0===t.value?r[s]:e[s=e[s=r[s]]]),"irot"===t.type)for(var n=0;n1&&(h.variants=f.variants),f.orientation&&(h.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=t.length){var p=a(t,f.exif_location.offset),d=t.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),m=s.get_orientation(d);m>0&&(h.orientation=m)}return h}}}}}}},{"../common":263,"../exif_utils":264,"../miaf_utils":265}],267:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("BM");e.exports=function(t){if(!(t.length<26)&&i(t,0,o))return{width:a(t,18),height:a(t,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}},{"../common":263}],268:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt16LE,o=n("GIF87a"),s=n("GIF89a");e.exports=function(t){if(!(t.length<10)&&(i(t,0,o)||i(t,0,s)))return{width:a(t,6),height:a(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}},{"../common":263}],269:[function(t,e,r){"use strict";var n=t("../common").readUInt16LE;e.exports=function(t){var e=n(t,0),r=n(t,2),i=n(t,4);if(0===e&&1===r&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}},{"../common":263}],270:[function(t,e,r){"use strict";var n=t("../common").readUInt16BE,i=t("../common").str2arr,a=t("../common").sliceEq,o=t("../exif_utils"),s=i("Exif\0\0");e.exports=function(t){if(!(t.length<2)&&255===t[0]&&216===t[1]&&255===t[2])for(var e=2;;){for(;;){if(t.length-e<2)return;if(255===t[e++])break}for(var r,i,l=t[e++];255===l;)l=t[e++];if(208<=l&&l<=217||1===l)r=0;else{if(!(192<=l&&l<=254))return;if(t.length-e<2)return;r=n(t,e)-2,e+=2}if(217===l||218===l)return;if(225===l&&r>=10&&a(t,e,s)&&(i=o.get_orientation(t.slice(e+6,e+r))),r>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(t.length-e0&&(c.orientation=i),c}e+=r}}},{"../common":263,"../exif_utils":264}],271:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("\x89PNG\r\n\x1a\n"),s=n("IHDR");e.exports=function(t){if(!(t.length<24)&&i(t,0,o)&&i(t,12,s))return{width:a(t,16),height:a(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}},{"../common":263}],272:[function(t,e,r){"use strict";var n=t("../common").str2arr,i=t("../common").sliceEq,a=t("../common").readUInt32BE,o=n("8BPS\0\x01");e.exports=function(t){if(!(t.length<22)&&i(t,0,o))return{width:a(t,18),height:a(t,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}},{"../common":263}],273:[function(t,e,r){"use strict";function n(t){return"number"==typeof t&&isFinite(t)&&t>0}var i=/<[-_.:a-zA-Z0-9][^>]*>/,a=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,o=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,s=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,c=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(t){return c.test(t)?t.match(c)[0]:"px"}e.exports=function(t){if(function(t){var e,r=0,n=t.length;for(239===t[0]&&187===t[1]&&191===t[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(t,e){return{width:1+(t[e+6]<<16|t[e+5]<<8|t[e+4]),height:1+(t[e+9]<t.length)){for(;e+8=10?r=r||u(t,e+8):"VP8L"===p&&d>=9?r=r||f(t,e+8):"VP8X"===p&&d>=10?r=r||h(t,e+8):"EXIF"===p&&(n=s.get_orientation(t.slice(e+8,e+8+d)),e=1/0),e+=8+d}else e++;if(r)return n>0&&(r.orientation=n),r}}}},{"../common":263,"../exif_utils":264}],276:[function(t,e,r){"use strict";e.exports={avif:t("./parse_sync/avif"),bmp:t("./parse_sync/bmp"),gif:t("./parse_sync/gif"),ico:t("./parse_sync/ico"),jpeg:t("./parse_sync/jpeg"),png:t("./parse_sync/png"),psd:t("./parse_sync/psd"),svg:t("./parse_sync/svg"),tiff:t("./parse_sync/tiff"),webp:t("./parse_sync/webp")}},{"./parse_sync/avif":266,"./parse_sync/bmp":267,"./parse_sync/gif":268,"./parse_sync/ico":269,"./parse_sync/jpeg":270,"./parse_sync/png":271,"./parse_sync/psd":272,"./parse_sync/svg":273,"./parse_sync/tiff":274,"./parse_sync/webp":275}],277:[function(t,e,r){"use strict";var n=t("./lib/parsers_sync");e.exports=function(t){return function(t){for(var e=Object.keys(n),r=0;r1)for(var r=1;r1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],r(t),t.after&&t.after(t))}function T(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(b.groups=x=t.map((function(t,c){var u=x[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(x[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},y,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:t.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:t.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:t.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(t){e=i}return{fill:t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:o(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n"]),frag:o(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:t.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:t.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:i,miter:e}},v.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},v.prototype.render=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];e.length&&(t=this).update.apply(t,e),this.draw()},v.prototype.draw=function(){for(var t=this,e=[],r=arguments.length;r--;)e[r]=arguments[r];return(e.length?e:this.passes).forEach((function(e,r){var n;if(e&&Array.isArray(e))return(n=t).draw.apply(n,e);"number"==typeof e&&(e=t.passes[e]),e&&e.count>1&&e.opacity&&(t.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&t.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>v.precisionThreshold||e.scale[1]*e.viewport.height>v.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=v.maxPoints)?t.shaders.rect(e):t.shaders.miter(e)))})),this},v.prototype.update=function(t){var e=this;if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var r=this.regl,o=this.gl;if(t.forEach((function(t,f){var d=e.passes[f];if(void 0!==t)if(null!==t){if("number"==typeof t[0]&&(t={positions:t}),t=s(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),d||(e.passes[f]=d={id:f,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:r.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:r.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},t=a({},v.defaults,t)),null!=t.thickness&&(d.thickness=parseFloat(t.thickness)),null!=t.opacity&&(d.opacity=parseFloat(t.opacity)),null!=t.miterLimit&&(d.miterLimit=parseFloat(t.miterLimit)),null!=t.overlay&&(d.overlay=!!t.overlay,f=D}));(I=I.slice(0,R)).push(D)}for(var F=function(t){var e=k.slice(2*z,2*I[t]).concat(D?k.slice(2*D):[]),r=(d.hole||[]).map((function(e){return e-D+(I[t]-z)})),n=c(e,r);n=n.map((function(e){return e+z+(e+zt.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),g&&(l.frag=l.frag.replace("smoothstep","smoothStep"),s.frag=s.frag.replace("smoothstep","smoothStep")),this.drawCircle=t(l)}b.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},b.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},b.prototype.draw=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;nn)?e.tree=u(t,{bounds:f}):n&&n.length&&(e.tree=n),e.tree){var h={primitive:"points",usage:"static",data:e.tree,type:"uint32"};e.elements?e.elements(h):e.elements=o.elements(h)}var p=v.float32(t);return i({data:p,usage:"dynamic"}),a({data:v.fract32(t,p),usage:"dynamic"}),s({data:new Uint8Array(c),type:"uint8",usage:"stream"}),t}},{marker:function(e,r,n){var i=r.activation;if(i.forEach((function(t){return t&&t.destroy&&t.destroy()})),i.length=0,e&&"number"!=typeof e[0]){for(var a=[],s=0,l=Math.min(e.length,r.count);s=0)return a;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)e=t;else{e=new Uint8Array(t.length);for(var o=0,s=t.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},b.prototype.updatePalette=function(t){if(!this.tooManyColors){var e=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*t.length/e);if(n>1)for(var i=.25*(t=t.slice()).length%e;i2?(s[0],s[2],n=s[1],i=s[3]):s.length?(n=s[0],i=s[1]):(s.x,n=s.y,s.x+s.width,i=s.y+s.height),l.length>2?(a=l[0],o=l[2],l[1],l[3]):l.length?(a=l[0],o=l[1]):(a=l.x,l.y,o=l.x+l.width,l.y+l.height),[a,n,o,i]}function p(t){if("number"==typeof t)return[t,t,t,t];if(2===t.length)return[t[0],t[1],t[0],t[1]];var e=l(t);return[e.x,e.y,e.x+e.width,e.y+e.height]}e.exports=u,u.prototype.render=function(){for(var t,e=this,r=[],n=arguments.length;n--;)r[n]=arguments[n];return r.length&&(t=this).update.apply(t,r),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=o((function(){e.draw(),e.dirty=!0,e.planned=null}))):(this.draw(),this.dirty=!0,o((function(){e.dirty=!1}))),this)},u.prototype.update=function(){for(var t,e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e.length){for(var n=0;nk))&&(s.lower||!(T>>=e))<<3,(e|=r=(15<(t>>>=r))<<2)|(r=(3<(t>>>=r))<<1)|t>>>r>>1}function s(){function t(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=r[o(t)>>2]).length?e.pop():new ArrayBuffer(t)}function e(t){r[o(t.byteLength)>>2].push(t)}var r=a(8,(function(){return[]}));return{alloc:t,free:e,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){e(t.buffer)}}}function l(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||J(t.data))}function c(t,e,r,n,i,a){for(var o=0;o(i=s)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=o,0>o&&(i=4,1===(o=n.buffer.dimension)&&(i=0),2===o&&(i=1),3===o&&(i=4)),n.primType=i}function o(t){n.elementsCount--,delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,o=0,h=0;Array.isArray(t)||J(t)||l(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=et[t.usage]),"primitive"in t&&(n=at[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?o=0|t.length:(o=i,5123===h||5122===h?o*=2:5125!==h&&5124!==h||(o*=4))),a(f,e,r,n,i,o,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return s}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=f,s.subdata=function(t,e){return c.subdata(t,e),s},s.destroy=function(){o(f)},s},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){K(s).forEach(o)}}}function m(t){for(var e=Z.allocType(5123,t.length),r=0;r>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,p(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function C(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),o.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(yt).forEach((function(e){t+=yt[e].stats.size})),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;P.call(r);var a=L();return"number"==typeof t?M(a,0|t,"number"==typeof e?0|e:0|t):t?(I(r,t),S(a,t)):M(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,D(i),E(a,3553),O(r,3553),R(),C(a),o.profile&&(i.stats.size=T(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=tt[i.internalformat],n.type=et[i.type],n.mag=rt[r.magFilter],n.min=nt[r.minFilter],n.wrapS=it[r.wrapS],n.wrapT=it[r.wrapT],n}var i=new z(3553);return yt[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=v();return c(o,i),o.width=0,o.height=0,p(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,D(i),d(o,3553,e,r,a),R(),k(o),n},n.resize=function(e,r){var a=0|e,s=0|r||a;if(a===i.width&&s===i.height)return n;n.width=i.width=a,n.height=i.height=s,D(i);for(var l=0;i.mipmask>>l;++l){var c=a>>l,u=s>>l;if(!c||!u)break;t.texImage2D(3553,l,i.format,c,u,0,i.format,i.type,null)}return R(),o.profile&&(i.stats.size=T(i.internalformat,i.type,a,s,!1,!1)),n},n._reglType="texture2d",n._texture=i,o.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,s,l){function f(t,e,r,n,i,a){var s,l=h.texInfo;for(P.call(l),s=0;6>s;++s)m[s]=L();if("number"!=typeof t&&t){if("object"==typeof t)if(e)S(m[0],t),S(m[1],e),S(m[2],r),S(m[3],n),S(m[4],i),S(m[5],a);else if(I(l,t),u(h,t),"faces"in t)for(t=t.faces,s=0;6>s;++s)c(m[s],h),S(m[s],t[s]);else for(s=0;6>s;++s)S(m[s],t)}else for(t=0|t||1,s=0;6>s;++s)M(m[s],t,t);for(c(h,m[0]),h.mipmask=l.genMipmaps?(m[0].width<<1)-1:m[0].mipmask,h.internalformat=m[0].internalformat,f.width=m[0].width,f.height=m[0].height,D(h),s=0;6>s;++s)E(m[s],34069+s);for(O(l,34067),R(),o.profile&&(h.stats.size=T(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=tt[h.internalformat],f.type=et[h.type],f.mag=rt[l.magFilter],f.min=nt[l.minFilter],f.wrapS=it[l.wrapS],f.wrapT=it[l.wrapT],s=0;6>s;++s)C(m[s]);return f}var h=new z(34067);yt[h.id]=h,a.cubeCount++;var m=Array(6);return f(e,r,n,i,s,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=v();return c(a,h),a.width=0,a.height=0,p(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,D(h),d(a,34069+t,r,n,i),R(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,D(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return R(),o.profile&&(h.stats.size=T(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,o.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);O(e.texInfo,e.target)}))},refresh:function(){for(var e=0;ei;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach((function(t){t.destroy()}))}})},clear:function(){K(k).forEach(g)},restore:function(){x.cur=null,x.next=null,x.dirty=!0,K(k).forEach((function(e){e.framebuffer=t.createFramebuffer(),v(e)}))}})}function M(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function S(t,e,r,n,i,a,o){function s(){this.id=++f,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var t=e.oes_vertex_array_object;this.vao=t?t.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}var c=r.maxAttributes,u=Array(c);for(r=0;r=h.byteLength?c.subdata(h):(c.destroy(),r.buffers[s]=null)),r.buffers[s]||(c=r.buffers[s]=i.create(u,34962,!1,!0)),f.buffer=i.getBuffer(c),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,t[s]=1;else i.getBuffer(u)?(f.buffer=i.getBuffer(u),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):i.getBuffer(u.buffer)?(f.buffer=i.getBuffer(u.buffer),f.size=0|(+u.size||f.buffer.dimension),f.normalized=!!u.normalized||!1,f.type="type"in u?tt[u.type]:f.buffer.dtype,f.offset=0|(u.offset||0),f.stride=0|(u.stride||0),f.divisor=0|(u.divisor||0),f.state=1):"x"in u&&(f.x=+u.x||0,f.y=+u.y||0,f.z=+u.z||0,f.w=+u.w||0,f.state=2)}for(c=0;ct&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);K(c).forEach(e),c={},K(u).forEach(e),u={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,f={},r.shaderCount=0},program:function(e,n,i,a){var o=f[n];o||(o=f[n]={});var p=o[e];if(p&&(p.refCount++,!a))return p;var d=new s(n,e);return r.shaderCount++,l(d,i,a),p||(o[e]=d),h.push(d),H(d,{destroy:function(){if(d.refCount--,0>=d.refCount){t.deleteProgram(d.program);var e=h.indexOf(d);h.splice(e,1),r.shaderCount--}0>=o[d.vertId].refCount&&(t.deleteShader(u[d.vertId]),delete u[d.vertId],delete f[d.fragId][d.vertId]),Object.keys(f[d.fragId]).length||(t.deleteShader(c[d.fragId]),delete c[d.fragId],delete f[d.fragId])}})},restore:function(){c={},u={};for(var t=0;t>>e|t<<32-e}function P(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function I(t){return Array.prototype.slice.call(t)}function O(t){return I(t).join("")}function z(t){function e(){var t=[],e=[];return H((function(){t.push.apply(t,I(arguments))}),{def:function(){var r="v"+i++;return e.push(r),0>>4&15)+"0123456789abcdef".charAt(15&e);return r}(function(t){for(var e=Array(t.length>>2),r=0;r>5]|=(255&t.charCodeAt(r/8))<<24-r%32;var n,i,a,o,s,l,c,u,f,h,p,d=8*t.length;for(t=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],r=Array(64),e[d>>5]|=128<<24-d%32,e[15+(d+64>>9<<4)]=d,u=0;uf;f++){var m;if(16>f)r[f]=e[f+u];else h=f,p=P(p=C(p=r[f-2],17)^C(p,19)^p>>>10,r[f-7]),m=C(m=r[f-15],7)^C(m,18)^m>>>3,r[h]=P(P(p,m),r[f-16]);h=P(P(P(P(c,h=C(h=o,6)^C(h,11)^C(h,25)),o&s^~o&l),kt[f]),r[f]),p=P(c=C(c=d,2)^C(c,13)^C(c,22),d&n^d&i^n&i),c=l,l=s,s=o,o=P(a,h),a=i,i=n,n=d,d=P(h,p)}t[0]=P(d,t[0]),t[1]=P(n,t[1]),t[2]=P(i,t[2]),t[3]=P(a,t[3]),t[4]=P(o,t[4]),t[5]=P(s,t[5]),t[6]=P(l,t[6]),t[7]=P(c,t[7])}for(e="",r=0;r<32*t.length;r+=8)e+=String.fromCharCode(t[r>>5]>>>24-r%32&255);return e}(function(t){for(var e,r,n="",i=-1;++i=e&&56320<=r&&57343>=r&&(e=65536+((1023&e)<<10)+(1023&r),i++),127>=e?n+=String.fromCharCode(e):2047>=e?n+=String.fromCharCode(192|e>>>6&31,128|63&e):65535>=e?n+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):2097151>=e&&(n+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return n}(r))),n[e])?n[e].apply(null,o):(r=Function.apply(null,a.concat(r)),n&&(n[e]=r),r.apply(null,o))}}}function D(t){return Array.isArray(t)||J(t)||l(t)}function R(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",u,"=",a,".createStream(",34962,",",i,".buffer);","}else{",u,"=",a,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",o.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",a,".destroyStream(",u,");","}"),l}))})),o}function M(t,e,n,i,o){function s(t){var e=c[t];e&&(h[t]=e)}var l=function(t,e){if("string"==typeof(r=t.static).frag&&"string"==typeof r.vert){if(0>1)",s],");")}function e(){r(l,".drawArraysInstancedANGLE(",[d,m,g,s],");")}p&&"null"!==p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(u+".drawElements("+[d,g,v,m+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(u+".drawArrays("+[d,m,g]+");")}p&&"null"!==p?y?t():(r("if(",p,"){"),t(),r("}else{"),e(),r("}")):e()}var s,l,c=t.shared,u=c.gl,f=c.draw,h=n.draw,p=function(){var i=h.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a),h.elementsActive&&a("if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);")):(i=a.def(),a(i,"=",f,".","elements",";","if(",i,"){",u,".bindBuffer(",34963,",",i,".buffer.buffer);}","else if(",c.vao,".currentVAO){",i,"=",t.shared.elements+".getElements("+c.vao,".currentVAO.elements);",rt?"":"if("+i+")"+u+".bindBuffer(34963,"+i+".buffer.buffer);","}")),i}(),d=i("primitive"),m=i("offset"),g=function(){var i=h.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(f,".","count"),i}();if("number"==typeof g){if(0===g)return}else r("if(",g,"){"),r.exit("}");$&&(s=i("instances"),l=t.instancing);var v=p+".type",y=h.elements&&B(h.elements)&&!h.vaoActive;$&&("number"!=typeof s||0<=s)?"string"==typeof s?(r("if(",s,">0){"),a(),r("}else if(",s,"<0){"),o(),r("}")):a():o()}function q(t,e,r,n,i){return i=(e=_()).proc("body",i),$&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function Y(t,e,r,n){P(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),O(t,e,r,n.attributes,(function(){return!0}))),U(t,e,r,n.uniforms,(function(){return!0}),!1),V(t,e,e,r)}function W(t,e,r,n){function i(){return!0}t.batchId="a1",P(t,e),O(t,e,r,n.attributes,i),U(t,e,r,n.uniforms,i,!1),V(t,e,e,r)}function Z(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}P(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&S(t,u,r.context),r.needsFramebuffer&&E(t,u,r.framebuffer),C(t,u,r.state,i),r.profile&&i(r.profile)&&I(t,u,r,!1,!0),n?(r.useVAO?r.drawVAO?i(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):c(t.shared.vao,".setVAO(",r.drawVAO.append(t,c),");"):c(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(c(t.shared.vao,".setVAO(null);"),O(t,c,r,n.attributes,a),O(t,u,r,n.attributes,i)),U(t,c,r,n.uniforms,a,!1),U(t,u,r,n.uniforms,i,!0),V(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link((function(e){return q(W,t,r,e,2)})),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function X(t,r){function n(e){var n=r.shader[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.shader,"."+e,n):i.set(a.shader,"."+e,t.link(n,{stable:!0})))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;if(S(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),R(Object.keys(r.state)).forEach((function(e){var n=r.state[e],o=n.append(t,i);g(o)?o.forEach((function(r,n){isNaN(r)?i.set(t.next[e],"["+n+"]",r):i.set(t.next[e],"["+n+"]",t.link(r,{stable:!0}))})):B(n)?i.set(a.next,"."+e,t.link(o,{stable:!0})):i.set(a.next,"."+e,o)})),I(t,i,r,!0,!0),["elements","offset","count","instances","primitive"].forEach((function(e){var n=r.draw[e];n&&(n=n.append(t,i),isNaN(n)?i.set(a.draw,"."+e,n):i.set(a.draw,"."+e,t.link(n),{stable:!0}))})),Object.keys(r.uniforms).forEach((function(n){var o=r.uniforms[n].append(t,i);Array.isArray(o)&&(o="["+o.map((function(e){return isNaN(e)?e:t.link(e,{stable:!0})}))+"]"),i.set(a.uniforms,"["+t.link(e.id(n),{stable:!0})+"]",o)})),Object.keys(r.attributes).forEach((function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new K).forEach((function(t){i.set(a,"."+t,n[t])}))})),r.scopeVAO){var s=r.scopeVAO.append(t,i);isNaN(s)?i.set(a.vao,".targetVAO",s):i.set(a.vao,".targetVAO",t.link(s,{stable:!0}))}n("vert"),n("frag"),0=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach((function(e){t+=u[e].stats.size})),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(n=0|(a=e.shape)[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=bt[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height||(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=bt[c.format]*c.width*c.height)),o},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){K(u).forEach(o)},restore:function(){K(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}},wt=[];wt[6408]=4,wt[6407]=3;var Tt=[];Tt[5121]=1,Tt[5126]=4,Tt[36193]=2;var kt=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],At=["x","y","z","w"],Mt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),St={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Et={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Lt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ct={cw:2304,ccw:2305},Pt=new F(!1,!1,!1,(function(){}));return function(t){function e(){if(0===K.length)T&&T.update(),et=null;else{et=Y.next(e),f();for(var t=K.length-1;0<=t;--t){var r=K[t];r&&r(I,null,0)}g.flush(),T&&T.update()}}function r(){!et&&0=K.length&&n()}}}}function u(){var t=Z.viewport,e=Z.scissor_box;t[0]=t[1]=e[0]=e[1]=0,I.viewportWidth=I.framebufferWidth=I.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,I.viewportHeight=I.framebufferHeight=I.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function f(){I.tick+=1,I.time=m(),u(),q.procs.poll()}function h(){B.refresh(),u(),q.procs.refresh(),T&&T.update()}function m(){return(W()-M)/1e3}if(!(t=i(t)))return null;var g=t.gl,v=g.getContextAttributes();g.isContextLost();var y=function(t,e){function r(e){var r;e=e.toLowerCase();try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;ie;++e)rt(H({framebuffer:t.framebuffer.faces[e]},t),l);else rt(t,l);else l(0,t)},prop:G.define.bind(null,1),context:G.define.bind(null,2),this:G.define.bind(null,3),draw:s({}),buffer:function(t){return z.create(t,34962,!1,!1)},elements:function(t){return D.create(t,!1)},texture:B.create2D,cube:B.createCube,renderbuffer:N.create,framebuffer:j.create,framebufferCube:j.createCube,vao:R.createVAO,attributes:v,frame:c,on:function(t,e){var r;switch(t){case"frame":return c(e);case"lost":r=Q;break;case"restore":r=$;break;case"destroy":r=tt}return r.push(e),{cancel:function(){for(var t=0;t2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(a(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(l," ").concat(n," ").concat(a(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],288:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),a=t("./_stream_writable");t("inherits")(c,i);for(var o=n(a.prototype),s=0;s0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)o.endEmitted?w(t,new _):S(t,o,e,!0);else if(o.ended)w(t,new x);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||0!==e.length?S(t,o,e,!1):P(t,o)):S(t,o,e,!1)}else n||(o.reading=!1,P(t,o));return!o.ended&&(o.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(C,t))}function C(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,R(t)}function P(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function z(t){c("readable nexttick read 0"),t.read(0)}function D(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(N,e,t))}function N(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){w(this,new b("_read()"))},A.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",p),t.removeListener("unpipe",s),n.removeListener("end",l),n.removeListener("end",g),n.removeListener("data",h),f=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function l(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,R(t))}}(n);t.on("drain",u);var f=!1;function h(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==j(i.pipes,t))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(e){c("onerror",e),g(),t.removeListener("error",p),0===a(t,"error")&&w(t,e)}function d(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",d),t.once("finish",m),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?L(this):i.reading||r.nextTick(z,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(O,this),n},A.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(O,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new m("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,P(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":287,"./_stream_duplex":288,"./internal/streams/destroy":295,"./internal/streams/state":299,"./internal/streams/stream":300,_process:278,buffer:85,inherits:231,"util-deprecate":331}],293:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=t("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var r=t[h].read();null!==r&&(t[u]=null,t[o]=null,t[s]=null,e(p(r,!1)))}}function m(t){r.nextTick(d,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,e=this[l];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(e,n){r.nextTick((function(){t[l]?n(t[l]):e(p(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(p(void 0,!0)):e[f](r,n)}),n)}}(i,this));else{var a=this[h].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),g);e.exports=function(t){var e,r=Object.create(v,(i(e={},h,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,l,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[h].read();n?(r[u]=null,r[o]=null,r[s]=null,t(p(n,!1))):(r[o]=t,r[s]=e)},writable:!0}),e));return r[u]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[u]=null,r[o]=null,r[s]=null,e(t)),void(r[l]=t)}var n=r[o];null!==n&&(r[u]=null,r[o]=null,r[s]=null,n(p(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":296,_process:278}],294:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(a===i.length?n+=i:n+=i.slice(0,t),0==(t-=a)){a===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0==(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&o.forEach(c),a||(o.forEach(c),i(n))}))}));return e.reduce(u)}},{"../../../errors":287,"./end-of-stream":296}],299:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var a=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return t.objectMode?16:16384}}},{"../../../errors":287}],300:[function(t,e,r){e.exports=t("events").EventEmitter},{events:84}],301:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=f,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":285}],302:[function(t,e,r){(function(r,n){(function(){var r=t("assert"),i=t("debug")("stream-parser");e.exports=function(t){var e=t&&"function"==typeof t._transform,r=t&&"function"==typeof t._write;if(!e&&!r)throw new Error("must pass a Writable or Transform stream in");i("extending Parser into stream"),t._bytes=o,t._skipBytes=s,e&&(t._passthrough=l);e?t._transform=u:t._write=c};function a(t){i("initializing parser stream"),t._parserBytesLeft=0,t._parserBuffers=[],t._parserBuffered=0,t._parserState=-1,t._parserCallback=null,"function"==typeof t.push&&(t._parserOutput=t.push.bind(t)),t._parserInit=!0}function o(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(t)&&t>0,'can only buffer a finite number of bytes > 0, got "'+t+'"'),this._parserInit||a(this),i("buffering %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=0}function s(t,e){r(!this._parserCallback,'there is already a "callback" set!'),r(t>0,'can only skip > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("skipping %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=1}function l(t,e){r(!this._parserCallback,'There is already a "callback" set!'),r(t>0,'can only pass through > 0 bytes, got "'+t+'"'),this._parserInit||a(this),i("passing through %o bytes",t),this._parserBytesLeft=t,this._parserCallback=e,this._parserState=2}function c(t,e,r){this._parserInit||a(this),i("write(%o bytes)",t.length),"function"==typeof e&&(r=e),h(this,t,null,r)}function u(t,e,r){this._parserInit||a(this),i("transform(%o bytes)",t.length),"function"!=typeof e&&(e=this._parserOutput),h(this,t,e,r)}function f(t,e,r,a){if(t._parserBytesLeft-=e.length,i("%o bytes left for stream piece",t._parserBytesLeft),0===t._parserState?(t._parserBuffers.push(e),t._parserBuffered+=e.length):2===t._parserState&&r(e),0!==t._parserBytesLeft)return a;var o=t._parserCallback;if(o&&0===t._parserState&&t._parserBuffers.length>1&&(e=n.concat(t._parserBuffers,t._parserBuffered)),0!==t._parserState&&(e=null),t._parserCallback=null,t._parserBuffered=0,t._parserState=-1,t._parserBuffers.splice(0),o){var s=[];e&&s.push(e),r&&s.push(r);var l=o.length>s.length;l&&s.push(p(a));var c=o.apply(t,s);if(!l||a===c)return a}}var h=p((function t(e,r,n,i){return e._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return f(e,r,n,i)}:function(){var a=r.slice(0,e._parserBytesLeft);return f(e,a,n,(function(o){return o?i(o):r.length>a.length?function(){return t(e,r.slice(a.length),n,i)}:void 0}))}}));function p(t){return function(){for(var e=t.apply(this,arguments);"function"==typeof e;)e=e();return e}}}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:278,assert:75,buffer:85,debug:303}],303:[function(t,e,r){(function(n){(function(){function i(){var t;try{t=r.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(r=e.exports=t("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},r.formatArgs=function(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+r.humanize(this.diff),!e)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(a=i))})),t.splice(a,0,n)},r.save=function(t){try{null==t?r.storage.removeItem("debug"):r.storage.debug=t}catch(t){}},r.load=i,r.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},r.enable(i())}).call(this)}).call(this,t("_process"))},{"./debug":304,_process:278}],304:[function(t,e,r){var n;function i(t){function e(){if(e.enabled){var t=e,i=+new Date,a=i-(n||i);t.diff=a,t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*o;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(t);if("number"===l&&!1===isNaN(t))return e.long?s(r=t,o,"day")||s(r,a,"hour")||s(r,i,"minute")||s(r,n,"second")||r+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=a)return Math.round(t/a)+"h";if(t>=i)return Math.round(t/i)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},{}],306:[function(t,e,r){"use strict";var n=t("parenthesis");e.exports=function(t,e,r){if(null==t)throw Error("First argument should be a string");if(null==e)throw Error("Separator should be a string or a RegExp");r?("string"==typeof r||Array.isArray(r))&&(r={ignore:r}):r={},null==r.escape&&(r.escape=!0),null==r.ignore?r.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"==typeof r.ignore&&(r.ignore=[r.ignore]),r.ignore=r.ignore.map((function(t){return 1===t.length&&(t+=t),t})));var i=n.parse(t,{flat:!0,brackets:r.ignore}),a=i[0].split(e);if(r.escape){for(var o=[],s=0;s0;){e=c[c.length-1];var p=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=d}else{if(n[e]===r[e]){var g=[],v=[],y=0;for(d=l.length-1;d>=0;--d){var x=l[d];if(i[x]=!1,g.push(x),v.push(s[x]),y+=s[x].length,o[x]=f.length,x===e){l.length=d;break}}f.push(g);var b=new Array(y);for(d=0;d1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,p=void 0===h?0:h,d=t.largeArcFlag,m=void 0===d?0:d,g=t.sweepFlag,v=void 0===g?0:g,y=[];if(0===u||0===f)return[];var x=Math.sin(p*i/360),b=Math.cos(p*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var T=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);T>1&&(u*=Math.sqrt(T),f*=Math.sqrt(T));var k=function(t,e,r,n,a,o,l,c,u,f,h,p){var d=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(h,2),v=Math.pow(p,2),y=d*m-d*v-m*g;y<0&&(y=0),y/=d*v+m*g;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*p,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,T=(h-x)/a,k=(p-b)/o,A=(-h-x)/a,M=(-p-b)/o,S=s(1,0,T,k),E=s(T,k,A,M);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,f,m,v,x,b,_,w),A=n(k,4),M=A[0],S=A[1],E=A[2],L=A[3],C=Math.abs(L)/(i/4);Math.abs(1-C)<1e-7&&(C=1);var P=Math.max(Math.ceil(C),1);L/=P;for(var I=0;Ie[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":70,assert:75,"is-svg-path":238,"normalize-svg-path":310,"parse-svg-path":250}],310:[function(t,e,r){"use strict";e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,p=0,d=0,m=t.length;d4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=p),r.push(g)}return r};var n=t("svg-arc-to-cubic-bezier");function i(t,e,r,n){return["C",t,e,r,n,r,n]}function a(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}},{"svg-arc-to-cubic-bezier":308}],311:[function(t,e,r){"use strict";var n,i=t("svg-path-bounds"),a=t("parse-svg-path"),o=t("draw-svg-path"),s=t("is-svg-path"),l=t("bitmap-sdf"),c=document.createElement("canvas"),u=c.getContext("2d");e.exports=function(t,e){if(!s(t))throw Error("Argument should be valid svg path string");e||(e={});var r,f;e.shape?(r=e.shape[0],f=e.shape[1]):(r=c.width=e.w||e.width||200,f=c.height=e.h||e.height||200);var h=Math.min(r,f),p=e.stroke||0,d=e.viewbox||e.viewBox||i(t),m=[r/(d[2]-d[0]),f/(d[3]-d[1])],g=Math.min(m[0]||0,m[1]||0)/2;u.fillStyle="black",u.fillRect(0,0,r,f),u.fillStyle="white",p&&("number"!=typeof p&&(p=1),u.strokeStyle=p>0?"white":"black",u.lineWidth=Math.abs(p));if(u.translate(.5*r,.5*f),u.scale(g,g),function(){if(null!=n)return n;var t=document.createElement("canvas").getContext("2d");if(t.canvas.width=t.canvas.height=1,!window.Path2D)return n=!1;var e=new Path2D("M0,0h1v1h-1v-1Z");t.fillStyle="black",t.fill(e);var r=t.getImageData(0,0,1,1);return n=r&&r.data&&255===r.data[3]}()){var v=new Path2D(t);u.fill(v),p&&u.stroke(v)}else{var y=a(t);o(u,y),u.fill(),p&&u.stroke()}return u.setTransform(1,0,0,1,0,0),l(u,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}},{"bitmap-sdf":82,"draw-svg-path":126,"is-svg-path":238,"parse-svg-path":250,"svg-path-bounds":309}],312:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},l=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&o.call(arguments,1);return s[e]=!0,i((function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":278,timers:312}],313:[function(t,e,r){!function(t){var r=/^\s+/,n=/\s+$/,i=0,a=t.round,o=t.min,s=t.max,l=t.random;function c(e,l){if(l=l||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,l);var u=function(e){var i={r:0,g:0,b:0},a=1,l=null,c=null,u=null,f=!1,h=!1;"string"==typeof e&&(e=function(t){t=t.replace(r,"").replace(n,"").toLowerCase();var e,i=!1;if(S[t])t=S[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=j.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=j.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=j.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=j.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=j.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=j.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=j.hex8.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),a:R(e[4]),format:i?"name":"hex8"};if(e=j.hex6.exec(t))return{r:I(e[1]),g:I(e[2]),b:I(e[3]),format:i?"name":"hex"};if(e=j.hex4.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),a:R(e[4]+""+e[4]),format:i?"name":"hex8"};if(e=j.hex3.exec(t))return{r:I(e[1]+""+e[1]),g:I(e[2]+""+e[2]),b:I(e[3]+""+e[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(U(e.r)&&U(e.g)&&U(e.b)?(p=e.r,d=e.g,m=e.b,i={r:255*C(p,255),g:255*C(d,255),b:255*C(m,255)},f=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(l=z(e.s),c=z(e.v),i=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var i=t.floor(e),a=e-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6;return{r:255*[n,s,o,o,l,n][c],g:255*[l,n,n,s,o,o][c],b:255*[o,o,l,n,n,s][c]}}(e.h,l,c),f=!0,h="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(l=z(e.s),u=z(e.l),i=function(t,e,r){var n,i,a;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=i=a=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=o(l,s,t+1/3),i=o(l,s,t),a=o(l,s,t-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,l,u),f=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a));var p,d,m;return a=L(a),{ok:f,format:e.format||h,r:o(255,s(i.r,0)),g:o(255,s(i.g,0)),b:o(255,s(i.b,0)),a:a}}(e);this._originalInput=e,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,i,a=s(t,e,r),l=o(t,e,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push(c(n));return a}function M(t,e){e=e||6;for(var r=c(t).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/e;e--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%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,i=this.toRgb();return e=i.r/255,r=i.g/255,n=i.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=L(t),this._roundA=a(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=a(360*t.h),r=a(100*t.s),n=a(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=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[O(a(t).toString(16)),O(a(e).toString(16)),O(a(r).toString(16)),O(D(n))];if(i&&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:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[h(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 i=c(t);r="#"+p(i._r,i._g,i._b,i._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(v,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,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(A,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(M,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]:z(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:l(),g:l(),b:l()})},c.mix=function(t,e,r){r=0===r?0:r||50;var n=c(t).toRgb(),i=c(e).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(e,r){var n=c(e),i=c(r);return(t.max(n.getLuminance(),i.getLuminance())+.05)/(t.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(t,e,r){var n,i,a=c.readability(t,e);switch(i=!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":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(t,e,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(e[u]));return c.isReadable(t,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(t,["#fff","#000"],r))};var S=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"},E=c.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(S);function L(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=o(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function P(t){return o(1,s(0,t))}function I(t){return parseInt(t,16)}function O(t){return 1==t.length?"0"+t:""+t}function z(t){return t<=1&&(t=100*t+"%"),t}function D(e){return t.round(255*parseFloat(e)).toString(16)}function R(t){return I(t)/255}var F,B,N,j=(B="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",N="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+B),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+B),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+B),hsva:new RegExp("hsva"+N),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 U(t){return!!j.CSS_UNIT.exec(t)}void 0!==e&&e.exports?e.exports=c:window.tinycolor=c}(Math)},{}],314:[function(t,e,r){"use strict";e.exports=i,e.exports.float32=e.exports.float=i,e.exports.fract32=e.exports.fract=function(t,e){if(t.length){if(t instanceof Float32Array)return new Float32Array(t.length);e instanceof Float32Array||(e=i(t));for(var r=0,n=e.length;ro&&(o=t[0]),t[1]s&&(s=t[1])}function c(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"Point":l(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(l)}}for(e in t.arcs.forEach((function(t){for(var e,r=-1,l=t.length;++ro&&(o=e[0]),e[1]s&&(s=e[1])})),t.objects)c(t.objects[e]);return[i,a,o,s]}function i(t,e){var r=e.id,n=e.bbox,i=null==e.properties?{}:e.properties,o=a(t,e);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(t,e){var n=r(t.transform),i=t.arcs;function a(t,e){e.length&&e.pop();for(var r=i[t<0?~t:t],a=0,o=r.length;a1)n=l(t,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(t){return t.length>0}))}}function u(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");var r,i=(l=t.bbox||n(t))[0],a=l[1],o=l[2],s=l[3];e={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,u=f(e),h=t.objects,p={};function d(t){return u(t)}function m(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(m)};break;case"Point":e={type:"Point",coordinates:d(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(d)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(c in h)p[c]=m(h[c]);return{type:"Topology",bbox:l,transform:e,objects:p,arcs:t.arcs.map((function(t){var e,r=0,n=1,i=t.length,a=new Array(i);for(a[0]=u(t[0],0);++r":(e.length>100&&(e=e.slice(0,99)+"\u2026"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":319}],321:[function(t,e,r){"use strict";var n=t("../value/is"),i={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(i,typeof t)}},{"../value/is":327}],322:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":318,"./is":323}],323:[function(t,e,r){"use strict";var n=t("../function/is"),i=/^\s*class[\s{/}]/,a=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!i.test(a.call(t))}},{"../function/is":317}],324:[function(t,e,r){"use strict";var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":321}],325:[function(t,e,r){"use strict";var n=t("../value/is"),i=t("../object/is"),a=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(i(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===a)return null}try{return""+t}catch(t){return null}}},{"../object/is":321,"../value/is":327}],326:[function(t,e,r){"use strict";var n=t("../lib/resolve-exception"),i=t("./is");e.exports=function(t){return i(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":318,"./is":327}],327:[function(t,e,r){"use strict";e.exports=function(t){return null!=t}},{}],328:[function(t,e,r){(function(e){(function(){"use strict";var n=t("bit-twiddle"),i=t("dup"),a=t("buffer").Buffer;e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!=typeof Uint8ClampedArray,s="undefined"!=typeof BigUint64Array,l="undefined"!=typeof BigInt64Array,c=e.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,f=c.BUFFER;function h(t){if(t){var e=t.length||t.byteLength,r=n.log2(e);u[r].push(t)}}function p(t){t=n.nextPow2(t);var e=n.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function d(t){return new Uint8Array(p(t),0,t)}function m(t){return new Uint16Array(p(2*t),0,t)}function g(t){return new Uint32Array(p(4*t),0,t)}function v(t){return new Int8Array(p(t),0,t)}function y(t){return new Int16Array(p(2*t),0,t)}function x(t){return new Int32Array(p(4*t),0,t)}function b(t){return new Float32Array(p(4*t),0,t)}function _(t){return new Float64Array(p(8*t),0,t)}function w(t){return o?new Uint8ClampedArray(p(t),0,t):d(t)}function T(t){return s?new BigUint64Array(p(8*t),0,t):null}function k(t){return l?new BigInt64Array(p(8*t),0,t):null}function A(t){return new DataView(p(t),0,t)}function M(t){t=n.nextPow2(t);var e=n.log2(t),r=f[e];return r.length>0?r.pop():new a(t)}r.free=function(t){if(a.isBuffer(t))f[n.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|n.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){h(t.buffer)},r.freeArrayBuffer=h,r.freeBuffer=function(t){f[n.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return p(t);switch(e){case"uint8":return d(t);case"uint16":return m(t);case"uint32":return g(t);case"int8":return v(t);case"int16":return y(t);case"int32":return x(t);case"float":case"float32":return b(t);case"double":case"float64":return _(t);case"uint8_clamped":return w(t);case"bigint64":return k(t);case"biguint64":return T(t);case"buffer":return M(t);case"data":case"dataview":return A(t);default:return null}return null},r.mallocArrayBuffer=p,r.mallocUint8=d,r.mallocUint16=m,r.mallocUint32=g,r.mallocInt8=v,r.mallocInt16=y,r.mallocInt32=x,r.mallocFloat32=r.mallocFloat=b,r.mallocFloat64=r.mallocDouble=_,r.mallocUint8Clamped=w,r.mallocBigUint64=T,r.mallocBigInt64=k,r.mallocDataView=A,r.mallocBuffer=M,r.clearCache=function(){for(var t=0;t<32;++t)c.UINT8[t].length=0,c.UINT16[t].length=0,c.UINT32[t].length=0,c.INT8[t].length=0,c.INT16[t].length=0,c.INT32[t].length=0,c.FLOAT[t].length=0,c.DOUBLE[t].length=0,c.BIGUINT64[t].length=0,c.BIGINT64[t].length=0,c.UINT8C[t].length=0,u[t].length=0,f[t].length=0}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bit-twiddle":81,buffer:85,dup:128}],329:[function(t,e,r){var n=/[\'\"]/;e.exports=function(t){return t?(n.test(t.charAt(0))&&(t=t.substr(1)),n.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},{}],330:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var i=this.intercalaryMonth(t);if(r&&e!==i||e<1||e>12)throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!r&&e<=i?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var i,o=this._validateYear(t,n.local.invalidyear),s=h[o-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(i=a.newDate(l,c,u)).add(4-(i.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-i.toJD();return 1+Math.floor(f/7)},monthsInYear:function(t){return this.leapYear(t)?13:12},daysInMonth:function(t,e){t.year&&(e=t.month(),t=t.year()),t=this._validateYear(t);var r=f[t-f[0]];if(e>(r>>13?12:11))throw n.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,s,r,n.local.invalidDate);t=this._validateYear(i.year()),e=i.month(),r=i.day();var o=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o,s;if("object"==typeof t)o=t,a=e||{};else{var l;if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"==typeof n?(l=!1,a=n):(l=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:l}}s=o.day-1;var c,u=f[o.year-f[0]],p=u>>13;c=p&&(o.month>p||o.isIntercalary)?o.month:o.month-1;for(var d=0;d>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,r,o);return a.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=a.fromJD(t),r=function(t,e,r,n){var i,a;if("object"==typeof t)i=t,a=e||{};else{if(!("number"==typeof t&&t>=1888&&t<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"==typeof e&&e>=1&&e<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"==typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:t,month:e,day:r},a=n||{}}var o=h[i.year-h[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=h[a.year-h[0]];var l,c=new Date(o>>9&4095,(o>>5&15)-1,31&o),u=new Date(i.year,i.month-1,i.day);l=Math.round((u-c)/864e5);var p,d=f[a.year-f[0]];for(p=0;p<13;p++){var m=d&1<<12-p?30:29;if(l>13;!g||p=2&&n<=6},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{century:o[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year()+(i.year()<0?1:0),e=i.month(),(r=i.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};n.calendars.discworld=a},{"../main":347,"object-assign":247}],336:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()+(e.year()<0?1:0))%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear),13},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),n.calendars.ethiopian=a},{"../main":347,"object-assign":247}],337:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return o(7*(t=t<0?t+1:t)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),12===e&&this.leapYear(t)||8===e&&5===o(this.daysInYear(t),10)?30:9===e&&3===o(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===e?1:e+1,7,1);)e++;for(var r=tthis.toJD(e,r,this.daysInMonth(e,r));)r++;var n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.hebrew=a},{"../main":347,"object-assign":247}],338:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year()+14)%30<11},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return this.leapYear(t)?355:354},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),t=t<=0?t+1:t,(r=i.day())+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),n.calendars.islamic=a},{"../main":347,"object-assign":247}],339:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return(t=e.year()<0?e.year()+1:e.year())%4==0},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return t=i.year(),e=i.month(),r=i.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),n.calendars.julian=a},{"../main":347,"object-assign":247}],340:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function o(t,e){return t-e*Math.floor(t/e)}function s(t,e){return o(t-1,e)+1}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year();var e=Math.floor(t/400);return t%=400,t+=t<0?400:0,e+"."+Math.floor(t/20)+"."+t%20},forYear:function(t){if((t=t.split(".")).length<3)throw"Invalid Mayan year";for(var e=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";e=20*e+n}return e},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,n.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,n.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,n.local.invalidDate),!0},extraInfo:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(t){var e=o((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,o(e,20)]},_toTzolkin:function(t){return[s((t-=this.jdEpoch)+20,20),s(t+4,13)]},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),n.calendars.mayan=a},{"../main":347,"object-assign":247}],341:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar;var o=n.instance("gregorian");i(a.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear||n.regionalOptions[""].invalidYear);return o.leapYear(e.year()+(e.year()<1?1:0)+1469)},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidMonth);(t=i.year())<0&&t++;for(var a=i.day(),s=1;s=this.toJD(e+1,1,1);)e++;for(var r=t-Math.floor(this.toJD(e,1,1)+.5)+1,n=1;r>this.daysInMonth(e,n);)r-=this.daysInMonth(e,n),n++;return this.newDate(e,n,r)}}),n.calendars.nanakshahi=a},{"../main":347,"object-assign":247}],342:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(t){return this.daysInYear(t)!==this.daysPerYear},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear).year(),void 0===this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var e=0,r=this.minMonth;r<=12;r++)e+=this.NEPALI_CALENDAR_DATA[t][r];return e},daysInMonth:function(t,e){return t.year&&(e=t.month(),t=t.year()),this._validate(t,e,this.minDay,n.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=n.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&r>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==e&&(o=r,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===e?(o+=r-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=n.instance().fromJD(t),r=e.year(),i=e.dayOfYear(),a=r+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(t){var e=this.daysPerMonth.slice(0);e.unshift(17);for(var r=t-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=i.year(),e=i.month(),r=i.day();var a=t-(t>=0?474:473),s=474+o(a,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(a/2820)+this.jdEpoch-1},fromJD:function(t){var e=(t=Math.floor(t)+.5)-this.toJD(475,1,1),r=Math.floor(e/1029983),n=o(e,1029983),i=2820;if(1029982!==n){var a=Math.floor(n/366),s=o(n,366);i=Math.floor((2134*a+2816*s+2815)/1028522)+a+1}var l=i+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),n.calendars.persian=a,n.calendars.jalali=a},{"../main":347,"object-assign":247}],344:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)},_g2tYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)}}),n.calendars.taiwan=o},{"../main":347,"object-assign":247}],345:[function(t,e,r){var n=t("../main"),i=t("object-assign"),a=n.instance();function o(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}o.prototype=new n.baseCalendar,i(o.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(e.year());return a.leapYear(t)},weekOfYear:function(t,e,r){var i=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);t=this._t2gYear(i.year());return a.weekOfYear(t,i.month(),i.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,n.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate);t=this._t2gYear(i.year());return a.toJD(t,i.month(),i.day())},fromJD:function(t){var e=a.fromJD(t),r=this._g2tYear(e.year());return this.newDate(r,e.month(),e.day())},_t2gYear:function(t){return t-this.yearsOffset-(t>=1&&t<=this.yearsOffset?1:0)},_g2tYear:function(t){return t+this.yearsOffset+(t>=-this.yearsOffset&&t<=-1?1:0)}}),n.calendars.thai=o},{"../main":347,"object-assign":247}],346:[function(t,e,r){var n=t("../main"),i=t("object-assign");function a(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}a.prototype=new n.baseCalendar,i(a.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,n.local.invalidYear);return 355===this.daysInYear(e.year())},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){for(var e=0,r=1;r<=12;r++)e+=this.daysInMonth(t,r);return e},daysInMonth:function(t,e){for(var r=this._validate(t,e,this.minDay,n.local.invalidMonth).toJD()-24e5+.5,i=0,a=0;ar)return o[i]-o[i-1];i++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var i=this._validate(t,e,r,n.local.invalidDate),a=12*(i.year()-1)+i.month()-15292;return i.day()+o[a-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,a=Math.floor((i-1)/12),s=a+1,l=i-12*a,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var i=n.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,e,r,i){var a=n.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),n.calendars.ummalqura=a;var o=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]},{"../main":347,"object-assign":247}],347:[function(t,e,r){var n=t("object-assign");function i(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function a(t,e,r,n){if(this._calendar=t,this._year=e,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function o(t,e){return"000000".substring(0,e-(t=""+t).length)+t}function s(){this.shortYearCutoff="+10"}function l(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}n(i.prototype,{instance:function(t,e){t=(t||"gregorian").toLowerCase(),e=e||"";var r=this._localCals[t+"-"+e];if(!r&&this.calendars[t]&&(r=new this.calendars[t](e),this._localCals[t+"-"+e]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,t);return r},newDate:function(t,e,r,n,i){return(n=(null!=t&&t.year?t.calendar():"string"==typeof n?this.instance(n,i):n)||this.instance()).newDate(t,e,r)},substituteDigits:function(t){return function(e){return(e+"").replace(/[0-9]/g,(function(e){return t[e]}))}},substituteChineseDigits:function(t,e){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":t[a]+e[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(t[1]+e[1])&&(n=n.substr(1)),n||t[0]}}}),n(a.prototype,{newDate:function(t,e,r){return this._calendar.newDate(null==t?this:t,e,r)},year:function(t){return 0===arguments.length?this._year:this.set(t,"y")},month:function(t){return 0===arguments.length?this._month:this.set(t,"m")},day:function(t){return 0===arguments.length?this._day:this.set(t,"d")},date:function(t,e,r){if(!this._calendar.isValid(t,e,r))throw(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=t,this._month=e,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(t,e){return this._calendar.add(this,t,e)},set:function(t,e){return this._calendar.set(this,t,e)},compareTo:function(t){if(this._calendar.name!==t._calendar.name)throw(c.local.differentCalendars||c.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,t._calendar.local.name);var e=this._year!==t._year?this._year-t._year:this._month!==t._month?this.monthOfYear()-t.monthOfYear():this._day-t._day;return 0===e?0:e<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(t){return this._calendar.fromJD(t)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(t){return this._calendar.fromJSDate(t)},toString:function(){return(this.year()<0?"-":"")+o(Math.abs(this.year()),4)+"-"+o(this.month(),2)+"-"+o(this.day(),2)}}),n(s.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new a(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+o(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(t,e){var r=(e+this.firstMonth-2*this.minMonth)%this.monthsInYear(t)+this.minMonth;return this._validate(t,r,this.minDay,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate),this._correctAdd(t,this._add(t,e,r),e,r)},_add:function(t,e,r){if(this._validateLevel++,"d"===r||"w"===r){var n=t.toJD()+e*("w"===r?this.daysInWeek():1),i=t.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=t.year()+("y"===r?e:0),o=t.monthOfYear()+("m"===r?e:0);i=t.day();"y"===r?(t.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,t.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(!function(t){for(;oe-1+t.minMonth;)a++,o-=e,e=t.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(t){throw this._validateLevel--,t}},_correctAdd:function(t,e,r,n){if(!(this.hasYearZero||"y"!==n&&"m"!==n||0!==e[0]&&t.year()>0==e[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;e=this._add(t,r*i[0]+a*i[1],i[2])}return t.date(e[0],e[1],e[2])},set:function(t,e,r){this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.regionalOptions[""].invalidDate);var n="y"===r?e:t.year(),i="m"===r?e:t.month(),a="d"===r?e:t.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),t.date(n,i,a)},isValid:function(t,e,r){this._validateLevel++;var n=this.hasYearZero||0!==t;if(n){var i=this.newDate(t,e,this.minDay);n=e>=this.minMonth&&e-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(t){return this.newDate(t.getFullYear(),t.getMonth()+1,t.getDate())}});var c=e.exports=new i;c.cdate=a,c.baseCalendar=s,c.calendars.gregorian=l},{"object-assign":247}],348:[function(t,e,r){var n=t("object-assign"),i=t("./main");n(i.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),i.local=i.regionalOptions[""],n(i.cdate.prototype,{formatDate:function(t,e){return"string"!=typeof t&&(e=t,t=""),this._calendar.formatDate(t||"",this,e)}}),n(i.baseCalendar.prototype,{UNIX_EPOCH:i.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:i.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(t,e,r){if("string"!=typeof t&&(r=e,e=t,t=""),!e)return"";if(e.calendar()!==this)throw i.local.invalidFormat||i.regionalOptions[""].invalidFormat;t=t||this.local.dateFormat;for(var n,a,o,s,l=(r=r||{}).dayNamesShort||this.local.dayNamesShort,c=r.dayNames||this.local.dayNames,u=r.monthNumbers||this.local.monthNumbers,f=r.monthNamesShort||this.local.monthNamesShort,h=r.monthNames||this.local.monthNames,p=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;w+n1}),d=function(t,e,r,n){var i=""+e;if(p(t,n))for(;i.length1},x=function(t,r){var n=y(t,r),a=[2,3,n?4:2,n?4:2,10,11,20]["oyYJ@!".indexOf(t)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=e.substring(A).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,A);return A+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"==typeof l){y("m");var t=l.call(b,e.substring(A));return A+=t.length,t}return x("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){p=1,d=m;for(var E=this.daysInMonth(h,p);d>E;E=this.daysInMonth(h,p))p++,d-=E}return f>-1?this.fromJD(f):this.newDate(h,p,d)},determineDate:function(t,e,r,n,i){r&&"object"!=typeof r&&(i=n,n=r,r=null),"string"!=typeof n&&(i=n,n="");var a=this;return e=e?e.newDate():null,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":347,"object-assign":247}],349:[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}]},{}],350:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=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:i({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",a.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",a.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",a.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",a.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:i({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},{"../../constants/axis_placeable_objects":484,"../../plot_api/plot_template":555,"../../plots/cartesian/constants":573,"../../plots/font_attributes":594,"./arrow_paths":349}],351:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./draw").draw;function o(t){var e=t._fullLayout;n.filterVisible(e.annotations).forEach((function(e){var r=i.getFromId(t,e.xref),n=i.getFromId(t,e.yref),a=i.getRefType(e.xref),o=i.getRefType(e.yref);e._extremes={},"range"===a&&s(e,r),"range"===o&&s(e,n)}))}function s(t,e){var r,n=e._id,a=n.charAt(0),o=t[a],s=t["a"+a],l=t[a+"ref"],c=t["a"+a+"ref"],u=t["_"+a+"padplus"],f=t["_"+a+"padminus"],h={x:1,y:-1}[a]*t[a+"shift"],p=3*t.arrowsize*t.arrowwidth||0,d=p+h,m=p-h,g=3*t.startarrowsize*t.arrowwidth||0,v=g+h,y=g-h;if(c===l){var x=i.findExtremes(e,[e.r2c(o)],{ppadplus:d,ppadminus:m}),b=i.findExtremes(e,[e.r2c(s)],{ppadplus:Math.max(u,v),ppadminus:Math.max(f,y)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else v=s?v+s:v,y=s?y-s:y,r=i.findExtremes(e,[e.r2c(o)],{ppadplus:Math.max(u,d,v),ppadminus:Math.max(f,m,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([a,o],t)}},{"../../lib":515,"../../plots/cartesian/axes":566,"./draw":356}],352:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("../../plot_api/plot_template").arrayEditor;function o(t,e){var r,n,i,a,o,l,c,u=t._fullLayout.annotations,f=[],h=[],p=[],d=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,s,l=o(t,e),c=l.on,u=l.off.concat(l.explicitOff),f={},h=t._fullLayout.annotations;if(!c.length&&!u.length)return;for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}for(var W=!1,Z=["x","y"],X=0;X1)&&(nt===rt?((pt=it.r2fraction(e["a"+et]))<0||pt>1)&&(W=!0):W=!0),J=it._offset+it.r2p(e[et]),$=.5}else{var dt="domain"===ht;"x"===et?(Q=e[et],J=dt?it._offset+it._length*Q:J=T.l+T.w*Q):(Q=1-e[et],J=dt?it._offset+it._length*Q:J=T.t+T.h*Q),$=e.showarrow?.5:Q}if(e.showarrow){ft.head=J;var mt=e["a"+et];if(tt=ot*q(.5,e.xanchor)-st*q(.5,e.yanchor),nt===rt){var gt=l.getRefType(nt);"domain"===gt?("y"===et&&(mt=1-mt),ft.tail=it._offset+it._length*mt):"paper"===gt?"y"===et?(mt=1-mt,ft.tail=T.t+T.h*mt):ft.tail=T.l+T.w*mt:ft.tail=it._offset+it.r2p(mt),K=tt}else ft.tail=J+mt,K=tt+mt;ft.text=ft.tail+tt;var vt=w["x"===et?"width":"height"];if("paper"===rt&&(ft.head=o.constrain(ft.head,1,vt-1)),"pixel"===nt){var yt=-Math.max(ft.tail-3,ft.text),xt=Math.min(ft.tail+3,ft.text)-vt;yt>0?(ft.tail+=yt,ft.text+=yt):xt>0&&(ft.tail-=xt,ft.text-=xt)}ft.tail+=ut,ft.head+=ut}else K=tt=lt*q($,ct),ft.text=J+tt;ft.text+=ut,tt+=ut,K+=ut,e["_"+et+"padplus"]=lt/2+K,e["_"+et+"padminus"]=lt/2-K,e["_"+et+"size"]=lt,e["_"+et+"shift"]=tt}if(W)R.remove();else{var bt=0,_t=0;if("left"!==e.align&&(bt=(A-b)*("center"===e.align?.5:1)),"top"!==e.valign&&(_t=(D-_)*("middle"===e.valign?.5:1)),f)n.select("svg").attr({x:N+bt-1,y:N+_t}).call(u.setClipUrl,U?L:null,t);else{var wt=N+_t-m.top,Tt=N+bt-m.left;G.call(h.positionText,Tt,wt).call(u.setClipUrl,U?L:null,t)}V.select("rect").call(u.setRect,N,N,A,D),j.call(u.setRect,F/2,F/2,B-F,H-F),R.call(u.setTranslate,Math.round(C.x.text-B/2),Math.round(C.y.text-H/2)),O.attr({transform:"rotate("+P+","+C.x.text+","+C.y.text+")"});var kt,At=function(r,n){I.selectAll(".annotation-arrow-g").remove();var l=C.x.head,f=C.y.head,h=C.x.tail+r,p=C.y.tail+n,m=C.x.text+r,b=C.y.text+n,_=o.rotationXYMatrix(P,m,b),w=o.apply2DTransform(_),A=o.apply2DTransform2(_),L=+j.attr("width"),z=+j.attr("height"),D=m-.5*L,F=D+L,B=b-.5*z,N=B+z,U=[[D,B,D,N],[D,N,F,N],[F,N,F,B],[F,B,D,B]].map(A);if(!U.reduce((function(t,e){return t^!!o.segmentsIntersect(l,f,l+1e6,f+1e6,e[0],e[1],e[2],e[3])}),!1)){U.forEach((function(t){var e=o.segmentsIntersect(h,p,l,f,t[0],t[1],t[2],t[3]);e&&(h=e.x,p=e.y)}));var V=e.arrowwidth,H=e.arrowcolor,q=e.arrowside,G=I.append("g").style({opacity:c.opacity(H)}).classed("annotation-arrow-g",!0),Y=G.append("path").attr("d","M"+h+","+p+"L"+l+","+f).style("stroke-width",V+"px").call(c.stroke,c.rgb(H));if(g(Y,q,e),k.annotationPosition&&Y.node().parentNode&&!a){var W=l,Z=f;if(e.standoff){var X=Math.sqrt(Math.pow(l-h,2)+Math.pow(f-p,2));W+=e.standoff*(h-l)/X,Z+=e.standoff*(p-f)/X}var J,K,Q=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-W)+","+(p-Z),transform:s(W,Z)}).style("stroke-width",V+6+"px").call(c.stroke,"rgba(0,0,0,0)").call(c.fill,"rgba(0,0,0,0)");d.init({element:Q.node(),gd:t,prepFn:function(){var t=u.getTranslate(R);J=t.x,K=t.y,v&&v.autorange&&M(v._name+".autorange",!0),x&&x.autorange&&M(x._name+".autorange",!0)},moveFn:function(t,r){var n=w(J,K),i=n[0]+t,a=n[1]+r;R.call(u.setTranslate,i,a),S("x",y(v,t,"x",T,e)),S("y",y(x,r,"y",T,e)),e.axref===e.xref&&S("ax",y(v,t,"ax",T,e)),e.ayref===e.yref&&S("ay",y(x,r,"ay",T,e)),G.attr("transform",s(t,r)),O.attr({transform:"rotate("+P+","+i+","+a+")"})},doneFn:function(){i.call("_guiRelayout",t,E());var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&At(0,0),z)d.init({element:R.node(),gd:t,prepFn:function(){kt=O.attr("transform")},moveFn:function(t,r){var n="pointer";if(e.showarrow)e.axref===e.xref?S("ax",y(v,t,"ax",T,e)):S("ax",e.ax+t),e.ayref===e.yref?S("ay",y(x,r,"ay",T.w,e)):S("ay",e.ay+r),At(t,r);else{if(a)return;var i,o;if(v)i=y(v,t,"x",T,e);else{var l=e._xsize/T.w,c=e.x+(e._xshift-e.xshift)/T.w-l/2;i=d.align(c+t/T.w,l,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=d.align(f-r/T.h,u,0,1,e.yanchor)}S("x",i),S("y",o),v&&x||(n=d.getCursor(v?.5:i,x?.5:o,e.xanchor,e.yanchor))}O.attr({transform:s(t,r)+kt}),p(R,n)},clickFn:function(r,n){e.captureevents&&t.emit("plotly_clickannotation",Y(n))},doneFn:function(){p(R),i.call("_guiRelayout",t,E());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=0,x=e.indexOf("end")>=0,b=d.backoff*g+r.standoff,_=m.backoff*v+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(h=(f=Math.atan2(T,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+T*T))return void z();if(b){if(b*b>w*w+T*T)return void z();var k=b*Math.cos(f),A=b*Math.sin(f);u.x+=k,u.y+=A,t.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+T*T)return void z();var M=_*Math.cos(f),S=_*Math.sin(f);o.x-=M,o.y-=S,t.attr({x1:o.x,y1:o.y})}}else if("path"===p.nodeName){var E=p.getTotalLength(),L="";if(E1){c=!0;break}}c?t.fullLayout._infolayer.select(".annotation-"+t.id+'[data-index="'+s+'"]').remove():(l._pdata=i(t.glplot.cameraParams,[e.xaxis.r2l(l.x)*r[0],e.yaxis.r2l(l.y)*r[1],e.zaxis.r2l(l.z)*r[2]]),n(t.graphDiv,l,s,t.id,l._xa,l._ya))}}},{"../../plots/gl3d/project":616,"../annotations/draw":356}],363:[function(t,e,r){"use strict";var n=t("../../registry"),i=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 a=r.attrRegex,o=Object.keys(t),s=0;s=0))return t;if(3===o)n[o]>1&&(n[o]=1);else if(n[o]>=1)return t}var s=Math.round(255*n[0])+", "+Math.round(255*n[1])+", "+Math.round(255*n[2]);return a?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}o.tinyRGB=function(t){var e=t.toRgb();return"rgb("+Math.round(e.r)+", "+Math.round(e.g)+", "+Math.round(e.b)+")"},o.rgb=function(t){return o.tinyRGB(n(t))},o.opacity=function(t){return t?n(t).getAlpha():0},o.addOpacity=function(t,e){var r=n(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=n(t).toRgb();if(1===r.a)return n(t).toRgbString();var i=n(e||c).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-r.a)+r.r*r.a,g:a.g*(1-r.a)+r.g*r.a,b:a.b*(1-r.a)+r.b*r.a};return n(o).toRgbString()},o.contrast=function(t,e,r){var i=n(t);return 1!==i.getAlpha()&&(i=n(o.combine(t,c))),(i.isDark()?e?i.lighten(e):c:r?i.darken(r):l).toString()},o.stroke=function(t,e){var r=n(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=n(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,n,i,s=Object.keys(t);for(e=0;e0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var ct=Math.pow(10,Math.floor(Math.log(lt)/Math.LN10));ot*=ct*c.roundUp(lt/ct,[2,5,10]),(Math.abs(q.start)/q.size+1e-6)%1<2e-6&&(it.tick0=0)}it.dtick=ot}it.domain=o?[rt+I/R.h,rt+K-I/R.h]:[rt+P/R.w,rt+K-P/R.w],it.setScale(),t.attr("transform",u(Math.round(R.l),Math.round(R.t)));var ut,ft=t.select("."+A.cbtitleunshift).attr("transform",u(-Math.round(R.l),-Math.round(R.t))),ht=it.ticklabelposition,pt=it.title.font.size,dt=t.select("."+A.cbaxis),mt=0,gt=0;function vt(n,i){var a={propContainer:it,propName:e._propPrefix+"title",traceIndex:e._traceIndex,_meta:e._meta,placeholder:D._dfltTitle.colorbar,containerGroup:t.select("."+A.cbtitle)},o="h"===n.charAt(0)?n.substr(1):"h"+n;t.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(r,n,f(a,i||{}))}return c.syncOrAsync([a.previousPromises,function(){var t,e;(o&&at||!o&&!at)&&("top"===j&&(t=P+R.l+R.w*O,e=I+R.t+R.h*(1-rt-K)+3+.75*pt),"bottom"===j&&(t=P+R.l+R.w*O,e=I+R.t+R.h*(1-rt)-3-.25*pt),"right"===j&&(e=I+R.t+R.h*z+3+.75*pt,t=P+R.l+R.w*rt),vt(it._id+"title",{attributes:{x:t,y:e,"text-anchor":o?"start":"middle"}}))},function(){if(!o&&!at||o&&at){var a,l=t.select("."+A.cbtitle),f=l.select("text"),h=[-M/2,M/2],d=l.select(".h"+it._id+"title-math-group").node(),m=15.6;if(f.node()&&(m=parseInt(f.node().style.fontSize,10)*w),d?(a=p.bBox(d),gt=a.width,(mt=a.height)>m&&(h[1]-=(mt-m)/2)):f.node()&&!f.classed(A.jsPlaceholder)&&(a=p.bBox(f.node()),gt=a.width,mt=a.height),o){if(mt){if(mt+=5,"top"===j)it.domain[1]-=mt/R.h,h[1]*=-1;else{it.domain[0]+=mt/R.h;var v=g.lineCount(f);h[1]+=(1-v)*m}l.attr("transform",u(h[0],h[1])),it.setScale()}}else gt&&("right"===j&&(it.domain[0]+=(gt+pt/2)/R.w),l.attr("transform",u(h[0],h[1])),it.setScale())}t.selectAll("."+A.cbfills+",."+A.cblines).attr("transform",o?u(0,Math.round(R.h*(1-it.domain[1]))):u(Math.round(R.w*it.domain[0]),0)),dt.attr("transform",o?u(0,Math.round(-R.t)):u(Math.round(-R.l),0));var y=t.select("."+A.cbfills).selectAll("rect."+A.cbfill).attr("style","").data(Y);y.enter().append("rect").classed(A.cbfill,!0).style("stroke","none"),y.exit().remove();var x=U.map(it.c2p).map(Math.round).sort((function(t,e){return t-e}));y.each((function(t,a){var s=[0===a?U[0]:(Y[a]+Y[a-1])/2,a===Y.length-1?U[1]:(Y[a]+Y[a+1])/2].map(it.c2p).map(Math.round);o&&(s[1]=c.constrain(s[1]+(s[1]>s[0])?1:-1,x[0],x[1]));var l=n.select(this).attr(o?"x":"y",Q).attr(o?"y":"x",n.min(s)).attr(o?"width":"height",Math.max(Z,2)).attr(o?"height":"width",Math.max(n.max(s)-n.min(s),2));if(e._fillgradient)p.gradient(l,r,e._id,o?"vertical":"horizontalreversed",e._fillgradient,"fill");else{var u=H(t).replace("e-","");l.attr("fill",i(u).toHexString())}}));var b=t.select("."+A.cblines).selectAll("path."+A.cbline).data(B.color&&B.width?W:[]);b.enter().append("path").classed(A.cbline,!0),b.exit().remove(),b.each((function(t){var e=Q,r=Math.round(it.c2p(t))+B.width/2%1;n.select(this).attr("d","M"+(o?e+","+r:r+","+e)+(o?"h":"v")+Z).call(p.lineGroupStyle,B.width,V(t),B.dash)})),dt.selectAll("g."+it._id+"tick,path").remove();var _=Q+Z+(M||0)/2-("outside"===e.ticks?1:0),T=s.calcTicks(it),k=s.getTickSigns(it)[2];return s.drawTicks(r,it,{vals:"inside"===it.ticks?s.clipEnds(it,T):T,layer:dt,path:s.makeTickPath(it,_,k),transFn:s.makeTransTickFn(it)}),s.drawLabels(r,it,{vals:T,layer:dt,transFn:s.makeTransTickLabelFn(it),labelFns:s.makeLabelFns(it,_)})},function(){if(o&&!at||!o&&at){var t,i,a=it.position||0,s=it._offset+it._length/2;if("right"===j)i=s,t=R.l+R.w*a+10+pt*(it.showticklabels?1:.5);else if(t=s,"bottom"===j&&(i=R.t+R.h*a+10+(-1===ht.indexOf("inside")?it.tickfont.size:0)+("intside"!==it.ticks&&e.ticklen||0)),"top"===j){var l=N.text.split("
").length;i=R.t+R.h*a+10-Z-w*pt*l}vt((o?"h":"v")+it._id+"title",{avoid:{selection:n.select(r).selectAll("g."+it._id+"tick"),side:j,offsetTop:o?0:R.t,offsetLeft:o?R.l:0,maxShift:o?D.width:D.height},attributes:{x:t,y:i,"text-anchor":"middle"},transform:{rotate:o?-90:0,offset:0}})}},a.previousPromises,function(){var n,s=Z+M/2;-1===ht.indexOf("inside")&&(n=p.bBox(dt.node()),s+=o?n.width:n.height),ut=ft.select("text");var c=0,f=o&&"top"===j,m=!o&&"right"===j,g=0;if(ut.node()&&!ut.classed(A.jsPlaceholder)){var y,x=ft.select(".h"+it._id+"title-math-group").node();x&&(o&&at||!o&&!at)?(c=(n=p.bBox(x)).width,y=n.height):(c=(n=p.bBox(ft.node())).right-R.l-(o?Q:nt),y=n.bottom-R.t-(o?nt:Q),o||"top"!==j||(s+=n.height,g=n.height)),m&&(ut.attr("transform",u(c/2+pt/2,0)),c*=2),s=Math.max(s,o?c:y)}var b=2*(o?P:I)+s+S+M/2,w=0;!o&&N.text&&"bottom"===C&&z<=0&&(b+=w=b/2,g+=w),D._hColorbarMoveTitle=w,D._hColorbarMoveCBTitle=g;var F=S+M;t.select("."+A.cbbg).attr("x",(o?Q:nt)-F/2-(o?P:0)).attr("y",(o?nt:Q)-(o?J:I+g-w)).attr(o?"width":"height",Math.max(b-w,2)).attr(o?"height":"width",Math.max(J+F,2)).call(d.fill,E).call(d.stroke,e.bordercolor).style("stroke-width",S);var B=m?Math.max(c-10,0):0;if(t.selectAll("."+A.cboutline).attr("x",(o?Q:nt+P)+B).attr("y",(o?nt+I-J:Q)+(f?mt:0)).attr(o?"width":"height",Math.max(Z,2)).attr(o?"height":"width",Math.max(J-(o?2*I+mt:2*P+B),2)).call(d.stroke,e.outlinecolor).style({fill:"none","stroke-width":M}),t.attr("transform",u(R.l-(o?$*b:0),R.t-(o?0:(1-tt)*b-g))),!o&&(S||i(E).getAlpha()&&!i.equals(D.paper_bgcolor,E))){var U=dt.selectAll("text"),V=U[0].length,H=t.select("."+A.cbbg).node(),q=p.bBox(H),G=p.getTranslate(t);U.each((function(t,e){var r=V-1;if(0===e||e===r){var n,i=p.bBox(this),a=p.getTranslate(this);if(e===r){var o=i.right+a.x;(n=q.right+G.x+nt-S-2+O-o)>0&&(n=0)}else if(0===e){var s=i.left+a.x;(n=q.left+G.x+nt+S+2-s)<0&&(n=0)}n&&(V<3?this.setAttribute("transform","translate("+n+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var Y={},W=T[L],X=k[L],K=T[C],et=k[C],rt=b-Z;o?("pixels"===h?(Y.y=z,Y.t=J*K,Y.b=J*et):(Y.t=Y.b=0,Y.yt=z+l*K,Y.yb=z-l*et),"pixels"===_?(Y.x=O,Y.l=b*W,Y.r=b*X):(Y.l=rt*W,Y.r=rt*X,Y.xl=O-v*W,Y.xr=O+v*X)):("pixels"===h?(Y.x=O,Y.l=J*W,Y.r=J*X):(Y.l=Y.r=0,Y.xl=O+l*W,Y.xr=O-l*X),"pixels"===_?(Y.y=1-z,Y.t=b*K,Y.b=b*et):(Y.t=rt*K,Y.b=rt*et,Y.yt=z-v*K,Y.yb=z+v*et)),a.autoMargin(r,e._id,Y)}],r)}(r,e,t);v&&v.then&&(t._promises||[]).push(v),t._context.edits.colorbarPosition&&function(t,e,r){var n,i,a,s="v"===e.orientation,c=r._fullLayout._size;l.init({element:t.node(),gd:r,prepFn:function(){n=t.attr("transform"),h(t)},moveFn:function(r,o){t.attr("transform",n+u(r,o)),i=l.align((s?e._uFrac:e._vFrac)+r/c.w,s?e._thickFrac:e._lenFrac,0,1,e.xanchor),a=l.align((s?e._vFrac:1-e._uFrac)-o/c.h,s?e._lenFrac:e._thickFrac,0,1,e.yanchor);var f=l.getCursor(i,a,e.xanchor,e.yanchor);h(t,f)},doneFn:function(){if(h(t),void 0!==i&&void 0!==a){var n={};n[e._propPrefix+"x"]=i,n[e._propPrefix+"y"]=a,void 0!==e._traceIndex?o.call("_guiRestyle",r,n,e._traceIndex):o.call("_guiRelayout",r,n)}}})}(r,e,t)})),e.exit().each((function(e){a.autoMargin(t,e._id)})).remove(),e.order()}}},{"../../constants/alignment":483,"../../lib":515,"../../lib/extend":505,"../../lib/setcursor":536,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"../../plots/cartesian/axis_defaults":568,"../../plots/cartesian/layout_attributes":579,"../../plots/cartesian/position_defaults":582,"../../plots/plots":628,"../../registry":647,"../color":367,"../colorscale/helpers":378,"../dragelement":386,"../drawing":389,"../titles":476,"./constants":369,"@plotly/d3":58,tinycolor2:313}],372:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t){return n.isPlainObject(t.colorbar)}},{"../../lib":515}],373:[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":368,"./defaults":370,"./draw":371,"./has_colorbar":372}],374:[function(t,e,r){"use strict";var n=t("../colorbar/attributes"),i=t("../../lib/regex").counter,a=t("../../lib/sort_object_keys"),o=t("./scales.js").scales;a(o);function s(t){return"`"+t+"`"}e.exports=function(t,e){t=t||"";var r,a=(e=e||{}).cLetter||"c",l=("onlyIfNumerical"in e?e.onlyIfNumerical:Boolean(t),"noScale"in e?e.noScale:"marker.line"===t),c="showScaleDflt"in e?e.showScaleDflt:"z"===a,u="string"==typeof e.colorscaleDflt?o[e.colorscaleDflt]:null,f=e.editTypeOverride||"",h=t?t+".":"";"colorAttr"in e?(r=e.colorAttr,e.colorAttr):s(h+(r={z:"z",c:"color"}[a]));var p=a+"auto",d=a+"min",m=a+"max",g=a+"mid",v=(s(h+p),s(h+d),s(h+m),{});v[d]=v[m]=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:v},x[d]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[m]={valType:"number",dflt:null,editType:f||"plot",impliedEdits:y},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:v},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"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=n),e.noColorAxis||(x.coloraxis={valType:"subplotid",regex:i("coloraxis"),dflt:null,editType:"calc"}),x}},{"../../lib/regex":532,"../../lib/sort_object_keys":538,"../colorbar/attributes":368,"./scales.js":382}],375:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./helpers").extractOpts;e.exports=function(t,e,r){var o,s=t._fullLayout,l=r.vals,c=r.containerStr,u=c?i.nestedProperty(e,c).get():e,f=a(u),h=!1!==f.auto,p=f.min,d=f.max,m=f.mid,g=function(){return i.aggNums(Math.min,null,l)},v=function(){return i.aggNums(Math.max,null,l)};(void 0===p?p=g():h&&(p=u._colorAx&&n(p)?Math.min(p,g()):g()),void 0===d?d=v():h&&(d=u._colorAx&&n(d)?Math.max(d,v()):v()),h&&void 0!==m&&(d-m>m-p?p=m-(d-m):d-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,f._sync("colorscale",o))}},{"../../lib":515,"./helpers":378,"fast-isnumeric":190}],376:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./helpers").hasColorscale,a=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,i){var o=i.container?n.nestedProperty(t,i.container).get():t;if(o)if(o.coloraxis)o._colorAx=e[o.coloraxis];else{var s=a(o),l=s.auto;(l||void 0===s.min)&&r(o,i.min),(l||void 0===s.max)&&r(o,i.max),s.autocolorscale&&r(o,"colorscale")}}for(var s=0;s=0;n--,i++){var a=t[n];r[i]=[1-a[0],a[1]]}return r}function d(t,e){e=e||{};for(var r=t.domain,o=t.range,l=o.length,c=new Array(l),u=0;u4/3-s?o:s}},{}],384:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.exports=function(t,e,r,a){return t="left"===r?0:"center"===r?1:"right"===r?2:n.constrain(Math.floor(3*t),0,2),e="bottom"===a?0:"middle"===a?1:"top"===a?2:n.constrain(Math.floor(3*e),0,2),i[e][t]}},{"../../lib":515}],385:[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)}},{}],386:[function(t,e,r){"use strict";var n=t("mouse-event-offset"),i=t("has-hover"),a=t("has-passive-events"),o=t("../../lib").removeElement,s=t("../../plots/cartesian/constants"),l=e.exports={};l.align=t("./align"),l.getCursor=t("./cursor");var 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)}l.unhover=c.wrapped,l.unhoverRaw=c.raw,l.init=function(t){var e,r,n,c,h,p,d,m,g=t.gd,v=1,y=g._context.doubleClickDelay,x=t.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,a?(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)y&&(v=Math.max(v-1,1)),g._dragged)t.doneFn&&t.doneFn();else if(t.clickFn&&t.clickFn(v,p),!m){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)}d.dispatchEvent(r)}g._dragging=!1,g._dragged=!1}else g._dragged=!1}},l.coverSlip=u},{"../../lib":515,"../../plots/cartesian/constants":573,"./align":383,"./cursor":384,"./unhover":387,"has-hover":228,"has-passive-events":229,"mouse-event-offset":242}],387:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/dom").getGraphDiv,o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){(t=a(t))._fullLayout&&i.clear(t._fullLayout._uid+o.HOVERID),s.raw(t,e,r)},s.raw=function(t,e){var r=t._fullLayout,i=t._hoverdata;e||(e={}),e.target&&!t._dragged&&!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&&i&&t.emit("plotly_unhover",{event:e,points:i}))}},{"../../lib/dom":503,"../../lib/events":504,"../../lib/throttle":542,"../fx/constants":401}],388:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},r.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},{}],389:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("fast-isnumeric"),s=t("tinycolor2"),l=t("../../registry"),c=t("../color"),u=t("../colorscale"),f=i.strTranslate,h=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),d=t("../../constants/alignment").LINE_SPACING,m=t("../../constants/interactions").DESELECTDIM,g=t("../../traces/scatter/subtypes"),v=t("../../traces/scatter/make_bubble_size_func"),y=t("../../components/fx/helpers").appendArrayPointValue,x=e.exports={};function b(t,e,r){var n=e.fillpattern,i=n&&x.getPatternAttr(n.shape,0,"");if(i){var a=x.getPatternAttr(n.bgcolor,0,null),o=x.getPatternAttr(n.fgcolor,0,null),s=n.fgopacity,l=x.getPatternAttr(n.size,0,8),u=x.getPatternAttr(n.solidity,0,.3),f=e.uid;x.pattern(t,"point",r,f,i,l,u,void 0,n.fillmode,a,o,s)}else e.fillcolor&&t.call(c.fill,e.fillcolor)}x.font=function(t,e,r,n){i.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(c.fill,n)},x.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},x.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},x.setRect=function(t,e,r,n,i){t.call(x.setPosition,e,r).call(x.setSize,n,i)},x.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(o(i)&&o(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform",f(i,a)),!0)},x.translatePoints=function(t,e,r){t.each((function(t){var i=n.select(this);x.translatePoint(t,i,e,r)}))},x.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},x.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,i=e.yaxis;t.each((function(e){var a=e[0].trace,o=a.xcalendar,s=a.ycalendar,c=l.traceIs(a,"bar-like")?".bartext":".point,.textpoint";t.selectAll(c).each((function(t){x.hideOutsideRangePoint(t,n.select(this),r,i,o,s)}))}))}},x.crispRound=function(t,e,r){return e&&o(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},x.singleLineStyle=function(t,e,r,n,i){e.style("fill","none");var a=(((t||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";c.stroke(e,n||a.color),x.dashLine(e,s,o)},x.lineGroupStyle=function(t,e,r,i){t.style("fill","none").each((function(t){var a=(((t||[])[0]||{}).trace||{}).line||{},o=e||a.width||0,s=i||a.dash||"";n.select(this).call(c.stroke,r||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(t,e,r){r=+r||0,e=x.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},x.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},x.singleFillStyle=function(t,e){var r=n.select(t.node());b(t,((r.data()[0]||[])[0]||{}).trace||{},e)},x.fillGroupStyle=function(t,e){t.style("stroke-width",0).each((function(t){var r=n.select(this);t[0].trace&&b(r,t[0].trace,e)}))};var _=t("./symbol_defs");x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(_).forEach((function(t){var e=_[t],r=e.n;x.symbolList.push(r,String(r),t,r+100,String(r+100),t+"-open"),x.symbolNames[r]=t,x.symbolFuncs[r]=e.f,x.symbolBackOffs[r]=e.backoff||0,e.needLine&&(x.symbolNeedLines[r]=!0),e.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),t+"-dot",r+300,String(r+300),t+"-open-dot"),e.noFill&&(x.symbolNoFill[r]=!0)}));var w=x.symbolNames.length;function T(t,e,r,n){var i=t%100;return x.symbolFuncs[i](e,r,n)+(t>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(t){if(o(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=x.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=w||t>=400?0:Math.floor(Math.max(t,0))};var k={x1:1,x2:0,y1:0,y2:0},A={x1:0,x2:0,y1:1,y2:0},M=a("~f"),S={radial:{node:"radialGradient"},radialreversed:{node:"radialGradient",reversed:!0},horizontal:{node:"linearGradient",attrs:k},horizontalreversed:{node:"linearGradient",attrs:k,reversed:!0},vertical:{node:"linearGradient",attrs:A},verticalreversed:{node:"linearGradient",attrs:A,reversed:!0}};x.gradient=function(t,e,r,a,o,l){for(var u=o.length,f=S[a],h=new Array(u),p=0;p=100;var f=rt(t,r),h=G(t,r);e.attr("d",T(u,l,f,h))}var p,d,m,g=!1;if(t.so)m=s.outlierwidth,d=s.outliercolor,p=o.outliercolor;else{var v=(s||{}).width;m=(t.mlw+1||v+1||(t.trace?(t.trace.marker.line||{}).width:0)+1)-1||0,d="mlc"in t?t.mlcc=n.lineScale(t.mlc):i.isArrayOrTypedArray(s.color)?c.defaultLine:s.color,i.isArrayOrTypedArray(o.color)&&(p=c.defaultLine,g=!0),p="mc"in t?t.mcc=n.markerScale(t.mc):o.color||"rgba(0,0,0,0)",n.selectedColorFn&&(p=n.selectedColorFn(t))}if(t.om)e.call(c.stroke,p).style({"stroke-width":(m||1)+"px",fill:"none"});else{e.style("stroke-width",(t.isBlank?0:m)+"px");var y=o.gradient,b=t.mgt;b?g=!0:b=y&&y.type,i.isArrayOrTypedArray(b)&&(b=b[0],S[b]||(b=0));var _=o.pattern,w=_&&x.getPatternAttr(_.shape,t.i,"");if(b&&"none"!==b){var k=t.mgc;k?g=!0:k=y.color;var A=r.uid;g&&(A+="-"+t.i),x.gradient(e,a,A,b,[[0,k],[1,p]],"fill")}else if(w){var M=x.getPatternAttr(_.bgcolor,t.i,null),E=x.getPatternAttr(_.fgcolor,t.i,null),L=_.fgopacity,C=x.getPatternAttr(_.size,t.i,8),P=x.getPatternAttr(_.solidity,t.i,.3),I=t.mcc||i.isArrayOrTypedArray(_.shape)||i.isArrayOrTypedArray(_.bgcolor)||i.isArrayOrTypedArray(_.size)||i.isArrayOrTypedArray(_.solidity),O=r.uid;I&&(O+="-"+t.i),x.pattern(e,"point",a,O,w,C,P,t.mcc,_.fillmode,M,E,L)}else c.fill(e,p);m&&c.stroke(e,d)}},x.makePointStyleFns=function(t){var e={},r=t.marker;return e.markerScale=x.tryColorscale(r,""),e.lineScale=x.tryColorscale(r,"line"),l.traceIs(t,"symbols")&&(e.ms2mrc=g.isBubble(t)?v(t):function(){return(r.size||6)/2}),t.selectedpoints&&i.extendFlat(e,x.makeSelectedPointStyleFns(t)),e},x.makeSelectedPointStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},a=t.marker||{},o=r.marker||{},s=n.marker||{},c=a.opacity,u=o.opacity,f=s.opacity,h=void 0!==u,p=void 0!==f;(i.isArrayOrTypedArray(c)||h||p)&&(e.selectedOpacityFn=function(t){var e=void 0===t.mo?a.opacity:t.mo;return t.selected?h?u:e:p?f:m*e});var d=a.color,g=o.color,v=s.color;(g||v)&&(e.selectedColorFn=function(t){var e=t.mcc||d;return t.selected?g||e:v||e});var y=a.size,x=o.size,b=s.size,_=void 0!==x,w=void 0!==b;return l.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},x.makeSelectedTextStyleFns=function(t){var e={},r=t.selected||{},n=t.unselected||{},i=t.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,l=a.color,u=o.color;return e.selectedTextColorFn=function(t){var e=t.tc||s;return t.selected?l||e:u||(l?e:c.addOpacity(e,m))},e},x.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedPointStyleFns(e),i=e.marker||{},a=[];r.selectedOpacityFn&&a.push((function(t,e){t.style("opacity",r.selectedOpacityFn(e))})),r.selectedColorFn&&a.push((function(t,e){c.fill(t,r.selectedColorFn(e))})),r.selectedSizeFn&&a.push((function(t,n){var a=n.mx||i.symbol||0,o=r.selectedSizeFn(n);t.attr("d",T(x.symbolNumber(a),o,rt(n,e),G(n,e))),n.mrc2=o})),a.length&&t.each((function(t){for(var e=n.select(this),r=0;r0?r:0}x.textPointStyle=function(t,e,r){if(t.size()){var a;if(e.selectedpoints){var o=x.makeSelectedTextStyleFns(e);a=o.selectedTextColorFn}var s=e.texttemplate,l=r._fullLayout;t.each((function(t){var o=n.select(this),c=s?i.extractOption(t,e,"txt","texttemplate"):i.extractOption(t,e,"tx","text");if(c||0===c){if(s){var u=e._module.formatLabels,f=u?u(t,e,l):{},p={};y(p,e,t.i);var d=e._meta||{};c=i.texttemplateString(c,f,l._d3locale,p,t,d)}var m=t.tp||e.textposition,g=C(t,e),v=a?a(t):t.tc||e.textfont.color;o.call(x.font,t.tf||e.textfont.family,g,v).text(c).call(h.convertToTspans,r).call(L,m,g,t.mrc)}else o.remove()}))}},x.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=x.makeSelectedTextStyleFns(e);t.each((function(t){var i=n.select(this),a=r.selectedTextColorFn(t),o=t.tp||e.textposition,s=C(t,e);c.fill(i,a);var u=l.traceIs(e,"bar-like");L(i,o,s,t.mrc2||t.mrc,u)}))}};var P,I;function O(t,e,r){return r&&(t=N(t)),e?D(t[1]):z(t[0])}function z(t){var e=n.round(t,2);return P=e,e}function D(t){var e=n.round(t,2);return I=e,e}function R(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],o=r[0]-e[0],s=r[1]-e[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,f=(c*c*a-l*l*s)*n,h=3*c*(l+c),p=3*l*(l+c);return[[z(e[0]+(h&&u/h)),D(e[1]+(h&&f/h))],[z(e[0]-(p&&u/p)),D(e[1]-(p&&f/p))]]}x.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=c||b>=f&&b<=c)&&(_<=h&&_>=u||_>=h&&_<=u)&&(t=[b,_])}return t}x.steps=function(t){var e=F[t]||B;return function(t){for(var r="M"+z(t[0][0])+","+D(t[0][1]),n=t.length,i=1;i=1e4&&(x.savedBBoxes={},j=0),r&&(x.savedBBoxes[r]=g),j++,i.extendFlat({},g)},x.setClipUrl=function(t,e,r){t.attr("clip-path",V(e,r))},x.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}},x.setTranslate=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=f(e,r)).trim(),t[i]("transform",a),a},x.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}},x.setScale=function(t,e,r){var n=t.attr?"attr":"getAttribute",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+e+","+r+")").trim(),t[i]("transform",a),a};var H=/\s*sc.*/;x.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(H,"");t=(t+=n).trim(),this.setAttribute("transform",t)}))}};var q=/translate\([^)]*\)\s*$/;function G(t,e){var r;return t&&(r=t.mf),void 0===r&&(r=e.marker&&e.marker.standoff||0),e._geo||e._xA?r:-r}x.setTextPointsScale=function(t,e,r){t&&t.each((function(){var t,i=n.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(q);t=1===e&&1===r?[]:[f(o,s),"scale("+e+","+r+")",f(-o,-s)],l&&t.push(l),i.attr("transform",t.join(""))}}))},x.getMarkerStandoff=G;var Y,W,Z,X,J,K,Q=Math.atan2,$=Math.cos,tt=Math.sin;function et(t,e){var r=e[0],n=e[1];return[r*$(t)-n*tt(t),r*tt(t)+n*$(t)]}function rt(t,e){var r,n,i=t.ma;void 0===i&&(i=e.marker.angle||0);var a=e.marker.angleref;if("previous"===a||"north"===a){if(e._geo){var s=e._geo.project(t.lonlat);r=s[0],n=s[1]}else{var l=e._xA,c=e._yA;if(!l||!c)return 90;r=l.c2p(t.x),n=c.c2p(t.y)}if(e._geo){var u,f=t.lonlat[0],h=t.lonlat[1],p=e._geo.project([f,h+1e-5]),d=e._geo.project([f+1e-5,h]),m=Q(d[1]-n,d[0]-r),g=Q(p[1]-n,p[0]-r);if("north"===a)u=i/180*Math.PI;else if("previous"===a){var v=f/180*Math.PI,y=h/180*Math.PI,x=Y/180*Math.PI,b=W/180*Math.PI,_=x-v,w=$(b)*tt(_),T=tt(b)*$(y)-$(b)*tt(y)*$(_);u=-Q(w,T)-Math.PI,Y=f,W=h}var k=et(m,[$(u),0]),A=et(g,[tt(u),0]);i=Q(k[1]+A[1],k[0]+A[0])/Math.PI*180,"previous"!==a||K===e.uid&&t.i===J+1||(i=null)}if("previous"===a&&!e._geo)if(K===e.uid&&t.i===J+1&&o(r)&&o(n)){var M=r-Z,S=n-X,E=e.line&&e.line.shape||"",L=E.slice(E.length-1);"h"===L&&(S=0),"v"===L&&(M=0),i+=Q(S,M)/Math.PI*180+90}else i=null}return Z=r,X=n,J=t.i,K=e.uid,i}x.getMarkerAngle=rt},{"../../components/fx/helpers":403,"../../constants/alignment":483,"../../constants/interactions":490,"../../constants/xmlns_namespaces":492,"../../lib":515,"../../lib/svg_text_utils":541,"../../registry":647,"../../traces/scatter/make_bubble_size_func":953,"../../traces/scatter/subtypes":961,"../color":367,"../colorscale":379,"./symbol_defs":390,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:313}],390:[function(t,e,r){"use strict";var n,i,a,o,s=t("parse-svg-path"),l=t("@plotly/d3").round,c=Math.sqrt(2),u=Math.sqrt(3),f=Math.PI,h=Math.cos,p=Math.sin;function d(t){return null===t}function m(t,e,r){if(!(t&&t%360!=0||e))return r;if(a===t&&o===e&&n===r)return i;function l(t,r){var n=h(t),i=p(t),a=r[0],o=r[1]+(e||0);return[a*n-o*i,a*i+o*n]}a=t,o=e,n=r;for(var c=t/180*f,u=0,d=0,m=s(r),g="",v=0;v0;e.each((function(e){var f,h=e[0].trace,p=h.error_x||{},d=h.error_y||{};h.ids&&(f=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||p.visible||(e=[]);var g=n.select(this).selectAll("g.errorbar").data(e,f);if(g.exit().remove(),e.length){p.visible||g.selectAll("path.xerror").remove(),d.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),a.setClipUrl(g,r.layerClipId,t),g.each((function(t){var e=n.select(this),r=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),i(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),i(n.xs)||(n.noXS=!0,n.xs=e.c2p(t.xs,!0)));return n}(t,l,c);if(!m||t.vis){var a,o=e.select("path.yerror");if(d.visible&&i(r.x)&&i(r.yh)&&i(r.ys)){var f=d.width;a="M"+(r.x-f)+","+r.yh+"h"+2*f+"m-"+f+",0V"+r.ys,r.noYS||(a+="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(s.duration).ease(s.easing)),o.attr("d",a)}else o.remove();var h=e.select("path.xerror");if(p.visible&&i(r.y)&&i(r.xh)&&i(r.xs)){var g=(p.copy_ystyle?d:p).width;a="M"+r.xh+","+(r.y-g)+"v"+2*g+"m0,-"+g+"H"+r.xs,r.noXS||(a+="m0,-"+g+"v"+2*g),!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(h=h.transition().duration(s.duration).ease(s.easing)),h.attr("d",a)}else h.remove()}}))}}))}},{"../../traces/scatter/subtypes":961,"../drawing":389,"@plotly/d3":58,"fast-isnumeric":190}],397:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../color");e.exports=function(t){t.each((function(t){var e=t[0].trace,r=e.error_y||{},a=e.error_x||{},o=n.select(this);o.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(i.stroke,r.color),a.copy_ystyle&&(a=r),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(i.stroke,a.color)}))}},{"../color":367,"@plotly/d3":58}],398:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("./layout_attributes").hoverlabel,a=t("../../lib/extend").extendFlat;e.exports={hoverlabel:{bgcolor:a({},i.bgcolor,{arrayOk:!0}),bordercolor:a({},i.bordercolor,{arrayOk:!0}),font:n({arrayOk:!0,editType:"none"}),align:a({},i.align,{arrayOk:!0}),namelength:a({},i.namelength,{arrayOk:!0}),editType:"none"}}},{"../../lib/extend":505,"../../plots/font_attributes":594,"./layout_attributes":408}],399:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");function a(t,e,r,i){i=i||n.identity,Array.isArray(t)&&(e[0][r]=i(t))}e.exports=function(t){var e=t.calcdata,r=t._fullLayout;function o(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},r)}}for(var s=0;s=0&&r.index_[0]._length||ot<0||ot>w[0]._length)return d.unhoverRaw(t,e)}if(e.pointerX=at+_[0]._offset,e.pointerY=ot+w[0]._offset,V="xval"in e?v.flat(l,e.xval):v.p2c(_,at),H="yval"in e?v.flat(l,e.yval):v.p2c(w,ot),!i(V[0])||!i(H[0]))return o.warn("Fx.hover failed",e,t),d.unhoverRaw(t,e)}var ct=1/0;function ut(t,r){for(G=0;Gtt&&(et.splice(0,tt),ct=et[0].distance),y&&0!==B&&0===et.length){$.distance=B,$.index=!1;var f=W._module.hoverPoints($,K,Q,"closest",{hoverLayer:u._hoverlayer});if(f&&(f=f.filter((function(t){return t.spikeDistance<=B}))),f&&f.length){var h,d=f.filter((function(t){return t.xa.showspikes&&"hovered data"!==t.xa.spikesnap}));if(d.length){var m=d[0];i(m.x0)&&i(m.y0)&&(h=ht(m),(!nt.vLinePoint||nt.vLinePoint.spikeDistance>h.spikeDistance)&&(nt.vLinePoint=h))}var g=f.filter((function(t){return t.ya.showspikes&&"hovered data"!==t.ya.spikesnap}));if(g.length){var x=g[0];i(x.x0)&&i(x.y0)&&(h=ht(x),(!nt.hLinePoint||nt.hLinePoint.spikeDistance>h.spikeDistance)&&(nt.hLinePoint=h))}}}}}function ft(t,e,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(t.distance)Tt-1;Mt--)Ct(et[Mt]);et=St,gt()}var Pt=t._hoverdata,It=[],Ot=j(t),zt=U(t);for(q=0;q1||et.length>1)||"closest"===P&&it&&et.length>1,Wt=p.combine(u.plot_bgcolor||p.background,u.paper_bgcolor),Zt=I(et,{gd:t,hovermode:P,rotateLabels:Yt,bgColor:Wt,container:u._hoverlayer,outerContainer:u._paper.node(),commonLabelOpts:u.hoverlabel,hoverdistance:u.hoverdistance});v.isUnifiedHover(P)||(!function(t,e,r){var n,i,a,o,s,l,c,u=0,f=1,h=t.size(),p=new Array(h),d=0;function m(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)(l=t[o]).pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}t.each((function(t){var n=t[e],i="x"===n._id.charAt(0),a=n.range;0===d&&a&&a[0]>a[1]!==i&&(f=-1),p[d++]=[{datum:t,traceIndex:t.trace.index,dp:0,pos:t.pos,posref:t.posref,size:t.by*(i?T:1)/2,pmin:0,pmax:i?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<=h;){for(u++,n=!0,o=0;o.01&&y.pmin===x.pmin&&y.pmax===x.pmax){for(s=v.length-1;s>=0;s--)v[s].dp+=i;for(g.push.apply(g,v),p.splice(o+1,1),c=0,s=g.length-1;s>=0;s--)c+=g[s].dp;for(a=c/g.length,s=g.length-1;s>=0;s--)g[s].dp-=a;n=!1}else o++}p.forEach(m)}for(o=p.length-1;o>=0;o--){var b=p[o];for(s=b.length-1;s>=0;s--){var _=b[s],w=_.datum;w.offset=_.dp,w.del=_.del}}}(Zt,Yt?"xa":"ya",u),z(Zt,Yt,u._invScaleX,u._invScaleY));if(s&&s.tagName){var Xt=g.getComponentMethod("annotations","hasClickToShow")(t,It);f(n.select(s),Xt?"pointer":"")}if(!s||a||!function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(t,0,Pt))return;Pt&&t.emit("plotly_unhover",{event:e,points:Pt});t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:_,yaxes:w,xvals:V,yvals:H})}(t,e,r,a,s)}))},r.loneHover=function(t,e){var r=!0;Array.isArray(t)||(r=!1,t=[t]);var i=e.gd,a=j(i),o=U(i),s=I(t.map((function(t){var r=t._x0||t.x0||t.x||0,n=t._x1||t.x1||t.x||0,s=t._y0||t.y0||t.y||0,l=t._y1||t.y1||t.y||0,c=t.eventData;if(c){var u=Math.min(r,n),f=Math.max(r,n),h=Math.min(s,l),d=Math.max(s,l),m=t.trace;if(g.traceIs(m,"gl3d")){var v=i._fullLayout[m.scene]._scene.container,y=v.offsetLeft,x=v.offsetTop;u+=y,f+=y,h+=x,d+=x}c.bbox={x0:u+o,x1:f+o,y0:h+a,y1:d+a},e.inOut_bbox&&e.inOut_bbox.push(c.bbox)}else c=!1;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,hovertemplateLabels:t.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||p.background,container:n.select(e.container),outerContainer:e.outerContainer||e.container}),l=0,c=0;return s.sort((function(t,e){return t.y0-e.y0})).each((function(t,r){var n=t.y0-t.by/2;t.offset=n-5([\s\S]*)<\/extra>/;function I(t,e){var r=e.gd,i=r._fullLayout,a=e.hovermode,c=e.rotateLabels,f=e.bgColor,d=e.container,m=e.outerContainer,w=e.commonLabelOpts||{};if(0===t.length)return[[]];var T=e.fontFamily||y.HOVERFONT,k=e.fontSize||y.HOVERFONTSIZE,A=t[0],E=A.xa,L=A.ya,P=a.charAt(0),I=P+"Label",z=A[I];if(void 0===z&&"multicategory"===E.type)for(var D=0;Di.width-b?(g=i.width-b,e.attr("d","M"+(b-M)+",0L"+b+","+x+M+"v"+x+(2*S+y.height)+"H-"+b+"V"+x+M+"H"+(b-2*M)+"Z")):e.attr("d","M0,0L"+M+","+x+M+"H"+(S+y.width/2)+"v"+x+(2*S+y.height)+"H-"+(S+y.width/2)+"V"+x+M+"H-"+M+"Z")}else{var _,C,P;"right"===L.side?(_="start",C=1,P="",g=E._offset+E._length):(_="end",C=-1,P="-",g=E._offset),v=L._offset+(A.y0+A.y1)/2,l.attr("text-anchor",_),e.attr("d","M0,0L"+P+M+","+M+"V"+(S+y.height/2)+"h"+P+(2*S+y.width)+"V-"+(S+y.height/2)+"H"+P+M+"V-"+M+"Z");var I,O=y.height/2,D=F-y.top-O,R="clip"+i._uid+"commonlabel"+L._id;if(g=0?st:lt+ft=0?lt:xt+ft=0?at:ot+ht=0?ot:bt+ht=0,"top"!==t.idealAlign&&G||!Y?G?(I+=R/2,t.anchor="start"):t.anchor="middle":(I-=R/2,t.anchor="end");else if(t.pos=I,G=P+D/2+W<=B,Y=P-D/2-W>=0,"left"!==t.idealAlign&&G||!Y)if(G)P+=D/2,t.anchor="start";else{t.anchor="middle";var Z=W/2,X=P+Z-B,J=P-Z;X>0&&(P-=X),J<0&&(P+=-J)}else P-=D/2,t.anchor="end";w.attr("text-anchor",t.anchor),E&&A.attr("text-anchor",t.anchor),e.attr("transform",s(P,I)+(c?l(_):""))})),_t}function O(t,e,r,n,i,a){var s="",l="";void 0!==t.nameOverride&&(t.name=t.nameOverride),t.name&&(t.trace._meta&&(t.name=o.templateString(t.name,t.trace._meta)),s=B(t.name,t.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),"choropleth"!==t.trace.type&&"choroplethmapbox"!==t.trace.type&&(l+=(l?"z: ":"")+t.zLabel)):e&&t[c+"Label"]===i?l=t[u+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&"scattercarpet"!==t.trace.type&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",!t.text&&0!==t.text||Array.isArray(t.text)||(l+=(l?"
":"")+t.text),void 0!==t.extraText&&(l+=(l?"
":"")+t.extraText),a&&""===l&&!t.hovertemplate&&(""===s&&a.remove(),l=s);var f=t.hovertemplate||!1;if(f){var h=t.hovertemplateLabels||t;t[c+"Label"]!==i&&(h[c+"other"]=h[c+"Val"],h[c+"otherLabel"]=h[c+"Label"]),l=(l=o.hovertemplateString(f,h,n._d3locale,t.eventData[0]||{},t.trace._meta)).replace(P,(function(e,r){return s=B(r,t.nameLength),""}))}return[l,s]}function z(t,e,r,i){var a=function(t){return t*r},o=function(t){return t*i};t.each((function(t){var r=n.select(this);if(t.del)return r.remove();var i=r.select("text.nums"),s=t.anchor,l="end"===s?-1:1,c={start:1,end:-1,middle:0}[s],f=c*(M+S),p=f+c*(t.txwidth+S),d=0,m=t.offset,g="middle"===s;g&&(f-=t.tx2width/2,p+=t.txwidth/2+S),e&&(m*=-A,d=t.offset*k),r.select("path").attr("d",g?"M-"+a(t.bx/2+t.tx2width/2)+","+o(m-t.by/2)+"h"+a(t.bx)+"v"+o(t.by)+"h-"+a(t.bx)+"Z":"M0,0L"+a(l*M+d)+","+o(M+m)+"v"+o(t.by/2-M)+"h"+a(l*t.bx)+"v-"+o(t.by)+"H"+a(l*M+d)+"V"+o(m-M)+"Z");var v=d+f,y=m+t.ty0-t.by/2+S,x=t.textAlign||"auto";"auto"!==x&&("left"===x&&"start"!==s?(i.attr("text-anchor","start"),v=g?-t.bx/2-t.tx2width/2+S:-t.bx-S):"right"===x&&"end"!==s&&(i.attr("text-anchor","end"),v=g?t.bx/2-t.tx2width/2-S:t.bx+S)),i.call(u.positionText,a(v),o(y)),t.tx2width&&(r.select("text.name").call(u.positionText,a(p+c*S+d),o(m+t.ty0-t.by/2+S)),r.select("rect").call(h.setRect,a(p+(c-1)*t.tx2width/2+d),o(m-t.by/2-1),a(t.tx2width),o(t.by+2)))}))}function D(t,e){var r=t.index,n=t.trace||{},a=t.cd[0],s=t.cd[r]||{};function l(t){return t||i(t)&&0===t}var c=Array.isArray(r)?function(t,e){var i=o.castOption(a,r,t);return l(i)?i:o.extractOption({},n,"",e)}:function(t,e){return o.extractOption(s,n,t,e)};function u(e,r,n){var i=c(r,n);l(i)&&(t[e]=i)}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:m.hoverLabelText(t.xa,t.xLabelVal,n.xhoverformat),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:m.hoverLabelText(t.ya,t.yLabelVal,n.yhoverformat),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=m.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+f+" / -"+m.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 h=m.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+h+" / -"+m.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+h,"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 R(t,e,r){var n,i,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!e.hLinePoint,f=!!e.vLinePoint;if(o.selectAll(".spikeline").remove(),f||u){var d=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,v,y=e.hLinePoint;n=y&&y.xa,"cursor"===(i=y&&y.ya).spikesnap?(g=c.pointerX,v=c.pointerY):(g=n._offset+y.x,v=i._offset+y.y);var x,b,_=a.readability(y.color,d)<1.5?p.contrast(d):y.color,w=i.spikemode,T=i.spikethickness,k=i.spikecolor||_,A=m.getPxPosition(t,i);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=A,b=g),-1!==w.indexOf("across")){var M=i._counterDomainMin,S=i._counterDomainMax;"free"===i.anchor&&(M=Math.min(M,i.position),S=Math.max(S,i.position)),x=l.l+M*l.w,b=l.l+S*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T,stroke:k,"stroke-dasharray":h.dashStyle(i.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:v,y2:v,"stroke-width":T+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:A+("right"!==i.side?T:-T),cy:v,r:T,fill:k}).classed("spikeline",!0)}if(f){var E,L,C=e.vLinePoint;n=C&&C.xa,i=C&&C.ya,"cursor"===n.spikesnap?(E=c.pointerX,L=c.pointerY):(E=n._offset+C.x,L=i._offset+C.y);var P,I,O=a.readability(C.color,d)<1.5?p.contrast(d):C.color,z=n.spikemode,D=n.spikethickness,R=n.spikecolor||O,F=m.getPxPosition(t,n);if(-1!==z.indexOf("toaxis")||-1!==z.indexOf("across")){if(-1!==z.indexOf("toaxis")&&(P=F,I=L),-1!==z.indexOf("across")){var B=n._counterDomainMin,N=n._counterDomainMax;"free"===n.anchor&&(B=Math.min(B,n.position),N=Math.max(N,n.position)),P=l.t+(1-N)*l.h,I=l.t+(1-B)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D,stroke:R,"stroke-dasharray":h.dashStyle(n.spikedash,D)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:P,y2:I,"stroke-width":D+2,stroke:d}).classed("spikeline",!0).classed("crisp",!0)}-1!==z.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:F-("top"!==n.side?D:-D),r:D,fill:R}).classed("spikeline",!0)}}}function F(t,e){return!e||(e.vLinePoint!==t._spikepoints.vLinePoint||e.hLinePoint!==t._spikepoints.hLinePoint)}function B(t,e){return u.plainText(t||"",{len:e,allowedTags:["br","sub","sup","b","i","em"]})}function N(t,e,r){var n=e[t+"a"],i=e[t+"Val"],a=e.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=e.trace[t+"periodalignment"];if(o){var s=e.cd[e.index],l=s[t+"Start"];void 0===l&&(l=s[t]);var c=s[t+"End"];void 0===c&&(c=s[t]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function j(t){return t.offsetTop+t.clientTop}function U(t){return t.offsetLeft+t.clientLeft}function V(t,e){var r=t._fullLayout,n=e.getBoundingClientRect(),i=n.x,a=n.y,s=i+n.width,l=a+n.height,c=o.apply3DTransform(r._invTransform)(i,a),u=o.apply3DTransform(r._invTransform)(s,l),f=c[0],h=c[1],p=u[0],d=u[1];return{x:f,y:h,width:p-f,height:d-h,top:Math.min(h,d),left:Math.min(f,p),right:Math.max(f,p),bottom:Math.max(h,d)}}},{"../../lib":515,"../../lib/events":504,"../../lib/override_cursor":526,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"../../registry":647,"../color":367,"../dragelement":386,"../drawing":389,"../legend/defaults":419,"../legend/draw":420,"./constants":401,"./helpers":403,"@plotly/d3":58,"fast-isnumeric":190,tinycolor2:313}],405:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../color"),a=t("./helpers").isUnifiedHover;e.exports=function(t,e,r,o){o=o||{};var s=e.legend;function l(t){o.font[t]||(o.font[t]=s?e.legend.font[t]:e.font[t])}e&&a(e.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),s?(o.bgcolor||(o.bgcolor=i.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":515,"../color":367,"./helpers":403}],406:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return void 0!==e[r]?e[r]:n.coerce(t,e,i,r,a)}return r("clickmode"),r("hovermode")}},{"../../lib":515,"./layout_attributes":408}],407:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes"),l=t("./hover");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:o.getDistanceFunction,getClosest:o.getClosest,inbox:o.inbox,quadrature:o.quadrature,appendArrayPointValue:o.appendArrayPointValue,castHoverOption:function(t,e,r){return i.castOption(t,e,"hoverlabel."+r)},castHoverinfo:function(t,e,r){return i.castOption(t,r,"hoverinfo",(function(r){return i.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}))},hover:l.hover,unhover:a.unhover,loneHover:l.loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":515,"../dragelement":386,"./attributes":398,"./calc":399,"./click":400,"./constants":401,"./defaults":402,"./helpers":403,"./hover":404,"./layout_attributes":408,"./layout_defaults":409,"./layout_global_defaults":410,"@plotly/d3":58}],408:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes"),a=i({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"],dflt:"closest",editType:"modebar"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:a,grouptitlefont:i({editType:"none"}),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":594,"./constants":401}],409:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("./hovermode_defaults"),o=t("./hoverlabel_defaults");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}a(t,e)&&(r("hoverdistance"),r("spikedistance")),"select"===r("dragmode")&&r("selectdirection");var s=e._has("mapbox"),l=e._has("geo"),c=e._basePlotModules.length;"zoom"===e.dragmode&&((s||l)&&1===c||s&&l&&2===c)&&(e.dragmode="pan"),o(t,e,r),n.coerceFont(r,"hoverlabel.grouptitlefont",e.hoverlabel.font)}},{"../../lib":515,"./hoverlabel_defaults":405,"./hovermode_defaults":406,"./layout_attributes":408}],410:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./hoverlabel_defaults"),a=t("./layout_attributes");e.exports=function(t,e){i(t,e,(function(r,i){return n.coerce(t,e,a,r,i)}))}},{"../../lib":515,"./hoverlabel_defaults":405,"./layout_attributes":408}],411:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../lib/regex").counter,a=t("../../plots/domain").attributes,o=t("../../plots/cartesian/constants").idRegex,s=t("../../plot_api/plot_template"),l={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[i("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:a({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"],i=Object.keys((t._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function u(t,e,r,n,i,a){var o=e(t+"gap",r),s=e("domain."+t);e(t+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),f=u*(1-o),h=0;h1){if(!h&&!p&&!d)"independent"===k("pattern")&&(h=!0);g._hasSubplotGrid=h;var x,b,_="top to bottom"===k("roworder"),w=h?.2:.1,T=h?.3:.1;m&&e._splomGridDflt&&(x=e._splomGridDflt.xside,b=e._splomGridDflt.yside),g._domains={x:u("x",k,w,x,y),y:u("y",k,T,b,v,_)}}else delete e.grid}function k(t,e){return n.coerce(r,g,l,t,e)}},contentDefaults:function(t,e){var r=e.grid;if(r&&r._domains){var n,i,a,o,s,l,u,h=t.grid||{},p=e._subplots,d=r._hasSubplotGrid,m=r.rows,g=r.columns,v="independent"===r.pattern,y=r._axisMap={};if(d){var x=h.subplots||[];l=r.subplots=new Array(m);var b=1;for(n=0;n1);if(!1===_&&(e.legend=void 0),(!1!==_||f.uirevision)&&(p("uirevision",e.uirevision),!1!==_)){p("bgcolor",e.paper_bgcolor),p("bordercolor"),p("borderwidth");var w,T,k,A=i.coerceFont(p,"font",e.font),M="h"===p("orientation");if(M?(w=0,n.getComponentMethod("rangeslider","isVisible")(t.xaxis)?(T=1.1,k="bottom"):(T=-.1,k="top")):(w=1.02,T=1,k="auto"),p("traceorder",x),c.isGrouped(e.legend)&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("x",w),p("xanchor"),p("y",T),p("yanchor",k),p("valign"),i.noneOrAll(f,h,["x","y"]),p("title.text")){p("title.side",M?"left":"top");var S=i.extendFlat({},A,{size:i.bigFont(A.size)});i.coerceFont(p,"title.font",S)}}}},{"../../lib":515,"../../plot_api/plot_template":555,"../../plots/attributes":562,"../../plots/layout_attributes":619,"../../registry":647,"./attributes":417,"./helpers":423}],420:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib/events"),l=t("../dragelement"),c=t("../drawing"),u=t("../color"),f=t("../../lib/svg_text_utils"),h=t("./handle_click"),p=t("./constants"),d=t("../../constants/alignment"),m=d.LINE_SPACING,g=d.FROM_TL,v=d.FROM_BR,y=t("./get_legend_data"),x=t("./style"),b=t("./helpers");function _(t,e,r){var n=t[0],i=n.width,a=e.entrywidthmode,o=n.trace.legendwidth||e.entrywidth;return"fraction"===a?e._maxWidth*o:r+(o||i)}function w(t,e,r,n,i){var a=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:a.index,expandedIndex:a._expandedIndex,data:t.data,layout:t.layout,frames:t._transitionData._frames,config:t._context,fullData:t._fullData,fullLayout:t._fullLayout};if(a._group&&(l.group=a._group),o.traceIs(a,"pie-like")&&(l.label=r.datum()[0].label),!1!==s.triggerHandler(t,"plotly_legendclick",l))if(1===n)e._clickTimeout=setTimeout((function(){t._fullLayout&&h(r,t,n)}),t._context.doubleClickDelay);else if(2===n){e._clickTimeout&&clearTimeout(e._clickTimeout),t._legendMouseDownTime=0,!1!==s.triggerHandler(t,"plotly_legenddoubleclick",l)&&h(r,t,n)}}function T(t,e,r){var n,a,s=t.data()[0][0],l=s.trace,u=o.traceIs(l,"pie-like"),h=!r._inHover&&e._context.edits.legendText&&!u,d=r._maxNameLength;s.groupTitle?(n=s.groupTitle.text,a=s.groupTitle.font):(a=r.font,r.entries?n=s.text:(n=u?s.label:l.name,l._meta&&(n=i.templateString(n,l._meta))));var m=i.ensureSingle(t,"text","legendtext");m.attr("text-anchor","start").call(c.font,a).text(h?k(n,d):n);var g=r.itemwidth+2*p.itemGap;f.positionText(m,g,0),h?m.call(f.makeEditable,{gd:e,text:n}).call(M,t,e,r).on("edit",(function(n){this.text(k(n,d)).call(M,t,e,r);var a=s.trace._fullInput||{},c={};if(o.hasTransform(a,"groupby")){var u=o.getTransformIndices(a,"groupby"),f=u[u.length-1],h=i.keyedContainer(a,"transforms["+f+"].styles","target","value.name");h.set(s.trace._group,n),c=h.constructUpdate()}else c.name=n;return o.call("_guiRestyle",e,c,l.index)})):M(m,t,e,r)}function k(t,e){var r=Math.max(4,e);if(t&&t.trim().length>=r/2)return t;for(var n=r-(t=t||"").length;n>0;n--)t+=" ";return t}function A(t,e){var r,a=e._context.doubleClickDelay,o=1,s=i.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||(s.on("mousedown",(function(){(r=(new Date).getTime())-e._legendMouseDownTimea&&(o=Math.max(o-1,1)),w(e,r,t,o,n.event)}})))}function M(t,e,r,n,i){n._inHover&&t.attr("data-notex",!0),f.convertToTspans(t,r,(function(){!function(t,e,r,n){var i=t.data()[0][0];if(!r._inHover&&i&&!i.trace.showlegend)return void t.remove();var a=t.select("g[class*=math-group]"),o=a.node();r||(r=e._fullLayout.legend);var s,l=r.borderwidth;s=1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font;var u,h,d=s.size*m;if(o){var g=c.bBox(o);u=g.height,h=g.width,1===n?c.setTranslate(a,l,l+.75*u):c.setTranslate(a,0,.25*u)}else{var v=t.select(1===n?".legendtitletext":".legendtext"),y=f.lineCount(v),x=v.node();if(u=d*y,h=x?c.bBox(x).width:0,1===n)"left"===r.title.side&&(h+=2*p.itemGap),f.positionText(v,l+p.titlePad,l+d);else{var b=2*p.itemGap+r.itemwidth;i.groupTitle&&(b=p.itemGap,h-=r.itemwidth),f.positionText(v,b,-d*((y-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=u):(i.lineHeight=d,i.height=Math.max(u,16)+3,i.width=h)}(e,r,n,i)}))}function S(t){return i.isRightAnchor(t)?"right":i.isCenterAnchor(t)?"center":"left"}function E(t){return i.isBottomAnchor(t)?"bottom":i.isMiddleAnchor(t)?"middle":"top"}e.exports=function(t,e){return e||(e=t._fullLayout.legend||{}),function(t,e){var r,s,f=t._fullLayout,h="legend"+f._uid,d=e._inHover;d?(r=e.layer,h+="-hover"):r=f._infolayer;if(!r)return;t._legendMouseDownTime||(t._legendMouseDownTime=0);if(d){if(!e.entries)return;s=y(e.entries,e)}else{if(!t.calcdata)return;s=f.showlegend&&y(t.calcdata,e)}var m=f.hiddenlabels||[];if(!(d||f.showlegend&&s.length))return r.selectAll(".legend").remove(),f._topdefs.select("#"+h).remove(),a.autoMargin(t,"legend");var k=i.ensureSingle(r,"g","legend",(function(t){d||t.attr("pointer-events","all")})),L=i.ensureSingleById(f._topdefs,"clipPath",h,(function(t){t.append("rect")})),C=i.ensureSingle(k,"rect","bg",(function(t){t.attr("shape-rendering","crispEdges")}));C.call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px");var P=i.ensureSingle(k,"g","scrollbox"),I=e.title;if(e._titleWidth=0,e._titleHeight=0,I.text){var O=i.ensureSingle(P,"text","legendtitletext");O.attr("text-anchor","start").call(c.font,I.font).text(I.text),M(O,P,t,e,1)}else P.selectAll(".legendtitletext").remove();var z=i.ensureSingle(k,"rect","scrollbar",(function(t){t.attr(p.scrollBarEnterAttrs).call(u.fill,p.scrollBarColor)})),D=P.selectAll("g.groups").data(s);D.enter().append("g").attr("class","groups"),D.exit().remove();var R=D.selectAll("g.traces").data(i.identity);R.enter().append("g").attr("class","traces"),R.exit().remove(),R.style("opacity",(function(t){var e=t[0].trace;return o.traceIs(e,"pie-like")?-1!==m.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1})).each((function(){n.select(this).call(T,t,e)})).call(x,t,e).each((function(){d||n.select(this).call(A,t)})),i.syncOrAsync([a.previousPromises,function(){return function(t,e,r,i){var a=t._fullLayout;i||(i=a.legend);var o=a._size,s=b.isVertical(i),l=b.isGrouped(i),u="fraction"===i.entrywidthmode,f=i.borderwidth,h=2*f,d=p.itemGap,m=i.itemwidth+2*d,g=2*(f+d),v=E(i),y=i.y<0||0===i.y&&"top"===v,x=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,T={};i._maxHeight=Math.max(y||x?a.height/2:o.h,30);var k=0;i._width=0,i._height=0;var A=function(t){var e=0,r=0,n=t.title.side;n&&(-1!==n.indexOf("left")&&(e=t._titleWidth),-1!==n.indexOf("top")&&(r=t._titleHeight));return[e,r]}(i);if(s)r.each((function(t){var e=t[0].height;c.setTranslate(this,f+A[0],f+A[1]+i._height+e/2+d),i._height+=e,i._width=Math.max(i._width,t[0].width)})),k=m+i._width,i._width+=d+m+h,i._height+=g,l&&(e.each((function(t,e){c.setTranslate(this,0,e*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var M=S(i),L=i.x<0||0===i.x&&"right"===M,C=i.x>1||1===i.x&&"left"===M,P=x||y,I=a.width/2;i._maxWidth=Math.max(L?P&&"left"===M?o.l+o.w:I:C?P&&"right"===M?o.r+o.w:I:o.w,2*m);var O=0,z=0;r.each((function(t){var e=_(t,i,m);O=Math.max(O,e),z+=e})),k=null;var D=0;if(l){var R=0,F=0,B=0;e.each((function(){var t=0,e=0;n.select(this).selectAll("g.traces").each((function(r){var n=_(r,i,m),a=r[0].height;c.setTranslate(this,A[0],A[1]+f+d+a/2+e),e+=a,t=Math.max(t,n),T[r[0].trace.legendgroup]=t}));var r=t+d;F>0&&r+f+F>i._maxWidth?(D=Math.max(D,F),F=0,B+=R+w,R=e):R=Math.max(R,e),c.setTranslate(this,F,B),F+=r})),i._width=Math.max(D,F)+f,i._height=B+R+g}else{var N=r.size(),j=z+h+(N-1)*d=i._maxWidth&&(D=Math.max(D,q),V=0,H+=U,i._height+=U,U=0),c.setTranslate(this,A[0]+f+V,A[1]+f+H+e/2+d),q=V+r+d,V+=n,U=Math.max(U,e)})),j?(i._width=V+h,i._height=U+g):(i._width=Math.max(D,q)+h,i._height+=U+g)}}i._width=Math.ceil(Math.max(i._width+A[0],i._titleWidth+2*(f+p.titlePad))),i._height=Math.ceil(Math.max(i._height+A[1],i._titleHeight+2*(f+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var G=t._context.edits,Y=G.legendText||G.legendPosition;r.each((function(t){var e=n.select(this).select(".legendtoggle"),r=t[0].height,a=t[0].trace.legendgroup,o=_(t,i,m);l&&""!==a&&(o=T[a]);var f=Y?m:k||o;s||u||(f+=d/2),c.setRect(e,0,-r/2,f,r)}))}(t,D,R,e)},function(){var s,u,m,y,x=f._size,b=e.borderwidth;if(!d){if(function(t){var e=t._fullLayout.legend,r=S(e),n=E(e);return a.autoMargin(t,"legend",{x:e.x,y:e.y,l:e._width*g[r],r:e._width*v[r],b:e._effHeight*v[n],t:e._effHeight*g[n]})}(t))return;var _=x.l+x.w*e.x-g[S(e)]*e._width,T=x.t+x.h*(1-e.y)-g[E(e)]*e._effHeight;if(f.margin.autoexpand){var A=_,M=T;_=i.constrain(_,0,f.width-e._width),T=i.constrain(T,0,f.height-e._effHeight),_!==A&&i.log("Constrain legend.x to make legend fit inside graph"),T!==M&&i.log("Constrain legend.y to make legend fit inside graph")}c.setTranslate(k,_,T)}if(z.on(".drag",null),k.on("wheel",null),d||e._height<=e._maxHeight||t._context.staticPlot){var I=e._effHeight;d&&(I=e._height),C.attr({width:e._width-b,height:I-b,x:b/2,y:b/2}),c.setTranslate(P,0,0),L.select("rect").attr({width:e._width-2*b,height:I-2*b,x:b,y:b}),c.setClipUrl(P,h,t),c.setRect(z,0,0,0,0),delete e._scrollY}else{var O,D,R,F=Math.max(p.scrollBarMinHeight,e._effHeight*e._effHeight/e._height),B=e._effHeight-F-2*p.scrollBarMargin,N=e._height-e._effHeight,j=B/N,U=Math.min(e._scrollY||0,N);C.attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-b,x:b/2,y:b/2}),L.select("rect").attr({width:e._width-2*b+p.scrollBarWidth+p.scrollBarMargin,height:e._effHeight-2*b,x:b,y:b+U}),c.setClipUrl(P,h,t),q(U,F,j),k.on("wheel",(function(){q(U=i.constrain(e._scrollY+n.event.deltaY/B*N,0,N),F,j),0!==U&&U!==N&&n.event.preventDefault()}));var V=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;O="touchstart"===t.type?t.changedTouches[0].clientY:t.clientY,R=U})).on("drag",(function(){var t=n.event.sourceEvent;2===t.buttons||t.ctrlKey||(D="touchmove"===t.type?t.changedTouches[0].clientY:t.clientY,q(U=function(t,e,r){var n=(r-e)/j+t;return i.constrain(n,0,N)}(R,O,D),F,j))}));z.call(V);var H=n.behavior.drag().on("dragstart",(function(){var t=n.event.sourceEvent;"touchstart"===t.type&&(O=t.changedTouches[0].clientY,R=U)})).on("drag",(function(){var t=n.event.sourceEvent;"touchmove"===t.type&&(D=t.changedTouches[0].clientY,q(U=function(t,e,r){var n=(e-r)/j+t;return i.constrain(n,0,N)}(R,O,D),F,j))}));P.call(H)}function q(r,n,i){e._scrollY=t._fullLayout.legend._scrollY=r,c.setTranslate(P,0,-r),c.setRect(z,e._width,p.scrollBarMargin+r*i,p.scrollBarWidth,n),L.select("rect").attr("y",b+r)}t._context.edits.legendPosition&&(k.classed("cursor-move",!0),l.init({element:k.node(),gd:t,prepFn:function(){var t=c.getTranslate(k);m=t.x,y=t.y},moveFn:function(t,r){var n=m+t,i=y+r;c.setTranslate(k,n,i),s=l.align(n,0,x.l,x.l+x.w,e.xanchor),u=l.align(i,0,x.t+x.h,x.t,e.yanchor)},doneFn:function(){void 0!==s&&void 0!==u&&o.call("_guiRelayout",t,{"legend.x":s,"legend.y":u})},clickFn:function(e,n){var i=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}));i.size()>0&&w(t,k,i,e,n)}}))}],t)}(t,e)}},{"../../constants/alignment":483,"../../lib":515,"../../lib/events":504,"../../lib/svg_text_utils":541,"../../plots/plots":628,"../../registry":647,"../color":367,"../dragelement":386,"../drawing":389,"./constants":418,"./get_legend_data":421,"./handle_click":422,"./helpers":423,"./style":425,"@plotly/d3":58}],421:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){var r,a,o=e._inHover,s=i.isGrouped(e),l=i.isReversed(e),c={},u=[],f=!1,h={},p=0,d=0;function m(t,r){if(""!==t&&i.isGrouped(e))-1===u.indexOf(t)?(u.push(t),f=!0,c[t]=[r]):c[t].push(r);else{var n="~~i"+p;u.push(n),c[n]=[r],p++}}for(r=0;rA&&(k=A)}w[r][0]._groupMinRank=k,w[r][0]._preGroupSort=r}var M=function(t,e){return t.trace.legendrank-e.trace.legendrank||t._preSort-e._preSort};for(w.forEach((function(t,e){t[0]._preGroupSort=e})),w.sort((function(t,e){return t[0]._groupMinRank-e[0]._groupMinRank||t[0]._preGroupSort-e[0]._preGroupSort})),r=0;rr?r:t}e.exports=function(t,e,r){var v=e._fullLayout;r||(r=v.legend);var y="constant"===r.itemsizing,x=r.itemwidth,b=(x+2*p.itemGap)/2,_=o(b,0),w=function(t,e,r,n){var i;if(t+1)i=t;else{if(!(e&&e.width>0))return 0;i=e.width}return y?n:Math.min(i,r)};function T(t,a,o){var u=t[0].trace,f=u.marker||{},h=f.line||{},p=o?u.visible&&u.type===o:i.traceIs(u,"bar"),d=n.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(p?[t]:[]);d.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),d.exit().remove(),d.each((function(t){var i=n.select(this),a=t[0],o=w(a.mlw,f.line,5,2);i.style("stroke-width",o+"px");var p=a.mcc;if(!r._inHover&&"mc"in a){var d=c(f),m=d.mid;void 0===m&&(m=(d.max+d.min)/2),p=s.tryColorscale(f,"")(m)}var v=p||a.mc||f.color,y=f.pattern,x=y&&s.getPatternAttr(y.shape,0,"");if(x){var b=s.getPatternAttr(y.bgcolor,0,null),_=s.getPatternAttr(y.fgcolor,0,null),T=y.fgopacity,k=g(y.size,8,10),A=g(y.solidity,.5,1),M="legend-"+u.uid;i.call(s.pattern,"legend",e,M,x,k,A,p,y.fillmode,b,_,T)}else i.call(l.fill,v);o&&l.stroke(i,a.mlc||h.color)}))}function k(t,e,r){var o=t[0],s=o.trace,l=r?s.visible&&s.type===r:i.traceIs(s,r),c=n.select(e).select("g.legendpoints").selectAll("path.legend"+r).data(l?[t]:[]);if(c.enter().append("path").classed("legend"+r,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),c.exit().remove(),c.size()){var u=(s.marker||{}).line,p=w(h(u.width,o.pts),u,5,2),d=a.minExtend(s,{marker:{line:{width:p}}});d.marker.line.color=u.color;var m=a.minExtend(o,{trace:d});f(c,m,d)}}t.each((function(t){var e=n.select(this),i=a.ensureSingle(e,"g","layers");i.style("opacity",t[0].trace.opacity);var s=r.valign,l=t[0].lineHeight,c=t[0].height;if("middle"!==s&&l&&c){var u={top:1,bottom:-1}[s]*(.5*(l-c+3));i.attr("transform",o(0,u))}else i.attr("transform",null);i.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),i.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var f=i.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,i=t[0].trace,o=[];if(i.visible)switch(i.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",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(t,o){var u,f=n.select(this),h=c(i),p=h.colorscale,m=h.reversescale;if(p){if(!r){var g=p.length;u=0===o?p[m?g-1:0][1]:1===o?p[m?0:g-1][1]:p[Math.floor((g-1)/2)][1]}}else{var v=i.vertexcolor||i.facecolor||i.color;u=a.isArrayOrTypedArray(v)?v[o]||v[0]:v}f.attr("d",t[0]),u?f.call(l.fill,u):f.call((function(t){if(t.size()){var n="legendfill-"+i.uid;s.gradient(t,e,n,d(m,"radial"===r),p,"fill")}}))}))})).each((function(t){var e=t[0].trace,r="waterfall"===e.type;if(t[0]._distinct&&r){var i=t[0].trace[t[0].dir].marker;return t[0].mc=i.color,t[0].mlw=i.line.width,t[0].mlc=i.line.color,T(t,this,"waterfall")}var a=[];e.visible&&r&&(a=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(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(t){var r=n.select(this),i=e[t[0]].marker,a=w(void 0,i.line,5,2);r.attr("d",t[1]).style("stroke-width",a+"px").call(l.fill,i.color),a&&r.call(l.stroke,i.line.color)}))})).each((function(t){T(t,this,"funnel")})).each((function(t){T(t,this)})).each((function(t){var r=t[0].trace,o=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(r.visible&&i.traceIs(r,"box-violin")?[t]:[]);o.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),o.exit().remove(),o.each((function(){var t=n.select(this);if("all"!==r.boxpoints&&"all"!==r.points||0!==l.opacity(r.fillcolor)||0!==l.opacity((r.line||{}).color)){var i=w(void 0,r.line,5,2);t.style("stroke-width",i+"px").call(l.fill,r.fillcolor),i&&l.stroke(t,r.line.color)}else{var c=a.minExtend(r,{marker:{size:y?12:a.constrain(r.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});o.call(s.pointStyle,c,e)}}))})).each((function(t){k(t,this,"funnelarea")})).each((function(t){k(t,this,"pie")})).each((function(t){var r,i,o=m(t),l=o.showFill,f=o.showLine,h=o.showGradientLine,p=o.showGradientFill,g=o.anyFill,v=o.anyLine,y=t[0],b=y.trace,_=c(b),T=_.colorscale,k=_.reversescale,A=u.hasMarkers(b)||!g?"M5,0":v?"M5,-2":"M5,-3",M=n.select(this),S=M.select(".legendfill").selectAll("path").data(l||p?[t]:[]);if(S.enter().append("path").classed("js-fill",!0),S.exit().remove(),S.attr("d",A+"h"+x+"v6h-"+x+"z").call((function(t){if(t.size())if(l)s.fillGroupStyle(t,e);else{var r="legendfill-"+b.uid;s.gradient(t,e,r,d(k),T,"fill")}})),f||h){var E=w(void 0,b.line,10,5);i=a.minExtend(b,{line:{width:E}}),r=[a.minExtend(y,{trace:i})]}var L=M.select(".legendlines").selectAll("path").data(f||h?[r]:[]);L.enter().append("path").classed("js-line",!0),L.exit().remove(),L.attr("d",A+(h?"l"+x+",0.0001":"h"+x)).call(f?s.lineGroupStyle:function(t){if(t.size()){var r="legendline-"+b.uid;s.lineGroupStyle(t),s.gradient(t,e,r,d(k),T,"stroke")}})})).each((function(t){var r,i,o=m(t),l=o.anyFill,c=o.anyLine,f=o.showLine,h=o.showMarker,p=t[0],d=p.trace,g=!h&&!c&&!l&&u.hasText(d);function v(t,e,r,n){var i=a.nestedProperty(d,t).get(),o=a.isArrayOrTypedArray(i)&&e?e(i):i;if(y&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(t){return p._distinct&&p.index&&t[p.index]?t[p.index]:t[0]}if(h||g||f){var b={},w={};if(h){b.mc=v("marker.color",x),b.mx=v("marker.symbol",x),b.mo=v("marker.opacity",a.mean,[.2,1]),b.mlc=v("marker.line.color",x),b.mlw=v("marker.line.width",a.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var T=v("marker.size",a.mean,[2,16],12);b.ms=T,w.marker.size=T}f&&(w.line={width:v("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=v("textposition",x),b.ts=10,b.tc=v("textfont.color",x),b.tf=v("textfont.family",x)),r=[a.minExtend(p,b)],(i=a.minExtend(d,w)).selectedpoints=null,i.texttemplate=null}var k=n.select(this).select("g.legendpoints"),A=k.selectAll("path.scatterpts").data(h?r:[]);A.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),A.exit().remove(),A.call(s.pointStyle,i,e),h&&(r[0].mrc=3);var M=k.selectAll("g.pointtext").data(g?r:[]);M.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),M.exit().remove(),M.selectAll("text").call(s.textPointStyle,i,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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(l.fill,a.fillcolor),o&&l.stroke(i,a.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",_).style("stroke-miterlimit",1),r.exit().remove(),r.each((function(t,r){var i=n.select(this),a=e[r?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("fill","none").call(s.dashLine,a.line.dash,o),o&&l.stroke(i,a.line.color)}))}))}},{"../../lib":515,"../../registry":647,"../../traces/pie/helpers":915,"../../traces/pie/style_one":921,"../../traces/scatter/subtypes":961,"../color":367,"../colorscale/helpers":378,"../drawing":389,"./constants":418,"@plotly/d3":58}],426:[function(t,e,r){"use strict";t("./constants");e.exports={editType:"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"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},{"./constants":428}],427:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/plots"),a=t("../../plots/cartesian/axis_ids"),o=t("../../fonts/ploticon"),s=t("../shapes/draw").eraseActiveShape,l=t("../../lib"),c=l._,u=e.exports={};function f(t,e){var r,i,o=e.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=t._fullLayout,u={},f=a.list(t,null,!0),h=c._cartesianSpikesEnabled;if("zoom"===s){var p,d="in"===l?.5:2,m=(1+d)/2,g=(1-d)/2;for(i=0;i1?(I=["toggleHover"],O=["resetViews"]):v?(P=["zoomInGeo","zoomOutGeo"],I=["hoverClosestGeo"],O=["resetGeo"]):g?(I=["hoverClosest3d"],O=["resetCameraDefault3d","resetCameraLastSave3d"]):w?(P=["zoomInMapbox","zoomOutMapbox"],I=["toggleHover"],O=["resetViewMapbox"]):b?I=["hoverClosestGl2d"]:y?I=["hoverClosestPie"]:A?(I=["hoverClosestCartesian","hoverCompareCartesian"],O=["resetViewSankey"]):I=["toggleHover"];m&&(I=["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]);(function(t){for(var e=0;e0)){var m=function(t,e,r){for(var n=r.filter((function(r){return e[r].anchor===t._id})),i=0,a=0;a=n.max)e=F[r+1];else if(t=n.pmax)e=F[r+1];else if(t=0;k--){var A=r.append("path").attr(g).style("opacity",k?.1:v).call(o.stroke,x).call(o.fill,y).call(s.dashLine,k?"solid":_,k?4+b:b);if(d(A,t,a),w){var M=l(t.layout,"selections",a);A.style({cursor:"move"});var S={element:A.node(),plotinfo:p,gd:t,editHelpers:M,isActiveSelection:!0},E=n(c,t);i(E,A,S)}else A.style("pointer-events",k?"all":"none");T[k]=A}var L=T[0];T[1].node().addEventListener("click",(function(){return function(t,e){if(!h(t))return;var r=+e.node().getAttribute("data-index");if(r>=0){if(r===t._fullLayout._activeSelectionIndex)return void m(t);t._fullLayout._activeSelectionIndex=r,t._fullLayout._deactivateSelection=m,f(t)}}(t,L)}))}(t._fullLayout._selectionLayer)}function d(t,e,r){var n=r.xref+r.yref;s.setClipUrl(t,"clip"+e._fullLayout._uid+n,e)}function m(t){h(t)&&(t._fullLayout._activeSelectionIndex>=0&&(a(t),delete t._fullLayout._activeSelectionIndex,f(t)))}e.exports={draw:f,drawOne:p,activateLastSelection:function(t){if(!h(t))return;var e=t._fullLayout.selections.length-1;t._fullLayout._activeSelectionIndex=e,t._fullLayout._deactivateSelection=m,f(t)}}},{"../../plot_api/plot_template":555,"../color":367,"../drawing":389,"../shapes/display_outlines":461,"../shapes/draw_newshape/helpers":466,"../shapes/handle_outline":468,"../shapes/helpers":469}],451:[function(t,e,r){"use strict";var n=t("../../drawing/attributes").dash,i=t("../../../lib/extend").extendFlat;e.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:i({},n,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},{"../../../lib/extend":505,"../../drawing/attributes":388}],452:[function(t,e,r){"use strict";e.exports=function(t,e,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}},{}],453:[function(t,e,r){"use strict";var n=t("../../dragelement/helpers").selectMode,i=t("../../shapes/handle_outline").clearOutline,a=t("../../shapes/draw_newshape/helpers"),o=a.readPaths,s=a.writePaths,l=a.fixDatesForPaths;e.exports=function(t,e){if(t.length){var r=t[0][0];if(r){var a=r.getAttribute("d"),c=e.gd,u=c._fullLayout.newselection,f=e.plotinfo,h=f.xaxis,p=f.yaxis,d=e.isActiveSelection,m=e.dragmode,g=(c.layout||{}).selections||[];if(!n(m)&&void 0!==d){var v=c._fullLayout._activeSelectionIndex;if(v-1,b=[];if(function(t){return t&&Array.isArray(t)&&!0!==t[0].hoverOnBox}(v)){Y(t,e,a);var _=function(t,e){var r,n,i=t[0],a=-1,o=[];for(n=0;n0?function(t,e){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===e.searchInfo&&(n=e.searchInfo.cd[0].trace).selectedpoints.length===e.pointNumbers.length){for(i=0;i1)return!1;if((i+=r.selectedpoints.length)>1)return!1}return 1===i}(s)&&(h=K(_))){for(o&&o.remove(),g=0;g=0})(i)&&i._fullLayout._deactivateShape(i),function(t){return t._fullLayout._activeSelectionIndex>=0}(i)&&i._fullLayout._deactivateSelection(i);var o=i._fullLayout._zoomlayer,s=p(r),l=m(r);if(s||l){var c,u,f=o.selectAll(".select-outline-"+n.id);if(f&&i._fullLayout._outlining)s&&(c=T(f,t)),c&&a.call("_guiRelayout",i,{shapes:c}),l&&!U(t)&&(u=k(f,t)),u&&(i._fullLayout._noEmitSelectedAtStart=!0,a.call("_guiRelayout",i,{selections:u}).then((function(){e&&A(i)}))),i._fullLayout._outlining=!1}n.selection={},n.selection.selectionDefs=t.selectionDefs=[],n.selection.mergedPolygons=t.mergedPolygons=[]}function Z(t){return t._id}function X(t,e,r,n){if(!t.calcdata)return[];var i,a,o,s=[],l=e.map(Z),c=r.map(Z);for(o=0;o0?n[0]:r;return!!e.selectedpoints&&e.selectedpoints.indexOf(i)>-1}function Q(t,e,r){var n,i;for(n=0;n-1&&e;if(!a&&e){var et=ot(t,!0);if(et.length){var nt=et[0].xref,pt=et[0].yref;if(nt&&pt){var dt=ct(et);ut([C(t,nt,"x"),C(t,pt,"y")])($,dt)}}t._fullLayout._noEmitSelectedAtStart?t._fullLayout._noEmitSelectedAtStart=!1:tt&&ft(t,$),h._reselect=!1}if(!a&&h._deselect){var mt=h._deselect;(function(t,e,r){for(var n=0;n=0)k._fullLayout._deactivateShape(k);else if(!x){var r=A.clickmode;L.done(At).then((function(){if(L.clear(At),2===t){for(bt.remove(),K=0;K-1&&V(e,k,n.xaxes,n.yaxes,n.subplot,n,bt),"event"===r&&ft(k,void 0);l.click(k,e)})).catch(M.error)}},n.doneFn=function(){kt.remove(),L.done(At).then((function(){L.clear(At),!S&&J&&n.selectionDefs&&(J.subtract=xt,n.selectionDefs.push(J),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Z)),(S||x)&&W(n,S),n.doneFnCompleted&&n.doneFnCompleted(Mt),b&&ft(k,at)})).catch(M.error)}},clearOutline:x,clearSelectionsCache:W,selectOnClick:V}},{"../../lib":515,"../../lib/clear_gl_canvases":499,"../../lib/polygon":527,"../../lib/throttle":542,"../../plot_api/subroutines":556,"../../plots/cartesian/axis_ids":570,"../../registry":647,"../color":367,"../dragelement/helpers":385,"../drawing":389,"../fx":407,"../fx/helpers":403,"../shapes/constants":459,"../shapes/display_outlines":461,"../shapes/draw_newshape/helpers":466,"../shapes/draw_newshape/newshapes":467,"../shapes/handle_outline":468,"../shapes/helpers":469,"./constants":448,"./draw":450,"./draw_newselection/newselections":453,"./helpers":454,"point-in-polygon/nested":254,polybooljs:255}],457:[function(t,e,r){"use strict";var n=t("../annotations/attributes"),i=t("../../traces/scatter/attributes").line,a=t("../drawing/attributes").dash,o=t("../../lib/extend").extendFlat,s=t("../../plot_api/plot_template").templatedArray;t("../../constants/axis_placeable_objects");e.exports=s("shape",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},xref:o({},n.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},yref:o({},n.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{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":484,"../../lib/extend":505,"../../plot_api/plot_template":555,"../../traces/scatter/attributes":936,"../annotations/attributes":350,"../drawing/attributes":388}],458:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./constants"),o=t("./helpers");function s(t){return c(t.line.width,t.xsizemode,t.x0,t.x1,t.path,!1)}function l(t){return c(t.line.width,t.ysizemode,t.y0,t.y1,t.path,!0)}function c(t,e,r,i,s,l){var c=t/2,u=l;if("pixel"===e){var f=s?o.extractPathCoords(s,l?a.paramIsY:a.paramIsX):[r,i],h=n.aggNums(Math.max,null,f),p=n.aggNums(Math.min,null,f),d=p<0?Math.abs(p)+c:c,m=h>0?h+c:c;return{ppad:c,ppadplus:u?d:m,ppadminus:u?m:d}}return{ppad:c}}function u(t,e,r,n,i){var s="category"===t.type||"multicategory"===t.type?t.r2c:t.d2c;if(void 0!==e)return[s(e),s(r)];if(n){var l,c,u,f,h=1/0,p=-1/0,d=n.match(a.segmentRE);for("date"===t.type&&(s=o.decodeDate(s)),l=0;lp&&(p=f)));return p>=h?[h,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;o1&&(2!==t.length||"Z"!==t[1][0])&&(0===E&&(t[0][0]="M"),e[S]=t,T(),k())}}()}}function B(t,r){!function(t,r){if(e.length)for(var n=0;nx?(k=f,E="y0",A=x,L="y1"):(k=x,E="y1",A=f,L="y0");X(n),Q(s,r),function(t,e,r){var n=e.xref,i=e.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n);"paper"===i||s.autorange||(l+=i);u.setClipUrl(t,l?"clip"+r._fullLayout._uid+l:null,r)}(e,r,t),Z.moveFn="move"===O?J:K,Z.altKey=n.altKey},doneFn:function(){if(y(t))return;p(e),$(s),_(e,t,r),n.call("_guiRelayout",t,l.getUpdateObj())},clickFn:function(){if(y(t))return;$(s)}};function X(r){if(y(t))O=null;else if(R)O="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=Z.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!F&&i>10&&a>10&&!r.shiftKey?h.getCursor(o/i,1-s/a):"move";p(e,l),O=l.split("-")[0]}}function J(n,i){if("path"===r.type){var a=function(t){return t},o=a,l=a;z?B("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(q(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else z?B("xanchor",r.xanchor=G(b+n)):(B("x0",r.x0=G(c+n)),B("x1",r.x1=G(v+n))),D?B("yanchor",r.yanchor=Y(T+i)):(B("y0",r.y0=Y(f+i)),B("y1",r.y1=Y(x+i)));e.attr("d",g(t,r)),Q(s,r)}function K(n,i){if(F){var a=function(t){return t},o=a,l=a;z?B("xanchor",r.xanchor=G(b+n)):(o=function(t){return G(H(t)+n)},N&&"date"===N.type&&(o=m.encodeDate(o))),D?B("yanchor",r.yanchor=Y(T+i)):(l=function(t){return Y(q(t)+i)},U&&"date"===U.type&&(l=m.encodeDate(l))),B("path",r.path=w(I,o,l))}else if(R){if("resize-over-start-point"===O){var u=c+n,h=D?f-i:f+i;B("x0",r.x0=z?u:G(u)),B("y0",r.y0=D?h:Y(h))}else if("resize-over-end-point"===O){var p=v+n,d=D?x-i:x+i;B("x1",r.x1=z?p:G(p)),B("y1",r.y1=D?d:Y(d))}}else{var y=function(t){return-1!==O.indexOf(t)},_=y("n"),j=y("s"),V=y("w"),W=y("e"),Z=_?k+i:k,X=j?A+i:A,J=V?M+n:M,K=W?S+n:S;D&&(_&&(Z=k-i),j&&(X=A-i)),(!D&&X-Z>10||D&&Z-X>10)&&(B(E,r[E]=D?Z:Y(Z)),B(L,r[L]=D?X:Y(X))),K-J>10&&(B(C,r[C]=z?J:G(J)),B(P,r[P]=z?K:G(K)))}e.attr("d",g(t,r)),Q(s,r)}function Q(t,e){(z||D)&&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 a=H(z?e.xanchor:i.midRange(r?[e.x0,e.x1]:m.extractPathCoords(e.path,d.paramIsX))),o=q(D?e.yanchor:i.midRange(r?[e.y0,e.y1]:m.extractPathCoords(e.path,d.paramIsY)));if(a=m.roundPositionForSharpStrokeRendering(a,1),o=m.roundPositionForSharpStrokeRendering(o,1),z&&D){var s="M"+(a-1-1)+","+(o-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",s)}else if(z){var l="M"+(a-1-1)+","+(o-9-1)+"v18 h2 v-18 Z";n.attr("d",l)}else{var c="M"+(a-9-1)+","+(o-1-1)+"h18 v2 h-18 Z";n.attr("d",c)}}()}function $(t){t.selectAll(".visual-cue").remove()}h.init(Z),W.node().onmousemove=X}(t,z,l,e,r,O):!0===l.editable&&z.style("pointer-events",P||c.opacity(S)*M<=.5?"stroke":"all");z.node().addEventListener("click",(function(){return function(t,e){if(!x(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,z)}))}}function _(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 w(t,e,r){return t.replace(d.segmentRE,(function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,(function(t){return n>=s||(a[n]?t=e(t):o[n]&&(t=r(t)),n++),t}))}))}function T(t){x(t)&&(t._fullLayout._activeShapeIndex>=0&&(l(t),delete t._fullLayout._activeShapeIndex,v(t)))}e.exports={draw:v,drawOne:b,eraseActiveShape:function(t){if(!x(t))return;l(t);var e=t._fullLayout._activeShapeIndex,r=(t.layout||{}).shapes||[];if(e0&&lp&&(t="X"),t}));return a>p&&(d=d.replace(/[\s,]*X.*/,""),i.log("Ignoring extra params in segment "+t)),u+d}))}(e,s,c);if("pixel"===e.xsizemode){var b=s(e.xanchor);u=b+e.x0,f=b+e.x1}else u=s(e.x0),f=s(e.x1);if("pixel"===e.ysizemode){var _=c(e.yanchor);h=_-e.y0,p=_-e.y1}else h=c(e.y0),p=c(e.y1);if("line"===d)return"M"+u+","+h+"L"+f+","+p;if("rect"===d)return"M"+u+","+h+"H"+f+"V"+p+"H"+u+"Z";var w=(u+f)/2,T=(h+p)/2,k=Math.abs(w-u),A=Math.abs(T-h),M="A"+k+","+A,S=w+k+","+T;return"M"+S+M+" 0 1,1 "+(w+","+(T-A))+M+" 0 0,1 "+S+"Z"}},{"../../lib":515,"../../plots/cartesian/axes":566,"./constants":459}],470:[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":577,"./attributes":457,"./calc_autorange":458,"./defaults":460,"./draw":462,"./draw_newshape/defaults":465}],471:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=t("./constants"),u=l("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});e.exports=o(l("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps: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:a(i({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:s.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:n({})},font:n({}),activebgcolor:{valType:"color",dflt: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":505,"../../plot_api/edit_types":548,"../../plot_api/plot_template":555,"../../plots/animation_attributes":560,"../../plots/font_attributes":594,"../../plots/pad_attributes":627,"./constants":472}],472:[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}},{}],473:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.steps;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}for(var s=i(t,e,{name:"steps",handleItemDefaults:c}),l=0,u=0;u0&&(s=s.transition().duration(e.transition.duration).ease(e.transition.easing)),s.attr("transform",l(o-.5*f.gripWidth,e._dims.currentValueTotalHeight))}}function E(t,e){var r=t._dims;return r.inputAreaStart+f.stepInset+(r.inputAreaLength-2*f.stepInset)*Math.min(1,Math.max(0,e))}function L(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 C(t,e,r){var n=r._dims,i=s.ensureSingle(t,"rect",f.railTouchRectClass,(function(n){n.call(A,e,t,r).style("pointer-events","all")}));i.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,f.tickOffset+r.ticklen+n.labelHeight)}).call(a.fill,r.bgcolor).attr("opacity",0),o.setTranslate(i,0,n.currentValueTotalHeight)}function P(t,e){var r=e._dims,n=r.inputAreaLength-2*f.railInset,i=s.ensureSingle(t,"rect",f.railRectClass);i.attr({width:n,height:f.railWidth,rx:f.railRadius,ry:f.railRadius,"shape-rendering":"crispEdges"}).call(a.stroke,e.bordercolor).call(a.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),o.setTranslate(i,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=[],i=0;i0?[0]:[]);function s(e){e._commandObserver&&(e._commandObserver.remove(),delete e._commandObserver),i.autoMargin(t,g(e))}if(a.enter().append("g").classed(f.containerClassName,!0).style("cursor","ew-resize"),a.exit().each((function(){n.select(this).selectAll("g."+f.groupClassName).each(s)})).remove(),0!==r.length){var l=a.selectAll("g."+f.groupClassName).data(r,v);l.enter().append("g").classed(f.groupClassName,!0),l.exit().each(s).remove();for(var c=0;c0||h<0){var v={left:[-d,0],right:[d,0],top:[0,-d],bottom:[0,d]}[b.side];e.attr("transform",l(v[0],v[1]))}}}return R.call(F),O&&(E?R.on(".opacity",null):(A=0,M=!0,R.text(y).on("mouseover.opacity",(function(){n.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){n.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))),R.call(f.makeEditable,{gd:t}).on("edit",(function(e){void 0!==x?o.call("_guiRestyle",t,v,e,x):o.call("_guiRelayout",t,v,e)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(F)})).on("input",(function(t){this.text(t||" ").call(f.positionText,_.x,_.y)}))),R.classed("js-placeholder",M),T}}},{"../../constants/alignment":483,"../../constants/interactions":490,"../../lib":515,"../../lib/svg_text_utils":541,"../../plots/plots":628,"../../registry":647,"../color":367,"../drawing":389,"@plotly/d3":58,"fast-isnumeric":190}],477:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l=t("../../plot_api/plot_template").templatedArray,c=l("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},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(l("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons: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:a(s({editType:"arraydraw"}),{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},{"../../lib/extend":505,"../../plot_api/edit_types":548,"../../plot_api/plot_template":555,"../../plots/font_attributes":594,"../../plots/pad_attributes":627,"../color/attributes":366}],478:[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"}}},{}],479:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/array_container_defaults"),a=t("./attributes"),o=t("./constants").name,s=a.buttons;function l(t,e,r){function o(r,i){return n.coerce(t,e,a,r,i)}o("visible",i(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,i){return n.coerce(t,e,s,r,i)}r("visible","skip"===t.method||Array.isArray(t.args))&&(r("method"),r("args"),r("args2"),r("label"),r("execute"))}e.exports=function(t,e){i(t,e,{name:o,handleItemDefaults:l})}},{"../../lib":515,"../../plots/array_container_defaults":561,"./attributes":477,"./constants":478}],480:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/plots"),a=t("../color"),o=t("../drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../../plot_api/plot_template").arrayEditor,u=t("../../constants/alignment").LINE_SPACING,f=t("./constants"),h=t("./scrollbox");function p(t){return t._index}function d(t,e){return+t.attr(f.menuIndexAttrName)===e._index}function m(t,e,r,n,i,a,o,s){e.active=o,c(t.layout,f.name,e).applyUpdate("active",o),"buttons"===e.type?v(t,n,null,null,e):"dropdown"===e.type&&(i.attr(f.menuIndexAttrName,"-1"),g(t,n,i,a,e),s||v(t,n,i,a,e))}function g(t,e,r,n,i){var a=s.ensureSingle(e,"g",f.headerClassName,(function(t){t.style("pointer-events","all")})),l=i._dims,c=i.active,u=i.buttons[c]||f.blankHeaderOpts,h={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},p={width:l.headerWidth,height:l.headerHeight};a.call(y,i,u,t).call(M,i,h,p),s.ensureSingle(e,"text",f.headerArrowClassName,(function(t){t.attr("text-anchor","end").call(o.font,i.font).text(f.arrowSymbol[i.direction])})).attr({x:l.headerWidth-f.arrowOffsetX+i.pad.l,y:l.headerHeight/2+f.textOffsetY+i.pad.t}),a.on("click",(function(){r.call(S,String(d(r,i)?-1:i._index)),v(t,e,r,n,i)})),a.on("mouseover",(function(){a.call(w)})),a.on("mouseout",(function(){a.call(T,i)})),o.setTranslate(e,l.lx,l.ly)}function v(t,e,r,a,o){r||(r=e).attr("pointer-events","all");var l=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(s.filterVisible(l)),h=u.enter().append("g").classed(c,!0),p=u.exit();"dropdown"===o.type?(h.attr("opacity","0").transition().attr("opacity","1"),p.transition().attr("opacity","0").remove()):p.remove();var d=0,g=0,v=o._dims,x=-1!==["up","down"].indexOf(o.direction);"dropdown"===o.type&&(x?g=v.headerHeight+f.gapButtonHeader:d=v.headerWidth+f.gapButtonHeader),"dropdown"===o.type&&"up"===o.direction&&(g=-f.gapButtonHeader+f.gapButton-v.openHeight),"dropdown"===o.type&&"left"===o.direction&&(d=-f.gapButtonHeader+f.gapButton-v.openWidth);var b={x:v.lx+d+o.pad.l,y:v.ly+g+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(s,l){var c=n.select(this);c.call(y,o,s,t).call(M,o,b),c.on("click",(function(){n.event.defaultPrevented||(s.execute&&(s.args2&&o.active===l?(m(t,o,0,e,r,a,-1),i.executeAPICommand(t,s.method,s.args2)):(m(t,o,0,e,r,a,l),i.executeAPICommand(t,s.method,s.args))),t.emit("plotly_buttonclicked",{menu:o,button:s,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(v.openWidth,v.headerWidth),k.h=b.y-k.t):(k.w=b.x-k.l,k.h=Math.max(v.openHeight,v.headerHeight)),k.direction=o.direction,a&&(u.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i._dims,p=i.active;if(u)for(s=0,l=0;l0?[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(a)})).remove(),0!==r.length){var l=o.selectAll("g."+f.headerGroupClassName).data(r,p);l.enter().append("g").classed(f.headerGroupClassName,!0);for(var c=s.ensureSingle(o,"g",f.dropdownButtonGroupClassName,(function(t){t.style("pointer-events","all")})),u=0;uw,A=s.barLength+2*s.barPad,M=s.barWidth+2*s.barPad,S=d,E=g+v;E+M>c&&(E=c-M);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(i.fill,s.barColor),k?(this.hbar=L.attr({rx:s.barRadius,ry:s.barRadius,x:S,y:E,width:A,height:M}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>T,P=s.barWidth+2*s.barPad,I=s.barLength+2*s.barPad,O=d+m,z=g;O+P>l&&(O=l-P);var D=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);D.exit().on(".drag",null).remove(),D.enter().append("rect").classed("scrollbar-vertical",!0).call(i.fill,s.barColor),C?(this.vbar=D.attr({rx:s.barRadius,ry:s.barRadius,x:O,y:z,width:P,height:I}),this._vbarYMin=z+I/2,this._vbarTranslateMax=T-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var R=this.id,F=u-.5,B=C?f+P+.5:f+.5,N=h-.5,j=k?p+M+.5:p+.5,U=o._topdefs.selectAll("#"+R).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",R).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(F),y:Math.floor(N),width:Math.ceil(B)-Math.floor(F),height:Math.ceil(j)-Math.floor(N)}),this.container.call(a.setClipUrl,R,this.gd),this.bg.attr({x:d,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),k||C){var V=n.behavior.drag().on("dragstart",(function(){n.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=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(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},s.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(a.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},s.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=n.event.dx),this.vbar&&(e-=n.event.dy),this.setTranslate(t,e)},s.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=n.event.deltaY),this.vbar&&(e+=n.event.deltaY),this.setTranslate(t,e)},s.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,i=r+this._hbarTranslateMax;t=(o.constrain(n.event.x,r,i)-r)/(i-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,s=a+this._vbarTranslateMax;e=(o.constrain(n.event.y,a,s)-a)/(s-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},s.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=o.constrain(t||0,0,r),e=o.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(a.setTranslate,this._box.l-this.position.l-t,this._box.t-this.position.t-e),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+t-.5),y:Math.floor(this.position.t+e-.5)}),this.hbar){var i=t/r;this.hbar.call(a.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var s=e/n;this.vbar.call(a.setTranslate,t,e+s*this._vbarTranslateMax)}}},{"../../lib":515,"../color":367,"../drawing":389,"@plotly/d3":58}],483:[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"}}},{}],484:[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(" ")}}},{}],485:[function(t,e,r){"use strict";e.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}},{}],486:[function(t,e,r){"use strict";e.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},{}],487:[function(t,e,r){"use strict";e.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},{}],488:[function(t,e,r){"use strict";e.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},{}],489:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],490:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},{}],491:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,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"}},{}],492:[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}},{}],493:[function(t,e,r){"use strict";r.version=t("./version").version,t("native-promise-only"),t("../build/plotcss");for(var n=t("./registry"),i=r.register=n.register,a=t("./plot_api"),o=Object.keys(a),s=0;s",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},{}],495:[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}},{}],496:[function(t,e,r){"use strict";var n=t("./mod"),i=n.mod,a=n.modHalf,o=Math.PI,s=2*o;function l(t){return Math.abs(t[1]-t[0])>s-1e-14}function c(t,e){return a(e-t,s)}function u(t,e){if(l(e))return!0;var r,n;e[0](n=i(n,s))&&(n+=s);var a=i(t,s),o=a+s;return a>=r&&a<=n||o>=r&&o<=n}function f(t,e,r,n,i,a,c){i=i||0,a=a||0;var u,f,h,p,d,m=l([r,n]);function g(t,e){return[t*Math.cos(e)+i,a-t*Math.sin(e)]}m?(u=0,f=o,h=s):r=i&&t<=a);var i,a},pathArc:function(t,e,r,n,i){return f(null,t,e,r,n,i,0)},pathSector:function(t,e,r,n,i){return f(null,t,e,r,n,i,1)},pathAnnulus:function(t,e,r,n,i,a){return f(t,e,r,n,i,a,1)}}},{"./mod":522}],497:[function(t,e,r){"use strict";var n=Array.isArray,i=ArrayBuffer,a=DataView;function o(t){return i.isView(t)&&!(t instanceof a)}function s(t){return n(t)||o(t)}function l(t,e,r){if(s(t)){if(s(t[0])){for(var n=r,i=0;ii.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;!0!==n.strict&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorlist:{coerceFunction:function(t,e,r){Array.isArray(t)&&t.length&&t.every((function(t){return i(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(f(+t,360)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r,n){var i=n.regex||u(r);"string"==typeof t&&i.test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!u(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if(-1===(n.extras||[]).indexOf(t))if("string"==typeof t){for(var i=t.split("+"),a=0;a=n&&t<=i?t:u}if("string"!=typeof t&&"number"!=typeof t)return u;t=String(t);var c=_(e),v=t.charAt(0);!c||"G"!==v&&"g"!==v||(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],A=T[3]||"1",M=Number(T[5]||1),S=Number(T[7]||0),E=Number(T[9]||0),L=Number(T[11]||0);if(c){if(2===k.length)return u;var C;k=Number(k);try{var P=g.getComponentMethod("calendars","getCal")(e);if(w){var I="i"===A.charAt(A.length-1);A=parseInt(A,10),C=P.newDate(k,P.toMonthIndex(k,A,I),M)}else C=P.newDate(k,Number(A),M)}catch(t){return u}return C?(C.toJD()-m)*f+S*h+E*p+L*d:u}k=2===k.length?(Number(k)+2e3-b)%100+b:Number(k),A-=1;var O=new Date(Date.UTC(2e3,A,M,S,E));return O.setUTCFullYear(k),O.getUTCMonth()!==A||O.getUTCDate()!==M?u:O.getTime()+L*d},n=r.MIN_MS=r.dateTime2ms("-9999"),i=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*h,A=5*p;function M(t,e,r,n,i){if((e||r||n||i)&&(t+=" "+w(e,2)+":"+w(r,2),(n||i)&&(t+=":"+w(n,2),i))){for(var a=4;i%10==0;)a-=1,i/=10;t+="."+w(i,a)}return t}r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=n&&t<=i))return u;e||(e=0);var a,o,s,c,y,x,b=Math.floor(10*l(t+.05,1)),w=Math.round(t-b/10);if(_(r)){var S=Math.floor(w/f)+m,E=Math.floor(l(t,f));try{a=g.getComponentMethod("calendars","getCal")(r).fromJD(S).formatDate("yyyy-mm-dd")}catch(t){a=v("G%Y-%m-%d")(new Date(w))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;o=e=n+f&&t<=i-f))return u;var e=Math.floor(10*l(t+.05,1)),r=new Date(Math.round(t-e/10));return M(a("%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 s.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,n))return s.error("unrecognized date",t),e;return t};var S=/%\d?f/g,E=/%h/g,L={1:"1",2:"1",3:"2",4:"2"};function C(t,e,r,n){t=t.replace(S,(function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(e+.05));if(t=t.replace(E,(function(){return L[r("%q")(i)]})),_(n))try{t=g.getComponentMethod("calendars","worldCalFmt")(t,e,n)}catch(t){return"Invalid"}return r(t)(i)}var P=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,n,i,a){if(i=_(i)&&i,!e)if("y"===r)e=a.year;else if("m"===r)e=a.month;else{if("d"!==r)return function(t,e){var r=l(t+.05,f),n=w(Math.floor(r/h),2)+":"+w(l(Math.floor(r/p),60),2);if("M"!==e){o(e)||(e=0);var i=(100+Math.min(l(t/d,60),P[e])).toFixed(e).substr(1);e>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+i}return n}(t,r)+"\n"+C(a.dayMonthYear,t,n,i);e=a.dayMonth+"\n"+a.year}return C(e,t,n,i)};var I=3*f;r.incrementMonth=function(t,e,r){r=_(r)&&r;var n=l(t,f);if(t=Math.round(t-n),r)try{var i=Math.round(t/f)+m,a=g.getComponentMethod("calendars","getCal")(r),o=a.fromJD(i);return e%12?a.add(o,e,"m"):a.add(o,e/12,"y"),(o.toJD()-m)*f+n}catch(e){s.error("invalid ms "+t+" in calendar "+r)}var c=new Date(t+I);return c.setUTCMonth(c.getUTCMonth()+e)+n-I},r.findExactDates=function(t,e){for(var r,n,i=0,a=0,s=0,l=0,c=_(e)&&g.getComponentMethod("calendars","getCal")(e),u=0;u0&&t[e+1][0]<0)return e;return null}switch(e="RUS"===s||"FJI"===s?function(t){var e;if(null===c(t))e=t;else for(e=new Array(t.length),i=0;ie?r[n++]=[t[i][0]+360,t[i][1]]:i===e?(r[n++]=t[i],r[n++]=[t[i][0],-90]):r[n++]=t[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(t){l.push(h.tester(t))},a.type){case"MultiPolygon":for(r=0;ri&&(i=c,e=l)}else e=r;return o.default(e).geometry.coordinates}(u),n.fIn=t,n.fOut=u,s.push(u)}else c.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete i[r]}switch(r.type){case"FeatureCollection":var h=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+t)):void i++}),50)}))}for(var o=0;o0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function l(t,e,r,n,i){var a=n*t+i*e;if(a<0)return n*n+i*i;if(a>r){var o=n-t,s=i-e;return o*o+s*s}var l=n*e-i*t;return l*l/r}r.segmentsIntersect=s,r.segmentDistance=function(t,e,r,n,i,a,o,c){if(s(t,e,r,n,i,a,o,c))return 0;var u=r-t,f=n-e,h=o-i,p=c-a,d=u*u+f*f,m=h*h+p*p,g=Math.min(l(u,f,d,i-t,a-e),l(u,f,d,o-t,c-e),l(h,p,m,t-i,e-a),l(h,p,m,r-i,n-a));return Math.sqrt(g)},r.getTextLocation=function(t,e,r,s){if(t===i&&s===a||(n={},i=t,a=s),n[r])return n[r];var l=t.getPointAtLength(o(r-s/2,e)),c=t.getPointAtLength(o(r+s/2,e)),u=Math.atan((c.y-l.y)/(c.x-l.x)),f=t.getPointAtLength(o(r,e)),h={x:(4*f.x+l.x+c.x)/6,y:(4*f.y+l.y+c.y)/6,theta:u};return n[r]=h,h},r.clearLocationCache=function(){i=null},r.getVisibleSegment=function(t,e,r){var n,i,a=e.left,o=e.right,s=e.top,l=e.bottom,c=0,u=t.getTotalLength(),f=u;function h(e){var r=t.getPointAtLength(e);0===e?n=r:e===u&&(i=r);var c=r.xo?r.x-o:0,f=r.yl?r.y-l:0;return Math.sqrt(c*c+f*f)}for(var p=h(c);p;){if((c+=p+r)>f)return;p=h(c)}for(p=h(f);p;){if(c>(f-=p+r))return;p=h(f)}return{min:c,max:f,len:f-c,total:u,isClosed:0===c&&f===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,p=s;f0?p=i:h=i,f++}return a}},{"./mod":522}],511:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("color-normalize"),o=t("../components/colorscale"),s=t("../components/color/attributes").defaultLine,l=t("./array").isArrayOrTypedArray,c=a(s);function u(t,e){var r=t;return r[3]*=e,r}function f(t){if(n(t))return c;var e=a(t);return e.length?e:c}function h(t){return n(t)?t:1}e.exports={formatColor:function(t,e,r){var n,i,s,p,d,m=t.color,g=l(m),v=l(e),y=o.extractOpts(t),x=[];if(n=void 0!==y.colorscale?o.makeColorScaleFuncFromTrace(t):f,i=g?function(t,e){return void 0===t[e]?c:a(n(t[e]))}:f,s=v?function(t,e){return void 0===t[e]?1:h(t[e])}:h,g||v)for(var b=0;b1?(r*t+r*e)/r:t+e,i=String(n).length;if(i>16){var a=String(e).length;if(i>=String(t).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}},{}],515:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("d3-format").format,o=t("fast-isnumeric"),s=t("../constants/numerical"),l=s.FP_SAFE,c=-l,u=s.BADNUM,f=e.exports={};f.adjustFormat=function(t){return!t||/^\d[.]\df/.test(t)||/[.]\d%/.test(t)?t:"0.f"===t?"~f":/^\d%/.test(t)?"~%":/^\ds/.test(t)?"~s":!/^[~,.0$]/.test(t)&&/[&fps]/.test(t)?"~"+t:t};var h={};f.warnBadFormat=function(t){var e=String(t);h[e]||(h[e]=1,f.warn('encountered bad format: "'+e+'"'))},f.noFormat=function(t){return String(t)},f.numberFormat=function(t){var e;try{e=a(f.adjustFormat(t))}catch(e){return f.warnBadFormat(t),f.noFormat}return e},f.nestedProperty=t("./nested_property"),f.keyedContainer=t("./keyed_container"),f.relativeAttr=t("./relative_attr"),f.isPlainObject=t("./is_plain_object"),f.toLogRange=t("./to_log_range"),f.relinkPrivateKeys=t("./relink_private");var p=t("./array");f.isTypedArray=p.isTypedArray,f.isArrayOrTypedArray=p.isArrayOrTypedArray,f.isArray1D=p.isArray1D,f.ensureArray=p.ensureArray,f.concat=p.concat,f.maxRowLength=p.maxRowLength,f.minRowLength=p.minRowLength;var d=t("./mod");f.mod=d.mod,f.modHalf=d.modHalf;var m=t("./coerce");f.valObjectMeta=m.valObjectMeta,f.coerce=m.coerce,f.coerce2=m.coerce2,f.coerceFont=m.coerceFont,f.coercePattern=m.coercePattern,f.coerceHoverinfo=m.coerceHoverinfo,f.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,f.validate=m.validate;var g=t("./dates");f.dateTime2ms=g.dateTime2ms,f.isDateTime=g.isDateTime,f.ms2DateTime=g.ms2DateTime,f.ms2DateTimeLocal=g.ms2DateTimeLocal,f.cleanDate=g.cleanDate,f.isJSDate=g.isJSDate,f.formatDate=g.formatDate,f.incrementMonth=g.incrementMonth,f.dateTick0=g.dateTick0,f.dfltRange=g.dfltRange,f.findExactDates=g.findExactDates,f.MIN_MS=g.MIN_MS,f.MAX_MS=g.MAX_MS;var v=t("./search");f.findBin=v.findBin,f.sorterAsc=v.sorterAsc,f.sorterDes=v.sorterDes,f.distinctVals=v.distinctVals,f.roundUp=v.roundUp,f.sort=v.sort,f.findIndexOfMin=v.findIndexOfMin,f.sortObjectKeys=t("./sort_object_keys");var y=t("./stats");f.aggNums=y.aggNums,f.len=y.len,f.mean=y.mean,f.median=y.median,f.midRange=y.midRange,f.variance=y.variance,f.stdev=y.stdev,f.interp=y.interp;var x=t("./matrix");f.init2dArray=x.init2dArray,f.transposeRagged=x.transposeRagged,f.dot=x.dot,f.translationMatrix=x.translationMatrix,f.rotationMatrix=x.rotationMatrix,f.rotationXYMatrix=x.rotationXYMatrix,f.apply3DTransform=x.apply3DTransform,f.apply2DTransform=x.apply2DTransform,f.apply2DTransform2=x.apply2DTransform2,f.convertCssMatrix=x.convertCssMatrix,f.inverseTransformMatrix=x.inverseTransformMatrix;var b=t("./angles");f.deg2rad=b.deg2rad,f.rad2deg=b.rad2deg,f.angleDelta=b.angleDelta,f.angleDist=b.angleDist,f.isFullCircle=b.isFullCircle,f.isAngleInsideSector=b.isAngleInsideSector,f.isPtInsideSector=b.isPtInsideSector,f.pathArc=b.pathArc,f.pathSector=b.pathSector,f.pathAnnulus=b.pathAnnulus;var _=t("./anchor_utils");f.isLeftAnchor=_.isLeftAnchor,f.isCenterAnchor=_.isCenterAnchor,f.isRightAnchor=_.isRightAnchor,f.isTopAnchor=_.isTopAnchor,f.isMiddleAnchor=_.isMiddleAnchor,f.isBottomAnchor=_.isBottomAnchor;var w=t("./geometry2d");f.segmentsIntersect=w.segmentsIntersect,f.segmentDistance=w.segmentDistance,f.getTextLocation=w.getTextLocation,f.clearLocationCache=w.clearLocationCache,f.getVisibleSegment=w.getVisibleSegment,f.findPointOnPath=w.findPointOnPath;var T=t("./extend");f.extendFlat=T.extendFlat,f.extendDeep=T.extendDeep,f.extendDeepAll=T.extendDeepAll,f.extendDeepNoArrays=T.extendDeepNoArrays;var k=t("./loggers");f.log=k.log,f.warn=k.warn,f.error=k.error;var A=t("./regex");f.counterRegex=A.counter;var M=t("./throttle");f.throttle=M.throttle,f.throttleDone=M.done,f.clearThrottle=M.clear;var S=t("./dom");function E(t){var e={};for(var r in t)for(var n=t[r],i=0;il||t=e)&&(o(t)&&t>=0&&t%1==0)},f.noop=t("./noop"),f.identity=t("./identity"),f.repeat=function(t,e){for(var r=new Array(e),n=0;nr?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},f.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},f.simpleMap=function(t,e,r,n,i){for(var a=t.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(f.warn("randstr failed uniqueness"),l):t(e,r,n,(i||0)+1):l},f.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},f.smooth=function(t,e){if((e=Math.round(e)||0)<2)return t;var r,n,i,a,o=t.length,s=2*o,l=2*e-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=t[i]*c[n];u[r]=a}return u},f.syncOrAsync=function(t,e,r){var n;function i(){return f.syncOrAsync(t,e,r)}for(;t.length;)if((n=(0,t.splice(0,1)[0])(e))&&n.then)return n.then(i);return r&&r(e)},f.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},f.noneOrAll=function(t,e,r){if(t){var n,i=!1,a=!0;for(n=0;n0?e:0}))},f.fillArray=function(t,e,r,n){if(n=n||f.identity,f.isArrayOrTypedArray(t))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},f.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var z=/^\w*$/;f.templateString=function(t,e){var r={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,n){var i;return z.test(n)?i=e[n]:(r[n]=r[n]||f.nestedProperty(e,n).get,i=r[n]()),f.isValidTextValue(i)?i:""}))};var D={max:10,count:0,name:"hovertemplate"};f.hovertemplateString=function(){return B.apply(D,arguments)};var R={max:10,count:0,name:"texttemplate"};f.texttemplateString=function(){return B.apply(R,arguments)};var F=/^[:|\|]/;function B(t,e,r){var n=this,a=arguments;e||(e={});var o={};return t.replace(f.TEMPLATE_STRING_REGEX,(function(t,s,l){var c,u,h,p="_xother"===s||"_yother"===s,d="_xother_"===s||"_yother_"===s,m="xother_"===s||"yother_"===s,g="xother"===s||"yother"===s||p||m||d,v=s;if((p||d)&&(v=v.substring(1)),(m||d)&&(v=v.substring(0,v.length-1)),g){if(void 0===(c=e[v]))return""}else for(h=3;h=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var N=2e9;f.seedPseudoRandom=function(){N=2e9},f.pseudoRandom=function(){var t=N;return N=(69069*N+1)%4294967296,Math.abs(N-t)<429496729?f.pseudoRandom():N/4294967296},f.fillText=function(t,e,r){var n=Array.isArray(r)?function(t){r.push(t)}:function(t){r.text=t},i=f.extractOption(t,e,"htx","hovertext");if(f.isValidTextValue(i))return n(i);var a=f.extractOption(t,e,"tx","text");return f.isValidTextValue(a)?n(a):void 0},f.isValidTextValue=function(t){return t||0===t},f.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;n1&&(c=1):c=0,f.strTranslate(i-c*(r+o),a-c*(n+s))+f.strScale(c)+(l?"rotate("+l+(e?"":" "+r+" "+n)+")":"")},f.setTransormAndDisplay=function(t,e){t.attr("transform",f.getTextTransform(e)),t.style("display",e.scale?null:"none")},f.ensureUniformFontSize=function(t,e){var r=f.extendFlat({},e);return r.size=Math.max(e.size,t._fullLayout.uniformtext.minsize||0),r},f.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)},f.bigFont=function(t){return Math.round(1.2*t)};var j=f.getFirefoxVersion(),U=null!==j&&j<86;f.getPositionFromD3Event=function(){return U?[n.event.layerX,n.event.layerY]:[n.event.offsetX,n.event.offsetY]}},{"../constants/numerical":491,"./anchor_utils":495,"./angles":496,"./array":497,"./clean_number":498,"./clear_responsive":500,"./coerce":501,"./dates":502,"./dom":503,"./extend":505,"./filter_unique":506,"./filter_visible":507,"./geometry2d":510,"./identity":513,"./increment":514,"./is_plain_object":516,"./keyed_container":517,"./localize":518,"./loggers":519,"./make_trace_groups":520,"./matrix":521,"./mod":522,"./nested_property":523,"./noop":524,"./notifier":525,"./preserve_drawing_buffer":529,"./push_unique":530,"./regex":532,"./relative_attr":533,"./relink_private":534,"./search":535,"./sort_object_keys":538,"./stats":539,"./throttle":542,"./to_log_range":543,"@plotly/d3":58,"d3-format":112,"d3-time-format":120,"fast-isnumeric":190}],516:[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).hasOwnProperty("hasOwnProperty")}},{}],517:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){var o,s,l;r=r||"name",a=a||"value";var c={};e&&e.length?(l=n(t,e),s=l.get()):s=t,e=e||"";var u={};if(s)for(o=0;o2)return c[e]=2|c[e],h.set(t,null);if(f){for(o=e;o1){var e=["LOG:"];for(t=0;t1){var r=[];for(t=0;t"),"long")}},a.warn=function(){var t;if(n.logging>0){var e=["WARN:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}},a.error=function(){var t;if(n.logging>0){var e=["ERROR:"];for(t=0;t0){var r=[];for(t=0;t"),"stick")}}},{"../plot_api/plot_config":553,"./notifier":525}],520:[function(t,e,r){"use strict";var n=t("@plotly/d3");e.exports=function(t,e,r){var i=t.selectAll("g."+r.replace(/\s/g,".")).data(e,(function(t){return t[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",r),i.order();var a=t.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(t){t[0][a]=n.select(this)})),i}},{"@plotly/d3":58}],521:[function(t,e,r){"use strict";var n=t("gl-mat4");r.init2dArray=function(t,e){for(var r=new Array(t),n=0;ne/2?t-Math.round(t/e)*e:t}}},{}],523:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./array").isArrayOrTypedArray;function a(t,e){return function(){var r,n,o,s,l,c=t;for(s=0;s/g),l=0;la||c===i||cs)&&(!e||!l(t))}:function(t,e){var l=t[0],c=t[1];if(l===i||la||c===i||cs)return!1;var u,f,h,p,d,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,v)))if(cu||Math.abs(n(o,h))>i)return!0;return!1},a.filter=function(t,e){var r=[t[0]],n=0,i=0;function o(o){t.push(o);var s=r.length,l=n;r.splice(i+1);for(var c=l+1;c1&&o(t.pop());return{addPt:o,raw:t,filtered:r}}},{"../constants/numerical":491,"./matrix":521}],528:[function(t,e,r){(function(r){(function(){"use strict";var n=t("./show_no_webgl_msg"),i=t("regl");e.exports=function(t,e,a){var o=t._fullLayout,s=!0;return o._glcanvas.each((function(n){if(n.regl)n.regl.preloadCachedCode(a);else if(!n.pick||o._has("parcoords")){try{n.regl=i({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio,extensions:e||[],cachedCode:a||{}})}catch(t){s=!1}n.regl||(s=!1),s&&this.addEventListener("webglcontextlost",(function(e){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:e,layer:n.key})}),!1)}})),s||n({container:o._glcontainer.node()}),s}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./show_no_webgl_msg":537,regl:284}],529:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=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=i({ua:{headers:{"user-agent":e}},tablet:!0,featureDetect:!1});if(!r)for(var a=e.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(n(c)&&(c=+c),c>=13)return!0}}}return r}},{"fast-isnumeric":190,"is-mobile":234}],530:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){for(var r=e.toString(),n=0;ni.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(!(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=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;re}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 a,o,f=0,h=e.length,p=0,d=h>1?(e[h-1]-e[0])/(h-1):1;for(o=d>=0?r?s:l:r?u:c,t+=1e-9*d*(r?-1:1)*(d>=0?1:-1);f90&&i.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e,n=t.slice();for(n.sort(r.sorterAsc),e=n.length-1;e>-1&&n[e]===o;e--);for(var i,a=n[e]-n[0]||1,s=a/(e||1)/1e4,l=[],c=0;c<=e;c++){var u=n[c],f=u-i;void 0===i?(l.push(u),i=u):f>s&&(a=Math.min(a,f),l.push(u),i=u)}return{vals:l,minDiff:a}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return t.sort(e)}return n?t:t.reverse()},r.findIndexOfMin=function(t,e){e=e||a;for(var r,n=1/0,i=0;ia.length)&&(o=a.length),n(e)||(e=!1),i(a[0])){for(l=new Array(o),s=0;st.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"./array":497,"fast-isnumeric":190}],540:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":89}],541:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../lib"),a=i.strTranslate,o=t("../constants/xmlns_namespaces"),s=t("../constants/alignment").LINE_SPACING,l=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;r.convertToTspans=function(t,e,m){var M=t.text(),S=!t.attr("data-notex")&&e&&e._context.typesetMath&&"undefined"!=typeof MathJax&&M.match(l),C=n.select(t.node().parentNode);if(!C.empty()){var P=t.attr("class")?t.attr("class").split(" ")[0]:"text";return P+="-math",C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove(),t.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),S?(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 a,o,s,l,h=parseInt((MathJax.version||"").split(".")[0]);if(2!==h&&3!==h)return void i.warn("No MathJax version:",MathJax.version);var p=function(){var r="math-output-"+i.randstr({},64),a=(l=n.select("body").append("div").attr({id:r}).style({visibility:"hidden",position:"absolute","font-size":e.fontSize+"px"}).text(t.replace(c,"\\lt ").replace(u,"\\gt "))).node();return 2===h?MathJax.Hub.Typeset(a):MathJax.typeset([a])},d=function(){var e=l.select(2===h?".MathJax_SVG":".MathJax"),a=!e.empty()&&l.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===h?n.select("body").select("#MathJax_SVG_glyphs"):e.select("defs"),r(e,o,s)}else i.log("There was an error in the tex syntax.",t),r();l.remove()};2===h?MathJax.Hub.Queue((function(){return o=i.extendDeepAll({},MathJax.Hub.config),s=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:f},displayAlign:"left"})}),(function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")}),p,d,(function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)}),(function(){return void 0!==s&&(MathJax.Hub.processSectionDelay=s),MathJax.Hub.Config(o)})):3===h&&(o=i.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=f,"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){p(),d(),"svg"!==a&&(MathJax.config.startup.output=a),MathJax.config=o})))}(S[2],o,(function(n,i,o){C.selectAll("svg."+P).remove(),C.selectAll("g."+P+"-group").remove();var s=n&&n.select("svg");if(!s||!s.node())return I(),void e();var l=C.append("g").classed(P+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});l.node().appendChild(s.node()),i&&i.node()&&s.node().insertBefore(i.node().cloneNode(!0),s.node().firstChild);var c=o.width,u=o.height;s.attr({class:P,height:u,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var f=t.node().style.fill||"black",h=s.select("g");h.attr({fill:f,stroke:f});var p=h.node().getBoundingClientRect(),d=p.width,g=p.height;(d>c||g>u)&&(s.style("overflow","hidden"),d=(p=s.node().getBoundingClientRect()).width,g=p.height);var v=+t.attr("x"),y=+t.attr("y"),x=-(r||t.node().getBoundingClientRect().height)/4;if("y"===P[0])l.attr({transform:"rotate("+[-90,v,y]+")"+a(-d/2,x-g/2)});else if("l"===P[0])y=x-g/2;else if("a"===P[0]&&0!==P.indexOf("atitle"))v=0,y=x;else{var b=t.attr("text-anchor");v-=d*("middle"===b?.5:"end"===b?1:0),y=y+x-g/2}s.attr({x:v,y:y}),m&&m.call(t,l),e(l)}))}))):I(),t}function I(){C.empty()||(P=t.attr("class")+"-math",C.select("svg."+P).remove()),t.text("").style("white-space","pre"),function(t,e){e=e.replace(g," ");var r,a=!1,l=[],c=-1;function u(){c++;var e=document.createElementNS(o.svg,"tspan");n.select(e).attr({class:"line",dy:c*s+"em"}),t.appendChild(e),r=e;var i=l;if(l=[{node:e}],i.length>1)for(var a=1;a doesnt match end tag <"+t+">. Pretending it did match.",e),r=l[l.length-1].node}else i.log("Ignoring unexpected end tag .",e)}x.test(e)?u():(r=t,l=[{node:t}]);for(var S=e.split(v),C=0;C|>|>)/g;var f=[["$","$"],["\\(","\\)"]];var h={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},p={sub:"0.3em",sup:"-0.6em"},d={sub:"-0.21em",sup:"0.42em"},m=["http:","https:","mailto:","",void 0,":"],g=r.NEWLINES=/(\r\n?|\n)/g,v=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;r.BR_TAG_ALL=//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&&E(n)}var A=/(^|;)\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"],i="...".length,a=t.split(v),o=[],s="",l=0,c=0;ci?o.push(u.substr(0,d-i)+"..."):o.push(u.substr(0,d));break}s=""}}return o.join("")};var M={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},S=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(t){return t.replace(S,(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)):M[e])||t}))}function L(t){var e=encodeURI(decodeURI(t)),r=document.createElement("a"),n=document.createElement("a");r.href=t,n.href=e;var i=r.protocol,a=n.protocol;return-1!==m.indexOf(i)&&-1!==m.indexOf(a)?e:""}function C(t,e,r){var n,a,o,s=r.horizontalAlign,l=r.verticalAlign||"top",c=t.node().getBoundingClientRect(),u=e.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-n.height}:"middle"===l?function(){return c.top+(c.height-n.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-n.width}:"center"===s?function(){return c.left+(c.width-n.width)/2}:function(){return c.left},function(){n=this.node().getBoundingClientRect();var t=o()-u.left,e=a()-u.top,s=r.gd||{};if(r.gd){s._fullLayout._calcInverseTransform(s);var l=i.apply3DTransform(s._fullLayout._invTransform)(t,e);t=l[0],e=l[1]}return this.style({top:e+"px",left:t+"px","z-index":1e3}),this}}r.convertEntities=E,r.sanitizeHTML=function(t){t=t.replace(g," ");for(var e=document.createElement("p"),r=e,i=[],a=t.split(v),o=0;oa.ts+e?l():a.timer=setTimeout((function(){l(),a.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)i(n[t]),delete n[t];else for(var e in n)r.clear(e)}},{}],543:[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":190}],544:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":596,"topojson-client":316}],545:[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"}}},{}],546:[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"}}},{}],547:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0&&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 a=(s.subplotsRegistry.cartesian||{}).attrRegex,l=(s.subplotsRegistry.polar||{}).attrRegex,f=(s.subplotsRegistry.ternary||{}).attrRegex,h=(s.subplotsRegistry.gl3d||{}).attrRegex,m=Object.keys(t);for(e=0;e3?(O.x=1.02,O.xanchor="left"):O.x<-2&&(O.x=-.02,O.xanchor="right"),O.y>3?(O.y=1.02,O.yanchor="bottom"):O.y<-2&&(O.y=-.02,O.yanchor="top")),d(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;e0)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;n1&&a.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 a.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(g,v),p(t),!0)}var x,b,_,w,T,k,A,M,S=Object.keys(r).map(Number).sort(o),E=e.get(),L=E||[],C=u(v,f).get(),P=[],I=-1,O=L.length;for(x=0;xL.length-(A?0:1))a.warn("index out of range",f,_);else if(void 0!==k)T.length>1&&a.warn("Insertion & removal are incompatible with edits to the same index.",f,_),c(k)?P.push(_):A?("add"===k&&(k={}),L.splice(_,0,k),C&&C.splice(_,0,{})):a.warn("Unrecognized full object edit value",f,_,k),-1===I&&(I=_);else for(b=0;b=0;x--)L.splice(P[x],1),C&&C.splice(P[x],1);if(L.length?E||e.set(L):e.set(null),m)return!1;if(h(g,v),d!==i){var z;if(-1===I)z=S;else{for(O=Math.max(L.length,O),z=[],x=0;x=I);x++)z.push(_);for(x=I;x=t.data.length||i<-t.data.length)throw new Error(r+" must be valid indices for gd.data.");if(e.indexOf(i,n+1)>-1||i>=0&&e.indexOf(-t.data.length+i)>-1||i<0&&e.indexOf(t.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function I(t,e,r){if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("currentIndices is a required argument.");if(Array.isArray(e)||(e=[e]),P(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&P(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function O(t,e,r,n,a){!function(t,e,r,n){var i=o.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!o.isPlainObject(e))throw new Error("update must be a key:value object");if(void 0===r)throw new Error("indices must be an integer or array of integers");for(var a in P(t,r,"indices"),e){if(!Array.isArray(e[a])||e[a].length!==r.length)throw new Error("attribute "+a+" must be an array of length equal to indices array length");if(i&&(!(a in n)||!Array.isArray(n[a])||n[a].length!==e[a].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(t,e,r,n);for(var l=function(t,e,r,n){var a,l,c,u,f,h=o.isPlainObject(n),p=[];for(var d in Array.isArray(r)||(r=[r]),r=C(r,t.data.length-1),e)for(var m=0;m-1&&-1===r.indexOf("grouptitlefont")?l(r,r.replace("titlefont","title.font")):r.indexOf("titleposition")>-1?l(r,r.replace("titleposition","title.position")):r.indexOf("titleside")>-1?l(r,r.replace("titleside","title.side")):r.indexOf("titleoffset")>-1&&l(r,r.replace("titleoffset","title.offset")):l(r,r.replace("title","title.text"));function l(e,r){t[r]=t[e],delete t[e]}}function U(t,e,r){t=o.getGraphDiv(t),_.clearPromiseQueue(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 i=W(t,n),a=i.flags;a.calc&&(t.calcdata=void 0);var s=[h.previousPromises];a.layoutReplot?s.push(w.layoutReplot):Object.keys(n).length&&(V(t,a,i)||h.supplyDefaults(t),a.legend&&s.push(w.doLegend),a.layoutstyle&&s.push(w.layoutStyles),a.axrange&&H(s,i.rangesAltered),a.ticks&&s.push(w.doTicksRelayout),a.modebar&&s.push(w.doModeBar),a.camera&&s.push(w.doCamera),a.colorbars&&s.push(w.doColorBars),s.push(M)),s.push(h.rehover,h.redrag,h.reselect),c.add(t,U,[t,i.undoit],U,[t,i.redoit]);var l=o.syncOrAsync(s,t);return l&&l.then||(l=Promise.resolve(t)),l.then((function(){return t.emit("plotly_relayout",i.eventData),t}))}function V(t,e,r){var n=t._fullLayout;if(!e.axrange)return!1;for(var i in e)if("axrange"!==i&&e[i])return!1;for(var a in r.rangesAltered){var o=p.id2name(a),s=t.layout[o],l=n[o];if(l.autorange=s.autorange,s.range&&(l.range=s.range.slice()),l.cleanRange(),l._matchGroup)for(var c in l._matchGroup)if(c!==a){var u=n[p.id2name(c)];u.autorange=l.autorange,u.range=l.range.slice(),u._input.range=l.range.slice()}}return!0}function H(t,e){var r=e?function(t){var r=[];for(var n in e){var i=p.getFromId(t,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)e[a]||r.push(a)}return p.draw(t,r,{skipTitle:!0})}:function(t){return p.draw(t,"redraw")};t.push(y,w.doAutoRangeAndConstraints,r,w.drawData,w.finalDraw)}var q=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,G=/^[xyz]axis[0-9]*\.autorange$/,Y=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function W(t,e){var r,n,i,a=t.layout,l=t._fullLayout,c=l._guiEditing,h=F(l._preGUI,c),d=Object.keys(e),m=p.list(t),g=o.extendDeepAll({},e),v={};for(j(e),d=Object.keys(e),n=0;n0&&"string"!=typeof O.parts[D];)D--;var B=O.parts[D],N=O.parts[D-1]+"."+B,U=O.parts.slice(0,D).join("."),V=s(t.layout,U).get(),H=s(l,U).get(),W=O.get();if(void 0!==z){M[I]=z,S[I]="reverse"===B?z:R(W);var X=f.getLayoutValObject(l,O.parts);if(X&&X.impliedEdits&&null!==z)for(var J in X.impliedEdits)E(o.relativeAttr(I,J),X.impliedEdits[J]);if(-1!==["width","height"].indexOf(I))if(z){E("autosize",null);var K="height"===I?"width":"height";E(K,l[K])}else l[I]=t._initialAutoSize[I];else if("autosize"===I)E("width",z?null:l.width),E("height",z?null:l.height);else if(N.match(q))P(N),s(l,U+"._inputRange").set(null);else if(N.match(G)){P(N),s(l,U+"._inputRange").set(null);var Q=s(l,U).get();Q._inputDomain&&(Q._input.domain=Q._inputDomain.slice())}else N.match(Y)&&s(l,U+"._inputDomain").set(null);if("type"===B){L=V;var $="linear"===H.type&&"log"===z,tt="log"===H.type&&"linear"===z;if($||tt){if(L&&L.range)if(H.autorange)$&&(L.range=L.range[1]>L.range[0]?[1,2]:[2,1]);else{var et=L.range[0],rt=L.range[1];$?(et<=0&&rt<=0&&E(U+".autorange",!0),et<=0?et=rt/1e6:rt<=0&&(rt=et/1e6),E(U+".range[0]",Math.log(et)/Math.LN10),E(U+".range[1]",Math.log(rt)/Math.LN10)):(E(U+".range[0]",Math.pow(10,et)),E(U+".range[1]",Math.pow(10,rt)))}else E(U+".autorange",!0);Array.isArray(l._subplots.polar)&&l._subplots.polar.length&&l[O.parts[0]]&&"radialaxis"===O.parts[1]&&delete l[O.parts[0]]._subplot.viewInitial["radialaxis.range"],u.getComponentMethod("annotations","convertCoords")(t,H,z,E),u.getComponentMethod("images","convertCoords")(t,H,z,E)}else E(U+".autorange",!0),E(U+".range",null);s(l,U+"._inputRange").set(null)}else if(B.match(k)){var nt=s(l,I).get(),it=(z||{}).type;it&&"-"!==it||(it="linear"),u.getComponentMethod("annotations","convertCoords")(t,nt,it,E),u.getComponentMethod("images","convertCoords")(t,nt,it,E)}var at=b.containerArrayMatch(I);if(at){r=at.array,n=at.index;var ot=at.property,st=X||{editType:"calc"};""!==n&&""===ot&&(b.isAddVal(z)?S[I]=null:b.isRemoveVal(z)?S[I]=(s(a,r).get()||[])[n]:o.warn("unrecognized full object value",e)),T.update(A,st),v[r]||(v[r]={});var lt=v[r][n];lt||(lt=v[r][n]={}),lt[ot]=z,delete e[I]}else"reverse"===B?(V.range?V.range.reverse():(E(U+".autorange",!0),V.range=[1,0]),H.autorange?A.calc=!0:A.plot=!0):("dragmode"===I&&(!1===z&&!1!==W||!1!==z&&!1===W)||l._has("scatter-like")&&l._has("regl")&&"dragmode"===I&&("lasso"===z||"select"===z)&&"lasso"!==W&&"select"!==W||l._has("gl2d")?A.plot=!0:X?T.update(A,X):A.calc=!0,O.set(z))}}for(r in v){b.applyContainerArrayChanges(t,h(a,r),v[r],A,h)||(A.plot=!0)}for(var ct in C){var ut=(L=p.getFromId(t,ct))&&L._constraintGroup;if(ut)for(var ft in A.calc=!0,ut)C[ft]||(p.getFromId(t,ft)._constraintShrinkable=!0)}return(Z(t)||e.height||e.width)&&(A.plot=!0),(A.plot||A.calc)&&(A.layoutReplot=!0),{flags:A,rangesAltered:C,undoit:S,redoit:M,eventData:g}}function Z(t){var e=t._fullLayout,r=e.width,n=e.height;return t.layout.autosize&&h.plotAutoSize(t,t.layout,e),e.width!==r||e.height!==n}function X(t,e,n,i){t=o.getGraphDiv(t),_.clearPromiseQueue(t),o.isPlainObject(e)||(e={}),o.isPlainObject(n)||(n={}),Object.keys(e).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var a=_.coerceTraceIndices(t,i),s=N(t,o.extendFlat({},e),a),l=s.flags,u=W(t,o.extendFlat({},n)),f=u.flags;(l.calc||f.calc)&&(t.calcdata=void 0),l.clearAxisTypes&&_.clearAxisTypes(t,a,n);var p=[];f.layoutReplot?p.push(w.layoutReplot):l.fullReplot?p.push(r._doPlot):(p.push(h.previousPromises),V(t,f,u)||h.supplyDefaults(t),l.style&&p.push(w.doTraceStyle),(l.colorbars||f.colorbars)&&p.push(w.doColorBars),f.legend&&p.push(w.doLegend),f.layoutstyle&&p.push(w.layoutStyles),f.axrange&&H(p,u.rangesAltered),f.ticks&&p.push(w.doTicksRelayout),f.modebar&&p.push(w.doModeBar),f.camera&&p.push(w.doCamera),p.push(M)),p.push(h.rehover,h.redrag,h.reselect),c.add(t,X,[t,s.undoit,u.undoit,s.traces],X,[t,s.redoit,u.redoit,s.traces]);var d=o.syncOrAsync(p,t);return d&&d.then||(d=Promise.resolve(t)),d.then((function(){return t.emit("plotly_update",{data:s.eventData,layout:u.eventData}),t}))}function J(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"}],Q=[{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 $(t,e){for(var r=0;r1;)if(n.pop(),void 0!==(r=s(e,n.join(".")+".uirevision").get()))return r;return e.uirevision}function et(t,e){for(var r=0;r=i.length?i[0]:i[t]:i}function l(t){return Array.isArray(a)?t>=a.length?a[0]:a[t]:a}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(a,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,h.transition(t,e.frame.data,e.frame.layout,_.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 d,m,g=0;function v(t){return Array.isArray(i)?g>=i.length?t.transitionOpts=i[g]:t.transitionOpts=i[0]:t.transitionOpts=i,g++,t}var y=[],x=null==e,b=Array.isArray(e);if(!x&&!b&&o.isPlainObject(e))y.push({type:"object",data:v(o.extendFlat({},e))});else if(x||-1!==["string","number"].indexOf(typeof e))for(d=0;d0&&kk)&&A.push(m);y=A}}y.length>0?function(e){if(0!==e.length){for(var i=0;i=0;n--)if(o.isPlainObject(e[n])){var m=e[n].name,g=(u[m]||d[m]||{}).name,v=e[n].name,y=u[g]||d[g];g&&v&&"number"==typeof v&&y&&A<5&&(A++,o.warn('addFrames: overwriting frame "'+(u[g]||d[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===A&&o.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),d[m]={name:m},p.push({frame:h.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=0;n--){if("number"==typeof(i=p[n].frame).name&&o.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!i.name)for(;u[i.name="frame "+t._transitionData._counter++];);if(u[i.name]){for(a=0;a=0;r--)n=e[r],a.push({type:"delete",index:n}),s.unshift({type:"insert",index:n,value:i[n]});var l=h.modifyFrames,u=h.modifyFrames,f=[t,s],p=[t,a];return c&&c.add(t,l,f,u,p),h.modifyFrames(t,a)},r.addTraces=function t(e,n,i){e=o.getGraphDiv(e);var a,s,l=[],u=r.deleteTraces,f=t,h=[e,l],p=[e,n];for(function(t,e,r){var n,i;if(!Array.isArray(t.data))throw new Error("gd.data must be an array.");if(void 0===e)throw new Error("traces must be defined.");for(Array.isArray(e)||(e=[e]),n=0;n=0&&r=0&&r=a.length)return!1;if(2===t.dimensions){if(r++,e.length===r)return t;var o=e[r];if(!y(o))return!1;t=a[i][o]}else t=a[i]}else t=a}}return t}function y(t){return t===Math.round(t)&&t>=0}function x(){var t,e,r={};for(t in f(r,o),n.subplotsRegistry){if((e=n.subplotsRegistry[t]).layoutAttributes)if(Array.isArray(e.attr))for(var i=0;i=l.length)return!1;i=(r=(n.transformsRegistry[l[c].type]||{}).attributes)&&r[e[2]],s=3}else{var u=t._module;if(u||(u=(n.modules[t.type||a.type.dflt]||{})._module),!u)return!1;if(!(i=(r=u.attributes)&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(i=f.attributes[o])}i||(i=a[o])}return v(i,e,s)},r.getLayoutValObject=function(t,e){return v(function(t,e){var r,i,a,s,l=t._basePlotModules;if(l){var c;for(r=0;r=i&&(r._input||{})._templateitemname;o&&(a=i);var s,l=e+"["+a+"]";function c(){s={},o&&(s[l]={},s[l].templateitemname=o)}function u(t,e){o?n.nestedProperty(s[l],t).set(e):s[l+"."+t]=e}function f(){var t=s;return c(),t}return c(),{modifyBase:function(t,e){s[t]=e},modifyItem:u,getUpdateObj:f,applyUpdate:function(e,r){e&&u(e,r);var i=f();for(var a in i)n.nestedProperty(t,a).set(i[a])}}}},{"../lib":515,"../plots/attributes":562}],556:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../registry"),a=t("../plots/plots"),o=t("../lib"),s=t("../lib/clear_gl_canvases"),l=t("../components/color"),c=t("../components/drawing"),u=t("../components/titles"),f=t("../components/modebar"),h=t("../plots/cartesian/axes"),p=t("../constants/alignment"),d=t("../plots/cartesian/constraints"),m=d.enforce,g=d.clean,v=t("../plots/cartesian/autorange").doAutoRange;function y(t,e,r){for(var n=0;n=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function x(t){var e,i,s,u,d,m,g=t._fullLayout,v=g._size,x=v.p,_=h.list(t,"",!0);if(g._paperdiv.style({width:t._context.responsive&&g.autosize&&!t._context._hasZeroWidth&&!t.layout.width?"100%":g.width+"px",height:t._context.responsive&&g.autosize&&!t._context._hasZeroHeight&&!t.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(c.setSize,g.width,g.height),t._context.setBackground(t,g.paper_bgcolor),r.drawMainTitle(t),f.manage(t),!g._has("cartesian"))return a.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:v.t+v.h*(1-(t.position||0))+n%1:e?"right"===r?e._offset+e._length+x+n:e._offset-x-n:v.l+v.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 A=[],M=[],S=[],E=1===l.opacity(g.paper_bgcolor)&&1===l.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(i in g._plots)if((s=g._plots[i]).mainplot)s.bg&&s.bg.remove(),s.bg=void 0;else{var L=s.xaxis.domain,C=s.yaxis.domain,P=s.plotgroup;if(y(L,C,S)){var I=P.node(),O=s.bg=o.ensureSingle(P,"rect","bg");I.insertBefore(O.node(),I.childNodes[0]),M.push(i)}else P.select("rect.bg").remove(),S.push([L,C]),E||(A.push(i),M.push(i))}var z,D,R,F,B,N,j,U,V,H,q,G,Y,W=g._bgLayer.selectAll(".bg").data(A);for(W.enter().append("rect").classed("bg",!0),W.exit().remove(),W.each((function(t){g._plots[t].bg=n.select(this)})),e=0;eT?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 a=e[n],o=m(e,n,r);i(a)?(Array.isArray(e)&&!1===a._template&&a.templateitemname&&u.push({code:"missing",path:o,templateitemname:a.templateitemname}),t(a,o)):Array.isArray(a)&&g(a)&&t(a,o)}}({data:p,layout:h},""),u.length)return u.map(v)}},{"../lib":515,"../plots/attributes":562,"../plots/plots":628,"./plot_config":553,"./plot_schema":554,"./plot_template":555}],558:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./plot_api"),a=t("../plots/plots"),o=t("../lib"),s=t("../snapshot/helpers"),l=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,h,p,d;function m(t){return!(t in e)||o.validate(e[t],f[t])}if(e=e||{},o.isPlainObject(t)?(r=t.data||[],h=t.layout||{},p=t.config||{},d={}):(t=o.getGraphDiv(t),r=o.extendDeep([],t.data),h=o.extendDeep({},t.layout),p=t._context,d=t._fullLayout||{}),!m("width")&&null!==e.width||!m("height")&&null!==e.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+o.join2(f.format.values,", "," or ")+".");var g={};function v(t,r){return o.coerce(e,g,f,t,r)}var y=v("format"),x=v("width"),b=v("height"),_=v("scale"),w=v("setBackground"),T=v("imageDataOnly"),k=document.createElement("div");k.style.position="absolute",k.style.left="-5000px",document.body.appendChild(k);var A=o.extendFlat({},h);x?A.width=x:null===e.width&&n(d.width)&&(A.width=d.width),b?A.height=b:null===e.height&&n(d.height)&&(A.height=d.height);var M=o.extendFlat({},p,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),S=s.getRedrawFunc(k);function E(){return new Promise((function(t){setTimeout(t,s.getDelay(k._fullLayout))}))}function L(){return new Promise((function(t,e){var r=l(k,y,_),n=k._fullLayout.width,f=k._fullLayout.height;function h(){i.purge(k),document.body.removeChild(k)}if("full-json"===y){var p=a.graphJson(k,!1,"keepdata","object",!0,!0);return p.version=u,p=JSON.stringify(p),h(),t(T?p:s.encodeJSON(p))}if(h(),"svg"===y)return t(T?r:s.encodeSVG(r));var d=document.createElement("canvas");d.id=o.randstr(),c({format:y,width:n,height:f,scale:_,canvas:d,svg:r,promise:!0}).then(t).catch(e)}))}return new Promise((function(t,e){i.newPlot(k,r,A,M).then(S).then(E).then(L).then((function(e){t(function(t){return T?t.replace(s.IMAGE_URL_PREFIX,""):t}(e))})).catch((function(t){e(t)}))}))}},{"../lib":515,"../plots/plots":628,"../snapshot/helpers":651,"../snapshot/svgtoimg":653,"../snapshot/tosvg":655,"../version":1132,"./plot_api":552,"fast-isnumeric":190}],559:[function(t,e,r){"use strict";var n=t("../lib"),i=t("../plots/plots"),a=t("./plot_schema"),o=t("./plot_config").dfltConfig,s=n.isPlainObject,l=Array.isArray,c=n.isArrayOrTypedArray;function u(t,e,r,i,a,o){o=o||[];for(var f=Object.keys(t),h=0;hx.length&&i.push(d("unused",a,v.concat(x.length)));var A,M,S,E,L,C=x.length,P=Array.isArray(k);if(P&&(C=Math.min(C,k.length)),2===b.dimensions)for(M=0;Mx[M].length&&i.push(d("unused",a,v.concat(M,x[M].length)));var I=x[M].length;for(A=0;A<(P?Math.min(I,k[M].length):I);A++)S=P?k[M][A]:k,E=y[M][A],L=x[M][A],n.validate(E,S)?L!==E&&L!==+E&&i.push(d("dynamic",a,v.concat(M,A),E,L)):i.push(d("value",a,v.concat(M,A),E))}else i.push(d("array",a,v.concat(M),y[M]));else for(M=0;M1&&p.push(d("object","layout"))),i.supplyDefaults(m);for(var g=m._fullData,v=r.length,y=0;y0&&Math.round(f)===f))return{vals:i};c=f}for(var h=e.calendar,p="start"===l,d="end"===l,m=t[r+"period0"],g=a(m,h)||0,v=[],y=[],x=[],b=i.length,_=0;_A;)k=o(k,-c,h);for(;k<=A;)k=o(k,c,h);T=o(k,-c,h)}else{for(k=g+(w=Math.round((A-g)/u))*u;k>A;)k-=u;for(;k<=A;)k+=u;T=k-u}v[_]=p?T:d?k:(T+k)/2,y[_]=T,x[_]=k}return{vals:v,starts:y,ends:x}}},{"../../constants/numerical":491,"../../lib":515,"fast-isnumeric":190}],564:[function(t,e,r){"use strict";e.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},{}],565:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../lib"),o=t("../../constants/numerical").FP_SAFE,s=t("../../registry"),l=t("../../components/drawing"),c=t("./axis_ids"),u=c.getFromId,f=c.isLinked;function h(t,e){var r,n,i=[],o=t._fullLayout,s=d(o,e,0),l=d(o,e,1),c=m(t,e),u=c.min,f=c.max;if(0===u.length||0===f.length)return a.simpleMap(e.range,e.r2l);var h=u[0].val,g=f[0].val;for(r=1;r0&&((T=E-s(x)-l(b))>L?k/T>C&&(_=x,w=b,C=k/T):k/E>C&&(_={val:x.val,nopad:1},w={val:b.val,nopad:1},C=k/E));if(h===g){var P=h-1,I=h+1;if(M)if(0===h)i=[0,1];else{var O=(h>0?f:u).reduce((function(t,e){return Math.max(t,l(e))}),0),z=h/(1-Math.min(.5,O/E));i=h>0?[0,z]:[z,0]}else i=S?[Math.max(0,P),Math.max(1,I)]:[P,I]}else M?(_.val>=0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:0,nopad:1})):S&&(_.val-C*s(_)<0&&(_={val:0,nopad:1}),w.val<=0&&(w={val:1,nopad:1})),C=(w.val-_.val-p(e,x.val,b.val))/(E-s(_)-l(w)),i=[_.val-C*s(_),w.val+C*l(w)];return v&&i.reverse(),a.simpleMap(i,e.l2r||Number)}function p(t,e,r){var n=0;if(t.rangebreaks)for(var i=t.locateBreaks(e,r),a=0;a0?r.ppadplus:r.ppadminus)||r.ppad||0),S=A((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=A(r.vpadplus||r.vpad),L=A(r.vpadminus||r.vpad);if(!T){if(h=1/0,p=-1/0,w)for(n=0;n0&&(h=a),a>p&&a-o&&(h=a),a>p&&a=I;n--)P(n);return{min:d,max:m,opts:r}},concatExtremes:m};function m(t,e,r){var n,i,a,o=e._id,s=t._fullData,l=t._fullLayout,c=[],f=[];function h(t,e){for(n=0;n=r&&(c.extrapad||!o)){s=!1;break}i(e,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(t.splice(l,1),l--)}if(s){var u=a&&0===e;t.push({val:e,pad:u?0:r,extrapad:!u&&o})}}function x(t){return i(t)&&Math.abs(t)=e}},{"../../components/drawing":389,"../../constants/numerical":491,"../../lib":515,"../../registry":647,"./axis_ids":570,"@plotly/d3":58,"fast-isnumeric":190}],566:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("fast-isnumeric"),a=t("../../plots/plots"),o=t("../../registry"),s=t("../../lib"),l=s.strTranslate,c=t("../../lib/svg_text_utils"),u=t("../../components/titles"),f=t("../../components/color"),h=t("../../components/drawing"),p=t("./layout_attributes"),d=t("./clean_ticks"),m=t("../../constants/numerical"),g=m.ONEMAXYEAR,v=m.ONEAVGYEAR,y=m.ONEMINYEAR,x=m.ONEMAXQUARTER,b=m.ONEAVGQUARTER,_=m.ONEMINQUARTER,w=m.ONEMAXMONTH,T=m.ONEAVGMONTH,k=m.ONEMINMONTH,A=m.ONEWEEK,M=m.ONEDAY,S=M/2,E=m.ONEHOUR,L=m.ONEMIN,C=m.ONESEC,P=m.MINUS_SIGN,I=m.BADNUM,O={K:"zeroline"},z={K:"gridline",L:"path"},D={K:"minor-gridline",L:"path"},R={K:"tick",L:"path"},F={K:"tick",L:"text"},B={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},N=t("../../constants/alignment"),j=N.MID_SHIFT,U=N.CAP_SHIFT,V=N.LINE_SPACING,H=N.OPPOSITE_SIDE,q=e.exports={};q.setConvert=t("./set_convert");var G=t("./axis_autotype"),Y=t("./axis_ids"),W=Y.idSort,Z=Y.isLinked;q.id2name=Y.id2name,q.name2id=Y.name2id,q.cleanId=Y.cleanId,q.list=Y.list,q.listIds=Y.listIds,q.getFromId=Y.getFromId,q.getFromTrace=Y.getFromTrace;var X=t("./autorange");q.getAutoRange=X.getAutoRange,q.findExtremes=X.findExtremes;function J(t){var e=1e-4*(t[1]-t[0]);return[t[0]-e,t[1]+e]}q.coerceRef=function(t,e,r,n,i,a){var o=n.charAt(n.length-1),l=r._fullLayout._subplots[o+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"==typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(t){return t+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"==typeof a?[a]:a:[]),dflt:i},s.coerce(t,e,u,c)},q.getRefType=function(t){return void 0===t?t:"paper"===t?"paper":"pixel"===t?"pixel":/( domain)$/.test(t)?"domain":"range"},q.coercePosition=function(t,e,r,n,i,a){var o,l;if("range"!==q.getRefType(n))o=s.ensureNumber,l=r(i,a);else{var c=q.getFromId(e,n);l=r(i,a=c.fraction2r(a)),o=c.cleanPos}t[i]=o(l)},q.cleanPosition=function(t,e,r){return("paper"===r||"pixel"===r?s.ensureNumber:q.getFromId(e,r).cleanPos)(t)},q.redrawComponents=function(t,e){e=e||q.listIds(t);var r=t._fullLayout;function n(n,i,a,s){for(var l=o.getComponentMethod(n,i),c={},u=0;ur&&f2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},q.saveRangeInitial=function(t,e){for(var r=q.list(t,"",!0),n=!1,i=0;i.3*h||u(n)||u(a))){var p=r.dtick/2;t+=t+p.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=q.tickIncrement(t,"M6","reverse")+1.5*M:a.exactMonths>.8?t=q.tickIncrement(t,"M1","reverse")+15.5*M:t-=S;var l=q.tickIncrement(t,r);if(l<=n)return l}return t}(y,t,v,c,a)),g=y,0;g<=u;)g=q.tickIncrement(g,v,!1,a);return{start:e.c2r(y,0,a),end:e.c2r(g,0,a),size:v,_dataSpan:u-c}},q.prepMinorTicks=function(t,e,r){if(!e.minor.dtick){delete t.dtick;var n,a=e.dtick&&i(e._tmin);if(a){var o=q.tickIncrement(e._tmin,e.dtick,!0);n=[e._tmin,.99*o+.01*e._tmin]}else{var l=s.simpleMap(e.range,e.r2l);n=[l[0],.8*l[0]+.2*l[1]]}if(t.range=s.simpleMap(n,e.l2r),t._isMinor=!0,q.prepTicks(t,r),a){var c=i(e.dtick),u=i(t.dtick),f=c?e.dtick:+e.dtick.substring(1),h=u?t.dtick:+t.dtick.substring(1);c&&u?tt(f,h)?f===2*A&&h===2*M&&(t.dtick=A):f===2*A&&h===3*M?t.dtick=A:f!==A||(e._input.minor||{}).nticks?et(f/h,2.5)?t.dtick=f/2:t.dtick=f:t.dtick=M:"M"===String(e.dtick).charAt(0)?u?t.dtick="M1":tt(f,h)?f>=12&&2===h&&(t.dtick="M3"):t.dtick=e.dtick:"L"===String(t.dtick).charAt(0)?"L"===String(e.dtick).charAt(0)?tt(f,h)||(t.dtick=et(f/h,2.5)?e.dtick/2:e.dtick):t.dtick="D1":"D2"===t.dtick&&+e.dtick>1&&(t.dtick=1)}t.range=e.range}void 0===e.minor._tick0Init&&(t.tick0=e.tick0)},q.prepTicks=function(t,e){var r=s.simpleMap(t.range,t.r2l,void 0,void 0,e);if("auto"===t.tickmode||!t.dtick){var n,a=t.nticks;a||("category"===t.type||"multicategory"===t.type?(n=t.tickfont?s.bigFont(t.tickfont.size||12):15,a=t._length/n):(n="y"===t._id.charAt(0)?40:80,a=s.constrain(t._length/n,4,9)+1),"radialaxis"===t._name&&(a*=2)),t.minor&&"array"!==t.minor.tickmode||"array"===t.tickmode&&(a*=100),t._roughDTick=Math.abs(r[1]-r[0])/a,q.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!(i(t.dtick)||"M"!==t.dtick.charAt(0))}var n=r(),a=q.getTickFormat(t);if(a){var o=t._dtickInit!==t.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(e=E,o&&!n&&t.dtick=(O?0:1);z--){var D=!z;z?(t._dtickInit=t.dtick,t._tick0Init=t.tick0):(t.minor._dtickInit=t.minor.dtick,t.minor._tick0Init=t.minor.tick0);var R=z?t:s.extendFlat({},t,t.minor);if(D?q.prepMinorTicks(R,t,e):q.prepTicks(R,e),"array"!==R.tickmode){var F=J(u),B=F[0],N=F[1],j=i(R.dtick),U="log"===a&&!(j||"L"===R.dtick.charAt(0)),V=q.tickFirst(R,e);if(z){if(t._tmin=V,V=N:W<=N;W=q.tickIncrement(W,Z,f,o)){if(z&&H++,R.rangebreaks&&!f){if(W=p)break}if(C.length>d||W===Y)break;Y=W;var X={value:W};z?(U&&W!==(0|W)&&(X.simpleLabel=!0),l>1&&H%l&&(X.skipLabel=!0),C.push(X)):(X.minor=!0,P.push(X))}}else z?(C=[],m=nt(t)):(P=[],L=nt(t))}if(O&&!("inside"===t.minor.ticks&&"outside"===t.ticks||"outside"===t.minor.ticks&&"inside"===t.ticks)){for(var K=C.map((function(t){return t.value})),Q=[],$=0;$0?(a=n-1,o=n):(a=n,o=n);var s,l=t[a].value,c=t[o].value,u=Math.abs(c-l),f=r||u,h=0;f>=y?h=u>=y&&u<=g?u:v:r===b&&f>=_?h=u>=_&&u<=x?u:b:f>=k?h=u>=k&&u<=w?u:T:r===A&&f>=A?h=A:f>=M?h=M:r===S&&f>=S?h=S:r===E&&f>=E&&(h=E),h>=u&&(h=u,s=!0);var p=i+h;if(e.rangebreaks&&h>0){for(var d=0,m=0;m<84;m++){var L=(m+.5)/84;e.maskBreaks(i*(1-L)+L*p)!==I&&d++}(h*=d/84)||(t[n].drop=!0),s&&u>A&&(h=u)}(h>0||0===n)&&(t[n].periodX=i+h/2)}}(C,t,t._definedDelta),t.rangebreaks){var at="y"===t._id.charAt(0),ot=1;"auto"===t.tickmode&&(ot=t.tickfont?t.tickfont.size:12);var st=NaN;for(r=C.length-1;r>-1;r--)if(C[r].drop)C.splice(r,1);else{C[r].value=It(C[r].value,t);var lt=t.c2p(C[r].value);(at?st>lt-ot:stp||utp&&(ct.periodX=p),ut10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=M&&a<=10||e>=15*M)t._tickround="d";else if(e>=L&&a<=16||e>=E)t._tickround="M";else if(e>=C&&a<=19||e>=L)t._tickround="S";else{var o=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(a,o)-20,t._tickround<0&&(t._tickround=4)}}else if(i(e)||"L"===e.charAt(0)){var s=t.range.map(t.r2d||Number);i(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===t.minexponent?3:t.minexponent;Math.abs(c)>u&&(mt(t.exponentformat)&&!gt(c)?t._tickexponent=3*Math.round((c-1)/3):t._tickexponent=c)}else t._tickround=null}function pt(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}}q.autoTicks=function(t,e,r){var n;function a(t){return Math.pow(t,Math.floor(Math.log(e)/Math.LN10))}if("date"===t.type){t.tick0=s.dateTick0(t.calendar,0);var o=2*e;if(o>v)e/=v,n=a(10),t.dtick="M"+12*ft(e,n,it);else if(o>T)e/=T,t.dtick="M"+ft(e,1,at);else if(o>M){if(t.dtick=ft(e,M,t._hasDayOfWeekBreaks?[1,2,7,14]:st),!r){var l=q.getTickFormat(t),c="period"===t.ticklabelmode;c&&(t._rawTick0=t.tick0),/%[uVW]/.test(l)?t.tick0=s.dateTick0(t.calendar,2):t.tick0=s.dateTick0(t.calendar,1),c&&(t._dowTick0=t.tick0)}}else o>E?t.dtick=ft(e,E,at):o>L?t.dtick=ft(e,L,ot):o>C?t.dtick=ft(e,C,ot):(n=a(10),t.dtick=ft(e,n,it))}else if("log"===t.type){t.tick0=0;var u=s.simpleMap(t.range,t.r2l);if(t._isMinor&&(e*=1.5),e>.7)t.dtick=Math.ceil(e);else if(Math.abs(u[1]-u[0])<1){var f=1.5*Math.abs((u[1]-u[0])/e);e=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/f,n=a(10),t.dtick="L"+ft(e,n,it)}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))):Pt(t)?(t.tick0=0,n=1,t.dtick=ft(e,n,ut)):(t.tick0=0,n=a(10),t.dtick=ft(e,n,it));if(0===t.dtick&&(t.dtick=1),!i(t.dtick)&&"string"!=typeof t.dtick){var h=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(h)}},q.tickIncrement=function(t,e,r,a){var o=r?-1:1;if(i(e))return s.increment(t,o*e);var l=e.charAt(0),c=o*Number(e.substr(1));if("M"===l)return s.incrementMonth(t,c,a);if("L"===l)return Math.log(Math.pow(10,t)+c)/Math.LN10;if("D"===l){var u="D2"===e?ct:lt,f=t+.01*o,h=s.roundUp(s.mod(f,1),u,r);return Math.floor(f)+Math.log(n.round(Math.pow(10,h),1))/Math.LN10}throw"unrecognized dtick "+String(e)},q.tickFirst=function(t,e){var r=t.r2l||Number,a=s.simpleMap(t.range,r,void 0,void 0,e),o=a[1] ")}else t._prevDateHead=l,c+="
"+l;e.text=c}(t,o,r,c):"log"===u?function(t,e,r,n,a){var o=t.dtick,l=e.x,c=t.tickformat,u="string"==typeof o&&o.charAt(0);"never"===a&&(a="");n&&"L"!==u&&(o="L3",u="L");if(c||"L"===u)e.text=vt(Math.pow(10,l),t,a,n);else if(i(o)||"D"===u&&s.mod(l+.01,1)<.1){var f=Math.round(l),h=Math.abs(f),p=t.exponentformat;"power"===p||mt(p)&>(f)?(e.text=0===f?1:1===f?"10":"10"+(f>1?"":P)+h+"",e.fontSize*=1.25):("e"===p||"E"===p)&&h>2?e.text="1"+p+(f>0?"+":P)+h:(e.text=vt(Math.pow(10,l),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,s.mod(l,1)))),e.fontSize*=.75}if("D1"===t.dtick){var d=String(e.text).charAt(0);"0"!==d&&"1"!==d||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(l<0?.5:.25)))}}(t,o,0,c,m):"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),i=t._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?e.text=o+" - "+a:(e.text=a,e.text2=o)}(t,o,r):Pt(t)?function(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=vt(e.x,t,i,n);else{var a=e.x/180;if(0===a)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,i=Math.abs(function t(r,n){return e(n,0)?r:t(n,r%n)}(n,r));return[Math.round(n/i),Math.round(r/i)]}(a);if(o[1]>=100)e.text=vt(s.deg2rad(e.x),t,i,n);else{var l=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),l&&(e.text=P+e.text)}}}}(t,o,r,c,m):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide");e.text=vt(e.x,t,i,n)}(t,o,0,c,m),n||(t.tickprefix&&!d(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!d(t.showticksuffix)&&(o.text+=t.ticksuffix)),"boundaries"===t.tickson||t.showdividers){var g=function(e){var r=t.l2p(e);return r>=0&&r<=t._length?e:null};o.xbnd=[g(o.x-.5),g(o.x+t.dtick-.5)]}return o},q.hoverLabelText=function(t,e,r){r&&(t=s.extendFlat({},t,{hoverformat:r}));var n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)?e[1]:void 0;if(void 0!==i&&i!==n)return q.hoverLabelText(t,n,r)+" - "+q.hoverLabelText(t,i,r);var a="log"===t.type&&n<=0,o=q.tickText(t,t.c2l(a?-n:n),"hover").text;return a?0===n?"0":P+o:o};var dt=["f","p","n","\u03bc","m","","k","M","G","T"];function mt(t){return"SI"===t||"B"===t}function gt(t){return t>14||t<-15}function vt(t,e,r,n){var a=t<0,o=e._tickround,l=r||e.exponentformat||"B",c=e._tickexponent,u=q.getTickFormat(e),f=e.separatethousands;if(n){var h={exponentformat:l,minexponent:e.minexponent,dtick:"none"===e.showexponent?e.dtick:i(t)&&Math.abs(t)||1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};ht(h),o=(Number(h._tickround)||0)+4,c=h._tickexponent,e.hoverformat&&(u=e.hoverformat)}if(u)return e._numFormat(u)(t).replace(/-/g,P);var p,d=Math.pow(10,-o)/2;if("none"===l&&(c=0),(t=Math.abs(t))"+p+"":"B"===l&&9===c?t+="B":mt(l)&&(t+=dt[c/3+5]));return a?P+t:t}function yt(t,e){if(t){var r=Object.keys(B).reduce((function(t,r){return-1!==e.indexOf(r)&&B[r].forEach((function(e){t[e]=1})),t}),{});Object.keys(t).forEach((function(e){r[e]||(1===e.length?t[e]=0:delete t[e])}))}}function xt(t,e){for(var r=[],n={},i=0;i1&&r=i.min&&t=0,a=u(t,e[1])<=0;return(r||i)&&(n||a)}if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(e=0;e=o(i)))){r=n;break}break;case"log":for(e=0;e0?r.bottom-f:0,h)))),e.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var p=[0,1];if("x"===d){if("b"===l?n[l]=e._depth:(n[l]=e._depth=Math.max(r.width>0?f-r.top:0,h),p.reverse()),r.width>0){var g=r.right-(e._offset+e._length);g>0&&(n.xr=1,n.r=g);var v=e._offset-r.left;v>0&&(n.xl=0,n.l=v)}}else if("l"===l?n[l]=e._depth=Math.max(r.height>0?f-r.left:0,h):(n[l]=e._depth=Math.max(r.height>0?r.right-f:0,h),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[m]="free"===e.anchor?e.position:e._anchorAxis.domain[p[0]],e.title.text!==c._dfltTitle[d]&&(n[l]+=wt(e)+(e.title.standoff||0)),e.mirror&&"free"!==e.anchor&&((i={x:0,y:0,r:0,l:0,t:0,b:0})[u]=e.linewidth,e.mirror&&!0!==e.mirror&&(i[u]+=h),!0===e.mirror||"ticks"===e.mirror?i[m]=e._anchorAxis.domain[p[1]]:"all"!==e.mirror&&"allticks"!==e.mirror||(i[m]=[e._counterDomainMin,e._counterDomainMax][p[1]]))}it&&(s=o.getComponentMethod("rangeslider","autoMarginOpts")(t,e)),"string"==typeof e.automargin&&(yt(n,e.automargin),yt(i,e.automargin)),a.autoMargin(t,At(e),n),a.autoMargin(t,Mt(e),i),a.autoMargin(t,St(e),s)})),r.skipTitle||it&&"bottom"===e.side||rt.push((function(){return function(t,e){var r,n=t._fullLayout,i=e._id,a=i.charAt(0),o=e.title.font.size;if(e.title.hasOwnProperty("standoff"))r=e._depth+e.title.standoff+wt(e);else{var s=Ot(e);if("multicategory"===e.type)r=e._depth;else{var l=1.5*o;s&&(l=.5*o,"outside"===e.ticks&&(l+=e.ticklen)),r=10+l+(e.linewidth?e.linewidth-1:0)}s||(r+="x"===a?"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,d,m=q.getPxPosition(t,e);"x"===a?(f=e._offset+e._length/2,p="top"===e.side?m-r:m+r):(p=e._offset+e._length/2,f="right"===e.side?m+r:m-r,c={rotate:"-90",offset:0});if("multicategory"!==e.type){var g=e._selections[e._id+"tick"];if(d={selection:g,side:e.side},g&&g.node()&&g.node().parentNode){var v=h.getTranslate(g.node().parentNode);d.offsetLeft=v.x,d.offsetTop=v.y}e.title.hasOwnProperty("standoff")&&(d.pad=0)}return u.draw(t,i+"title",{propContainer:e,propName:e._name+".title.text",placeholder:n._dfltTitle[a],avoid:d,transform:c,attributes:{x:f,y:p,"text-anchor":"middle"}})}(t,e)})),s.syncOrAsync(rt)}}function at(t){var r=p+(t||"tick");return w[r]||(w[r]=function(t,e){var r,n,i,a;t._selections[e].size()?(r=1/0,n=-1/0,i=1/0,a=-1/0,t._selections[e].each((function(){var t=kt(this),e=h.bBox(t.node().parentNode);r=Math.min(r,e.top),n=Math.max(n,e.bottom),i=Math.min(i,e.left),a=Math.max(a,e.right)}))):(r=0,n=0,i=0,a=0);return{top:r,bottom:n,left:i,right:a,height:n-r,width:a-i}}(e,r)),w[r]}},q.getTickSigns=function(t,e){var r=t._id.charAt(0),n={x:"top",y:"right"}[r],i=t.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(e?(t.minor||{}).ticks:t.ticks)==("x"===r)&&(a=a.map((function(t){return-t}))),t.side&&a.push({l:-1,t:-1,r:1,b:1}[t.side.charAt(0)]),a},q.makeTransTickFn=function(t){return"x"===t._id.charAt(0)?function(e){return l(t._offset+t.l2p(e.x),0)}:function(e){return l(0,t._offset+t.l2p(e.x))}},q.makeTransTickLabelFn=function(t){var e=function(t){var e=t.ticklabelposition||"",r=function(t){return-1!==e.indexOf(t)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=t.side,u=l?(t.tickwidth||0)/2:0,f=3,h=t.tickfont?t.tickfont.size:12;(o||n)&&(u+=h*U,f+=(t.linewidth||0)/2);(i||a)&&(u+=(t.linewidth||0)/2,f+=3);s&&"top"===c&&(f-=h*(1-U));(i||n)&&(u=-u);"bottom"!==c&&"right"!==c||(f=-f);return[l?u:0,s?f:0]}(t),r=e[0],n=e[1];return"x"===t._id.charAt(0)?function(e){return l(r+t._offset+t.l2p(bt(e)),n)}:function(e){return l(n,r+t._offset+t.l2p(bt(e)))}},q.makeTickPath=function(t,e,r,n){n||(n={});var i=n.minor;if(i&&!t.minor)return"";var a=void 0!==n.len?n.len:i?t.minor.ticklen:t.ticklen,o=t._id.charAt(0),s=(t.linewidth||1)/2;return"x"===o?"M0,"+(e+s*r)+"v"+a*r:"M"+(e+s*r)+",0h"+a*r},q.makeLabelFns=function(t,e,r){var n=t.ticklabelposition||"",a=function(t){return-1!==n.indexOf(t)},o=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||o||c,f=a("inside"),h="inside"===n&&"inside"===t.ticks||!f&&"outside"===t.ticks&&"boundaries"!==t.tickson,p=0,d=0,m=h?t.ticklen:0;if(f?m*=-1:u&&(m=0),h&&(p+=m,r)){var g=s.deg2rad(r);p=m*Math.cos(g)+1,d=m*Math.sin(g)}t.showticklabels&&(h||t.showline)&&(p+=.2*t.tickfont.size);var v,y,x,b,_,w={labelStandoff:p+=(t.linewidth||1)/2*(f?-1:1),labelShift:d},T=0,k=t.side,A=t._id.charAt(0),M=t.tickangle;if("x"===A)b=(_=!f&&"bottom"===k||f&&"top"===k)?1:-1,f&&(b*=-1),v=d*b,y=e+p*b,x=_?1:-.2,90===Math.abs(M)&&(f?x+=j:x=-90===M&&"bottom"===k?U:90===M&&"top"===k?j:.5,T=j/2*(M/90)),w.xFn=function(t){return t.dx+v+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*x},w.anchorFn=function(t,e){if(u){if(l)return"end";if(c)return"start"}return i(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"===A){if(b=(_=!f&&"left"===k||f&&"right"===k)?1:-1,f&&(b*=-1),v=p,y=d*b,x=0,f||90!==Math.abs(M)||(x=-90===M&&"left"===k||90===M&&"right"===k?U:.5),f){var S=i(M)?+M:0;if(0!==S){var E=s.deg2rad(S);T=Math.abs(Math.sin(E))*U*b,x=0}}w.xFn=function(t){return t.dx+e-(v+t.fontSize*x)*b+T*t.fontSize},w.yFn=function(t){return t.dy+y+t.fontSize*j},w.anchorFn=function(t,e){return i(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},q.drawTicks=function(t,e,r){r=r||{};var i=e._id+"tick",a=[].concat(e.minor&&e.minor.ticks?r.vals.filter((function(t){return t.minor&&!t.noTick})):[]).concat(e.ticks?r.vals.filter((function(t){return!t.minor&&!t.noTick})):[]),o=r.layer.selectAll("path."+i).data(a,_t);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==r.crisp).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.tickcolor:e.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(t,r.minor?e.minor.tickwidth:e.tickwidth,1)+"px"})).attr("d",r.path).style("display",null),zt(e,[R]),o.attr("transform",r.transFn)},q.drawGrid=function(t,e,r){r=r||{};var i=e._id+"grid",a=e.minor&&e.minor.showgrid,o=a?r.vals.filter((function(t){return t.minor})):[],s=e.showgrid?r.vals.filter((function(t){return!t.minor})):[],l=r.counterAxis;if(l&&q.shouldShowZeroLine(t,e,l))for(var c="array"===e.tickmode,u=0;u=0;v--){var y=v?m:g;if(y){var x=y.selectAll("path."+i).data(v?s:o,_t);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==r.crisp),x.attr("transform",r.transFn).attr("d",r.path).each((function(t){return f.stroke(n.select(this),t.minor?e.minor.gridcolor:e.gridcolor||"#ddd")})).style("stroke-dasharray",(function(t){return h.dashStyle(t.minor?e.minor.griddash:e.griddash,t.minor?e.minor.gridwidth:e.gridwidth)})).style("stroke-width",(function(t){return(t.minor?d:e._gw)+"px"})).style("display",null),"function"==typeof r.path&&x.attr("d",r.path)}}zt(e,[z,D])},q.drawZeroLine=function(t,e,r){r=r||r;var n=e._id+"zl",i=q.shouldShowZeroLine(t,e,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:e._id}]:[]);a.exit().remove(),a.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 W(t.id,e.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(f.stroke,e.zerolinecolor||f.defaultLine).style("stroke-width",h.crispRound(t,e.zerolinewidth,e._gw||1)+"px").style("display",null),zt(e,[O])},q.drawLabels=function(t,e,r){r=r||{};var a=t._fullLayout,o=e._id,u=o.charAt(0),f=r.cls||o+"tick",p=r.vals.filter((function(t){return t.text})),d=r.labelFns,m=r.secondary?0:e.tickangle,g=(e._prevTickAngles||{})[f],v=r.layer.selectAll("g."+f).data(e.showticklabels?p:[],_t),y=[];function x(t,a){t.each((function(t){var o=n.select(this),s=o.select(".text-math-group"),u=d.anchorFn(t,a),f=r.transFn.call(o.node(),t)+(i(a)&&0!=+a?" rotate("+a+","+d.xFn(t)+","+(d.yFn(t)-t.fontSize/2)+")":""),p=c.lineCount(o),m=V*t.fontSize,g=d.heightFn(t,i(a)?+a:0,(p-1)*m);if(g&&(f+=l(0,g)),s.empty()){var v=o.select("text");v.attr({transform:f,"text-anchor":u}),v.style("opacity",1),e._adjustTickLabelsOverflow&&e._adjustTickLabelsOverflow()}else{var y=h.bBox(s.node()).width*{end:-.5,start:.5}[u];s.attr("transform",f+l(y,0))}}))}v.enter().append("g").classed(f,1).append("text").attr("text-anchor","middle").each((function(e){var r=n.select(this),i=t._promises.length;r.call(c.positionText,d.xFn(e),d.yFn(e)).call(h.font,e.font,e.fontSize,e.fontColor).text(e.text).call(c.convertToTspans,t),t._promises[i]?y.push(t._promises.pop().then((function(){x(r,m)}))):x(r,m)})),zt(e,[F]),v.exit().remove(),r.repositionOnUpdate&&v.each((function(t){n.select(this).select("text").call(c.positionText,d.xFn(t),d.yFn(t))})),e._adjustTickLabelsOverflow=function(){var r=e.ticklabeloverflow;if(r&&"allow"!==r){var i=-1!==r.indexOf("hide"),o="x"===e._id.charAt(0),l=0,c=o?t._fullLayout.width:t._fullLayout.height;if(-1!==r.indexOf("domain")){var u=s.simpleMap(e.range,e.r2l);l=e.l2p(u[0])+e._offset,c=e.l2p(u[1])+e._offset}var f=Math.min(l,c),p=Math.max(l,c),d=e.side,m=1/0,g=-1/0;for(var y in v.each((function(t){var r=n.select(this);if(r.select(".text-math-group").empty()){var a=h.bBox(r.node()),s=0;o?(a.right>p||a.leftp||a.top+(e.tickangle?0:t.fontSize/4)e["_visibleLabelMin_"+r._id]?l.style("display","none"):"tick"!==t.K||i||l.style("display",null)}))}))}))}))},x(v,g+1?g:m);var b=null;e._selections&&(e._selections[f]=v);var _=[function(){return y.length&&Promise.all(y)}];e.automargin&&a._redrawFromAutoMarginCount&&90===g?(b=90,_.push((function(){x(v,g)}))):_.push((function(){if(x(v,m),p.length&&"x"===u&&!i(m)&&("log"!==e.type||"D"!==String(e.dtick).charAt(0))){b=0;var t,n=0,a=[];if(v.each((function(t){n=Math.max(n,t.fontSize);var r=e.l2p(t.x),i=kt(this),o=h.bBox(i.node());a.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,l=Math.abs((p[o-1].x-p[0].x)*e._m)/(o-1),c=e.ticklabelposition||"",f=function(t){return-1!==c.indexOf(t)},d=f("top"),g=f("left"),y=f("right"),_=f("bottom")||g||d||y?(e.tickwidth||0)+6:0,w=l<2.5*n||"multicategory"===e.type||"realaxis"===e._name;for(t=0;t1)for(n=1;n2*o}(i,e))return"date";var g="strict"!==r.autotypenumbers;return function(t,e){for(var r=t.length,n=f(r),i=0,o=0,s={},u=0;u2*i}(i,g)?"category":function(t,e){for(var r=t.length,n=0;n=2){var s,c,u="";if(2===o.length)for(s=0;s<2;s++)if(c=b(o[s])){u=g;break}var f=i("pattern",u);if(f===g)for(s=0;s<2;s++)(c=b(o[s]))&&(e.bounds[s]=o[s]=c-1);if(f)for(s=0;s<2;s++)switch(c=o[s],f){case g: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 v: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 h=r.range;if(h[0]h[1])return void(e.enabled=!1)}else if(o[0]>h[0]&&o[1]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 a(e,t._axisMatchGroups)||a(e,t._axisConstraintGroups)}},{"../../registry":647,"./constants":573}],571:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){if("category"===e.type){var i,a=t.categoryarray,o=Array.isArray(a)&&a.length>0;o&&(i="array");var s,l=r("categoryorder",i);"array"===l&&(s=r("categoryarray")),o||"array"!==l||(l=e.categoryorder="trace"),"trace"===l?e._initialCategories=[]:"array"===l?e._initialCategories=s.slice():(s=function(t,e){var r,n,i,a=e.dataAttr||t._id.charAt(0),o={};if(e.axData)r=e.axData;else for(r=[],n=0;nn?i.substr(n):a.substr(r))+o:i+a+t*e:o}function g(t,e){for(var r=e._size,n=r.h/r.w,i={},a=Object.keys(t),o=0;oc*x)||T)for(r=0;rO&&FP&&(P=F);h/=(P-C)/(2*I),C=l.l2r(C),P=l.l2r(P),l.range=l._input.range=S=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function N(t,e,r,n,i){return t.append("path").attr("class","zoombox").style({fill:e>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",c(r,n)).attr("d",i+"Z")}function j(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:f.background,stroke:f.defaultLine,"stroke-width":1,opacity:0}).attr("transform",c(e,r)).attr("d","M0,0Z")}function U(t,e,r,n,i,a){t.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),V(t,e,i,a)}function V(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 H(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function q(t){I&&t.data&&t._context.showTips&&(i.notifier(i._(t,"Double-click to zoom back out"),"long"),I=!1)}function G(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,P)/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 Y(t,e,r,n,a){for(var o,s,l,c,u=!1,f={},h={},p=(a||{}).xaHash,d=(a||{}).yaHash,m=0;m=0)i._fullLayout._deactivateShape(i);else{var o=i._fullLayout.clickmode;if(H(i),2!==t||vt||qt(),gt)o.indexOf("select")>-1&&S(r,i,J,K,e.id,Pt),o.indexOf("event")>-1&&p.click(i,r,e.id);else if(1===t&&vt){var s=m?O:I,c="s"===m||"w"===v?0:1,f=s._name+".range["+c+"]",h=function(t,e){var r,n=t.range[e],i=Math.abs(n-t.range[1-e]);return"date"===t.type?n:"log"===t.type?(r=Math.ceil(Math.max(0,-Math.log(i)/Math.LN10))+3,a("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(i)/Math.LN10)+4,a("."+String(r)+"g")(n))}(s,c),d="left",g="middle";if(s.fixedrange)return;m?(g="n"===m?"top":"bottom","right"===s.side&&(d="right")):"e"===v&&(d="right"),i._context.showAxisRangeEntryBoxes&&n.select(bt).call(u.makeEditable,{gd:i,immediate:!0,background:i._fullLayout.paper_bgcolor,text:String(h),fill:s.tickfont?s.tickfont.color:"#444",horizontalAlign:d,verticalAlign:g}).on("edit",(function(t){var e=s.d2r(t);void 0!==e&&l.call("_guiRelayout",i,f,e)}))}}}function zt(e,r){if(t._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(tt,pt*e+_t)),i=Math.max(0,Math.min(et,dt*r+wt)),a=Math.abs(n-_t),o=Math.abs(i-wt);function s(){St="",Tt.r=Tt.l,Tt.t=Tt.b,Lt.attr("d","M0,0Z")}if(Tt.l=Math.min(_t,n),Tt.r=Math.max(_t,n),Tt.t=Math.min(wt,i),Tt.b=Math.max(wt,i),rt.isSubplotConstrained)a>P||o>P?(St="xy",a/tt>o/et?(o=a*et/tt,wt>i?Tt.t=wt-o:Tt.b=wt+o):(a=o*tt/et,_t>n?Tt.l=_t-a:Tt.r=_t+a),Lt.attr("d",G(Tt))):s();else if(nt.isSubplotConstrained)if(a>P||o>P){St="xy";var l=Math.min(Tt.l/tt,(et-Tt.b)/et),c=Math.max(Tt.r/tt,(et-Tt.t)/et);Tt.l=l*tt,Tt.r=c*tt,Tt.b=(1-l)*et,Tt.t=(1-c)*et,Lt.attr("d",G(Tt))}else s();else!at||o0){var u;if(nt.isSubplotConstrained||!it&&1===at.length){for(u=0;um[1]-1/4096&&(e.domain=s),i.noneOrAll(t.domain,e.domain,s)}return r("layer"),e}},{"../../lib":515,"fast-isnumeric":190}],583:[function(t,e,r){"use strict";var n=t("./show_dflt");e.exports=function(t,e,r,i,a){a||(a={});var o=a.tickSuffixDflt,s=n(t);r("tickprefix")&&r("showtickprefix",s),r("ticksuffix",o)&&r("showticksuffix",s)}},{"./show_dflt":586}],584:[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 i=[t.r2l(t.range[0]),t.r2l(t.range[1])],a=i[0]+(i[1]-i[0])*r;t.range=t._input.range=[t.l2r(a+(i[0]-a)*e),t.l2r(a+(i[1]-a)*e)],t.setScale()}},{"../../constants/alignment":483}],585:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-time-format").utcFormat,a=t("../../lib"),o=a.numberFormat,s=t("fast-isnumeric"),l=a.cleanNumber,c=a.ms2DateTime,u=a.dateTime2ms,f=a.ensureNumber,h=a.isArrayOrTypedArray,p=t("../../constants/numerical"),d=p.FP_SAFE,m=p.BADNUM,g=p.LOG_CLIP,v=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,b=p.ONEMIN,_=p.ONESEC,w=t("./axis_ids"),T=t("./constants"),k=T.HOUR_PATTERN,A=T.WEEKDAY_PATTERN;function M(t){return Math.pow(10,t)}function S(t){return null!=t}e.exports=function(t,e){e=e||{};var r=t._id||"x",p=r.charAt(0);function E(e,r){if(e>0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-2*g*Math.abs(n-i))}return m}function L(e,r,n,i){if((i||{}).msUTC&&s(e))return+e;var o=u(e,n||t.calendar);if(o===m){if(!s(e))return m;e=+e;var l=Math.floor(10*a.mod(e+.05,1)),c=Math.round(e-l/10);o=u(new Date(c))+l/10}return o}function C(e,r,n){return c(e,r,n||t.calendar)}function P(e){return t._categories[Math.round(e)]}function I(e){if(S(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 m}function O(e){if(t._categoriesMap)return t._categoriesMap[e]}function z(t){var e=O(t);return void 0!==e?e:s(t)?+t:void 0}function D(t){return s(t)?+t:O(t)}function R(t,e,r){return n.round(r+e*t,2)}function F(t,e,r){return(t-r)/e}var B=function(e){return s(e)?R(e,t._m,t._b):m},N=function(e){return F(e,t._m,t._b)};if(t.rangebreaks){var j="y"===p;B=function(e){if(!s(e))return m;var r=t._rangebreaks.length;if(!r)return R(e,t._m,t._b);var n=j;t.range[0]>t.range[1]&&(n=!n);for(var i=n?-1:1,a=i*e,o=0,l=0;lu)){o=a<(c+u)/2?l:l+1;break}o=l+1}var f=t._B[o]||0;return isFinite(f)?R(e,t._m2,f):0},N=function(e){var r=t._rangebreaks.length;if(!r)return F(e,t._m,t._b);for(var n=0,i=0;it._rangebreaks[i].pmax&&(n=i+1);return F(e,t._m2,t._B[n])}}t.c2l="log"===t.type?E:f,t.l2c="log"===t.type?M:f,t.l2p=B,t.p2l=N,t.c2p="log"===t.type?function(t,e){return B(E(t,e))}:B,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=f,t.d2p=t.r2p=function(e){return t.l2p(l(e))},t.p2d=t.p2r=N,t.cleanPos=f):"log"===t.type?(t.d2r=t.d2l=function(t,e){return E(l(t),e)},t.r2d=t.r2c=function(t){return M(l(t))},t.d2c=t.r2l=l,t.c2d=t.l2r=f,t.c2r=E,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=f):"date"===t.type?(t.d2r=t.r2d=a.identity,t.d2c=t.r2c=t.d2l=t.r2l=L,t.c2d=t.c2r=t.l2d=t.l2r=C,t.d2p=t.r2p=function(e,r,n){return t.l2p(L(e,0,n))},t.p2d=t.p2r=function(t,e,r){return C(N(t),e,r)},t.cleanPos=function(e){return a.cleanDate(e,m,t.calendar)}):"category"===t.type?(t.d2c=t.d2l=I,t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=D(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=f,t.r2l=D,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:f(t)}):"multicategory"===t.type&&(t.r2d=t.c2d=t.l2d=P,t.d2r=t.d2l_noadd=z,t.r2c=function(e){var r=z(e);return void 0!==r?r:t.fraction2r(.5)},t.r2c_just_indices=O,t.l2r=t.c2r=f,t.r2l=z,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return P(N(t))},t.r2p=t.d2p,t.p2r=N,t.cleanPos=function(t){return Array.isArray(t)||"string"==typeof t&&""!==t?t:f(t)},t.setupMultiCategory=function(n){var i,o,s=t._traceIndices,l=t._matchGroup;if(l&&0===t._categories.length)for(var c in l)if(c!==r){var u=e[w.id2name(c)];s=s.concat(u._traceIndices)}var f=[[0,{}],[0,{}]],d=[];for(i=0;id&&(o[n]=d),o[0]===o[1]){var c=Math.max(1,Math.abs(1e-6*o[0]));o[0]-=c,o[1]+=c}}else a.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t.overlaying){var i=w.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s,l,c=t.r2l(t[a][0],o),u=t.r2l(t[a][1],o),f="y"===p;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(s=0;su&&(h=!h),h&&t._rangebreaks.reverse();var d=h?-1:1;for(t._m2=d*t._length/(Math.abs(u-c)-t._lBreaks),t._B.push(-t._m2*(f?u:c)),s=0;si&&(i+=7,oi&&(i+=24,o=n&&o=n&&e=s.min&&(ts.max&&(s.max=n),i=!1)}i&&c.push({min:t,max:n})}};for(n=0;nr.duration?(!function(){for(var r={},n=0;n 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 g(e,r){var n=e.plotinfo,i=n.xaxis,l=n.yaxis,c=i._length,u=l._length,f=!!e.xr1,h=!!e.yr1,p=[];if(f){var d=a.simpleMap(e.xr0,i.r2l),m=a.simpleMap(e.xr1,i.r2l),g=d[1]-d[0],v=m[1]-m[0];p[0]=(d[0]*(1-r)+r*m[0]-d[0])/(d[1]-d[0])*c,p[2]=c*(1-r+r*v/g),i.range[0]=i.l2r(d[0]*(1-r)+r*m[0]),i.range[1]=i.l2r(d[1]*(1-r)+r*m[1])}else p[0]=0,p[2]=c;if(h){var y=a.simpleMap(e.yr0,l.r2l),x=a.simpleMap(e.yr1,l.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),l.range[0]=i.l2r(y[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(y[1]*(1-r)+r*x[1])}else p[1]=0,p[3]=u;s.drawOne(t,i,{skipTitle:!0}),s.drawOne(t,l,{skipTitle:!0}),s.redrawComponents(t,[i._id,l._id]);var w=f?c/p[2]:1,T=h?u/p[3]:1,k=f?p[0]:0,A=h?p[1]:0,M=f?p[0]/p[2]*c:0,S=h?p[1]/p[3]*u:0,E=i._offset-M,L=l._offset-S;n.clipRect.call(o.setTranslate,k,A).call(o.setScale,1/w,1/T),n.plot.call(o.setTranslate,E,L).call(o.setScale,w,T),o.setPointGroupScale(n.zoomScalePts,1/w,1/T),o.setTextPointsScale(n.zoomScaleTxt,1/w,1/T)}s.redrawComponents(t)}},{"../../components/drawing":389,"../../lib":515,"../../registry":647,"./axes":566,"@plotly/d3":58}],591:[function(t,e,r){"use strict";var n=t("../../registry").traceIs,i=t("./axis_autotype");function a(t){return{v:"x",h:"y"}[t.orientation||"v"]}function o(t,e){var r=a(t),i=n(t,"box-violin"),o=n(t._fullInput||{},"candlestick");return i&&!o&&e===r&&void 0===t[r]&&void 0===t[r+"0"]}e.exports=function(t,e,r,s){r("autotypenumbers",s.autotypenumbersDflt),"-"===r("type",(s.splomStash||{}).type)&&(!function(t,e){if("-"!==t.type)return;var r,s=t._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(t,e,r){for(var n=0;n0&&(i["_"+r+"axes"]||{})[e])return i;if((i[r+"axis"]||r)===e){if(o(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(e,s,l);if(!c)return;if("histogram"===c.type&&l==={v:"y",h:"x"}[c.orientation||"v"])return void(t.type="linear");var u=l+"calendar",f=c[u],h={noMultiCategory:!n(c,"cartesian")||n(c,"noMultiCategory")};"box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(h.noMultiCategory=!0);if(h.autotypenumbers=t.autotypenumbers,o(c,l)){var p=a(c),d=[];for(r=0;r0?".":"")+a;i.isPlainObject(o)?l(o,e,s,n+1):e(s,a,o)}}))}r.manageCommandObserver=function(t,e,n,o){var s={},l=!0;e&&e._commandObserver&&(s=e._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,n,s.lookupTable);if(e&&e._commandObserver){if(c)return s;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,s}if(c){a(t,c,s.cache),s.check=function(){if(l){var e=a(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;f0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}e.exports=function(t){return new M(t)},S.plot=function(t,e,r,n){var i=this;if(n)return i.update(t,e,!0);i._geoCalcData=t,i._fullLayout=e;var a=e[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(a,e)}if(!r){if(this.updateProjection(t,e))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(e,n),this.updateDims(e,n),this.updateFx(e,n),d.generalUpdatePerTraceModule(this.graphDiv,this,t,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},S.updateProjection=function(t,e){var r=this.graphDiv,n=e[this.id],l=e._size,u=n.domain,f=n.projection,h=n.lonaxis,p=n.lataxis,d=h._ax,m=p._ax,v=this.projection=function(t){var e=t.projection,r=e.type,n=w.projNames[r];n="geo"+c.titleCase(n);for(var l=(i[n]||s[n])(),u=t._isSatellite?180*Math.acos(1/e.distance)/Math.PI:t._isClipped?w.lonaxisSpan[r]/2:null,f=["center","rotate","parallels","clipExtent"],h=function(t){return t?l:[]},p=0;pu*Math.PI/180}return!1},l.getPath=function(){return a().projection(l)},l.getBounds=function(t){return l.getPath().bounds(t)},l.precision(w.precision),t._isSatellite&&l.tilt(e.tilt).distance(e.distance);u&&l.clipAngle(u-w.clipPad);return l}(n),y=[[l.l+l.w*u.x[0],l.t+l.h*(1-u.y[1])],[l.l+l.w*u.x[1],l.t+l.h*(1-u.y[0])]],x=n.center||{},b=f.rotation||{},_=h.range||[],T=p.range||[];if(n.fitbounds){d._length=y[1][0]-y[0][0],m._length=y[1][1]-y[0][1],d.range=g(r,d),m.range=g(r,m);var k=(d.range[0]+d.range[1])/2,A=(m.range[0]+m.range[1])/2;if(n._isScoped)x={lon:k,lat:A};else if(n._isClipped){x={lon:k,lat:A},b={lon:k,lat:A,roll:b.roll};var M=f.type,S=w.lonaxisSpan[M]/2||180,L=w.lataxisSpan[M]/2||90;_=[k-S,k+S],T=[A-L,A+L]}else x={lon:k,lat:A},b={lon:k,lat:b.lat,roll:b.roll}}v.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(f.parallels);var C=E(_,T);v.fitExtent(y,C);var P=this.bounds=v.getBounds(C),I=this.fitScale=v.scale(),O=v.translate();if(n.fitbounds){var z=v.getBounds(E(d.range,m.range)),D=Math.min((P[1][0]-P[0][0])/(z[1][0]-z[0][0]),(P[1][1]-P[0][1])/(z[1][1]-z[0][1]));isFinite(D)?v.scale(D*I):c.warn("Something went wrong during"+this.id+"fitbounds computations.")}else v.scale(f.scale*I);var R=this.midPt=[(P[0][0]+P[1][0])/2,(P[0][1]+P[1][1])/2];if(v.translate([O[0]+(R[0]-O[0]),O[1]+(R[1]-O[1])]).clipExtent(P),n._isAlbersUsa){var F=v([x.lon,x.lat]),B=v.translate();v.translate([B[0]-(F[0]-B[0]),B[1]-(F[1]-B[1])])}},S.updateBaseLayers=function(t,e){var r=this,i=r.topojson,a=r.layers,o=r.basePaths;function s(t){return"lonaxis"===t||"lataxis"===t}function l(t){return Boolean(w.lineLayers[t])}function c(t){return Boolean(w.fillLayers[t])}var u=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(t){return l(t)||c(t)?e["show"+t]:!s(t)||e[t].showgrid})),p=r.framework.selectAll(".layer").data(u,String);p.exit().each((function(t){delete a[t],delete o[t],n.select(this).remove()})),p.enter().append("g").attr("class",(function(t){return"layer "+t})).each((function(t){var e=a[t]=n.select(this);"bg"===t?r.bgRect=e.append("rect").style("pointer-events","all"):s(t)?o[t]=e.append("path").style("fill","none"):"backplot"===t?e.append("g").classed("choroplethlayer",!0):"frontplot"===t?e.append("g").classed("scatterlayer",!0):l(t)?o[t]=e.append("path").style("fill","none").style("stroke-miterlimit",2):c(t)&&(o[t]=e.append("path").style("stroke","none"))})),p.order(),p.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(A(i,i.objects[r])):s(r)&&n.datum(function(t,e,r){var n,i,a,o=e[t],s=w.scopeDefaults[e.scope];"lonaxis"===t?(n=s.lonaxisRange,i=s.lataxisRange,a=function(t,e){return[t,e]}):"lataxis"===t&&(n=s.lataxisRange,i=s.lonaxisRange,a=function(t,e){return[e,t]});var l={type:"linear",range:[n[0],n[1]-1e-6],tick0:o.tick0,dtick:o.dtick};m.setConvert(l,r);var c=m.calcTicks(l);e.isScoped||"lonaxis"!==t||c.pop();for(var u=c.length,f=new Array(u),h=0;h-1&&b(n.event,i,[r.xaxis],[r.yaxis],r.id,u),s.indexOf("event")>-1&&p.click(i,n.event))}))}function f(t){return r.projection.invert([t[0]+r.xaxis._offset,t[1]+r.yaxis._offset])}},S.makeFramework=function(){var t=this,e=t.graphDiv,r=e._fullLayout,i="clip"+r._uid+t.id;t.clipDef=r._clips.append("clipPath").attr("id",i),t.clipRect=t.clipDef.append("rect"),t.framework=n.select(t.container).append("g").attr("class","geo "+t.id).call(h.setClipUrl,i,e),t.project=function(e){var r=t.projection(e);return r?[r[0]-t.xaxis._offset,r[1]-t.yaxis._offset]:[null,null]},t.xaxis={_id:"x",c2p:function(e){return t.project(e)[0]}},t.yaxis={_id:"y",c2p:function(e){return t.project(e)[1]}},t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(t.mockAxis,r)},S.saveViewInitial=function(t){var e,r=t.center||{},n=t.projection,i=n.rotation||{};this.viewInitial={fitbounds:t.fitbounds,"projection.scale":n.scale},e=t._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:t._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},c.extendFlat(this.viewInitial,e)},S.render=function(t){this._hasMarkerAngles&&t?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},S._render=function(){var t,e=this.projection,r=e.getPath();function n(t){var r=e(t.lonlat);return r?u(r[0],r[1]):null}function i(t){return e.isLonLatOverEdges(t.lonlat)?"none":null}for(t in this.basePaths)this.basePaths[t].attr("d",r);for(t in this.dataPaths)this.dataPaths[t].attr("d",(function(t){return r(t.geojson)}));for(t in this.dataPoints)this.dataPoints[t].attr("display",i).attr("transform",n)}},{"../../components/color":367,"../../components/dragelement":386,"../../components/drawing":389,"../../components/fx":407,"../../components/selections":455,"../../lib":515,"../../lib/geo_location_utils":508,"../../lib/topojson_utils":544,"../../registry":647,"../cartesian/autorange":565,"../cartesian/axes":566,"../plots":628,"./constants":596,"./zoom":601,"@plotly/d3":58,"d3-geo":114,"d3-geo-projection":113,"topojson-client":316}],598:[function(t,e,r){"use strict";var n=t("../../plots/get_data").getSubplotCalcData,i=t("../../lib").counterRegex,a=t("./geo"),o="geo",s=i(o),l={};l.geo={valType:"subplotid",dflt:o,editType:"calc"},e.exports={attr:o,name:o,idRoot:o,idRegex:s,attrRegex:s,attributes:l,layoutAttributes:t("./layout_attributes"),supplyLayoutDefaults:t("./layout_defaults"),plot:function(t){for(var e=t._fullLayout,r=t.calcdata,i=e._subplots.geo,s=0;s0&&P<0&&(P+=360);var I,O,z,D=(C+P)/2;if(!p){var R=d?f.projRotate:[D,0,0];I=r("projection.rotation.lon",R[0]),r("projection.rotation.lat",R[1]),r("projection.rotation.roll",R[2]),r("showcoastlines",!d&&x)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean",!!x&&void 0)&&r("oceancolor")}(p?(O=-96.6,z=38.7):(O=d?D:I,z=(L[0]+L[1])/2),r("center.lon",O),r("center.lat",z),m&&(r("projection.tilt"),r("projection.distance")),g)&&r("projection.parallels",f.projParallels||[0,60]);r("projection.scale"),r("showland",!!x&&void 0)&&r("landcolor"),r("showlakes",!!x&&void 0)&&r("lakecolor"),r("showrivers",!!x&&void 0)&&(r("rivercolor"),r("riverwidth")),r("showcountries",d&&"usa"!==u&&x)&&(r("countrycolor"),r("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(r("showsubunits",x),r("subunitcolor"),r("subunitwidth")),d||r("showframe",x)&&(r("framecolor"),r("framewidth")),r("bgcolor"),r("fitbounds")&&(delete e.projection.scale,d?(delete e.center.lon,delete e.center.lat):v?(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon,delete e.projection.rotation.lat,delete e.lonaxis.range,delete e.lataxis.range):(delete e.center.lon,delete e.center.lat,delete e.projection.rotation.lon))}e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:s,handleDefaults:c,fullData:r,partition:"y"})}},{"../../lib":515,"../get_data":602,"../subplot_defaults":641,"./constants":596,"./layout_attributes":599}],601:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../registry"),o=Math.PI/180,s=180/Math.PI,l={cursor:"pointer"},c={cursor:"auto"};function u(t,e){return n.behavior.zoom().translate(e.translate()).scale(e.scale())}function f(t,e,r){var n=t.id,o=t.graphDiv,s=o.layout,l=s[n],c=o._fullLayout,u=c[n],f={},h={};function p(t,e){f[n+"."+t]=i.nestedProperty(l,t).get(),a.call("_storeDirectGUIEdit",s,c._preGUI,f);var r=i.nestedProperty(u,t);r.get()!==e&&(r.set(e),i.nestedProperty(l,t).set(e),h[n+"."+t]=e)}r(p),p("projection.scale",e.scale()/t.fitScale),p("fitbounds",!1),o.emit("plotly_relayout",h)}function h(t,e){var r=u(0,e);function i(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return r.on("zoomstart",(function(){n.select(this).style(l)})).on("zoom",(function(){e.scale(n.event.scale).translate(n.event.translate),t.render(!0);var r=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":r[0],"geo.center.lat":r[1]})})).on("zoomend",(function(){n.select(this).style(c),f(t,e,i)})),r}function p(t,e){var r,i,a,o,s,h,p,d,m,g=u(0,e);function v(t){return e.invert(t)}function y(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){n.select(this).style(l),r=n.mouse(this),i=e.rotate(),a=e.translate(),o=i,s=v(r)})).on("zoom",(function(){if(h=n.mouse(this),function(t){var r=v(t);if(!r)return!0;var n=e(r);return Math.abs(n[0]-t[0])>2||Math.abs(n[1]-t[1])>2}(r))return g.scale(e.scale()),void g.translate(e.translate());e.scale(n.event.scale),e.translate([a[0],n.event.translate[1]]),s?v(h)&&(d=v(h),p=[o[0]+(d[0]-s[0]),i[1],i[2]],e.rotate(p),o=p):s=v(r=h),m=!0,t.render(!0);var l=e.rotate(),c=e.invert(t.midPt);t.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":e.scale()/t.fitScale,"geo.center.lon":c[0],"geo.center.lat":c[1],"geo.projection.rotation.lon":-l[0]})})).on("zoomend",(function(){n.select(this).style(c),m&&f(t,e,y)})),g}function d(t,e){var r,i={r:e.rotate(),k:e.scale()},a=u(0,e),o=function(t){var e=0,r=arguments.length,i=[];for(;++ed?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/d)*s-p,i=Math.sqrt(d*d-f*f));var m=180-a-2*p,g=(Math.atan2(h,u)-Math.atan2(c,i))*s,v=(Math.atan2(h,u)-Math.atan2(c,-i))*s;return b(r[0],r[1],a,g)<=b(r[0],r[1],m,v)?[a,g,r[2]]:[m,v,r[2]]}function b(t,e,r,n){var i=_(r-t),a=_(n-e);return Math.sqrt(i*i+a*a)}function _(t){return(t%360+540)%360-180}function w(t,e,r){var n=r*o,i=t.slice(),a=0===e?1:0,s=2===e?1:2,l=Math.cos(n),c=Math.sin(n);return i[a]=t[a]*l-t[s]*c,i[s]=t[s]*l+t[a]*c,i}function T(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*s,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*s,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*s]}function k(t,e){for(var r=0,n=0,i=t.length;nMath.abs(s)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(a)*_*(s>=0?1:-1),c.boxEnd[1]l[3]&&(c.boxEnd[1]=l[3],c.boxEnd[0]=c.boxStart[0]+(l[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(s)/_*(a>=0?1:-1),c.boxEnd[0]l[2]&&(c.boxEnd[0]=l[2],c.boxEnd[1]=c.boxStart[1]+(l[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(a=c.boxStart[0]!==c.boxEnd[0],s=c.boxStart[1]!==c.boxEnd[1],a||s?(a&&(g(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),s&&(g(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,e?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n).999&&(m="turntable"):m="turntable")}else m="turntable";r("dragmode",m),r("hovermode",n.getDfltFromLayout("hovermode"))}e.exports=function(t,e,r){var i=e._basePlotModules.length>1;o(t,e,r,{type:"gl3d",attributes:l,handleDefaults:u,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!i)return n.validate(t[e],l[e])?t[e]:void 0},autotypenumbersDflt:e.autotypenumbers,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":367,"../../../lib":515,"../../../registry":647,"../../get_data":602,"../../subplot_defaults":641,"./axis_defaults":610,"./layout_attributes":613}],613:[function(t,e,r){"use strict";var n=t("./axis_attributes"),i=t("../../domain").attributes,a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;function s(t,e,r){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:e,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(s(0,0,1),{}),center:a(s(0,0,0),{}),eye:a(s(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:i({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:n,yaxis:n,zaxis:n,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":515,"../../../lib/extend":505,"../../domain":593,"./axis_attributes":609}],614:[function(t,e,r){"use strict";var n=t("../../../lib/str2rgbarray"),i=["xaxis","yaxis","zaxis"];function a(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}a.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[i[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=n(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new a;return e.merge(t),e}},{"../../../lib/str2rgbarray":540}],615:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,s=t.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[a[c]];if(u._length=(r[c].hi-r[c].lo)*r[c].pixelsPerDataUnit/t.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=r[c].lo/t.dataScale[c],u.range[1]=r[c].hi/t.dataScale[c],u._m=1/(t.dataScale[c]*r[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var f=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var h=u.nticks||i.constrain(u._length/40,4,9);n.autoTicks(u,Math.abs(u.range[1]-u.range[0])/h)}for(var p=n.calcTicks(u,{msUTC:!0}),d=0;d/g," "));l[c]=p,u.tickmode=f}}e.ticks=l;for(c=0;c<3;++c){o[c]=.5*(t.glplot.bounds[0][c]+t.glplot.bounds[1][c]);for(d=0;d<2;++d)e.bounds[d][c]=t.glplot.bounds[d][c]}t.contourLevels=function(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=t.glplot.getAspectratio();t.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(t)}}),!!c&&{passive:!1}),t.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==t.fullSceneLayout.dragmode&&0!==t.camera.mouseListener.buttons){var e=n();t.graphDiv.emit("plotly_relayouting",e)}})),t.staticMode||t.glplot.canvas.addEventListener("webglcontextlost",(function(r){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:r,layer:t.id})}),!1)),t.glplot.oncontextloss=function(){t.recoverContext()},t.glplot.onrender=function(){t.render()},!0},w.render=function(){var t,e=this,r=e.graphDiv,n=e.svgContainer,i=e.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),b(e),e.glplot.axes.update(e.axesOptions);for(var c=Object.keys(e.traces),u=null,h=e.glplot.selection,m=0;m")):"isosurface"===t.type||"volume"===t.type?(T.valueLabel=p.hoverLabelText(e._mockAxis,e._mockAxis.d2l(h.traceCoordinate[3]),t.valuehoverformat),S.push("value: "+T.valueLabel),h.textLabel&&S.push(h.textLabel),x=S.join("
")):x=h.textLabel;var E={x:h.traceCoordinate[0],y:h.traceCoordinate[1],z:h.traceCoordinate[2],data:_._input,fullData:_,curveNumber:_.index,pointNumber:w};d.appendArrayPointValue(E,_,w),t._module.eventData&&(E=_._module.eventData(E,h,_,{},w));var L={points:[E]};if(e.fullSceneLayout.hovermode){var C=[];d.loneHover({trace:_,x:(.5+.5*y[0]/y[3])*s,y:(.5-.5*y[1]/y[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:x,name:u.name,color:d.castHoverOption(_,w,"bgcolor")||u.color,borderColor:d.castHoverOption(_,w,"bordercolor"),fontFamily:d.castHoverOption(_,w,"font.family"),fontSize:d.castHoverOption(_,w,"font.size"),fontColor:d.castHoverOption(_,w,"font.color"),nameLength:d.castHoverOption(_,w,"namelength"),textAlign:d.castHoverOption(_,w,"align"),hovertemplate:f.castOption(_,w,"hovertemplate"),hovertemplateLabels:f.extendFlat({},E,T),eventData:[E]},{container:n,gd:r,inOut_bbox:C}),E.bbox=C[0]}h.buttons&&h.distance<5?r.emit("plotly_click",L):r.emit("plotly_hover",L),this.oldEventData=L}else d.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;e.drawAnnotations(e)},w.recoverContext=function(){var t=this;t.glplot.dispose();var e=function(){t.glplot.gl.isContextLost()?requestAnimationFrame(e):t.initializeGLPlot()?t.plot.apply(t,t.plotArgs):f.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(e)};var k=["xaxis","yaxis","zaxis"];function A(t,e,r){for(var n=t.fullSceneLayout,i=0;i<3;i++){var a=k[i],o=a.charAt(0),s=n[a],l=e[o],c=e[o+"calendar"],u=e["_"+o+"length"];if(f.isArrayOrTypedArray(l))for(var h,p=0;p<(u||l.length);p++)if(f.isArrayOrTypedArray(l[p]))for(var d=0;dg[1][a])g[0][a]=-1,g[1][a]=1;else{var L=g[1][a]-g[0][a];g[0][a]-=L/32,g[1][a]+=L/32}if("reversed"===s.autorange){var C=g[0][a];g[0][a]=g[1][a],g[1][a]=C}}else{var P=s.range;g[0][a]=s.r2l(P[0]),g[1][a]=s.r2l(P[1])}g[0][a]===g[1][a]&&(g[0][a]-=1,g[1][a]+=1),v[a]=g[1][a]-g[0][a],this.glplot.setBounds(a,{min:g[0][a]*h[a],max:g[1][a]*h[a]})}var I=c.aspectmode;if("cube"===I)d=[1,1,1];else if("manual"===I){var O=c.aspectratio;d=[O.x,O.y,O.z]}else{if("auto"!==I&&"data"!==I)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=[1,1,1];for(a=0;a<3;++a){var D=y[l=(s=c[k[a]]).type];z[a]=Math.pow(D.acc,1/D.count)/h[a]}d="data"===I||Math.max.apply(null,z)/Math.min.apply(null,z)<=4?z:[1,1,1]}c.aspectratio.x=u.aspectratio.x=d[0],c.aspectratio.y=u.aspectratio.y=d[1],c.aspectratio.z=u.aspectratio.z=d[2],this.glplot.setAspectratio(c.aspectratio),this.viewInitial.aspectratio||(this.viewInitial.aspectratio={x:c.aspectratio.x,y:c.aspectratio.y,z:c.aspectratio.z}),this.viewInitial.aspectmode||(this.viewInitial.aspectmode=c.aspectmode);var R=c.domain||null,F=e._size||null;if(R&&F){var B=this.container.style;B.position="absolute",B.left=F.l+R.x[0]*F.w+"px",B.top=F.t+(1-R.y[1])*F.h+"px",B.width=F.w*(R.x[1]-R.x[0])+"px",B.height=F.h*(R.y[1]-R.y[0])+"px"}this.glplot.redraw()}},w.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},w.getCamera=function(){var t;return this.camera.view.recalcMatrix(this.camera.view.lastT()),{up:{x:(t=this.camera).up[0],y:t.up[1],z:t.up[2]},center:{x:t.center[0],y:t.center[1],z:t.center[2]},eye:{x:t.eye[0],y:t.eye[1],z:t.eye[2]},projection:{type:!0===t._ortho?"orthographic":"perspective"}}},w.setViewport=function(t){var e,r=t.camera;this.camera.lookAt.apply(this,[[(e=r).eye.x,e.eye.y,e.eye.z],[e.center.x,e.center.y,e.center.z],[e.up.x,e.up.y,e.up.z]]),this.glplot.setAspectratio(t.aspectratio),"orthographic"===r.projection.type!==this.camera._ortho&&(this.glplot.redraw(),this.glplot.clearRGBA(),this.glplot.dispose(),this.initializeGLPlot())},w.isCameraChanged=function(t){var e=this.getCamera(),r=f.nestedProperty(t,this.id+".camera").get();function n(t,e,r,n){var i=["up","center","eye"],a=["x","y","z"];return e[i[r]]&&t[i[r]][a[n]]===e[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(e,r,a,o)){i=!0;break}(!r.projection||e.projection&&e.projection.type!==r.projection.type)&&(i=!0)}return i},w.isAspectChanged=function(t){var e=this.glplot.getAspectratio(),r=f.nestedProperty(t,this.id+".aspectratio").get();return void 0===r||r.x!==e.x||r.y!==e.y||r.z!==e.z},w.saveLayout=function(t){var e,r,n,i,a,o,s=this.fullLayout,l=this.isCameraChanged(t),c=this.isAspectChanged(t),h=l||c;if(h){var p={};if(l&&(e=this.getCamera(),n=(r=f.nestedProperty(t,this.id+".camera")).get(),p[this.id+".camera"]=n),c&&(i=this.glplot.getAspectratio(),o=(a=f.nestedProperty(t,this.id+".aspectratio")).get(),p[this.id+".aspectratio"]=o),u.call("_storeDirectGUIEdit",t,s._preGUI,p),l)r.set(e),f.nestedProperty(s,this.id+".camera").set(e);if(c)a.set(i),f.nestedProperty(s,this.id+".aspectratio").set(i),this.glplot.redraw()}return h},w.updateFx=function(t,e){var r=this.camera;if(r)if("orbit"===t)r.mode="orbit",r.keyBindingMode="rotate";else if("turntable"===t){r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate";var n=this.graphDiv,i=n._fullLayout,a=this.fullSceneLayout.camera,o=a.up.x,s=a.up.y,l=a.up.z;if(l/Math.sqrt(o*o+s*s+l*l)<.999){var c=this.id+".camera.up",h={x:0,y:0,z:1},p={};p[c]=h;var d=n.layout;u.call("_storeDirectGUIEdit",d,i._preGUI,p),a.up=h,f.nestedProperty(d,c).set(h)}}else r.keyBindingMode=t;this.fullSceneLayout.hovermode=e},w.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(n),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,i=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var a=new Uint8Array(r*i*4);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a),function(t,e,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)t[a+l]=Math.min(s*t[a+l],255)}}(a,r,i);var o=document.createElement("canvas");o.width=r,o.height=i;var s,l=o.getContext("2d",{willReadFrequently:!0}),c=l.createImageData(r,i);switch(c.data.set(a),l.putImageData(c,0,0),t){case"jpeg":s=o.toDataURL("image/jpeg");break;case"webp":s=o.toDataURL("image/webp");break;default:s=o.toDataURL("image/png")}return this.staticMode&&this.container.removeChild(n),s},w.setConvert=function(){for(var t=0;t<3;t++){var e=this.fullSceneLayout[k[t]];p.setConvert(e,this.fullLayout),e.setScale=f.noop}},w.make4thDimension=function(){var t=this.graphDiv._fullLayout;this._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(this._mockAxis,t)},e.exports=_},{"../../../stackgl_modules":1133,"../../components/fx":407,"../../lib":515,"../../lib/show_no_webgl_msg":537,"../../lib/str2rgbarray":540,"../../plots/cartesian/axes":566,"../../registry":647,"./layout/convert":611,"./layout/spikes":614,"./layout/tick_marks":615,"./project":616,"has-passive-events":229,"webgl-context":332}],618:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){n=n||t.length;for(var i=new Array(n),a=0;aOpenStreetMap
contributors',a=['\xa9 Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}]},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}]},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}]},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}]},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}]},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}]},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),tiles:["https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}]}},l=n(s);e.exports={requiredVersion:"1.10.1",styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install mapbox-gl@1.10.1."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}},{"../../lib/sort_object_keys":538}],621:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r=t.split(" "),i=r[0],a=r[1],o=n.isArrayOrTypedArray(e)?n.mean(e):e,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}},{"../../lib":515}],622:[function(t,e,r){"use strict";var n=t("mapbox-gl/dist/mapbox-gl-unminified"),i=t("../../lib"),a=i.strTranslate,o=i.strScale,s=t("../../plots/get_data").getSubplotCalcData,l=t("../../constants/xmlns_namespaces"),c=t("@plotly/d3"),u=t("../../components/drawing"),f=t("../../lib/svg_text_utils"),h=t("./mapbox"),p=r.constants=t("./constants");function d(t){return"string"==typeof t&&(-1!==p.styleValuesMapbox.indexOf(t)||0===t.indexOf("mapbox://"))}r.name="mapbox",r.attr="subplot",r.idRoot="mapbox",r.idRegex=r.attrRegex=i.counterRegex("mapbox"),r.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},r.layoutAttributes=t("./layout_attributes"),r.supplyLayoutDefaults=t("./layout_defaults"),r.plot=function(t){var e=t._fullLayout,r=t.calcdata,a=e._subplots.mapbox;if(n.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var o=function(t,e){var r=t._fullLayout;if(""===t._context.mapboxAccessToken)return"";for(var n=[],a=[],o=!1,s=!1,l=0;l1&&i.warn(p.multipleTokensErrorMsg),n[0]):(a.length&&i.log(["Listed mapbox access token(s)",a.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(t,a);n.accessToken=o;for(var l=0;l_/2){var w=v.split("|").join("
");x.text(w).attr("data-unformatted",w).call(f.convertToTspans,t),b=u.bBox(x.node())}x.attr("transform",a(-3,8-b.height)),y.insert("rect",".static-attribution").attr({x:-b.width-6,y:-b.height-3,width:b.width+6,height:b.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;b.width+6>_&&(T=_/(b.width+6));var k=[n.l+n.w*h.x[1],n.t+n.h*(1-h.y[0])];y.attr("transform",a(k[0],k[1])+o(T))}},r.updateFx=function(t){for(var e=t._fullLayout,r=e._subplots.mapbox,n=0;n0){for(var r=0;r0}function u(t){var e={},r={};switch(t.type){case"circle":n.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":n.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity,"line-dasharray":t.line.dash});break;case"fill":n.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var i=t.symbol,o=a(i.textposition,i.iconsize);n.extendFlat(e,{"icon-image":i.icon+"-15","icon-size":i.iconsize/10,"text-field":i.text,"text-size":i.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":i.placement}),n.extendFlat(r,{"icon-color":t.color,"text-color":i.textfont.color,"text-opacity":t.opacity});break;case"raster":n.extendFlat(r,{"raster-fade-duration":0,"raster-opacity":t.opacity})}return{layout:e,paint:r}}l.update=function(t){this.visible?this.needsNewImage(t)?this.updateImage(t):this.needsNewSource(t)?(this.removeLayer(),this.updateSource(t),this.updateLayer(t)):this.needsNewLayer(t)?this.updateLayer(t):this.updateStyle(t):(this.updateSource(t),this.updateLayer(t)),this.visible=c(t)},l.needsNewImage=function(t){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===t.sourcetype&&(this.source!==t.source||JSON.stringify(this.coordinates)!==JSON.stringify(t.coordinates))},l.needsNewSource=function(t){return this.sourceType!==t.sourcetype||JSON.stringify(this.source)!==JSON.stringify(t.source)||this.layerType!==t.type},l.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},l.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},l.updateImage=function(t){this.subplot.map.getSource(this.idSource).updateImage({url:t.source,coordinates:t.coordinates});var e=this.findFollowingMapboxLayerId(this.lookupBelow());null!==e&&this.subplot.map.moveLayer(this.idLayer,e)},l.updateSource=function(t){var e=this.subplot.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,c(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,a={type:r};"geojson"===r?e="data":"vector"===r?e="string"==typeof n?"url":"tiles":"raster"===r?(e="tiles",a.tileSize=256):"image"===r&&(e="url",a.coordinates=t.coordinates);a[e]=n,t.sourceattribution&&(a.attribution=i(t.sourceattribution));return a}(t);e.addSource(this.idSource,r)}},l.findFollowingMapboxLayerId=function(t){if("traces"===t)for(var e=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&g(e.originalEvent,n,[r.xaxis],[r.yaxis],r.id,t),i.indexOf("event")>-1&&c.click(n,e.originalEvent)}}},b.updateFx=function(t){var e=this,r=e.map,n=e.gd;if(!e.isStatic){var a,o=t.dragmode;a=function(t,r){r.isRect?(t.range={})[e.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(t.lassoPoints={})[e.id]=r.map(c)};var s=e.dragOptions;e.dragOptions=i.extendDeep(s||{},{dragmode:t.dragmode,element:e.div,gd:n,plotinfo:{id:e.id,domain:t[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis,fillRangeItems:a},xaxes:[e.xaxis],yaxes:[e.yaxis],subplot:e.id}),r.off("click",e.onClickInPanHandler),h(o)||f(o)?(r.dragPan.disable(),r.on("zoomstart",e.clearOutline),e.dragOptions.prepFn=function(t,r,n){p(t,r,n,e.dragOptions,o)},l.init(e.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",e.clearOutline),e.div.onmousedown=null,e.div.ontouchstart=null,e.div.removeEventListener("touchstart",e.div._ontouchstart),e.onClickInPanHandler=e.onClickInPanFn(e.dragOptions),r.on("click",e.onClickInPanHandler))}function c(t){var r=e.map.unproject(t);return[r.lng,r.lat]}},b.updateFramework=function(t){var e=t[this.id].domain,r=t._size,n=this.div.style;n.width=r.w*(e.x[1]-e.x[0])+"px",n.height=r.h*(e.y[1]-e.y[0])+"px",n.left=r.l+e.x[0]*r.w+"px",n.top=r.t+(1-e.y[1])*r.h+"px",this.xaxis._offset=r.l+e.x[0]*r.w,this.xaxis._length=r.w*(e.x[1]-e.x[0]),this.yaxis._offset=r.t+(1-e.y[1])*r.h,this.yaxis._length=r.h*(e.y[1]-e.y[0])},b.updateLayers=function(t){var e,r=t[this.id].layers,n=this.layerList;if(r.length!==n.length){for(e=0;e=e.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=e._paper.attr("width")-7),r.attr(a);var o=r.select(".js-link-to-tool"),s=r.select(".js-link-spacer"),l=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(){b.sendDataToCloud(t)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(t,o),s.text(o.text()&&l.text()?" - ":"")}},b.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"),i=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=b.graphJson(t,!1,"keepdata"),i.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1}};var T=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],k=["year","month","dayMonth","dayMonthYear"];function A(t,e){var r=t._context.locale;r||(r="en-US");var n=!1,i={};function a(t){for(var r=!0,a=0;a1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,b.linkSubplots(h,l,f,n),b.cleanPlot(h,l,f,n);var N=!(!n._has||!n._has("gl2d")),j=!(!l._has||!l._has("gl2d")),U=!(!n._has||!n._has("cartesian"))||N,V=!(!l._has||!l._has("cartesian"))||j;U&&!V?n._bgLayer.remove():V&&!U&&(l._shouldCreateBgLayer=!0),n._zoomlayer&&!t._dragging&&d({_fullLayout:n}),function(t,e){var r,n=[];e.meta&&(r=e._meta={meta:e.meta,layout:{meta:e.meta}});for(var i=0;i0){var f=1-2*s;n=Math.round(f*n),i=Math.round(f*i)}}var h=b.layoutAttributes.width.min,p=b.layoutAttributes.height.min;n1,m=!e.height&&Math.abs(r.height-i)>1;(m||d)&&(d&&(r.width=n),m&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),b.sanitizeMargins(r)},b.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,l=s.componentsRegistry,c=e._basePlotModules,f=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(t,e);for(var h in c.length||c.push(f),e._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(t,e),f.finalizeSubplots(t,e)),e._subplots)e._subplots[h].sort(u.subplotSort);for(a=0;a1&&(r.l/=v,r.r/=v)}if(p){var y=(r.t+r.b)/p;y>1&&(r.t/=y,r.b/=y)}var x=void 0!==r.xl?r.xl:r.x,_=void 0!==r.xr?r.xr:r.x,w=void 0!==r.yt?r.yt:r.y,T=void 0!==r.yb?r.yb:r.y;d[e]={l:{val:x,size:r.l+g},r:{val:_,size:r.r+g},b:{val:T,size:r.b+g},t:{val:w,size:r.t+g}},m[e]=1}else delete d[e],delete m[e];if(!n._replotting)return b.doAutoMargin(t)}},b.doAutoMargin=function(t){var e=t._fullLayout,r=e.width,n=e.height;e._size||(e._size={}),C(e);var i=e._size,a=e.margin,l=u.extendFlat({},i),c=a.l,f=a.r,h=a.t,d=a.b,m=e._pushmargin,g=e._pushmarginIds,v=e.minreducedwidth,y=e.minreducedheight;if(!1!==e.margin.autoexpand){for(var x in m)g[x]||delete m[x];for(var _ in m.base={l:{val:0,size:c},r:{val:1,size:f},t:{val:1,size:h},b:{val:0,size:d}},m){var w=m[_].l||{},T=m[_].b||{},k=w.val,A=w.size,M=T.val,S=T.size;for(var E in m){if(o(A)&&m[E].r){var L=m[E].r.val,P=m[E].r.size;if(L>k){var I=(A*L+(P-r)*k)/(L-k),O=(P*(1-k)+(A-r)*(1-L))/(L-k);I+O>c+f&&(c=I,f=O)}}if(o(S)&&m[E].t){var z=m[E].t.val,D=m[E].t.size;if(z>M){var R=(S*z+(D-n)*M)/(z-M),F=(D*(1-M)+(S-n)*(1-z))/(z-M);R+F>d+h&&(d=R,h=F)}}}}}var B=u.constrain(r-a.l-a.r,2,v),N=u.constrain(n-a.t-a.b,2,y),j=Math.max(0,r-B),U=Math.max(0,n-N);if(j){var V=(c+f)/j;V>1&&(c/=V,f/=V)}if(U){var H=(d+h)/U;H>1&&(d/=H,h/=H)}if(i.l=Math.round(c),i.r=Math.round(f),i.t=Math.round(h),i.b=Math.round(d),i.p=Math.round(a.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!e._replotting&&b.didMarginChange(l,i)){"_redrawFromAutoMarginCount"in e?e._redrawFromAutoMarginCount++:e._redrawFromAutoMarginCount=1;var q=3*(1+Object.keys(g).length);if(e._redrawFromAutoMarginCount0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&t._transitionData._interruptCallbacks.push((function(){return s.call("redraw",t)})),t._transitionData._interruptCallbacks.push((function(){t.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){o++,n||o!==a||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 s.call("redraw",t)})).then((function(){t._transitioning=!1,t._transitioningWithDuration=!1,t.emit("plotly_transitioned",[])})).then(e)}(i)}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,t);return a&&a.then||(a=Promise.resolve()),a.then((function(){return t}))}b.didMarginChange=function(t,e){for(var r=0;r1)return!0}return!1},b.graphJson=function(t,e,r,n,i,a){(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&b.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames;function c(t,e){if("function"==typeof t)return e?"_function_":null;if(u.isPlainObject(t)){var n,i={};return Object.keys(t).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!=typeof t[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))return}else if("keepall"!==r&&"string"==typeof(n=t[a+"src"])&&n.indexOf(":")>0)return;i[a]=c(t[a],e)}else e&&(i[a]="_function")})),i}return Array.isArray(t)?t.map((function(t){return c(t,e)})):u.isTypedArray(t)?u.simpleMap(t,u.identity):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}var f={data:(o||[]).map((function(t){var r=c(t);return e&&delete r.fit,r}))};if(!e&&(f.layout=c(s),i)){var h=s._size;f.layout.computed={margin:{b:h.b,l:h.l,r:h.r,t:h.t}}}return l&&(f.frames=c(l)),a&&(f.config=c(t._context,!0)),"object"===n?f:JSON.stringify(f)},b.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(t,r))}Array.isArray(o)&&o[0]||(o=[{x:h,y:h}]),o[0].t||(o[0].t={}),o[0].trace=r,d[e]=o}}for(z(o,c,f),i=0;i1e-10?t:0}function h(t,e,r){e=e||0,r=r||0;for(var n=t.length,i=new Array(n),a=0;a0?r:1/0})),i=n.mod(r+1,e.length);return[e[r],e[i]]},findIntersectionXY:c,findXYatLength:function(t,e,r,n){var i=-e*r,a=e*e+1,o=2*(e*i-r),s=i*i+r*r-t*t,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,e*c+i+n],[u,e*u+i+n]]},clampTiny:f,pathPolygon:function(t,e,r,n,i,a){return"M"+h(u(t,e,r,n),i,a).join("L")},pathPolygonAnnulus:function(t,e,r,n,i,a,o){var s,l;t=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h);e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f);r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h);n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f);return[e,r,n,i]}(p),b=x[2]-x[0],_=x[3]-x[1],w=h/f,T=Math.abs(_/b);w>T?(d=f,y=(h-(m=f*T))/n.h/2,g=[o[0],o[1]],v=[s[0]+y,s[1]-y]):(m=h,y=(f-(d=h/T))/n.w/2,g=[o[0]+y,o[1]-y],v=[s[0],s[1]]),this.xLength2=d,this.yLength2=m,this.xDomain2=g,this.yDomain2=v;var k,A=this.xOffset2=n.l+n.w*g[0],M=this.yOffset2=n.t+n.h*(1-v[1]),S=this.radius=d/b,E=this.innerRadius=this.getHole(e)*S,L=this.cx=A-S*x[0],C=this.cy=M+S*x[3],P=this.cxx=L-A,I=this.cyy=C-M,O=i.side;"counterclockwise"===O?(k=O,O="top"):"clockwise"===O&&(k=O,O="bottom"),this.radialAxis=this.mockAxis(t,e,i,{_id:"x",side:O,_trueSide:k,domain:[E/n.w,S/n.w]}),this.angularAxis=this.mockAxis(t,e,a,{side:"right",domain:[0,Math.PI],autorange:!1}),this.doAutoRange(t,e),this.updateAngularAxis(t,e),this.updateRadialAxis(t,e),this.updateRadialAxisTitle(t,e),this.xaxis=this.mockCartesianAxis(t,e,{_id:"x",domain:g}),this.yaxis=this.mockCartesianAxis(t,e,{_id:"y",domain:v});var z=this.pathSubplot();this.clipPaths.forTraces.select("path").attr("d",z).attr("transform",l(P,I)),r.frontplot.attr("transform",l(A,M)).call(u.setClipUrl,this._hasClipOnAxisFalse?null:this.clipIds.forTraces,this.gd),r.bg.attr("d",z).attr("transform",l(L,C)).call(c.fill,e.bgcolor)},N.mockAxis=function(t,e,r,n){var i=o.extendFlat({},r,n);return d(i,e,t),i},N.mockCartesianAxis=function(t,e,r){var n=this,i=n.isSmith,a=r._id,s=o.extendFlat({type:"linear"},r);p(s,t);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var t=n.sectorBBox,r=l[a],i=n.radialAxis._rl,o=(i[1]-i[0])/(1-n.getHole(e));s.range=[t[r[0]]*o,t[r[1]]*o]},s.isPtWithinRange="x"!==a||i?function(){return!0}:function(t){return n.isPtInside(t)},s.setRange(),s.setScale(),s},N.doAutoRange=function(t,e){var r=this.gd,n=this.radialAxis,i=this.getRadial(e);m(r,n);var a=n.range;i.range=a.slice(),i._input.range=a.slice(),n._rl=[n.r2l(a[0],null,"gregorian"),n.r2l(a[1],null,"gregorian")]},N.updateRadialAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getRadial(e),m=D(r.getSector(e)[0],360),g=r.radialAxis,v=u90&&m<=270&&(g.tickangle=180);var x=y?function(t){var e=O(r,C([t.x,0]));return l(e[0]-f,e[1]-p)}:function(t){return l(g.l2p(t.x)+u,0)},b=y?function(t){return I(r,t.x,-1/0,1/0)}:function(t){return r.pathArc(g.r2p(t.x)+u)},_=j(d);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),v){g.setScale();var w=0,T=y?(g.tickvals||[]).filter((function(t){return t>=0})).map((function(t){return h.tickText(g,t,!0,!1)})):h.calcTicks(g),k=y?T:h.clipEnds(g,T),A=h.getTickSigns(g)[2];y&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(A=-A),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:T,layer:i["radial-axis"],path:h.makeTickPath(g,0,A),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:k,layer:i["radial-grid"],path:b,transFn:o.noop,crisp:!1}),h.drawLabels(n,g,{vals:T,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var M=r.radialAxisAngle=r.vangles?F(U(R(d.angle),r.vangles)):d.angle,S=l(f,p),E=S+s(-M);V(i["radial-axis"],v&&(d.showticklabels||d.ticks),{transform:E}),V(i["radial-grid"],v&&d.showgrid,{transform:y?"":S}),V(i["radial-line"].select("line"),v&&d.showline,{x1:y?-a:u,y1:0,x2:a,y2:0,transform:E}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},N.updateRadialAxisTitle=function(t,e,r){if(!this.isSmith){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=this.getRadial(e),l=this.id+"title",c=0;if(s.title){var f=u.bBox(this.layers["radial-axis"].node()).height,h=s.title.font.size,p=s.side;c="top"===p?h:"counterclockwise"===p?-(f+.4*h):f+.8*h}var d=void 0!==r?r:this.radialAxisAngle,m=R(d),g=Math.cos(m),v=Math.sin(m),y=a+i/2*g+c*v,b=o-i/2*v+c*g;this.layers["radial-axis-title"]=x.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:z(n,"Click to enter radial axis title"),attributes:{x:y,y:b,"text-anchor":"middle"},transform:{rotate:-d}})}},N.updateAngularAxis=function(t,e){var r=this,n=r.gd,i=r.layers,a=r.radius,u=r.innerRadius,f=r.cx,p=r.cy,d=r.getAngular(e),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",d.rotation),m.setGeometry(),m.setScale());var v=g?function(t){var e=O(r,C([0,t.x]));return Math.atan2(e[0]-f,e[1]-p)-Math.PI/2}:function(t){return m.t2g(t.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=F(m.tick0),m.dtick=F(m.dtick));var y=function(t){return l(f+a*Math.cos(t),p-a*Math.sin(t))},x=g?function(t){var e=O(r,C([0,t.x]));return l(e[0],e[1])}:function(t){return y(v(t))},b=g?function(t){var e=O(r,C([0,t.x])),n=Math.atan2(e[0]-f,e[1]-p)-Math.PI/2;return l(e[0],e[1])+s(-F(n))}:function(t){var e=v(t);return y(e)+s(-F(e))},_=g?function(t){return P(r,t.x,0,1/0)}:function(t){var e=v(t),r=Math.cos(e),n=Math.sin(e);return"M"+[f+u*r,p-u*n]+"L"+[f+a*r,p-a*n]},w=h.makeLabelFns(m,0).labelStandoff,T={xFn:function(t){var e=v(t);return Math.cos(e)*w},yFn:function(t){var e=v(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(w+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*M)},anchorFn:function(t){var e=v(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(t,e,r){var n=v(t);return-.5*(1+Math.sin(n))*r}},k=j(d);r.angularTickLayout!==k&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=k);var A,S=g?[1/0].concat(m.tickvals||[]).map((function(t){return h.tickText(m,t,!0,!1)})):h.calcTicks(m);if(g&&(S[0].text="\u221e",S[0].fontSize*=1.75),"linear"===e.gridshape?(A=S.map(v),o.angleDelta(A[0],A[1])<0&&(A=A.slice().reverse())):A=null,r.vangles=A,"category"===m.type&&(S=S.filter((function(t){return o.isAngleInsideSector(v(t),r.sectorInRad)}))),m.visible){var E="inside"===m.ticks?-1:1,L=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:S,layer:i["angular-axis"],path:"M"+E*L+",0h"+E*m.ticklen,transFn:b,crisp:!1}),h.drawGrid(n,m,{vals:S,layer:i["angular-grid"],path:_,transFn:o.noop,crisp:!1}),h.drawLabels(n,m,{vals:S,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:T})}V(i["angular-line"].select("path"),d.showline,{d:r.pathSubplot(),transform:l(f,p)}).attr("stroke-width",d.linewidth).call(c.stroke,d.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(t),this.updateRadialDrag(t,e,0),this.updateRadialDrag(t,e,1)),this.updateHoverAndMainDrag(t))},N.updateHoverAndMainDrag=function(t){var e,r,s=this,c=s.isSmith,u=s.gd,f=s.layers,h=t._zoomlayer,p=S.MINZOOM,d=S.OFFEDGE,m=s.radius,x=s.innerRadius,T=s.cx,k=s.cy,A=s.cxx,M=s.cyy,L=s.sectorInRad,C=s.vangles,P=s.radialAxis,I=E.clampTiny,O=E.findXYatLength,z=E.findEnclosingVertexAngles,D=S.cornerHalfWidth,R=S.cornerLen/2,F=g.makeDragger(f,"path","maindrag",!1===t.dragmode?"none":"crosshair");n.select(F).attr("d",s.pathSubplot()).attr("transform",l(T,k)),F.onmousemove=function(t){y.hover(u,t,s.id),u._fullLayout._lasthover=F,u._fullLayout._hoversubplot=s.id},F.onmouseout=function(t){u._dragging||v.unhover(u,t)};var B,N,j,U,V,H,q,G,Y,W={element:F,gd:u,subplot:s.id,plotinfo:{id:s.id,xaxis:s.xaxis,yaxis:s.yaxis},xaxes:[s.xaxis],yaxes:[s.yaxis]};function Z(t,e){return Math.sqrt(t*t+e*e)}function X(t,e){return Z(t-A,e-M)}function J(t,e){return Math.atan2(M-e,t-A)}function K(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function Q(t,e){if(0===t)return s.pathSector(2*D);var r=R/t,n=e-r,i=e+r,a=Math.max(0,Math.min(t,m)),o=a-D,l=a+D;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(l,i)+"A"+[l,l]+" 0,0,1 "+K(l,n)+"Z"}function $(t,e,r){if(0===t)return s.pathSector(2*D);var n,i,a=K(t,e),o=K(t,r),l=I((a[0]+o[0])/2),c=I((a[1]+o[1])/2);if(l&&c){var u=c/l,f=-1/u,h=O(D,u,l,c);n=O(R,f,h[0][0],h[0][1]),i=O(R,f,h[1][0],h[1][1])}else{var p,d;c?(p=R,d=D):(p=D,d=R),n=[[l-p,c-d],[l+p,c-d]],i=[[l-p,c+d],[l+p,c+d]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function tt(t,e){return e=Math.max(Math.min(e,m),x),tp?(t-1&&1===t&&_(e,u,[s.xaxis],[s.yaxis],s.id,W),r.indexOf("event")>-1&&y.click(u,e,s.id)}W.prepFn=function(t,n,a){var l=u._fullLayout.dragmode,f=F.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var p=u._fullLayout._invTransform;e=u._fullLayout._invScaleX,r=u._fullLayout._invScaleY;var d=o.apply3DTransform(p)(n-f.left,a-f.top);if(B=d[0],N=d[1],C){var v=E.findPolygonOffset(m,L[0],L[1],C);B+=A+v[0],N+=M+v[1]}switch(l){case"zoom":W.clickFn=st,c||(W.moveFn=C?it:rt,W.doneFn=at,function(){j=null,U=null,V=s.pathSubplot(),H=!1;var t=u._fullLayout[s.id];q=i(t.bgcolor).getLuminance(),(G=g.makeZoombox(h,q,T,k,V)).attr("fill-rule","evenodd"),Y=g.makeCorners(h,T,k),w(u)}());break;case"select":case"lasso":b(t,n,a,W,l)}},v.init(W)},N.updateRadialDrag=function(t,e,r){var i=this,c=i.gd,u=i.layers,f=i.radius,h=i.innerRadius,p=i.cx,d=i.cy,m=i.radialAxis,y=S.radialDragBoxSize,x=y/2;if(m.visible){var b,_,T,M=R(i.radialAxisAngle),E=m._rl,L=E[0],C=E[1],P=E[r],I=.75*(E[1]-E[0])/(1-i.getHole(e))/f;r?(b=p+(f+x)*Math.cos(M),_=d-(f+x)*Math.sin(M),T="radialdrag"):(b=p+(h-x)*Math.cos(M),_=d-(h-x)*Math.sin(M),T="radialdrag-inner");var O,z,D,B=g.makeRectDragger(u,T,"crosshair",-x,-x,y,y),N={element:B,gd:c};!1===t.dragmode&&(N.dragmode=!1),V(n.select(B),m.visible&&h0==(r?D>L:Dn?function(t){return t<=0}:function(t){return t>=0};t.c2g=function(r){var n=t.c2l(r)-e;return(s(n)?n:0)+o},t.g2c=function(r){return t.l2c(r+e-o)},t.g2p=function(t){return t*a},t.c2p=function(e){return t.g2p(t.c2g(e))}}}(t,e);break;case"angularaxis":!function(t,e){var r=t.type;if("linear"===r){var i=t.d2c,s=t.c2d;t.d2c=function(t,e){return function(t,e){return"degrees"===e?a(t):t}(i(t),e)},t.c2d=function(t,e){return s(function(t,e){return"degrees"===e?o(t):t}(t,e))}}t.makeCalcdata=function(e,i){var a,o,s=e[i],l=e._length,c=function(r){return t.d2c(r,e.thetaunit)};if(s){if(n.isTypedArray(s)&&"linear"===r){if(l===s.length)return s;if(s.subarray)return s.subarray(0,l)}for(a=new Array(l),o=0;o0?1:0}function i(t){var e=t[0],r=t[1];if(!isFinite(e)||!isFinite(r))return[1,0];var n=(e+1)*(e+1)+r*r;return[(e*e+r*r-1)/n,2*r/n]}function a(t,e){var r=e[0],n=e[1];return[r*t.radius+t.cx,-n*t.radius+t.cy]}function o(t,e){return e*t.radius}e.exports={smith:i,reactanceArc:function(t,e,r,n){var s=a(t,i([r,e])),l=s[0],c=s[1],u=a(t,i([n,e])),f=u[0],h=u[1];if(0===e)return["M"+l+","+c,"L"+f+","+h].join(" ");var p=o(t,1/Math.abs(e));return["M"+l+","+c,"A"+p+","+p+" 0 0,"+(e<0?1:0)+" "+f+","+h].join(" ")},resistanceArc:function(t,e,r,s){var l=o(t,1/(e+1)),c=a(t,i([e,r])),u=c[0],f=c[1],h=a(t,i([e,s])),p=h[0],d=h[1];if(n(r)!==n(s)){var m=a(t,i([e,0]));return["M"+u+","+f,"A"+l+","+l+" 0 0,"+(00){for(var n=[],i=0;i=u&&(h.min=0,d.min=0,g.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}function m(t,e,r,n){var i=h[e._name];function o(r,n){return a.coerce(t,e,i,r,n)}o("uirevision",n.uirevision),e.type="linear";var p=o("color"),d=p!==i.color.dflt?p:r.font.color,m=e._name.charAt(0).toUpperCase(),g="Component "+m,v=o("title.text",g);e._hovertitle=v===g?v:m,a.coerceFont(o,"title.font",{family:r.font.family,size:a.bigFont(r.font.size),color:d}),o("min"),u(t,e,o,"linear"),l(t,e,o,"linear"),s(t,e,o,"linear"),c(t,e,o,{outerTicks:!0}),o("showticklabels")&&(a.coerceFont(o,"tickfont",{family:r.font.family,size:r.font.size,color:d}),o("tickangle"),o("tickformat")),f(t,e,o,{dfltColor:p,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:i}),o("hoverformat"),o("layer")}e.exports=function(t,e,r){o(t,e,r,{type:"ternary",attributes:h,handleDefaults:d,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../components/color":367,"../../lib":515,"../../plot_api/plot_template":555,"../cartesian/line_grid_defaults":581,"../cartesian/prefix_suffix_defaults":583,"../cartesian/tick_label_defaults":587,"../cartesian/tick_mark_defaults":588,"../cartesian/tick_value_defaults":589,"../subplot_defaults":641,"./layout_attributes":644}],646:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("tinycolor2"),a=t("../../registry"),o=t("../../lib"),s=o.strTranslate,l=o._,c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,p=t("../plots"),d=t("../cartesian/axes"),m=t("../../components/dragelement"),g=t("../../components/fx"),v=t("../../components/dragelement/helpers"),y=v.freeMode,x=v.rectMode,b=t("../../components/titles"),_=t("../../components/selections").prepSelect,w=t("../../components/selections").selectOnClick,T=t("../../components/selections").clearOutline,k=t("../../components/selections").clearSelectionsCache,A=t("../cartesian/constants");function M(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=M;var S=M.prototype;S.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},S.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iE*b?i=(a=b)*E:a=(i=x)/E,o=v*i/x,l=y*a/b,r=e.l+e.w*m-i/2,n=e.t+e.h*(1-g)-a/2,p.x0=r,p.y0=n,p.w=i,p.h=a,p.sum=_,p.xaxis={type:"linear",range:[w+2*k-_,_-w-2*T],domain:[m-o/2,m+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:[g-l/2,g+l/2],_id:"y"},f(p.yaxis,p.graphDiv._fullLayout),p.yaxis.setScale(),p.yaxis.isPtWithinRange=function(){return!0};var A=p.yaxis.domain[0],M=p.aaxis=h({},t.aaxis,{range:[w,_-T-k],side:"left",tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+l*E],anchor:"free",position:0,_id:"y",_length:i});f(M,p.graphDiv._fullLayout),M.setScale();var S=p.baxis=h({},t.baxis,{range:[_-w-k,T],side:"bottom",domain:p.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});f(S,p.graphDiv._fullLayout),S.setScale();var L=p.caxis=h({},t.caxis,{range:[_-w-T,k],side:"right",tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+l*E],anchor:"free",position:0,_id:"y",_length:i});f(L,p.graphDiv._fullLayout),L.setScale();var C="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDef.select("path").attr("d",C),p.layers.plotbg.select("path").attr("d",C);var P="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";p.clipDefRelative.select("path").attr("d",P);var I=s(r,n);p.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),p.clipDefRelative.select("path").attr("transform",null);var O=s(r-S._offset,n+a);p.layers.baxis.attr("transform",O),p.layers.bgrid.attr("transform",O);var z=s(r+i/2,n)+"rotate(30)"+s(0,-M._offset);p.layers.aaxis.attr("transform",z),p.layers.agrid.attr("transform",z);var D=s(r+i/2,n)+"rotate(-30)"+s(0,-L._offset);p.layers.caxis.attr("transform",D),p.layers.cgrid.attr("transform",D),p.drawAxes(!0),p.layers.aline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),p.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),p.layers.cline.select("path").attr("d",L.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,L.linecolor||"#000").style("stroke-width",(L.linewidth||0)+"px"),p.graphDiv._context.staticPlot||p.initInteractions(),u.setClipUrl(p.layers.frontplot,p._hasClipOnAxisFalse?null:p.clipId,p.graphDiv)},S.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.layers,i=this.aaxis,a=this.baxis,o=this.caxis;if(this.drawAx(i),this.drawAx(a),this.drawAx(o),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0)),c=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;n["a-title"]=b.draw(e,"a"+r,{propContainer:i,propName:this.id+".aaxis.title",placeholder:l(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-i.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=b.draw(e,"b"+r,{propContainer:a,propName:this.id+".baxis.title",placeholder:l(e,"Click to enter Component B title"),attributes:{x:this.x0-c,y:this.y0+this.h+.83*a.title.font.size+c,"text-anchor":"middle"}}),n["c-title"]=b.draw(e,"c"+r,{propContainer:o,propName:this.id+".caxis.title",placeholder:l(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"}})}},S.drawAx=function(t){var e,r=this.graphDiv,n=t._name,i=n.charAt(0),a=t._id,s=this.layers[n],l=i+"tickLayout",c=(e=t).ticks+String(e.ticklen)+String(e.showticklabels);this[l]!==c&&(s.selectAll("."+a+"tick").remove(),this[l]=c),t.setScale();var u=d.calcTicks(t),f=d.clipEnds(t,u),h=d.makeTransTickFn(t),p=d.getTickSigns(t)[2],m=o.deg2rad(30),g=p*(t.linewidth||1)/2,v=p*t.ticklen,y=this.w,x=this.h,b="b"===i?"M0,"+g+"l"+Math.sin(m)*v+","+Math.cos(m)*v:"M"+g+",0l"+Math.cos(m)*v+","+-Math.sin(m)*v,_={a:"M0,0l"+x+",-"+y/2,b:"M0,0l-"+y/2+",-"+x,c:"M0,0l-"+x+","+y/2}[i];d.drawTicks(r,t,{vals:"inside"===t.ticks?f:u,layer:s,path:b,transFn:h,crisp:!1}),d.drawGrid(r,t,{vals:f,layer:this.layers[i+"grid"],path:_,transFn:h,crisp:!1}),d.drawLabels(r,t,{vals:u,layer:s,transFn:h,labelFns:d.makeLabelFns(t,0,30)})};var L=A.MINZOOM/2+.87,C="m-0.87,.5h"+L+"v3h-"+(L+5.2)+"l"+(L/2+2.6)+",-"+(.87*L+4.5)+"l2.6,1.5l-"+L/2+","+.87*L+"Z",P="m0.87,.5h-"+L+"v3h"+(L+5.2)+"l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-2.6,1.5l"+L/2+","+.87*L+"Z",I="m0,1l"+L/2+","+.87*L+"l2.6,-1.5l-"+(L/2+2.6)+",-"+(.87*L+4.5)+"l-"+(L/2+2.6)+","+(.87*L+4.5)+"l2.6,1.5l"+L/2+",-"+.87*L+"Z",O=!0;function z(t){n.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}S.clearOutline=function(){k(this.dragOptions),T(this.dragOptions.gd)},S.initInteractions=function(){var t,e,r,n,f,h,p,d,v,b,T,k,M=this,S=M.layers.plotbg.select("path").node(),L=M.graphDiv,D=L._fullLayout._zoomlayer;function R(t){var e={};return e[M.id+".aaxis.min"]=t.a,e[M.id+".baxis.min"]=t.b,e[M.id+".caxis.min"]=t.c,e}function F(t,e){var r=L._fullLayout.clickmode;z(L),2===t&&(L.emit("plotly_doubleclick",null),a.call("_guiRelayout",L,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===t&&w(e,L,[M.xaxis],[M.yaxis],M.id,M.dragOptions),r.indexOf("event")>-1&&g.click(L,e,M.id)}function B(t,e){return 1-e/M.h}function N(t,e){return 1-(t+(M.h-e)/Math.sqrt(3))/M.w}function j(t,e){return(t-(M.h-e)/Math.sqrt(3))/M.w}function U(i,a){var o=r+i*t,s=n+a*e,l=Math.max(0,Math.min(1,B(0,n),B(0,s))),c=Math.max(0,Math.min(1,N(r,n),N(o,s))),u=Math.max(0,Math.min(1,j(r,n),j(o,s))),m=(l/2+u)*M.w,g=(1-l/2-c)*M.w,y=(m+g)/2,x=g-m,_=(1-l)*M.h,w=_-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),k.transition().style("opacity",1).duration(200),b=!0),L.emit("plotly_relayouting",R(p))}function V(){z(L),p!==f&&(a.call("_guiRelayout",L,R(p)),O&&L.data&&L._context.showTips&&(o.notifier(l(L,"Double-click to zoom back out"),"long"),O=!1))}function H(t,e){var r=t/M.xaxis._m,n=e/M.yaxis._m,i=[(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),a=i.indexOf(p.a),l=i.indexOf(p.b),c=i.indexOf(p.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),p={a:i[a],b:i[l],c:i[c]},e=(f.a-p.a)*M.yaxis._m,t=(f.c-p.c-f.b+p.b)*M.xaxis._m);var h=s(M.x0+t,M.y0+e);M.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",h);var d=s(-t,-e);M.clipDefRelative.select("path").attr("transform",d),M.aaxis.range=[p.a,M.sum-p.b-p.c],M.baxis.range=[M.sum-p.a-p.c,p.b],M.caxis.range=[M.sum-p.a-p.b,p.c],M.drawAxes(!1),M._hasClipOnAxisFalse&&M.plotContainer.select(".scatterlayer").selectAll(".trace").call(u.hideOutsideRangePoints,M),L.emit("plotly_relayouting",R(p))}function q(){a.call("_guiRelayout",L,R(p))}this.dragOptions={element:S,gd:L,plotinfo:{id:M.id,domain:L._fullLayout[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis},subplot:M.id,prepFn:function(a,l,u){M.dragOptions.xaxes=[M.xaxis],M.dragOptions.yaxes=[M.yaxis],t=L._fullLayout._invScaleX,e=L._fullLayout._invScaleY;var m=M.dragOptions.dragmode=L._fullLayout.dragmode;y(m)?M.dragOptions.minDrag=1:M.dragOptions.minDrag=void 0,"zoom"===m?(M.dragOptions.moveFn=U,M.dragOptions.clickFn=F,M.dragOptions.doneFn=V,function(t,e,a){var l=S.getBoundingClientRect();r=e-l.left,n=a-l.top,L._fullLayout._calcInverseTransform(L);var u=L._fullLayout._invTransform,m=o.apply3DTransform(u)(r,n);r=m[0],n=m[1],f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=f,h=M.aaxis.range[1]-f.a,d=i(M.graphDiv._fullLayout[M.id].bgcolor).getLuminance(),v="M0,"+M.h+"L"+M.w/2+", 0L"+M.w+","+M.h+"Z",b=!1,T=D.append("path").attr("class","zoombox").attr("transform",s(M.x0,M.y0)).style({fill:d>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),k=D.append("path").attr("class","zoombox-corners").attr("transform",s(M.x0,M.y0)).style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),M.clearOutline(L)}(0,l,u)):"pan"===m?(M.dragOptions.moveFn=H,M.dragOptions.clickFn=F,M.dragOptions.doneFn=q,f={a:M.aaxis.range[0],b:M.baxis.range[1],c:M.caxis.range[1]},p=f,M.clearOutline(L)):(x(m)||y(m))&&_(a,l,u,M.dragOptions,m)}},S.onmousemove=function(t){g.hover(L,t,M.id),L._fullLayout._lasthover=S,L._fullLayout._hoversubplot=M.id},S.onmouseout=function(t){L._dragging||m.unhover(L,t)},m.init(this.dragOptions)}},{"../../components/color":367,"../../components/dragelement":386,"../../components/dragelement/helpers":385,"../../components/drawing":389,"../../components/fx":407,"../../components/selections":455,"../../components/titles":476,"../../lib":515,"../../lib/extend":505,"../../registry":647,"../cartesian/axes":566,"../cartesian/constants":573,"../cartesian/set_convert":585,"../plots":628,"@plotly/d3":58,tinycolor2:313}],647:[function(t,e,r){"use strict";var n=t("./lib/loggers"),i=t("./lib/noop"),a=t("./lib/push_unique"),o=t("./lib/is_plain_object"),s=t("./lib/dom").addStyleRule,l=t("./lib/extend"),c=t("./plots/attributes"),u=t("./plots/layout_attributes"),f=l.extendFlat,h=l.extendDeepAll;function p(t){var e=t.name,i=t.categories,a=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 i in v(t),r.subplotsRegistry[e]=t,r.componentsRegistry)b(i,t.name)}(t.basePlotModule);for(var o={},l=0;l-1&&(f[p[r]].title={text:""});for(r=0;r")?"":e.html(t).text()}));return e.remove(),r}(_),_=(_=_.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(c,"'"),i.isIE()&&(_=(_=(_=_.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),_}},{"../components/color":367,"../components/drawing":389,"../constants/xmlns_namespaces":492,"../lib":515,"@plotly/d3":58}],656:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rf+c||!n(u))}for(var p=0;pa))return e}return void 0!==r?r:t.dflt},r.coerceColor=function(t,e,r){return i(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)?e0?e+=r:u<0&&(e-=r)}return e}function z(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,_+(i-e)/(i-r)-1)}var D=t[f+"a"],R=t[h+"a"];m=Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0]));var F=n.getDistanceFunction(i,p,d,(function(t){return(p(t)+d(t))/2}));if(n.getClosest(g,F,t),!1!==t.index&&g[t.index].p!==c){k||(L=function(t){return Math.min(A(t),t.p-y.bargroupwidth/2)},C=function(t){return Math.max(M(t),t.p+y.bargroupwidth/2)});var B=g[t.index],N=v.base?B.b+B.s:B.s;t[h+"0"]=t[h+"1"]=R.c2p(B[h],!0),t[h+"LabelVal"]=N;var j=y.extents[y.extents.round(B.p)];t[f+"0"]=D.c2p(x?L(B):j[0],!0),t[f+"1"]=D.c2p(x?C(B):j[1],!0);var U=void 0!==B.orig_p;return t[f+"LabelVal"]=U?B.orig_p:B.p,t.labelLabel=l(D,t[f+"LabelVal"],v[f+"hoverformat"]),t.valueLabel=l(R,t[h+"LabelVal"],v[h+"hoverformat"]),t.baseLabel=l(R,B.b,v[h+"hoverformat"]),t.spikeDistance=(function(t){var e=u,r=t.b,i=O(t);return n.inbox(r-e,i-e,w+(i-e)/(i-r)-1)}(B)+function(t){return P(A(t),M(t),w)}(B))/2,t[f+"Spike"]=D.c2p(B.p,!0),o(B,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,i=s(t,e);return a.opacity(r)?r:a.opacity(n)&&i?n:void 0}e.exports={hoverPoints:function(t,e,r,n,a){var o=u(t,e,r,n,a);if(o){var s=o.cd,l=s[0].trace,c=s[o.index];return o.color=f(l,c),i.getComponentMethod("errorbars","hoverInfo")(c,l,o),[o]}},hoverOnBars:u,getTraceColor:f}},{"../../components/color":367,"../../components/fx":407,"../../constants/numerical":491,"../../lib":515,"../../plots/cartesian/axes":566,"../../registry":647,"./helpers":663}],665:[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":578,"../scatter/marker_colorbar":954,"./arrays_to_calcdata":656,"./attributes":657,"./calc":658,"./cross_trace_calc":660,"./defaults":661,"./event_data":662,"./hover":664,"./layout_attributes":666,"./layout_defaults":667,"./plot":668,"./select":669,"./style":671}],666:[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"}}},{}],667:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../plots/cartesian/axes"),a=t("../../lib"),o=t("./layout_attributes");e.exports=function(t,e,r){function s(r,n){return a.coerce(t,e,o,r,n)}for(var l=!1,c=!1,u=!1,f={},h=s("barmode"),p=0;p0}function S(t){return"auto"===t?0:t}function E(t,e){var r=Math.PI/180*e,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:t.width*i+t.height*n,y:t.width*n+t.height*i}}function L(t,e,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor||"end",u="end"===c,f="start"===c,h=((a.leftToRight||0)+1)/2,p=1-h,d=i.width,m=i.height,g=Math.abs(e-t),v=Math.abs(n-r),y=g>2*_&&v>2*_?_:0;g-=2*y,v-=2*y;var x=S(l);"auto"!==l||d<=g&&m<=v||!(d>g||m>v)||(d>v||m>g)&&d.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)};B=G(B,N,D),N=G(N,B,D),j=G(j,U,!D),U=G(U,j,!D)}var Y=A(a.ensureSingle(I,"path"),P,g,v);if(Y.style("vector-effect","non-scaling-stroke").attr("d",isNaN((N-B)*(U-j))||V&&t._context.staticPlot?"M0,0Z":"M"+B+","+j+"V"+U+"H"+N+"V"+j+"Z").call(l.setClipUrl,e.layerClipId,t),!P.uniformtext.mode&&R){var W=l.makePointStyleFns(f);l.singlePointStyle(c,Y,f,W,t)}!function(t,e,r,n,i,s,c,f,p,g,v){var w,T=e.xaxis,M=e.yaxis,C=t._fullLayout;function P(e,r,n){return a.ensureSingle(e,"text").text(r).attr({class:"bartext bartext-"+w,"text-anchor":"middle","data-notex":1}).call(l.font,n).call(o.convertToTspans,t)}var I=n[0].trace,O="h"===I.orientation,z=function(t,e,r,n,i){var o,s=e[0].trace;o=s.texttemplate?function(t,e,r,n,i){var o=e[0].trace,s=a.castOption(o,r,"texttemplate");if(!s)return"";var l,c,f,h,p="histogram"===o.type,d="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;g?(l="y",c=i,f="x",h=n):(l="x",c=n,f="y",h=i);function v(t){return u(h,h.c2l(t),!0).text}var y=e[r],x={};x.label=y.p,x.labelLabel=x[l+"Label"]=(_=y.p,u(c,c.c2l(_),!0).text);var _;var w=a.castOption(o,y.i,"text");(0===w||w)&&(x.text=w);x.value=y.s,x.valueLabel=x[f+"Label"]=v(y.s);var T={};b(T,o,y.i),(p||void 0===T.x)&&(T.x=g?x.value:x.label);(p||void 0===T.y)&&(T.y=g?x.label:x.value);(p||void 0===T.xLabel)&&(T.xLabel=g?x.valueLabel:x.labelLabel);(p||void 0===T.yLabel)&&(T.yLabel=g?x.labelLabel:x.valueLabel);d&&(x.delta=+y.rawS||y.s,x.deltaLabel=v(x.delta),x.final=y.v,x.finalLabel=v(x.final),x.initial=x.final-x.delta,x.initialLabel=v(x.initial));m&&(x.value=y.s,x.valueLabel=v(x.value),x.percentInitial=y.begR,x.percentInitialLabel=a.formatPercent(y.begR),x.percentPrevious=y.difR,x.percentPreviousLabel=a.formatPercent(y.difR),x.percentTotal=y.sumR,x.percenTotalLabel=a.formatPercent(y.sumR));var k=a.castOption(o,y.i,"customdata");k&&(x.customdata=k);return a.texttemplateString(s,x,t._d3locale,T,x,o._meta||{})}(t,e,r,n,i):s.textinfo?function(t,e,r,n){var i=t[0].trace,o="h"===i.orientation,s="waterfall"===i.type,l="funnel"===i.type;function c(t){return u(o?r:n,+t,!0).text}var f,h=i.textinfo,p=t[e],d=h.split("+"),m=[],g=function(t){return-1!==d.indexOf(t)};g("label")&&m.push((v=t[e].p,u(o?n:r,v,!0).text));var v;g("text")&&(0===(f=a.castOption(i,p.i,"text"))||f)&&m.push(f);if(s){var y=+p.rawS||p.s,x=p.v,b=x-y;g("initial")&&m.push(c(b)),g("delta")&&m.push(c(y)),g("final")&&m.push(c(x))}if(l){g("value")&&m.push(c(p.s));var _=0;g("percent initial")&&_++,g("percent previous")&&_++,g("percent total")&&_++;var w=_>1;g("percent initial")&&(f=a.formatPercent(p.begR),w&&(f+=" of initial"),m.push(f)),g("percent previous")&&(f=a.formatPercent(p.difR),w&&(f+=" of previous"),m.push(f)),g("percent total")&&(f=a.formatPercent(p.sumR),w&&(f+=" of total"),m.push(f))}return m.join("
")}(e,r,n,i):m.getValue(s.text,r);return m.coerceString(y,o)}(C,n,i,T,M);w=function(t,e){var r=m.getValue(t.textposition,e);return m.coerceEnumerated(x,r)}(I,i);var D="stack"===g.mode||"relative"===g.mode,R=n[i],F=!D||R._outmost;if(!z||"none"===w||(R.isBlank||s===c||f===p)&&("auto"===w||"inside"===w))return void r.select("text").remove();var B=C.font,N=d.getBarColor(n[i],I),j=d.getInsideTextFont(I,i,B,N),U=d.getOutsideTextFont(I,i,B),V=r.datum();O?"log"===T.type&&V.s0<=0&&(s=T.range[0]=G*(X/Y):X>=Y*(Z/G);G>0&&Y>0&&(J||K||Q)?w="inside":(w="outside",H.remove(),H=null)}else w="inside";if(!H){W=a.ensureUniformFontSize(t,"outside"===w?U:j);var $=(H=P(r,z,W)).attr("transform");if(H.attr("transform",""),q=l.bBox(H.node()),G=q.width,Y=q.height,H.attr("transform",$),G<=0||Y<=0)return void H.remove()}var tt,et,rt=I.textangle;"outside"===w?(et="both"===I.constraintext||"outside"===I.constraintext,tt=function(t,e,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,f=i.height,h=Math.abs(e-t),p=Math.abs(n-r);o=s?p>2*_?_:0:h>2*_?_:0;var d=1;l&&(d=s?Math.min(1,p/f):Math.min(1,h/u));var m=S(c),g=E(i,m),v=(s?g.x:g.y)/2,y=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(t+e)/2,w=(r+n)/2,T=0,A=0,M=s?k(e,t):k(r,n);s?(b=e-M*o,T=M*v):(w=n+M*o,A=-M*v);return{textX:y,textY:x,targetX:b,targetY:w,anchorX:T,anchorY:A,scale:d,rotate:m}}(s,c,f,p,q,{isHorizontal:O,constrained:et,angle:rt})):(et="both"===I.constraintext||"inside"===I.constraintext,tt=L(s,c,f,p,q,{isHorizontal:O,constrained:et,angle:rt,anchor:I.insidetextanchor}));tt.fontSize=W.size,h("histogram"===I.type?"bar":I.type,tt,C),R.transform=tt;var nt=A(H,C,g,v);a.setTransormAndDisplay(nt,tt)}(t,e,I,r,p,B,N,j,U,g,v),e.layerClipId&&l.hideOutsideRangePoint(c,I.select("text"),w,C,f.xcalendar,f.ycalendar)}));var j=!1===f.cliponaxis;l.setClipUrl(c,j?null:e.layerClipId,t)}));c.getComponentMethod("errorbars","plot")(t,I,e,g)},toMoveInsideBar:L}},{"../../components/color":367,"../../components/drawing":389,"../../components/fx/helpers":403,"../../lib":515,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"../../registry":647,"./attributes":657,"./constants":659,"./helpers":663,"./style":671,"./uniform_text":673,"@plotly/d3":58,"fast-isnumeric":190}],669:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=e.c2p(n?t.s0:t.p0,!0),o=e.c2p(n?t.s1:t.p1,!0),s=r.c2p(n?t.p0:t.s0,!0),l=r.c2p(n?t.p1:t.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===e)for(r=0;r1||0===i.bargap&&0===i.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")})),e.selectAll("g.points").each((function(e){d(n.select(this),e[0].trace,t)})),s.getComponentMethod("errorbars","style")(e)},styleTextPoints:m,styleOnSelect:function(t,e,r){var i=e[0].trace;i.selectedpoints?function(t,e,r){a.selectedPointStyle(t.selectAll("path"),e),function(t,e,r){t.each((function(t){var i,s=n.select(this);if(t.selected){i=o.ensureUniformFontSize(r,g(s,t,e,r));var l=e.selected.textfont&&e.selected.textfont.color;l&&(i.color=l),a.font(s,i)}else a.selectedTextStyle(s,e)}))}(t.selectAll("text"),e,r)}(r,i,t):(d(r,i,t),s.getComponentMethod("errorbars","style")(r))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:l}},{"../../components/color":367,"../../components/drawing":389,"../../lib":515,"../../registry":647,"./attributes":657,"./helpers":663,"./uniform_text":673,"@plotly/d3":58}],672:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("../../lib").coercePattern;e.exports=function(t,e,r,s,l){var c=r("marker.color",s),u=i(t,"marker");u&&a(t,e,l,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,l,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),o(r,"marker.pattern",c,u),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":367,"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"../../lib":515}],673:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");function a(t){return"_"+t+"Text_minsize"}e.exports={recordMinTextSize:function(t,e,r){if(r.uniformtext.mode){var n=a(t),i=r.uniformtext.minsize,o=e.scale*e.fontSize;e.hide=oh.range[1]&&(x+=Math.PI);if(n.getClosest(c,(function(t){return m(y,x,[t.rp0,t.rp1],[t.thetag0,t.thetag1],d)?g+Math.min(1,Math.abs(t.thetag1-t.thetag0)/v)-1+(t.rp1-y)/(t.rp1-t.rp0)-1:1/0}),t),!1!==t.index){var b=c[t.index];t.x0=t.x1=b.ct[0],t.y0=t.y1=b.ct[1];var _=i.extendFlat({},b,{r:b.s,theta:b.p});return o(b,u,t),s(_,u,f,t),t.hovertemplate=u.hovertemplate,t.color=a(u,b),t.xLabelVal=t.yLabelVal=void 0,b.s<0&&(t.idealAlign="left"),[t]}}},{"../../components/fx":407,"../../lib":515,"../../plots/polar/helpers":630,"../bar/hover":664,"../scatterpolar/hover":1015}],678:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"barpolar",basePlotModule:t("../../plots/polar"),categories:["polar","bar","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),colorbar:t("../scatter/marker_colorbar"),formatLabels:t("../scatterpolar/format_labels"),style:t("../bar/style").style,styleOnSelect:t("../bar/style").styleOnSelect,hoverPoints:t("./hover"),selectPoints:t("../bar/select"),meta:{}}},{"../../plots/polar":631,"../bar/select":669,"../bar/style":671,"../scatter/marker_colorbar":954,"../scatterpolar/format_labels":1014,"./attributes":674,"./calc":675,"./defaults":676,"./hover":677,"./layout_attributes":679,"./layout_defaults":680,"./plot":681}],679:[function(t,e,r){"use strict";e.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},{}],680:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a,o={};function s(r,o){return n.coerce(t[a]||{},e[a],i,r,o)}for(var l=0;l0?(c=o,u=l):(c=l,u=o);var f=[s.findEnclosingVertexAngles(c,t.vangles)[0],(c+u)/2,s.findEnclosingVertexAngles(u,t.vangles)[1]];return s.pathPolygonAnnulus(n,i,c,u,f,e,r)};return function(t,n,i,o){return a.pathAnnulus(t,n,i,o,e,r)}}(e),p=e.layers.frontplot.select("g.barlayer");a.makeTraceGroups(p,r,"trace bars").each((function(){var r=n.select(this),s=a.ensureSingle(r,"g","points").selectAll("g.point").data(a.identity);s.enter().append("g").style("vector-effect","non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(t){var e,r=n.select(this),o=t.rp0=u.c2p(t.s0),s=t.rp1=u.c2p(t.s1),p=t.thetag0=f.c2g(t.p0),d=t.thetag1=f.c2g(t.p1);if(i(o)&&i(s)&&i(p)&&i(d)&&o!==s&&p!==d){var m=u.c2g(t.s1),g=(p+d)/2;t.ct=[l.c2p(m*Math.cos(g)),c.c2p(m*Math.sin(g))],e=h(o,s,p,d)}else e="M0,0Z";a.ensureSingle(r,"path").attr("d",e)})),o.setClipUrl(r,e._hasClipOnAxisFalse?e.clipIds.forTraces:null,t)}))}},{"../../components/drawing":389,"../../lib":515,"../../plots/polar/helpers":630,"@plotly/d3":58,"fast-isnumeric":190}],682:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../bar/attributes"),a=t("../../components/color/attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../lib/extend").extendFlat,c=n.marker,u=c.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,xhoverformat:o("x"),yhoverformat:o("y"),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({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},c.angle,{arrayOk:!1,editType:"calc"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":366,"../../lib/extend":505,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642,"../bar/attributes":657,"../scatter/attributes":936}],683:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../../plots/cartesian/align_period"),o=t("../../lib"),s=t("../../constants/numerical").BADNUM,l=o._;e.exports=function(t,e){var r,c,y,x,b,_,w,T=t._fullLayout,k=i.getFromId(t,e.xaxis||"x"),A=i.getFromId(t,e.yaxis||"y"),M=[],S="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(y=k,x="x",b=A,_="y",w=!!e.yperiodalignment):(y=A,x="y",b=k,_="x",w=!!e.xperiodalignment);var E,L,C,P,I,O,z=function(t,e,r,i){var s,l=e+"0"in t,c="d"+e in t;if(e in t||l&&c){var u=r.makeCalcdata(t,e);return[a(t,r,e,u).vals,u]}s=l?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:i;for(var f="multicategory"===r.type?r.r2c_just_indices(s):r.d2c(s,0,t[e+"calendar"]),h=t._length,p=new Array(h),d=0;dE.uf};if(e._hasPreCompStats){var U=e[x],V=function(t){return y.d2c((e[t]||[])[r])},H=1/0,q=-1/0;for(r=0;r=E.q1&&E.q3>=E.med){var Y=V("lowerfence");E.lf=Y!==s&&Y<=E.q1?Y:p(E,C,P);var W=V("upperfence");E.uf=W!==s&&W>=E.q3?W:d(E,C,P);var Z=V("mean");E.mean=Z!==s?Z:P?o.mean(C,P):(E.q1+E.q3)/2;var X=V("sd");E.sd=Z!==s&&X>=0?X:P?o.stdev(C,P,E.mean):E.q3-E.q1,E.lo=m(E),E.uo=g(E);var J=V("notchspan");J=J!==s&&J>0?J:v(E,P),E.ln=E.med-J,E.un=E.med+J;var K=E.lf,Q=E.uf;e.boxpoints&&C.length&&(K=Math.min(K,C[0]),Q=Math.max(Q,C[P-1])),e.notched&&(K=Math.min(K,E.ln),Q=Math.max(Q,E.un)),E.min=K,E.max=Q}else{var $;o.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),$=E.med!==s?E.med:E.q1!==s?E.q3!==s?(E.q1+E.q3)/2:E.q1:E.q3!==s?E.q3:0,E.med=$,E.q1=E.q3=$,E.lf=E.uf=$,E.mean=E.sd=$,E.ln=E.un=$,E.min=E.max=$}H=Math.min(H,E.min),q=Math.max(q,E.max),E.pts2=L.filter(j),M.push(E)}}e._extremes[y._id]=i.findExtremes(y,[H,q],{padded:!0})}else{var tt=y.makeCalcdata(e,x),et=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&it0){var ut,ft;if((E={}).pos=E[_]=B[r],L=E.pts=nt[r].sort(f),P=(C=E[x]=L.map(h)).length,E.min=C[0],E.max=C[P-1],E.mean=o.mean(C,P),E.sd=o.stdev(C,P,E.mean),E.med=o.interp(C,.5),P%2&&(lt||ct))lt?(ut=C.slice(0,P/2),ft=C.slice(P/2+1)):ct&&(ut=C.slice(0,P/2+1),ft=C.slice(P/2)),E.q1=o.interp(ut,.5),E.q3=o.interp(ft,.5);else E.q1=o.interp(C,.25),E.q3=o.interp(C,.75);E.lf=p(E,C,P),E.uf=d(E,C,P),E.lo=m(E),E.uo=g(E);var ht=v(E,P);E.ln=E.med-ht,E.un=E.med+ht,at=Math.min(at,E.ln),ot=Math.max(ot,E.un),E.pts2=L.filter(j),M.push(E)}e._extremes[y._id]=i.findExtremes(y,e.notched?tt.concat([at,ot]):tt,{padded:!0})}return function(t,e){if(o.isArrayOrTypedArray(e.selectedpoints))for(var r=0;r0?(M[0].t={num:T[S],dPos:N,posLetter:_,valLetter:x,labels:{med:l(t,"median:"),min:l(t,"min:"),q1:l(t,"q1:"),q3:l(t,"q3:"),max:l(t,"max:"),mean:"sd"===e.boxmean?l(t,"mean \xb1 \u03c3:"):l(t,"mean:"),lf:l(t,"lower fence:"),uf:l(t,"upper fence:")}},T[S]++,M):[{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 h(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 d(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 m(t){return 4*t.q1-3*t.q3}function g(t){return 4*t.q3-3*t.q1}function v(t,e){return 0===e?0:1.57*(t.q3-t.q1)/Math.sqrt(e)}},{"../../constants/numerical":491,"../../lib":515,"../../plots/cartesian/align_period":563,"../../plots/cartesian/axes":566,"fast-isnumeric":190}],684:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib"),a=t("../../plots/cartesian/constraints").getAxisGroup,o=["v","h"];function s(t,e,r,o){var s,l,c,u=e.calcdata,f=e._fullLayout,h=o._id,p=h.charAt(0),d=[],m=0;for(s=0;s1,b=1-f[t+"gap"],_=1-f[t+"groupgap"];for(s=0;s0){var q=E.pointpos,G=E.jitter,Y=E.marker.size/2,W=0;q+G>=0&&((W=V*(q+G))>M?(H=!0,j=Y,B=W):W>R&&(j=Y,B=M)),W<=M&&(B=M);var Z=0;q-G<=0&&((Z=-V*(q-G))>S?(H=!0,U=Y,N=Z):Z>F&&(U=Y,N=S)),Z<=S&&(N=S)}else B=M,N=S;var X=new Array(c.length);for(l=0;l0?(g="v",v=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",v=Math.min(_)):v=0;if(v){e._length=v;var S=r("orientation",g);e._hasPreCompStats?"v"===S&&0===x?(r("x0",0),r("dx",1)):"h"===S&&0===y&&(r("y0",0),r("dy",1)):"v"===S&&0===x?r("x0"):"h"===S&&0===y&&r("y0"),i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],a)}else e.visible=!1}function f(t,e,r,i){var a=i.prefix,o=n.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l="outliers";e._hasPreCompStats?l="all":(o||s)&&(l="suspectedoutliers");var u=r(a+"points",l);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.angle"),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,i){function s(r,i){return n.coerce(t,e,c,r,i)}if(u(t,e,s,i),!1!==e.visible){o(t,e,i,s),s("xhoverformat"),s("yhoverformat");var l=e._hasPreCompStats;l&&(s("lowerfence"),s("upperfence")),s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",a.addOpacity(e.line.color,.5));var h=!1;if(l){var p=s("mean"),d=s("sd");p&&p.length&&(h=!0,d&&d.length&&(h="sd"))}s("boxmean",h),s("whiskerwidth"),s("width"),s("quartilemethod");var m=!1;if(l){var g=s("notchspan");g&&g.length&&(m=!0)}else n.validate(t.notchwidth,c.notchwidth)&&(m=!0);s("notched",m)&&s("notchwidth"),f(t,e,s,{prefix:"box"})}},crossTraceDefaults:function(t,e){var r,i;function a(t){return n.coerce(i._input,i,c,t)}for(var o=0;ot.lo&&(x.so=!0)}return a}));h.enter().append("path").classed("point",!0),h.exit().remove(),h.call(a.translatePoints,o,s)}function l(t,e,r,a){var o,s,l=e.val,c=e.pos,u=!!c.rangebreaks,f=a.bPos,h=a.bPosPxOffset||0,p=r.boxmean||(r.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var d=t.selectAll("path.mean").data("box"===r.type&&r.boxmean||"violin"===r.type&&r.box.visible&&r.meanline.visible?i.identity:[]);d.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),d.exit().remove(),d.each((function(t){var e=c.c2l(t.pos+f,!0),i=c.l2p(e-o)+h,a=c.l2p(e+s)+h,d=u?(i+a)/2:c.l2p(e)+h,m=l.c2p(t.mean,!0),g=l.c2p(t.mean-t.sd,!0),v=l.c2p(t.mean+t.sd,!0);"h"===r.orientation?n.select(this).attr("d","M"+m+","+i+"V"+a+("sd"===p?"m0,0L"+g+","+d+"L"+m+","+i+"L"+v+","+d+"Z":"")):n.select(this).attr("d","M"+i+","+m+"H"+a+("sd"===p?"m0,0L"+d+","+g+"L"+i+","+m+"L"+d+","+v+"Z":""))}))}e.exports={plot:function(t,e,r,a){var c=e.xaxis,u=e.yaxis;i.makeTraceGroups(a,r,"trace boxes").each((function(t){var e,r,i=n.select(this),a=t[0],f=a.t,h=a.trace;(f.wdPos=f.bdPos*h.whiskerwidth,!0!==h.visible||f.empty)?i.remove():("h"===h.orientation?(e=u,r=c):(e=c,r=u),o(i,{pos:e,val:r},h,f),s(i,{x:c,y:u},h,f),l(i,{pos:e,val:r},h,f))}))},plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":389,"../../lib":515,"@plotly/d3":58}],692:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0?Math.floor:Math.ceil,I=L>0?Math.ceil:Math.floor,O=L>0?Math.min:Math.max,z=L>0?Math.max:Math.min,D=P(S+C),R=I(E-C),F=[[f=M(S)]];for(a=D;a*L=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],706:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r){var a,o,s,l,c,u,f,h,p,d,m,g,v,y,x=t["_"+e],b=t[e+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],T=b._boundarylines=[],k=t["_"+r],A=t[r+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var M=t._xctrl,S=t._yctrl,E=M[0].length,L=M.length,C=t._a.length,P=t._b.length;n.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function O(n){var i,a,o,s,l,c,u,f,p,d,m,g,v=[],y=[],x={};if("b"===e)for(a=t.b2j(n),o=Math.floor(Math.max(0,Math.min(P-2,a))),s=a-o,x.length=P,x.crossLength=C,x.xy=function(e){return t.evalxy([],e,a)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},i=0;i0&&(p=t.dxydi([],i-1,o,0,s),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),d=t.dxydi([],i-1,o,1,s),v.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),v.push(f[0]),y.push(f[1]),l=f;else for(i=t.a2i(n),c=Math.floor(Math.max(0,Math.min(C-2,i))),u=i-c,x.length=C,x.crossLength=P,x.xy=function(e){return t.evalxy([],i,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},a=0;a0&&(m=t.dxydj([],c,a-1,u,0),v.push(l[0]+m[0]/3),y.push(l[1]+m[1]/3),g=t.dxydj([],c,a-1,u,1),v.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),v.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=e,x.axis=b,x.crossAxis=A,x.value=n,x.constvar=r,x.index=h,x.x=v,x.y=y,x.smoothing=A.smoothing,x}function z(n){var i,a,o,s,l,c=[],u=[],f={};if(f.length=x.length,f.crossLength=k.length,"b"===e)for(o=Math.max(0,Math.min(P-2,n)),l=Math.min(1,Math.max(0,n-o)),f.xy=function(e){return t.evalxy([],e,n)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},i=0;ix.length-1||_.push(i(z(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(h=u;hx.length-1||m<0||m>x.length-1))for(g=x[s],v=x[m],a=0;ax[x.length-1]||w.push(i(O(d),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&T.push(i(z(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(z(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(t,e){return t-e})))[0],f=c[1],h=u;h<=f;h++)p=b.tick0+b.dtick*h,_.push(i(O(p),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(h=u-1;hx[x.length-1]||w.push(i(O(d),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&T.push(i(O(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&T.push(i(O(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}},{"../../lib/extend":505,"../../plots/cartesian/axes":566}],707:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],i=0;i90&&(p-=180,l=-l),{angle:p,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],721:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("./map_1d_array"),o=t("./makepath"),s=t("./orient_text"),l=t("../../lib/svg_text_utils"),c=t("../../lib"),u=c.strRotate,f=c.strTranslate,h=t("../../constants/alignment");function p(t,e,r,s,l,c){var u="const-"+l+"-lines",f=r.selectAll("."+u).data(c);f.enter().append("path").classed(u,!0).style("vector-effect","non-scaling-stroke"),f.each((function(r){var s=r,l=s.x,c=s.y,u=a([],l,t.c2p),f=a([],c,e.c2p),h="M"+o(u,f,s.smoothing);n.select(this).attr("d",h).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",i.dashStyle(s.dash,s.width)).style("fill","none")})),f.exit().remove()}function d(t,e,r,a,o,c,h,p){var d=c.selectAll("text."+p).data(h);d.enter().append("text").classed(p,!0);var m=0,g={};return d.each((function(o,c){var h;if("auto"===o.axis.tickangle)h=s(a,e,r,o.xy,o.dxy);else{var p=(o.axis.tickangle+180)*Math.PI/180;h=s(a,e,r,o.xy,[Math.cos(p),Math.sin(p)])}c||(g={angle:h.angle,flip:h.flip});var d=(o.endAnchor?-1:1)*h.flip,v=n.select(this).attr({"text-anchor":d>0?"start":"end","data-notex":1}).call(i.font,o.font).text(o.text).call(l.convertToTspans,t),y=i.bBox(this);v.attr("transform",f(h.p[0],h.p[1])+u(h.angle)+f(o.axis.labelpadding*d,.3*y.height)),m=Math.max(m,y.width+o.axis.labelpadding)})),d.exit().remove(),g.maxExtent=m,g}e.exports=function(t,e,r,i){var l=e.xaxis,u=e.yaxis,f=t._fullLayout._clips;c.makeTraceGroups(i,r,"trace").each((function(e){var r=n.select(this),i=e[0],h=i.trace,m=h.aaxis,g=h.baxis,y=c.ensureSingle(r,"g","minorlayer"),x=c.ensureSingle(r,"g","majorlayer"),b=c.ensureSingle(r,"g","boundarylayer"),_=c.ensureSingle(r,"g","labellayer");r.style("opacity",h.opacity),p(l,u,x,m,"a",m._gridlines),p(l,u,x,g,"b",g._gridlines),p(l,u,y,m,"a",m._minorgridlines),p(l,u,y,g,"b",g._minorgridlines),p(l,u,b,m,"a-boundary",m._boundarylines),p(l,u,b,g,"b-boundary",g._boundarylines);var w=d(t,l,u,h,i,_,m._labels,"a-label"),T=d(t,l,u,h,i,_,g._labels,"b-label");!function(t,e,r,n,i,a,o,l){var u,f,h,p,d=c.aggNums(Math.min,null,r.a),m=c.aggNums(Math.max,null,r.a),g=c.aggNums(Math.min,null,r.b),y=c.aggNums(Math.max,null,r.b);u=.5*(d+m),f=g,h=r.ab2xy(u,f,!0),p=r.dxyda_rough(u,f),void 0===o.angle&&c.extendFlat(o,s(r,i,a,h,r.dxydb_rough(u,f)));v(t,e,r,n,h,p,r.aaxis,i,a,o,"a-title"),u=d,f=.5*(g+y),h=r.ab2xy(u,f,!0),p=r.dxydb_rough(u,f),void 0===l.angle&&c.extendFlat(l,s(r,i,a,h,r.dxyda_rough(u,f)));v(t,e,r,n,h,p,r.baxis,i,a,l,"b-title")}(t,_,h,i,l,u,w,T),function(t,e,r,n,i){var s,l,u,f,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var p=c.ensureSingle(h,"path","carpetboundary"),d=e.clipsegments,m=[];for(f=0;f90&&y<270,b=n.select(this);b.text(h.title.text).call(l.convertToTspans,t),x&&(_=(-l.lineCount(b)+g)*m*a-_),b.attr("transform",f(e.p[0],e.p[1])+u(e.angle)+f(0,_)).attr("text-anchor","middle").call(i.font,h.title.font)})),b.exit().remove()}},{"../../components/drawing":389,"../../constants/alignment":483,"../../lib":515,"../../lib/svg_text_utils":541,"./makepath":718,"./map_1d_array":719,"./orient_text":720,"@plotly/d3":58}],722:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/search").findBin,a=t("./compute_control_points"),o=t("./create_spline_evaluator"),s=t("./create_i_derivative_evaluator"),l=t("./create_j_derivative_evaluator");e.exports=function(t){var e=t._a,r=t._b,c=e.length,u=r.length,f=t.aaxis,h=t.baxis,p=e[0],d=e[c-1],m=r[0],g=r[u-1],v=e[e.length-1]-e[0],y=r[r.length-1]-r[0],x=v*n.RELATIVE_CULL_TOLERANCE,b=y*n.RELATIVE_CULL_TOLERANCE;p-=x,d+=x,m-=b,g+=b,t.isVisible=function(t,e){return t>p&&tm&&ed||eg},t.setScale=function(){var e=t._x,r=t._y,n=a(t._xctrl,t._yctrl,e,r,f.smoothing,h.smoothing);t._xctrl=n[0],t._yctrl=n[1],t.evalxy=o([t._xctrl,t._yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t._xctrl,t._yctrl],f.smoothing,h.smoothing),t.dxydj=l([t._xctrl,t._yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,p,d,m=0,g=0,v=[];ne[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(p=u-2,d=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):d=s-(p=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,f,p,h,d),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,f,p,h,d),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":535,"./compute_control_points":710,"./constants":711,"./create_i_derivative_evaluator":712,"./create_j_derivative_evaluator":713,"./create_spline_evaluator":714}],723:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length;function f(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":515}],724:[function(t,e,r){"use strict";var n=t("../../lib").isArray1D;e.exports=function(t,e,r){var i=r("x"),a=i&&i.length,o=r("y"),s=o&&o.length;if(!a&&!s)return!1;if(e._cheater=!i,a&&!n(i)||s&&!n(o))e._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),e.a&&e.a.length&&(l=Math.min(l,e.a.length)),e.b&&e.b.length&&(l=Math.min(l,e.b.length)),e._length=l}return!0}},{"../../lib":515}],725:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../scattergeo/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../plots/attributes"),s=t("../../components/color/attributes").defaultLine,l=t("../../lib/extend").extendFlat,c=i.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:i.locationmode,z:{valType:"data_array",editType:"calc"},geojson:l({},i.geojson,{}),featureidkey:i.featureidkey,text:l({},i.text,{}),hovertext:l({},i.hovertext,{}),marker:{line:{color:l({},c.color,{dflt:s}),width:l({},c.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:i.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:n(),showlegend:l({},o.showlegend,{dflt:!1})},a("",{cLetter:"z",editTypeOverride:"calc"}))},{"../../components/color/attributes":366,"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/template_attributes":642,"../scattergeo/attributes":978}],726:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");function l(t){return t&&"string"==typeof t}e.exports=function(t,e){var r,c=e._length,u=new Array(c);r=e.geojson?function(t){return l(t)||n(t)}:l;for(var f=0;f")}(t,f,o),[t]}},{"../../lib":515,"../../plots/cartesian/axes":566,"./attributes":725}],730:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),calc:t("./calc"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style").style,styleOnSelect:t("./style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"choropleth",basePlotModule:t("../../plots/geo"),categories:["geo","noOpacity","showLegend"],meta:{}}},{"../../plots/geo":598,"../heatmap/colorbar":804,"./attributes":725,"./calc":726,"./defaults":727,"./event_data":728,"./hover":729,"./plot":731,"./select":732,"./style":733}],731:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/geo_location_utils"),o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../plots/cartesian/autorange").findExtremes,l=t("./style").style;e.exports={calcGeoJSON:function(t,e){for(var r=t[0].trace,n=e[r.geo],i=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?a.extractTraceFeature(t):o(r,i.topojson),f=[],h=[],p=0;p=0;n--){var i=r[n].id;if("string"==typeof i&&0===i.indexOf("water"))for(var a=n+1;a=0;r--)t.removeLayer(e[r][1])},s.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new o(t,r.uid),a=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,l),e[0].trace._glTrace=i,i}},{"../../plots/mapbox/constants":620,"./convert":735}],739:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"},{keys:["norm"]}),uhoverformat:i("u",1),vhoverformat:i("v",1),whoverformat:i("w",1),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),showlegend:l({},s.showlegend,{dflt:!1})};l(c,n("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));["opacity","lightposition","lighting"].forEach((function(t){c[t]=o[t]})),c.hoverinfo=l({},s.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),c.transforms=void 0,e.exports=c},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642,"../mesh3d/attributes":876}],740:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){for(var r=e.u,i=e.v,a=e.w,o=Math.min(e.x.length,e.y.length,e.z.length,r.length,i.length,a.length),s=-1/0,l=1/0,c=0;co.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":p>c&&(n.prefixBoundary=!0);break;case"<":(pc||n.starts.length&&h===u)&&(n.prefixBoundary=!0);break;case"][":f=Math.min(p[0],p[1]),h=Math.max(p[0],p[1]),fc&&(n.prefixBoundary=!0)}}}},{}],747:[function(t,e,r){"use strict";var n=t("../../components/colorscale"),i=t("./make_color_map"),a=t("./end_plus");e.exports={min:"zmin",max:"zmax",calc:function(t,e,r){var o=e.contours,s=e.line,l=o.size||1,c=o.coloring,u=i(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:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},r._levels={start:o.start,end:a(o),size:l}}}},{"../../components/colorscale":379,"./end_plus":755,"./make_color_map":760}],748:[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}}},{}],749:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("./label_defaults"),a=t("../../components/color"),o=a.addOpacity,s=a.opacity,l=t("../../constants/filter_ops"),c=l.CONSTRAINT_REDUCTION,u=l.COMPARISON_OPS2;e.exports=function(t,e,r,a,l,f){var h,p,d,m=e.contours,g=r("contours.operation");(m._operation=c[g],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,m),"="===g?h=m.showlines=!0:(h=r("contours.showlines"),d=r("fillcolor",o((t.line||{}).color||l,.5))),h)&&(p=r("line.color",d&&s(d)?o(e.fillcolor,1):l),r("line.width",2),r("line.dash"));r("line.smoothing"),i(r,a,p,f)}},{"../../components/color":367,"../../constants/filter_ops":487,"./label_defaults":759,"fast-isnumeric":190}],750:[function(t,e,r){"use strict";var n=t("../../constants/filter_ops"),i=t("fast-isnumeric");function a(t,e){var r,a=Array.isArray(e);function o(t){return i(t)?+t:null}return-1!==n.COMPARISON_OPS2.indexOf(t)?r=o(a?e[0]:e):-1!==n.INTERVAL_OPS.indexOf(t)?r=a?[o(e[0]),o(e[1])]:[o(e),o(e)]:-1!==n.SET_OPS.indexOf(t)&&(r=a?e.map(o):[o(e)]),r}function o(t){return function(e){e=a(t,e);var r=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return{start:r,end:n,size:n-r}}}function s(t){return function(e){return{start:e=a(t,e),end:1/0,size:1/0}}}e.exports={"[]":o("[]"),"][":o("]["),">":s(">"),"<":s("<"),"=":s("=")}},{"../../constants/filter_ops":487,"fast-isnumeric":190}],751:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?e.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}},{}],752:[function(t,e,r){"use strict";var n=t("../../lib");function i(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,a,o,s=function(t){return t.reverse()},l=function(t){return t};switch(e){case"=":case"<":return t;case">":for(1!==t.length&&n.warn("Contour data invalid for the specified inequality operation."),a=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return l}},{"../../lib":515,"./constraint_mapping":750,"./end_plus":755}],755:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],756:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./constants");function a(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==i.BOTTOMSTART.indexOf(t)?a=1:-1!==i.LEFTSTART.indexOf(t)?n=1:-1!==i.TOPSTART.indexOf(t)?a=-1:n=-1;return[n,a]}(f,r,e),p=[s(t,e,[-h[0],-h[1]])],d=t.z.length,m=t.z[0].length,g=e.slice(),v=h.slice();for(c=0;c<1e4;c++){if(f>20?(f=i.CHOOSESADDLE[f][(h[0]||h[1])<0?0:1],t.crossings[u]=i.SADDLEREMAINDER[f]):delete t.crossings[u],!(h=i.NEWDELTA[f])){n.log("Found bad marching index:",f,e,t.level);break}p.push(s(t,e,h)),e[0]+=h[0],e[1]+=h[1],u=e.join(","),a(p[p.length-1],p[p.length-2],o,l)&&p.pop();var y=h[0]&&(e[0]<0||e[0]>m-2)||h[1]&&(e[1]<0||e[1]>d-2);if(e[0]===g[0]&&e[1]===g[1]&&h[0]===v[0]&&h[1]===v[1]||r&&y)break;f=t.crossings[u]}1e4===c&&n.log("Infinite loop in contour?");var x,b,_,w,T,k,A,M,S,E,L,C,P,I,O,z=a(p[0],p[p.length-1],o,l),D=0,R=.2*t.smoothing,F=[],B=0;for(c=1;c=B;c--)if((x=F[c])=B&&x+F[b]M&&S--,t.edgepaths[S]=L.concat(p,E));break}V||(t.edgepaths[M]=p.concat(E))}for(M=0;Mt?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,a,o,s,l,c,u,f,h=t[0].z,p=h.length,d=h[0].length,m=2===p||2===d;for(r=0;r=0&&(n=y,s=l):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,s=l):i.log("endpt to newendpt is not vert. or horz.",r,n,y)}if(r=n,s>=0)break;f+="L"+n}if(s===t.edgepaths.length){i.log("unclosed perimeter path");break}h=s,(d=-1===p.indexOf(h))&&(h=p[0],f+="Z")}for(h=0;hn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*o)),p=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*o);if(h<1||p<1)return 1/0;var d=v.EDGECOST*(1/(h-1)+1/(p-1));d+=v.ANGLECOST*c*c;for(var m=s-u,g=l-f,y=s+u,x=l+f,b=0;b2*v.MAXCOST)break;p&&(s/=2),l=(o=c-s/2)+1.5*s}if(h<=v.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.fontSize,a=e.width+i/3,o=Math.max(0,e.height-i/3),s=t.x,l=t.y,c=t.theta,u=Math.sin(c),f=Math.cos(c),h=function(t,e){return[s+t*f-e*u,l+t*u+e*f]},p=[h(-a/2,-o/2),h(-a/2,o/2),h(a/2,o/2),h(a/2,-o/2)];r.push({text:e.text,x:s,y:l,dy:e.dy,theta:c,level:e.level,width:a,height:o}),n.push(p)},r.drawLabels=function(t,e,r,a,o){var l=t.selectAll("text").data(e,(function(t){return t.text+","+t.x+","+t.y+","+t.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(t){var e=t.x+Math.sin(t.theta)*t.dy,i=t.y-Math.cos(t.theta)*t.dy;n.select(this).text(t.text).attr({x:e,y:i,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+i+")"}).call(s.convertToTspans,r)})),o){for(var c="",u=0;ur.end&&(r.start=r.end=(r.start+r.end)/2),t._input.contours||(t._input.contours={}),i.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,h=t._input.contours;if(u>f&&(r.start=h.start=f,f=r.end=h.end=u,u=r.start),!(r.size>0))c=u===f?1:a(u,f,t.ncontours).dtick,h.size=r.size=c}}},{"../../lib":515,"../../plots/cartesian/axes":566}],764:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../heatmap/style"),o=t("./make_color_map");e.exports=function(t){var e=n.select(t).selectAll("g.contour");e.style("opacity",(function(t){return t[0].trace.opacity})),e.each((function(t){var e=n.select(this),r=t[0].trace,a=r.contours,s=r.line,l=a.size||1,c=a.start,u="constraint"===a.type,f=!u&&"lines"===a.coloring,h=!u&&"fill"===a.coloring,p=f||h?o(r):null;e.selectAll("g.contourlevel").each((function(t){n.select(this).selectAll("path").call(i.lineGroupStyle,s.width,f?p(t.level):s.color,s.dash)}));var d=a.labelfont;if(e.selectAll("g.contourlabels text").each((function(t){i.font(n.select(this),{family:d.family,size:d.size,color:d.color||(f?p(t.level):s.color)})})),u)e.selectAll("g.contourfill path").style("fill",r.fillcolor);else if(h){var m;e.selectAll("g.contourfill path").style("fill",(function(t){return void 0===m&&(m=t.level),p(t.level+.5*l)})),void 0===m&&(m=c),e.selectAll("g.contourbg path").style("fill",p(m-.5*l))}})),a(t)}},{"../../components/drawing":389,"../heatmap/style":814,"./make_color_map":760,"@plotly/d3":58}],765:[function(t,e,r){"use strict";var n=t("../../components/colorscale/defaults"),i=t("./label_defaults");e.exports=function(t,e,r,a,o){var s,l=r("contours.coloring"),c="";"fill"===l&&(s=r("contours.showlines")),!1!==s&&("lines"!==l&&(c=r("line.color","#000")),r("line.width",.5),r("line.dash")),"none"!==l&&(!0!==t.showlegend&&(e.showlegend=!1),e._dfltShowLegend=!1,n(t,e,a,r,{prefix:"",cLetter:"z"})),r("line.smoothing"),i(r,a,c,o)}},{"../../components/colorscale/defaults":377,"./label_defaults":759}],766:[function(t,e,r){"use strict";var n=t("../heatmap/attributes"),i=t("../contour/attributes"),a=t("../../components/colorscale/attributes"),o=t("../../lib/extend").extendFlat,s=i.contours;e.exports=o({carpet:{valType:"string",editType:"calc"},z:n.z,a:n.x,a0:n.x0,da:n.dx,b:n.y,b0:n.y0,db:n.dy,text:n.text,hovertext:n.hovertext,transpose:n.transpose,atype:n.xtype,btype:n.ytype,fillcolor:i.fillcolor,autocontour:i.autocontour,ncontours:i.ncontours,contours:{type:s.type,start:s.start,end:s.end,size:s.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:s.showlines,showlabels:s.showlabels,labelfont:s.labelfont,labelformat:s.labelformat,operation:s.operation,value:s.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:i.line.color,width:i.line.width,dash:i.line.dash,smoothing:i.line.smoothing,editType:"plot"},transforms:void 0},a("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../contour/attributes":744,"../heatmap/attributes":801}],767:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../../lib"),a=t("../heatmap/convert_column_xyz"),o=t("../heatmap/clean_2d_array"),s=t("../heatmap/interp2d"),l=t("../heatmap/find_empties"),c=t("../heatmap/make_bound_array"),u=t("./defaults"),f=t("../carpet/lookup_carpetid"),h=t("../contour/set_contours");e.exports=function(t,e){var r=e._carpetTrace=f(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var p=t.data[r.index],d=t.data[e.index];d.a||(d.a=p.a),d.b||(d.b=p.b),u(d,e,e._defaultColor,t._fullLayout)}var m=function(t,e){var r,u,f,h,p,d,m,g=e._carpetTrace,v=g.aaxis,y=g.baxis;v._minDtick=0,y._minDtick=0,i.isArray1D(e.z)&&a(e,v,y,"a","b",["z"]);r=e._a=e._a||e.a,h=e._b=e._b||e.b,r=r?v.makeCalcdata(e,"_a"):[],h=h?y.makeCalcdata(e,"_b"):[],u=e.a0||0,f=e.da||1,p=e.b0||0,d=e.db||1,m=e._z=o(e._z||e.z,e.transpose),e._emptypoints=l(m),s(m,e._emptypoints);var x=i.maxRowLength(m),b="scaled"===e.xtype?"":r,_=c(e,b,u,f,x,v),w="scaled"===e.ytype?"":h,T=c(e,w,p,d,m.length,y),k={a:_,b:T,z:m};"levels"===e.contours.type&&"none"!==e.contours.coloring&&n(t,e,{vals:m,containerStr:"",cLetter:"z"});return[k]}(t,e);return h(e,e._z),m}}},{"../../components/colorscale/calc":375,"../../lib":515,"../carpet/lookup_carpetid":717,"../contour/set_contours":763,"../heatmap/clean_2d_array":803,"../heatmap/convert_column_xyz":805,"../heatmap/find_empties":807,"../heatmap/interp2d":810,"../heatmap/make_bound_array":812,"./defaults":768}],768:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/xyz_defaults"),a=t("./attributes"),o=t("../contour/constraint_defaults"),s=t("../contour/contours_defaults"),l=t("../contour/style_defaults");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,a,r,i)}if(u("carpet"),t.a&&t.b){if(!i(t,e,u,c,"a","b"))return void(e.visible=!1);u("text"),"constraint"===u("contours.type")?o(t,e,u,c,r,{hasHover:!1}):(s(t,e,u,(function(r){return n.coerce2(t,e,a,r)})),l(t,e,u,c,{hasHover:!1}))}else e._defaultColor=r,e._length=null}},{"../../lib":515,"../contour/constraint_defaults":749,"../contour/contours_defaults":751,"../contour/style_defaults":765,"../heatmap/xyz_defaults":816,"./attributes":766}],769:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../contour/colorbar"),calc:t("./calc"),plot:t("./plot"),style:t("../contour/style"),moduleType:"trace",name:"contourcarpet",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},{"../../plots/cartesian":578,"../contour/colorbar":747,"../contour/style":764,"./attributes":766,"./calc":767,"./defaults":768,"./plot":770}],770:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../carpet/map_1d_array"),a=t("../carpet/makepath"),o=t("../../components/drawing"),s=t("../../lib"),l=t("../contour/make_crossings"),c=t("../contour/find_all_paths"),u=t("../contour/plot"),f=t("../contour/constants"),h=t("../contour/convert_to_constraints"),p=t("../contour/empty_pathinfo"),d=t("../contour/close_boundaries"),m=t("../carpet/lookup_carpetid"),g=t("../carpet/axis_aligned_line");function v(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function x(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}e.exports=function(t,e,r,b){var _=e.xaxis,w=e.yaxis;s.makeTraceGroups(b,r,"contour").each((function(r){var b=n.select(this),T=r[0],k=T.trace,A=k._carpetTrace=m(t,k),M=t.calcdata[A.index][0];if(A.visible&&"legendonly"!==A.visible){var S=T.a,E=T.b,L=k.contours,C=p(L,e,T),P="constraint"===L.type,I=L._operation,O=P?"="===I?"lines":"fill":L.coloring,z=[[S[0],E[E.length-1]],[S[S.length-1],E[E.length-1]],[S[S.length-1],E[0]],[S[0],E[0]]];l(C);var D=1e-8*(S[S.length-1]-S[0]),R=1e-8*(E[E.length-1]-E[0]);c(C,D,R);var F,B,N,j,U=C;"constraint"===L.type&&(U=h(C,I)),function(t,e){var r,n,i,a,o,s,l,c,u;for(r=0;r=0;j--)F=M.clipsegments[j],B=i([],F.x,_.c2p),N=i([],F.y,w.c2p),B.reverse(),N.reverse(),V.push(a(B,N,F.bicubic));var H="M"+V.join("L")+"Z";!function(t,e,r,n,o,l){var c,u,f,h,p=s.ensureSingle(t,"g","contourbg").selectAll("path").data("fill"!==l||o?[]:[0]);p.enter().append("path"),p.exit().remove();var d=[];for(h=0;h=0&&(h=L,d=m):Math.abs(f[1]-h[1])=0&&(h=L,d=m):s.log("endpt to newendpt is not vert. or horz.",f,h,L)}if(d>=0)break;y+=S(f,h),f=h}if(d===e.edgepaths.length){s.log("unclosed perimeter path");break}u=d,(b=-1===x.indexOf(u))&&(u=x[0],y+=S(f,h)+"Z",f=null)}for(u=0;ug&&(n.max=g);n.len=n.max-n.min}(this,r,t,n,c,e.height),!(n.len<(e.width+e.height)*f.LABELMIN)))for(var i=Math.min(Math.ceil(n.len/I),f.LABELMAX),a=0;a0?+p[u]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:v},properties:y})}}var b=o.extractOpts(e),_=b.reversescale?o.flipScale(b.colorscale):b.colorscale,w=_[0][1],T=["interpolate",["linear"],["heatmap-density"],0,a.opacity(w)<1?w:a.addOpacity(w,0)];for(u=1;u<_.length;u++)T.push(_[u][0],_[u][1]);var k=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return i.extendFlat(c.heatmap.paint,{"heatmap-weight":d?k:1/(b.max-b.min),"heatmap-color":T,"heatmap-radius":m?{type:"identity",property:"r"}:e.radius,"heatmap-opacity":e.opacity}),c.geojson={type:"FeatureCollection",features:f},c.heatmap.layout.visibility="visible",c}},{"../../components/color":367,"../../components/colorscale":379,"../../constants/numerical":491,"../../lib":515,"../../lib/geojson_utils":509,"fast-isnumeric":190}],774:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/colorscale/defaults"),a=t("./attributes");e.exports=function(t,e,r,o){function s(r,i){return n.coerce(t,e,a,r,i)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(e._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),i(t,e,o,s,{prefix:"",cLetter:"z"})):e.visible=!1}},{"../../components/colorscale/defaults":377,"../../lib":515,"./attributes":771}],775:[function(t,e,r){"use strict";e.exports=function(t,e){return t.lon=e.lon,t.lat=e.lat,t.z=e.z,t}},{}],776:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../scattermapbox/hover").hoverPoints,a=t("../scattermapbox/hover").getExtraText;e.exports=function(t,e,r){var o=i(t,e,r);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var f=s.subplot.mockAxis;s.z=u.z,s.zLabel=n.tickText(f,f.c2l(u.z),"hover").text}return s.extraText=a(c,u,l[0].t.labels),[s]}}},{"../../plots/cartesian/axes":566,"../scattermapbox/hover":1007}],777:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),colorbar:t("../heatmap/colorbar"),formatLabels:t("../scattermapbox/format_labels"),calc:t("./calc"),plot:t("./plot"),hoverPoints:t("./hover"),eventData:t("./event_data"),getBelow:function(t,e){for(var r=e.getMapLayers(),n=0;n=0;r--)t.removeLayer(e[r][1])},o.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},e.exports=function(t,e){var r=e[0].trace,i=new a(t,r.uid),o=i.sourceId,s=n(e),l=i.below=t.belowLookup["trace-"+r.uid];return t.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),i}},{"../../plots/mapbox/constants":620,"./convert":773}],779:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;r"),l.color=function(t,e){var r=t.marker,i=e.mc||r.color,a=e.mlc||r.line.color,o=e.mlw||r.line.width;if(n(i))return i;if(n(a)&&o)return a}(u,h),[l]}}},{"../../components/color":367,"../../lib":515,"../bar/hover":664}],787:[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"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"funnel",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":578,"../bar/select":669,"./attributes":780,"./calc":781,"./cross_trace_calc":783,"./defaults":784,"./event_data":785,"./hover":786,"./layout_attributes":788,"./layout_defaults":789,"./plot":790,"./style":791}],788:[function(t,e,r){"use strict";e.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],789:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s path").each((function(t){if(!t.isBlank){var e=s.marker;n.select(this).call(a.fill,t.mc||e.color).call(a.stroke,t.mlc||e.line.color).call(i.dashLine,e.line.dash,t.mlw||e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".regions").each((function(){n.select(this).selectAll("path").style("stroke-width",0).call(a.fill,s.connector.fillcolor)})),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":367,"../../components/drawing":389,"../../constants/interactions":490,"../bar/style":671,"../bar/uniform_text":673,"@plotly/d3":58}],792:[function(t,e,r){"use strict";var n=t("../pie/attributes"),i=t("../../plots/attributes"),a=t("../../plots/domain").attributes,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/template_attributes").texttemplateAttrs,l=t("../../lib/extend").extendFlat;e.exports={labels:n.labels,label0:n.label0,dlabel:n.dlabel,values:n.values,marker:{colors:n.marker.colors,line:{color:l({},n.marker.line.color,{dflt:null}),width:l({},n.marker.line.width,{dflt:1}),editType:"calc"},editType:"calc"},text:n.text,hovertext:n.hovertext,scalegroup:l({},n.scalegroup,{}),textinfo:l({},n.textinfo,{flags:["label","text","value","percent"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","text","percent"]}),textposition:l({},n.textposition,{values:["inside","none"],dflt:"inside"}),textfont:n.textfont,insidetextfont:n.insidetextfont,title:{text:n.title.text,font:n.title.font,position:l({},n.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:a({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}},{"../../lib/extend":505,"../../plots/attributes":562,"../../plots/domain":593,"../../plots/template_attributes":642,"../pie/attributes":910}],793:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="funnelarea",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":628}],794:[function(t,e,r){"use strict";var n=t("../pie/calc");e.exports={calc:function(t,e){return n.calc(t,e)},crossTraceCalc:function(t){n.crossTraceCalc(t,{type:"funnelarea"})}}},{"../pie/calc":912}],795:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults,o=t("../bar/defaults").handleText,s=t("../pie/defaults").handleLabelsAndValues;e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}var u=c("labels"),f=c("values"),h=s(u,f),p=h.len;if(e._hasLabels=h.hasLabels,e._hasValues=h.hasValues,!e._hasLabels&&e._hasValues&&(c("label0"),c("dlabel")),p){e._length=p,c("marker.line.width")&&c("marker.line.color",l.paper_bgcolor),c("marker.colors"),c("scalegroup");var d,m=c("text"),g=c("texttemplate");if(g||(d=c("textinfo",Array.isArray(m)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),g||d&&"none"!==d){var v=c("textposition");o(t,e,l,c,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}a(e,l,c),c("title.text")&&(c("title.position"),n.coerceFont(c,"title.font",l.font)),c("aspectratio"),c("baseratio")}else e.visible=!1}},{"../../lib":515,"../../plots/domain":593,"../bar/defaults":661,"../pie/defaults":913,"./attributes":792}],796:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t("./base_plot"),categories:["pie-like","funnelarea","showLegend"],attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style"),styleOne:t("../pie/style_one"),meta:{}}},{"../pie/style_one":921,"./attributes":792,"./base_plot":793,"./calc":794,"./defaults":795,"./layout_attributes":797,"./layout_defaults":798,"./plot":799,"./style":800}],797:[function(t,e,r){"use strict";var n=t("../pie/layout_attributes").hiddenlabels;e.exports={hiddenlabels:n,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{"../pie/layout_attributes":917}],798:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("hiddenlabels"),r("funnelareacolorway",e.colorway),r("extendfunnelareacolors")}},{"../../lib":515,"./layout_attributes":797}],799:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/drawing"),a=t("../../lib"),o=a.strScale,s=a.strTranslate,l=t("../../lib/svg_text_utils"),c=t("../bar/plot").toMoveInsideBar,u=t("../bar/uniform_text"),f=u.recordMinTextSize,h=u.clearMinTextSize,p=t("../pie/helpers"),d=t("../pie/plot"),m=d.attachFxHandlers,g=d.determineInsideTextFont,v=d.layoutAreas,y=d.prerenderTitles,x=d.positionTitleOutside,b=d.formatSliceLabel;function _(t,e){return"l"+(e[0]-t[0])+","+(e[1]-t[1])}e.exports=function(t,e){var r=t._context.staticPlot,u=t._fullLayout;h("funnelarea",u),y(e,t),v(e,u._size),a.makeTraceGroups(u._funnelarealayer,e,"trace").each((function(e){var h=n.select(this),d=e[0],v=d.trace;!function(t){if(!t.length)return;var e=t[0],r=e.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o=Math.pow(i,2),s=e.vTotal,l=s,c=s*o/(1-o)/s;function u(){var t,e={x:t=Math.sqrt(c),y:-t};return[e.x,e.y]}var f,h,p=[];for(p.push(u()),f=t.length-1;f>-1;f--)if(!(h=t[f]).hidden){var d=h.v/l;c+=d,p.push(u())}var m=1/0,g=-1/0;for(f=0;f-1;f--)if(!(h=t[f]).hidden){var A=p[k+=1][0],M=p[k][1];h.TL=[-A,M],h.TR=[A,M],h.BL=w,h.BR=T,h.pxmid=(S=h.TR,E=h.BR,[.5*(S[0]+E[0]),.5*(S[1]+E[1])]),w=h.TL,T=h.TR}var S,E}(e),h.each((function(){var h=n.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(o,s){if(o.hidden)n.select(this).selectAll("path,g").remove();else{o.pointNumber=o.i,o.curveNumber=v.index;var h=d.cx,y=d.cy,x=n.select(this),w=x.selectAll("path.surface").data([o]);w.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),x.call(m,t,e);var T="M"+(h+o.TR[0])+","+(y+o.TR[1])+_(o.TR,o.BR)+_(o.BR,o.BL)+_(o.BL,o.TL)+"Z";w.attr("d",T),b(t,o,d);var k=p.castOption(v.textposition,o.pts),A=x.selectAll("g.slicetext").data(o.text&&"none"!==k?[0]:[]);A.enter().append("g").classed("slicetext",!0),A.exit().remove(),A.each((function(){var r=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),p=a.ensureUniformFontSize(t,g(v,o,u.font));r.text(o.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,p).call(l.convertToTspans,t);var d,m,x,b=i.bBox(r.node()),_=Math.min(o.BL[1],o.BR[1])+y,w=Math.max(o.TL[1],o.TR[1])+y;m=Math.max(o.TL[0],o.BL[0])+h,x=Math.min(o.TR[0],o.BR[0])+h,(d=c(m,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,f(v.type,d,u),e[s].transform=d,a.setTransormAndDisplay(r,d)}))}}));var y=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);y.enter().append("g").classed("titletext",!0),y.exit().remove(),y.each((function(){var e=a.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),r=v.title.text;v._meta&&(r=a.templateString(r,v._meta)),e.text(r).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,v.title.font).call(l.convertToTspans,t);var c=x(d,u._size);e.attr("transform",s(c.x,c.y)+o(Math.min(1,c.scale))+s(c.tx,c.ty))}))}))}))}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../bar/plot":668,"../bar/uniform_text":673,"../pie/helpers":915,"../pie/plot":919,"@plotly/d3":58}],800:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../pie/style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._funnelarealayer.selectAll(".trace");a(t,e,"funnelarea"),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(i,t,e)}))}))}},{"../bar/uniform_text":673,"../pie/style_one":921,"@plotly/d3":58}],801:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../lib/extend").extendFlat;e.exports=u({z:{valType:"data_array",editType:"calc"},x:u({},n.x,{impliedEdits:{xtype:"array"}}),x0:u({},n.x0,{impliedEdits:{xtype:"scaled"}}),dx:u({},n.dx,{impliedEdits:{xtype:"scaled"}}),y:u({},n.y,{impliedEdits:{ytype:"array"}}),y0:u({},n.y0,{impliedEdits:{ytype:"scaled"}}),dy:u({},n.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:u({},n.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:u({},n.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:u({},n.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:u({},n.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:u({},n.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:u({},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"},xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:a({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:u({},i.showlegend,{dflt:!1})},{transforms:void 0},c("",{cLetter:"z",autoColorDflt:!1}))},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/font_attributes":594,"../../plots/template_attributes":642,"../scatter/attributes":936}],802:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../plots/cartesian/align_period"),s=t("../histogram2d/calc"),l=t("../../components/colorscale/calc"),c=t("./convert_column_xyz"),u=t("./clean_2d_array"),f=t("./interp2d"),h=t("./find_empties"),p=t("./make_bound_array"),d=t("../../constants/numerical").BADNUM;function m(t){for(var e=[],r=t.length,n=0;nD){O("x scale is not linear");break}}if(x.length&&"fast"===P){var R=(x[x.length-1]-x[0])/(x.length-1),F=Math.abs(R/100);for(k=0;kF){O("y scale is not linear");break}}}var B=i.maxRowLength(T),N="scaled"===e.xtype?"":r,j=p(e,N,g,v,B,M),U="scaled"===e.ytype?"":x,V=p(e,U,b,_,T.length,S);C||(e._extremes[M._id]=a.findExtremes(M,j),e._extremes[S._id]=a.findExtremes(S,V));var H={x:j,y:V,z:T,text:e._text||e.text,hovertext:e._hovertext||e.hovertext};if(e.xperiodalignment&&y&&(H.orig_x=y),e.yperiodalignment&&w&&(H.orig_y=w),N&&N.length===j.length-1&&(H.xCenter=N),U&&U.length===V.length-1&&(H.yCenter=U),L&&(H.xRanges=A.xRanges,H.yRanges=A.yRanges,H.pts=A.pts),E||l(t,e,{vals:T,cLetter:"z"}),E&&e.contours&&"heatmap"===e.contours.coloring){var q={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};H.xfill=p(q,N,g,v,B,M),H.yfill=p(q,U,b,_,T.length,S)}return[H]}},{"../../components/colorscale/calc":375,"../../constants/numerical":491,"../../lib":515,"../../plots/cartesian/align_period":563,"../../plots/cartesian/axes":566,"../../registry":647,"../histogram2d/calc":835,"./clean_2d_array":803,"./convert_column_xyz":805,"./find_empties":807,"./interp2d":810,"./make_bound_array":812}],803:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r,o){var s,l,c,u,f,h;function p(t){if(n(t))return+t}if(e&&e.transpose){for(s=0,f=0;f=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort((function(t,e){return e[2]-t[2]}))}},{"../../lib":515}],808:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("../../components/colorscale").extractOpts;e.exports=function(t,e,r,s,l){l||(l={});var c,u,f,h,p=l.isContour,d=t.cd[0],m=d.trace,g=t.xa,v=t.ya,y=d.x,x=d.y,b=d.z,_=d.xCenter,w=d.yCenter,T=d.zmask,k=m.zhoverformat,A=y,M=x;if(!1!==t.index){try{f=Math.round(t.index[1]),h=Math.round(t.index[0])}catch(e){return void i.error("Error hovering on heatmap, pointNumber must be [row,col], found:",t.index)}if(f<0||f>=b[0].length||h<0||h>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(p){var S;for(A=[2*y[0]-y[1]],S=1;Sm&&(v=Math.max(v,Math.abs(t[a][o]-d)/(g-m))))}return v}e.exports=function(t,e){var r,i=1;for(o(t,e),r=0;r.01;r++)i=o(t,e,a(i));return i>.01&&n.log("interp2d didn't converge quickly",i),t}},{"../../lib":515}],811:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){t("texttemplate");var r=n.extendFlat({},e.font,{color:"auto",size:"auto"});n.coerceFont(t,"textfont",r)}},{"../../lib":515}],812:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib").isArrayOrTypedArray;e.exports=function(t,e,r,a,o,s){var l,c,u,f=[],h=n.traceIs(t,"contour"),p=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(i(e)&&e.length>1&&!p&&"category"!==s.type){var m=e.length;if(!(m<=o))return h?e.slice(0,o):e.slice(0,o+1);if(h||d)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;u0;)_=w.c2p(R[S]),S--;for(_0;)M=T.c2p(F[S]),S--;if(MGt||Gt>T._length))for(E=Ut;EWt||Wt>w._length)){var Zt=u({x:Yt,y:qt},I,t._fullLayout);Zt.x=Yt,Zt.y=qt;var Xt=P.z[S][E];void 0===Xt?(Zt.z="",Zt.zLabel=""):(Zt.z=Xt,Zt.zLabel=s.tickText(Ft,Xt,"hover").text);var Jt=P.text&&P.text[S]&&P.text[S][E];void 0!==Jt&&!1!==Jt||(Jt=""),Zt.text=Jt;var Kt=l.texttemplateString(Dt,Zt,t._fullLayout._d3locale,Zt,I._meta||{});if(Kt){var Qt=Kt.split("
"),$t=Qt.length,te=0;for(L=0;L<$t;L++)te=Math.max(te,Qt[L].length);Ht.push({l:$t,c:te,t:Kt,x:Wt,y:Gt,z:Xt})}}}}var ee=I.textfont,re=ee.family,ne=ee.size,ie=t._fullLayout.font.size;if(!ne||"auto"===ne){var ae=1/0,oe=1/0,se=0,le=0;for(L=0;L0&&(a=!0);for(var l=0;la){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c?t>o?t>1.1*i?i:t>1.1*a?a:o:t>s?s:t>l?l:c:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function p(t,e,r,n,a,s){if(n&&t>o){var l=d(e,a,s),c=d(r,a,s),u=t===i?0:1;return l[u]!==c[u]}return Math.floor(r/t)-Math.floor(e/t)>.1}function d(t,e,r){var n=e.c2d(t,i,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}e.exports=function(t,e,r,n,a){var s,l,c=-1.1*e,h=-.1*e,p=t-h,d=r[0],m=r[1],g=Math.min(f(d+h,d+p,n,a),f(m+h,m+p,n,a)),v=Math.min(f(d+c,d+h,n,a),f(m+c,m+h,n,a));if(g>v&&vo){var y=s===i?1:6,x=s===i?"M12":"M1";return function(e,r){var o=n.c2d(e,i,a),s=o.indexOf("-",y);s>0&&(o=o.substr(0,s));var c=n.d2c(o,0,a);if(cr.r2l(B)&&(j=o.tickIncrement(j,b.size,!0,p)),z.start=r.l2r(j),F||i.nestedProperty(e,v+".start").set(z.start)}var U=b.end,V=r.r2l(O.end),H=void 0!==V;if((b.endFound||H)&&V!==r.r2l(U)){var q=H?V:i.aggNums(Math.max,null,d);z.end=r.l2r(q),H||i.nestedProperty(e,v+".start").set(z.end)}var G="autobin"+s;return!1===e._input[G]&&(e._input[v]=i.extendFlat({},e[v]||{}),delete e._input[G],delete e[G]),[z,d]}e.exports={calc:function(t,e){var r,a,p,d,m=[],g=[],v="h"===e.orientation,y=o.getFromId(t,v?e.yaxis:e.xaxis),x=v?"y":"x",b={x:"y",y:"x"}[x],_=e[x+"calendar"],w=e.cumulative,T=h(t,e,y,x),k=T[0],A=T[1],M="string"==typeof k.size,S=[],E=M?S:k,L=[],C=[],P=[],I=0,O=e.histnorm,z=e.histfunc,D=-1!==O.indexOf("density");w.enabled&&D&&(O=O.replace(/ ?density$/,""),D=!1);var R,F="max"===z||"min"===z?null:0,B=l.count,N=c[O],j=!1,U=function(t){return y.r2c(t,0,_)};for(i.isArrayOrTypedArray(e[b])&&"count"!==z&&(R=e[b],j="avg"===z,B=l[z]),r=U(k.start),p=U(k.end)+(r-o.tickIncrement(r,k.size,!1,_))/1e6;r=0&&d=0;n--)s(n);else if("increasing"===e){for(n=1;n=0;n--)t[n]+=t[n+1];"exclude"===r&&(t.push(0),t.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),Q=[],$=0,tt=K-1;for(r=0;r=$;r--)if(g[r]){tt=r;break}for(r=$;r<=tt;r++)if(n(m[r])&&n(g[r])){var et={p:m[r],s:g[r],b:0};w.enabled||(et.pts=P[r],Y?et.ph0=et.ph1=P[r].length?A[P[r][0]]:m[r]:(e._computePh=!0,et.ph0=q(S[r]),et.ph1=q(S[r+1],!0))),Q.push(et)}return 1===Q.length&&(Q[0].width1=o.tickIncrement(Q[0].p,k.size,!1,_)-Q[0].p),s(Q,e),i.isArrayOrTypedArray(e.selectedpoints)&&i.tagSelected(Q,e,X),Q},calcAllAutoBins:h}},{"../../lib":515,"../../plots/cartesian/axes":566,"../../registry":647,"../bar/arrays_to_calcdata":656,"./average":822,"./bin_functions":824,"./bin_label_vals":825,"./norm_functions":833,"fast-isnumeric":190}],827:[function(t,e,r){"use strict";e.exports={eventDataKeys:["binNumber"]}},{}],828:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axis_ids"),a=t("../../registry").traceIs,o=t("../bar/defaults").handleGroupingDefaults,s=n.nestedProperty,l=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,h,p,d,m,g,v=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,a){var o=t.uid+"__"+a;r||(r=o);var s=function(t,r){return i.getFromTrace({_fullLayout:e},t,r).type}(t,a),l=t[a+"calendar"]||"",c=v[r],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(t),c.dirs.push(a)):(r=o,s!==c.axType&&n.warn(["Attempted to group the bins of trace",t.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&n.warn(["Attempted to group the bins of trace",t.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[r]={traces:[t],dirs:[a],axType:s,calendar:t[a+"calendar"]||""}),t["_"+a+"bingroup"]=r}for(d=0;dS&&T.splice(S,T.length-S),M.length>S&&M.splice(S,M.length-S);var E=[],L=[],C=[],P="string"==typeof w.size,I="string"==typeof A.size,O=[],z=[],D=P?O:w,R=I?z:A,F=0,B=[],N=[],j=e.histnorm,U=e.histfunc,V=-1!==j.indexOf("density"),H="max"===U||"min"===U?null:0,q=a.count,G=o[j],Y=!1,W=[],Z=[],X="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";X&&"count"!==U&&(Y="avg"===U,q=a[U]);var J=w.size,K=x(w.start),Q=x(w.end)+(K-i.tickIncrement(K,J,!1,v))/1e6;for(r=K;r=0&&p=0&&d-1,flipY:L.tiling.flip.indexOf("y")>-1,orientation:L.tiling.orientation,pad:{inner:L.tiling.pad},maxDepth:L._maxDepth}).descendants(),z=1/0,D=-1/0;O.forEach((function(t){var e=t.depth;e>=L._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(z=Math.min(z,e),D=Math.max(D,e))})),p=p.data(O,u.getPtId),L._maxVisibleLayers=isFinite(D)?D-z+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[m,g],x),p.order();var R=null;if(w&&M){var F=u.getPtId(M);p.each((function(t){null===R&&u.getPtId(t)===F&&(R={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var B=function(){return R||{x0:0,x1:m,y0:0,y1:g}},N=p;return w&&(N=N.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-L.tiling.pad),s._hoverY=y(I?s.y1-L.tiling.pad/2:s.y0+L.tiling.pad/2);var p=n.select(this),d=i.ensureSingle(p,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?d.transition().attrTween("d",(function(t){var e=k(t,!1,B(),[m,g],{orientation:L.tiling.orientation,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1});return function(t){return x(e(t))}})):d.attr("d",x),p.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),d.call(l,s,L,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=h(s,r,L,e,E)||"";var T=i.ensureSingle(p,"g","slicetext"),M=i.ensureSingle(T,"text","",(function(t){t.attr("data-notex",1)})),O=i.ensureUniformFontSize(t,u.determineTextFont(L,s,E.font));M.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":C?"start":"middle").call(a.font,O).call(o.convertToTspans,t),s.textBB=a.bBox(M.node()),s.transform=b(s,{fontSize:O.size}),s.transform.fontSize=O.size,w?M.transition().attrTween("transform",(function(t){var e=A(t,!1,B(),[m,g]);return function(t){return _(e(t))}})):M.attr("transform",_(s))})),R}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../sunburst/fx":1063,"../sunburst/helpers":1064,"../sunburst/plot":1068,"../treemap/constants":1087,"./partition":851,"./style":853,"@plotly/d3":58}],848:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"icicle",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot"),style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":954,"./attributes":843,"./base_plot":844,"./calc":845,"./defaults":846,"./layout_attributes":849,"./layout_defaults":850,"./plot":852,"./style":853}],849:[function(t,e,r){"use strict";e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],850:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("iciclecolorway",e.colorway),r("extendiciclecolors")}},{"../../lib":515,"./layout_attributes":849}],851:[function(t,e,r){"use strict";var n=t("d3-hierarchy"),i=t("../treemap/flip_tree");e.exports=function(t,e,r){var a=r.flipX,o=r.flipY,s="h"===r.orientation,l=r.maxDepth,c=e[0],u=e[1];l&&(c=(t.height+1)*e[0]/Math.min(t.height+1,l),u=(t.height+1)*e[1]/Math.min(t.height+1,l));var f=n.partition().padding(r.pad.inner).size(s?[e[1],c]:[e[0],u])(t);return(s||a||o)&&i(f,e,{swapXY:s,flipX:a,flipY:o}),f}},{"../treemap/flip_tree":1092,"d3-hierarchy":115}],852:[function(t,e,r){"use strict";var n=t("../treemap/draw"),i=t("./draw_descendants");e.exports=function(t,e,r,a){return n(t,e,r,a,{type:"icicle",drawDescendants:i})}},{"../treemap/draw":1089,"./draw_descendants":847}],853:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._iciclelayer.selectAll(".trace");o(t,e,"icicle"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":367,"../../lib":515,"../bar/uniform_text":673,"@plotly/d3":58}],854:[function(t,e,r){"use strict";for(var n=t("../../plots/attributes"),i=t("../../plots/template_attributes").hovertemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("./constants").colormodel,s=["rgb","rgba","rgba256","hsl","hsla"],l=[],c=[],u=0;u0||n.inbox(r-o.y0,r-(o.y0+o.h*s.dy),0)>0)){var u,f=Math.floor((e-o.x0)/s.dx),h=Math.floor(Math.abs(r-o.y0)/s.dy);if(s._hasZ?u=o.z[h][f]:s._hasSource&&(u=s._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,h,1,1).data),u){var p,d=o.hi||s.hoverinfo;if(d){var m=d.split("+");-1!==m.indexOf("all")&&(m=["color"]),-1!==m.indexOf("color")&&(p=!0)}var g,v=a.colormodel[s.colormodel],y=v.colormodel||s.colormodel,x=y.length,b=s._scaler(u),_=v.suffix,w=[];(s.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(s.hovertext)&&Array.isArray(s.hovertext[h])?g=s.hovertext[h][f]:Array.isArray(s.text)&&Array.isArray(s.text[h])&&(g=s.text[h][f]);var T=c.c2p(o.y0+(h+.5)*s.dy),k=o.x0+(f+.5)*s.dx,A=o.y0+(h+.5)*s.dy,M="["+u.slice(0,s.colormodel.length).join(", ")+"]";return[i.extendFlat(t,{index:[h,f],x0:l.c2p(o.x0+f*s.dx),x1:l.c2p(o.x0+(f+1)*s.dx),y0:T,y1:T,color:b,xVal:k,xLabelVal:k,yVal:A,yLabelVal:A,zLabelVal:M,text:g,hovertemplateLabels:{zLabel:M,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":407,"../../lib":515,"./constants":856}],861:[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":578,"./attributes":854,"./calc":855,"./defaults":857,"./event_data":858,"./hover":860,"./plot":862,"./style":863}],862:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.strTranslate,o=t("../../constants/xmlns_namespaces"),s=t("./constants"),l=i.isIOS()||i.isSafari()||i.isIE();e.exports=function(t,e,r,c){var u=e.xaxis,f=e.yaxis,h=!(l||t._context._exportedPlot);i.makeTraceGroups(c,r,"im").each((function(e){var r=n.select(this),l=e[0],c=l.trace,p=("fast"===c.zsmooth||!1===c.zsmooth&&h)&&!c._hasZ&&c._hasSource&&"linear"===u.type&&"linear"===f.type;c._realImage=p;var d,m,g,v,y,x,b=l.z,_=l.x0,w=l.y0,T=l.w,k=l.h,A=c.dx,M=c.dy;for(x=0;void 0===d&&x0;)m=u.c2p(_+x*A),x--;for(x=0;void 0===v&&x0;)y=f.c2p(w+x*M),x--;if(mI[0];if(O||z){var D=d+S/2,R=v+E/2;C+="transform:"+a(D+"px",R+"px")+"scale("+(O?-1:1)+","+(z?-1:1)+")"+a(-D+"px",-R+"px")+";"}}L.attr("style",C);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",{willReadFrequently:!0});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=B((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",{willReadFrequently:!0}).getImageData(0,0,T,k).data;t=B((function(t,r){var n=4*(r*T+t);return[e[n],e[n+1],e[n+2],e[n+3]]})).toDataURL("image/png")}L.attr({"xlink:href":t,height:E,width:S,x:d,y:v})}));t._promises.push(F)}function B(t){var e=document.createElement("canvas");e.width=S,e.height=E;var r,n=e.getContext("2d",{willReadFrequently:!0}),a=function(t){return i.constrain(Math.round(u.c2p(_+t*A)-d),0,S)},o=function(t){return i.constrain(Math.round(f.c2p(w+t*M)-v),0,E)},h=s.colormodel[c.colormodel],p=h.colormodel||c.colormodel,m=h.fmt;for(x=0;x0}function T(t){t.each((function(t){y.stroke(n.select(this),t.line.color)})).each((function(t){y.fill(n.select(this),t.color)})).style("stroke-width",(function(t){return t.line.width}))}function k(t,e,r){var n=t._fullLayout,i=o.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},e),a={type:"linear",_id:"x"+e._id},s={letter:"x",font:n.font,noHover:!0,noTickson:!0};function l(t,e){return o.coerce(i,a,v,t,e)}return m(i,a,l,s,n),g(i,a,l,s),a}function A(t,e,r){return[Math.min(e/t.width,r/t.height),t,e+"x"+r]}function M(t,e,r,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=n.select(a);return o.text(t).attr("x",0).attr("y",0).attr("text-anchor",r).attr("data-unformatted",t).call(p.convertToTspans,i).call(f.font,e),f.bBox(o.node())}function S(t,e,r,n,i,a){var s="_cache"+e;t[s]&&t[s].key===i||(t[s]={key:i,value:r});var l=o.aggNums(a,null,[t[s].value,n],2);return t[s].value=l,l}e.exports=function(t,e,r,m){var g,v=t._fullLayout;w(r)&&m&&(g=m()),o.makeTraceGroups(v._indicatorlayer,e,"trace").each((function(e){var m,E,L,C,P,I=e[0].trace,O=n.select(this),z=I._hasGauge,D=I._isAngular,R=I._isBullet,F=I.domain,B={w:v._size.w*(F.x[1]-F.x[0]),h:v._size.h*(F.y[1]-F.y[0]),l:v._size.l+v._size.w*F.x[0],r:v._size.r+v._size.w*(1-F.x[1]),t:v._size.t+v._size.h*(1-F.y[1]),b:v._size.b+v._size.h*F.y[0]},N=B.l+B.w/2,j=B.t+B.h/2,U=Math.min(B.w/2,B.h),V=h.innerRadius*U,H=I.align||"center";if(E=j,z){if(D&&(m=N,E=j+U/2,L=function(t){return function(t,e){var r=Math.sqrt(t.width/2*(t.width/2)+t.height*t.height);return[e/r,t,e]}(t,.9*V)}),R){var q=h.bulletPadding,G=1-h.bulletNumberDomainSize+q;m=B.l+(G+(1-G)*b[H])*B.w,L=function(t){return A(t,(h.bulletNumberDomainSize-q)*B.w,B.h)}}}else m=B.l+b[H]*B.w,L=function(t){return A(t,B.w,B.h)};!function(t,e,r,i){var c,u,h,m=r[0].trace,g=i.numbersX,v=i.numbersY,T=m.align||"center",A=x[T],E=i.transitionOpts,L=i.onComplete,C=o.ensureSingle(e,"g","numbers"),P=[];m._hasNumber&&P.push("number");m._hasDelta&&(P.push("delta"),"left"===m.delta.position&&P.reverse());var I=C.selectAll("text").data(P);function O(e,r,n,i){if(!e.match("s")||n>=0==i>=0||r(n).slice(-1).match(_)||r(i).slice(-1).match(_))return r;var a=e.slice().replace("s","f").replace(/\d+/,(function(t){return parseInt(t)-1})),o=k(t,{tickformat:a});return function(t){return Math.abs(t)<1?d.tickText(o,t).text:r(t)}}I.enter().append("text"),I.attr("text-anchor",(function(){return A})).attr("class",(function(t){return t})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var z,D=m.mode+m.align;m._hasDelta&&(z=function(){var e=k(t,{tickformat:m.delta.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.delta.suffix,s=m.delta.prefix,l=function(t){return m.delta.relative?t.relativeDelta:t.delta},c=function(t,e){return 0===t||"number"!=typeof t||isNaN(t)?"-":(t>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+e(t)+o},h=function(t){return t.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(r[0]));var g=C.select("text.delta");function v(){g.text(c(l(r[0]),i)).call(y.fill,h(r[0])).call(p.convertToTspans,t)}return g.call(f.font,m.delta.font).call(y.fill,h({delta:m._deltaLastValue})),w(E)?g.transition().duration(E.duration).ease(E.easing).tween("text",(function(){var t=n.select(this),e=l(r[0]),o=m._deltaLastValue,s=O(m.delta.valueformat,i,o,e),u=a(o,e);return m._deltaLastValue=e,function(e){t.text(c(u(e),s)),t.call(y.fill,h({delta:u(e)}))}})).each("end",(function(){v(),L&&L()})).each("interrupt",(function(){v(),L&&L()})):v(),u=M(c(l(r[0]),i),m.delta.font,A,t),g}(),D+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,D+=m.delta.increasing.symbol+m.delta.decreasing.symbol,h=u);m._hasNumber&&(!function(){var e=k(t,{tickformat:m.number.valueformat},m._range);e.setScale(),d.prepTicks(e);var i=function(t){return d.tickText(e,t).text},o=m.number.suffix,s=m.number.prefix,l=C.select("text.number");function u(){var e="number"==typeof r[0].y?s+i(r[0].y)+o:"-";l.text(e).call(f.font,m.number.font).call(p.convertToTspans,t)}w(E)?l.transition().duration(E.duration).ease(E.easing).each("end",(function(){u(),L&&L()})).each("interrupt",(function(){u(),L&&L()})).attrTween("text",(function(){var t=n.select(this),e=a(r[0].lastY,r[0].y);m._lastValue=r[0].y;var l=O(m.number.valueformat,i,r[0].lastY,r[0].y);return function(r){t.text(s+l(e(r))+o)}})):u(),c=M(s+i(r[0].y)+o,m.number.font,A,t)}(),D+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,h=c);if(m._hasDelta&&m._hasNumber){var R,F,B=[(c.left+c.right)/2,(c.top+c.bottom)/2],N=[(u.left+u.right)/2,(u.top+u.bottom)/2],j=.75*m.delta.font.size;"left"===m.delta.position&&(R=S(m,"deltaPos",0,-1*(c.width*b[m.align]+u.width*(1-b[m.align])+j),D,Math.min),F=B[1]-N[1],h={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:u.left+R,right:c.right,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"right"===m.delta.position&&(R=S(m,"deltaPos",0,c.width*(1-b[m.align])+u.width*b[m.align]+j,D,Math.max),F=B[1]-N[1],h={width:c.width+u.width+j,height:Math.max(c.height,u.height),left:c.left,right:u.right+R,top:Math.min(c.top,u.top+F),bottom:Math.max(c.bottom,u.bottom+F)}),"bottom"===m.delta.position&&(R=null,F=u.height,h={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height,bottom:c.bottom+u.height}),"top"===m.delta.position&&(R=null,F=c.top,h={width:Math.max(c.width,u.width),height:c.height+u.height,left:Math.min(c.left,u.left),right:Math.max(c.right,u.right),top:c.bottom-c.height-u.height,bottom:c.bottom}),z.attr({dx:R,dy:F})}(m._hasNumber||m._hasDelta)&&C.attr("transform",(function(){var t=i.numbersScaler(h);D+=t[2];var e,r=S(m,"numbersScale",1,t[0],D,Math.min);m._scaleNumbers||(r=1),e=m._isAngular?v-r*h.bottom:v-r*(h.top+h.bottom)/2,m._numbersTop=r*h.top+e;var n=h[T];"center"===T&&(n=(h.left+h.right)/2);var a=g-r*n;return a=S(m,"numbersTranslate",0,a,D,Math.max),l(a,e)+s(r)}))}(t,O,e,{numbersX:m,numbersY:E,numbersScaler:L,transitionOpts:r,onComplete:g}),z&&(C={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},P={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var Y=O.selectAll("g.angular").data(D?e:[]);Y.exit().remove();var W=O.selectAll("g.angularaxis").data(D?e:[]);W.exit().remove(),D&&function(t,e,r,a){var o,s,f,h,p=r[0].trace,m=a.size,g=a.radius,v=a.innerRadius,y=a.gaugeBg,x=a.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,A=a.layer,M=a.transitionOpts,S=a.onComplete,E=Math.PI/2;function L(t){var e=p.gauge.axis.range[0],r=(t-e)/(p.gauge.axis.range[1]-e)*Math.PI-E;return r<-E?-E:r>E?E:r}function C(t){return n.svg.arc().innerRadius((v+g)/2-t/2*(g-v)).outerRadius((v+g)/2+t/2*(g-v)).startAngle(-E)}function P(t){t.attr("d",(function(t){return C(t.thickness).startAngle(L(t.range[0])).endAngle(L(t.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",l(b[0],b[1])),A.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),A.selectAll("g.xangularaxistick,path,text").remove(),(o=k(t,p.gauge.axis)).type="linear",o.range=p.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(t){return(o.range[0]-t.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},O={},z=d.makeLabelFns(o,0).labelStandoff;O.xFn=function(t){var e=I(t);return Math.cos(e)*z},O.yFn=function(t){var e=I(t),r=Math.sin(e)>0?.2:1;return-Math.sin(e)*(z+t.fontSize*r)+Math.abs(Math.cos(e))*(t.fontSize*u)},O.anchorFn=function(t){var e=I(t),r=Math.cos(e);return Math.abs(r)<.1?"middle":r>0?"start":"end"},O.heightFn=function(t,e,r){var n=I(t);return-.5*(1+Math.sin(n))*r};var D=function(t){return l(b[0]+g*Math.cos(t),b[1]-g*Math.sin(t))};f=function(t){return D(I(t))};if(s=d.calcTicks(o),h=d.getTickSigns(o)[2],o.visible){h="inside"===o.ticks?-1:1;var R=(o.linewidth||1)/2;d.drawTicks(t,o,{vals:s,layer:A,path:"M"+h*R+",0h"+h*o.ticklen,transFn:function(t){var e=I(t);return D(e)+"rotate("+-c(e)+")"}}),d.drawLabels(t,o,{vals:s,layer:A,transFn:f,labelFns:O})}var F=[y].concat(p.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(P).call(T),B.exit().remove();var N=C(p.gauge.bar.thickness),j=_.selectAll("g.value-arc").data([p.gauge.bar]);j.enter().append("g").classed("value-arc",!0).append("path");var U=j.select("path");w(M)?(U.transition().duration(M.duration).ease(M.easing).each("end",(function(){S&&S()})).each("interrupt",(function(){S&&S()})).attrTween("d",(V=N,H=L(r[0].lastY),q=L(r[0].y),function(){var t=i(H,q);return function(e){return V.endAngle(t(e))()}})),p._lastValue=r[0].y):U.attr("d","number"==typeof r[0].y?N.endAngle(L(r[0].y)):"M0,0Z");var V,H,q;U.call(T),j.exit().remove(),F=[];var G=p.gauge.threshold.value;(G||0===G)&&F.push({range:[G,G],color:p.gauge.threshold.color,line:{color:p.gauge.threshold.line.color,width:p.gauge.threshold.line.width},thickness:p.gauge.threshold.thickness});var Y=_.selectAll("g.threshold-arc").data(F);Y.enter().append("g").classed("threshold-arc",!0).append("path"),Y.select("path").call(P).call(T),Y.exit().remove();var W=_.selectAll("g.gauge-outline").data([x]);W.enter().append("g").classed("gauge-outline",!0).append("path"),W.select("path").call(P).call(T),W.exit().remove()}(t,0,e,{radius:U,innerRadius:V,gauge:Y,layer:W,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var Z=O.selectAll("g.bullet").data(R?e:[]);Z.exit().remove();var X=O.selectAll("g.bulletaxis").data(R?e:[]);X.exit().remove(),R&&function(t,e,r,n){var i,a,o,s,c,u=r[0].trace,f=n.gauge,p=n.layer,m=n.gaugeBg,g=n.gaugeOutline,v=n.size,x=u.domain,b=n.transitionOpts,_=n.onComplete;f.enter().append("g").classed("bullet",!0),f.attr("transform",l(v.l,v.t)),p.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),p.selectAll("g.xbulletaxistick,path,text").remove();var A=v.h,M=u.gauge.bar.thickness*A,S=x.x[0],E=x.x[0]+(x.x[1]-x.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);(i=k(t,u.gauge.axis))._id="xbulletaxis",i.domain=[S,E],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),s=d.getTickSigns(i)[2],c=v.t+v.h,i.visible&&(d.drawTicks(t,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:p,path:d.makeTickPath(i,c,s),transFn:o}),d.drawLabels(t,i,{vals:a,layer:p,transFn:o,labelFns:d.makeLabelFns(i,c)}));function L(t){t.attr("width",(function(t){return Math.max(0,i.c2p(t.range[1])-i.c2p(t.range[0]))})).attr("x",(function(t){return i.c2p(t.range[0])})).attr("y",(function(t){return.5*(1-t.thickness)*A})).attr("height",(function(t){return t.thickness*A}))}var C=[m].concat(u.gauge.steps),P=f.selectAll("g.bg-bullet").data(C);P.enter().append("g").classed("bg-bullet",!0).append("rect"),P.select("rect").call(L).call(T),P.exit().remove();var I=f.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",M).attr("y",(A-M)/2).call(T),w(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"==typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0);I.exit().remove();var O=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),z=f.selectAll("g.threshold-bullet").data(O);z.enter().append("g").classed("threshold-bullet",!0).append("line"),z.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*A).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*A).call(y.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),z.exit().remove();var D=f.selectAll("g.gauge-outline").data([g]);D.enter().append("g").classed("gauge-outline",!0).append("rect"),D.select("rect").call(L).call(T),D.exit().remove()}(t,0,e,{gauge:Z,layer:X,size:B,gaugeBg:C,gaugeOutline:P,transitionOpts:r,onComplete:g});var J=O.selectAll("text.title").data(e);J.exit().remove(),J.enter().append("text").classed("title",!0),J.attr("text-anchor",(function(){return R?x.right:x[I.title.align]})).text(I.title.text).call(f.font,I.title.font).call(p.convertToTspans,t),J.attr("transform",(function(){var t,e=B.l+B.w*b[I.title.align],r=h.titlePadding,n=f.bBox(J.node());if(z){if(D)if(I.gauge.axis.visible)t=f.bBox(W.node()).top-r-n.bottom;else t=B.t+B.h/2-U/2-n.bottom-r;R&&(t=E-(n.top+n.bottom)/2,e=B.l-h.bulletPadding*B.w)}else t=I._numbersTop-r-n.bottom;return l(e,t)}))}))}},{"../../components/color":367,"../../components/drawing":389,"../../constants/alignment":483,"../../lib":515,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"../../plots/cartesian/axis_defaults":568,"../../plots/cartesian/layout_attributes":579,"../../plots/cartesian/position_defaults":582,"./constants":867,"@plotly/d3":58,"d3-interpolate":116}],871:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../mesh3d/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;var u=e.exports=c(l({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),valuehoverformat:i("value",1),showlegend:l({},s.showlegend,{dflt:!1})},n("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,lightposition:o.lightposition,lighting:o.lighting,flatshading:o.flatshading,contour:o.contour,hoverinfo:l({},s.hoverinfo)}),"calc","nested");u.flatshading.dflt=!0,u.lighting.facenormalsepsilon.dflt=0,u.x.editType=u.y.editType=u.z.editType=u.value.editType="calc+clearAxisTypes",u.transforms=void 0},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plot_api/edit_types":548,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642,"../mesh3d/attributes":876}],872:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc"),i=t("../streamtube/calc").processGrid,a=t("../streamtube/calc").filter;e.exports=function(t,e){e._len=Math.min(e.x.length,e.y.length,e.z.length,e.value.length),e._x=a(e.x,e._len),e._y=a(e.y,e._len),e._z=a(e.z,e._len),e._value=a(e.value,e._len);var r=i(e);e._gridFill=r.fill,e._Xs=r.Xs,e._Ys=r.Ys,e._Zs=r.Zs,e._len=r.len;for(var o=1/0,s=-1/0,l=0;l0;r--){var n=Math.min(e[r],e[r-1]),i=Math.max(e[r],e[r-1]);if(i>n&&n-1}function R(t,e){return null===t?e:t}function F(e,r,n){C();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(t,e){var r=t[0],n=t[1],i=t[2],a=function(t,e,r){for(var n=[],i=0;i-1?n[p]:L(d,m,v);h[p]=x>-1?x:I(d,m,v,R(e,y))}i=h[0],a=h[1],o=h[2],t._meshI.push(i),t._meshJ.push(a),t._meshK.push(o),++g}}function B(t,e,r,n){var i=t[3];in&&(i=n);for(var a=(t[3]-i)/(t[3]-e[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*t[s]+a*e[s];return o}function N(t,e,r){return t>=e&&t<=r}function j(t){var e=.001*(E-S);return t>=S-e&&t<=E+e}function U(e){for(var r=[],n=0;n<4;n++){var i=e[n];r.push([t._x[i],t._y[i],t._z[i],t._value[i]])}return r}function V(t,e,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[N(e[0][3],n,i),N(e[1][3],n,i),N(e[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(t,e,r){return j(e[0][3])&&j(e[1][3])&&j(e[2][3])?(F(t,e,r),!0):a<3&&V(t,e,r,S,E,++a)};if(s[0]&&s[1]&&s[2])return l(t,e,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],p=B(h,u,n,i),d=B(h,f,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,o=l(t,[u,f,d],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=e[a[0]],f=e[a[1]],h=e[a[2]],p=B(f,u,n,i),d=B(h,u,n,i);o=l(t,[d,p,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function H(t,e,r,n){var i=!1,a=U(e),o=[N(a[0][3],r,n),N(a[1][3],r,n),N(a[2][3],r,n),N(a[3][3],r,n)];if(!(o[0]||o[1]||o[2]||o[3]))return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(t,a,e)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]];if(m)i=F(t,[c,u,f],[e[l[0]],e[l[1]],e[l[2]]])||i;else{var p=B(h,c,r,n),d=B(h,u,r,n),g=B(h,f,r,n);i=F(null,[p,d,g],[-1,-1,-1])||i}s=!0}})),s?i:([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],p=B(f,c,r,n),d=B(f,u,r,n),g=B(h,u,r,n),v=B(h,c,r,n);m?(i=F(t,[c,v,p],[e[l[0]],-1,-1])||i,i=F(t,[u,d,g],[e[l[1]],-1,-1])||i):i=function(t,e,r){var n=function(n,i,a){F(t,[e[n],e[i],e[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[p,d,g,v],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],f=a[l[2]],h=a[l[3]],p=B(u,c,r,n),d=B(f,c,r,n),g=B(h,c,r,n);m?(i=F(t,[c,p,d],[e[l[0]],-1,-1])||i,i=F(t,[c,d,g],[e[l[0]],-1,-1])||i,i=F(t,[c,g,p],[e[l[0]],-1,-1])||i):i=F(null,[p,d,g],[-1,-1,-1])||i,s=!0}})),i)}function q(t,e,r,n,i,a,o,s,l,c,u){var f=!1;return d&&(D(t,"A")&&(f=H(null,[e,r,n,a],c,u)||f),D(t,"B")&&(f=H(null,[r,n,i,l],c,u)||f),D(t,"C")&&(f=H(null,[r,a,o,l],c,u)||f),D(t,"D")&&(f=H(null,[n,a,s,l],c,u)||f),D(t,"E")&&(f=H(null,[r,n,a,l],c,u)||f)),m&&(f=H(t,[r,n,a,l],c,u)||f),f}function G(t,e,r,n,i,a,o,s){return[!0===s[0]||V(t,U([e,r,n]),[e,r,n],a,o),!0===s[1]||V(t,U([n,i,e]),[n,i,e],a,o)]}function Y(t,e,r,n,i,a,o,s,l){return s?G(t,e,r,i,n,a,o,l):G(t,r,i,n,e,a,o,l)}function W(t,e,r,n,i,a,o){var s,l,c,u,f=!1,h=function(){f=V(t,[s,l,c],[-1,-1,-1],i,a)||f,f=V(t,[c,u,s],[-1,-1,-1],i,a)||f},p=o[0],d=o[1],m=o[2];return p&&(s=O(U([k(e,r-0,n-0)])[0],U([k(e-1,r-0,n-0)])[0],p),l=O(U([k(e,r-0,n-1)])[0],U([k(e-1,r-0,n-1)])[0],p),c=O(U([k(e,r-1,n-1)])[0],U([k(e-1,r-1,n-1)])[0],p),u=O(U([k(e,r-1,n-0)])[0],U([k(e-1,r-1,n-0)])[0],p),h()),d&&(s=O(U([k(e-0,r,n-0)])[0],U([k(e-0,r-1,n-0)])[0],d),l=O(U([k(e-0,r,n-1)])[0],U([k(e-0,r-1,n-1)])[0],d),c=O(U([k(e-1,r,n-1)])[0],U([k(e-1,r-1,n-1)])[0],d),u=O(U([k(e-1,r,n-0)])[0],U([k(e-1,r-1,n-0)])[0],d),h()),m&&(s=O(U([k(e-0,r-0,n)])[0],U([k(e-0,r-0,n-1)])[0],m),l=O(U([k(e-0,r-1,n)])[0],U([k(e-0,r-1,n-1)])[0],m),c=O(U([k(e-1,r-1,n)])[0],U([k(e-1,r-1,n-1)])[0],m),u=O(U([k(e-1,r-0,n)])[0],U([k(e-1,r-0,n-1)])[0],m),h()),f}function Z(t,e,r,n,i,a,o,s,l,c,u,f){var h=t;return f?(d&&"even"===t&&(h=null),q(h,e,r,n,i,a,o,s,l,c,u)):(d&&"odd"===t&&(h=null),q(h,l,s,o,a,i,n,r,e,c,u))}function X(t,e,r,n,i){for(var a=[],o=0,s=0;sMath.abs(d-M)?[A,d]:[d,M];$(e,T[0],T[1])}}var L=[[Math.min(S,M),Math.max(S,M)],[Math.min(A,E),Math.max(A,E)]];["x","y","z"].forEach((function(e){for(var r=[],n=0;n0&&(u.push(p.id),"x"===e?f.push([p.distRatio,0,0]):"y"===e?f.push([0,p.distRatio,0]):f.push([0,0,p.distRatio]))}else c=nt(1,"x"===e?b-1:"y"===e?_-1:w-1);u.length>0&&(r[i]="x"===e?tt(null,u,a,o,f,r[i]):"y"===e?et(null,u,a,o,f,r[i]):rt(null,u,a,o,f,r[i]),i++),c.length>0&&(r[i]="x"===e?X(null,c,a,o,r[i]):"y"===e?J(null,c,a,o,r[i]):K(null,c,a,o,r[i]),i++)}var d=t.caps[e];d.show&&d.fill&&(z(d.fill),r[i]="x"===e?X(null,[0,b-1],a,o,r[i]):"y"===e?J(null,[0,_-1],a,o,r[i]):K(null,[0,w-1],a,o,r[i]),i++)}})),0===g&&P(),t._meshX=n,t._meshY=i,t._meshZ=a,t._meshIntensity=o,t._Xs=v,t._Ys=y,t._Zs=x}(),t}e.exports={findNearestOnAxis:l,generateIsoMeshes:h,createIsosurfaceTrace:function(t,e){var r=t.glplot.gl,i=n({gl:r}),a=new c(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}}},{"../../../stackgl_modules":1133,"../../components/colorscale":379,"../../lib/gl_format_color":511,"../../lib/str2rgbarray":540,"../../plots/gl3d/zip3":618}],874:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("../../components/colorscale/defaults");function s(t,e,r,n,a){var s=a("isomin"),l=a("isomax");null!=l&&null!=s&&s>l&&(e.isomin=null,e.isomax=null);var c=a("x"),u=a("y"),f=a("z"),h=a("value");c&&c.length&&u&&u.length&&f&&f.length&&h&&h.length?(i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),a("valuehoverformat"),["x","y","z"].forEach((function(t){a(t+"hoverformat");var e="caps."+t;a(e+".show")&&a(e+".fill");var r="slices."+t;a(r+".show")&&(a(r+".fill"),a(r+".locations"))})),a("spaceframe.show")&&a("spaceframe.fill"),a("surface.show")&&(a("surface.count"),a("surface.fill"),a("surface.pattern")),a("contour.show")&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(t){a(t)})),o(t,e,n,a,{prefix:"",cLetter:"c"}),e._length=null):e.visible=!1}e.exports={supplyDefaults:function(t,e,r,i){s(t,e,r,i,(function(r,i){return n.coerce(t,e,a,r,i)}))},supplyIsoDefaults:s}},{"../../components/colorscale/defaults":377,"../../lib":515,"../../registry":647,"./attributes":871}],875:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,calc:t("./calc"),colorbar:{min:"cmin",max:"cmax"},plot:t("./convert").createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","showLegend"],meta:{}}},{"../../plots/gl3d":607,"./attributes":871,"./calc":872,"./convert":873,"./defaults":874}],876:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../surface/attributes"),s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat;e.exports=l({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:a({editType:"calc"}),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},n("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:o.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:l({},o.contours.x.show,{}),color:o.contours.x.color,width:o.contours.x.width,editType:"calc"},lightposition:{x:l({},o.lightposition.x,{dflt:1e5}),y:l({},o.lightposition.y,{dflt:1e5}),z:l({},o.lightposition.z,{dflt:0}),editType:"calc"},lighting:l({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},o.lighting),hoverinfo:l({},s.hoverinfo,{editType:"calc"}),showlegend:l({},s.showlegend,{dflt:!1})})},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642,"../surface/attributes":1070}],877:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.intensity&&n(t,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":375}],878:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_mesh3d,i=t("../../../stackgl_modules").delaunay_triangulate,a=t("../../../stackgl_modules").alpha_shape,o=t("../../../stackgl_modules").convex_hull,s=t("../../lib/gl_format_color").parseColorScale,l=t("../../lib/str2rgbarray"),c=t("../../components/colorscale").extractOpts,u=t("../../plots/gl3d/zip3");function f(t,e,r){this.scene=t,this.uid=r,this.mesh=e,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var h=f.prototype;function p(t){for(var e=[],r=t.length,n=0;n=e-.5)return!1;return!0}h.handlePick=function(t){if(t.object===this.mesh){var e=t.index=t.data.index;t.data._cellCenter?t.traceCoordinate=t.data.dataCoordinate:t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]];var r=this.data.hovertext||this.data.text;return Array.isArray(r)&&void 0!==r[e]?t.textLabel=r[e]:r&&(t.textLabel=r),!0}},h.update=function(t){var e=this.scene,r=e.fullSceneLayout;this.data=t;var n,f=t.x.length,h=u(d(r.xaxis,t.x,e.dataScale[0],t.xcalendar),d(r.yaxis,t.y,e.dataScale[1],t.ycalendar),d(r.zaxis,t.z,e.dataScale[2],t.zcalendar));if(t.i&&t.j&&t.k){if(t.i.length!==t.j.length||t.j.length!==t.k.length||!g(t.i,f)||!g(t.j,f)||!g(t.k,f))return;n=u(m(t.i),m(t.j),m(t.k))}else n=0===t.alphahull?o(h):t.alphahull>0?a(t.alphahull,h):function(t,e){for(var r=["x","y","z"].indexOf(t),n=[],a=e.length,o=0;ov):g=A>w,v=A;var M=c(w,T,k,A);M.pos=_,M.yc=(w+A)/2,M.i=b,M.dir=g?"increasing":"decreasing",M.x=M.pos,M.y=[k,T],y&&(M.orig_p=r[b]),d&&(M.tx=e.text[b]),m&&(M.htx=e.hovertext[b]),x.push(M)}else x.push({pos:_,empty:!0})}return e._extremes[l._id]=a.findExtremes(l,n.concat(h,f),{padded:!0}),x.length&&(x[0].t={labels:{open:i(t,"open:")+" ",high:i(t,"high:")+" ",low:i(t,"low:")+" ",close:i(t,"close:")+" "}}),x}e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis),i=a.getFromId(t,e.yaxis),s=function(t,e,r){var i=r._minDiff;if(!i){var a,s=t._fullData,l=[];for(i=1/0,a=0;a"+c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat):((y=i.extendFlat({},h)).y0=y.y1=_,y.yLabelVal=b,y.yLabel=c.labels[x]+n.hoverLabelText(s,b,l.yhoverformat),y.name="",f.push(y),g[b]=y)}return f}function h(t,e,r,i){var a=t.cd,o=t.ya,l=a[0].trace,f=a[0].t,h=u(t,e,r,i);if(!h)return[];var p=a[h.index],d=h.index=p.i,m=p.dir;function g(t){return f.labels[t]+n.hoverLabelText(o,l[t][d],l.yhoverformat)}var v=p.hi||l.hoverinfo,y=v.split("+"),x="all"===v,b=x||-1!==y.indexOf("y"),_=x||-1!==y.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+c[m]]:[];return _&&s(p,l,w),h.extraText=w.join("
"),h.y0=h.y1=o.c2p(p.yc,!0),[h]}e.exports={hoverPoints:function(t,e,r,n){return t.cd[0].trace.hoverlabel.split?f(t,e,r,n):h(t,e,r,n)},hoverSplit:f,hoverOnPoints:h}},{"../../components/color":367,"../../components/fx":407,"../../constants/delta.js":485,"../../lib":515,"../../plots/cartesian/axes":566}],885:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"ohlc",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","svg","showLegend"],meta:{},attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc").calc,plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover").hoverPoints,selectPoints:t("./select")}},{"../../plots/cartesian":578,"./attributes":881,"./calc":882,"./defaults":883,"./hover":884,"./plot":887,"./select":888,"./style":889}],886:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports=function(t,e,r,a){var o=r("x"),s=r("open"),l=r("high"),c=r("low"),u=r("close");if(r("hoverlabel.split"),n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x"],a),s&&l&&c&&u){var f=Math.min(s.length,l.length,c.length,u.length);return o&&(f=Math.min(f,i.minRowLength(o))),e._length=f,f}}},{"../../lib":515,"../../registry":647}],887:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib");e.exports=function(t,e,r,a){var o=e.yaxis,s=e.xaxis,l=!!s.rangebreaks;i.makeTraceGroups(a,r,"trace ohlc").each((function(t){var e=n.select(this),r=t[0],a=r.t;if(!0!==r.trace.visible||a.empty)e.remove();else{var c=a.tickLen,u=e.selectAll("path").data(i.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(t){if(t.empty)return"M0,0Z";var e=s.c2p(t.pos-c,!0),r=s.c2p(t.pos+c,!0),n=l?(e+r)/2:s.c2p(t.pos,!0);return"M"+e+","+o.c2p(t.o,!0)+"H"+n+"M"+n+","+o.c2p(t.h,!0)+"V"+o.c2p(t.l,!0)+"M"+r+","+o.c2p(t.c,!0)+"H"+n}))}}))}},{"../../lib":515,"@plotly/d3":58}],888:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[],s=n[0].t.bPos||0;if(!1===e)for(r=0;r=t.length)return!1;if(void 0!==e[t[r]])return!1;e[t[r]]=!0}return!0}(t.map((function(t){return t.displayindex}))))for(e=0;e0;c&&(o="array");var u=r("categoryorder",o);"array"===u?(r("categoryarray"),r("ticktext")):(delete t.categoryarray,delete t.ticktext),c||"array"!==u||(e.categoryorder="trace")}}e.exports=function(t,e,r,f){function h(r,i){return n.coerce(t,e,l,r,i)}var p=s(t,e,{name:"dimensions",handleItemDefaults:u}),d=function(t,e,r,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,f,h);o(e,f,h),Array.isArray(p)&&p.length||(e.visible=!1),c(e,p,"values",d),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var m={family:f.font.family,size:Math.round(f.font.size),color:f.font.color};n.coerceFont(h,"labelfont",m);var g={family:f.font.family,size:Math.round(f.font.size/1.2),color:f.font.color};n.coerceFont(h,"tickfont",g)}},{"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"../../lib":515,"../../plots/array_container_defaults":561,"../../plots/domain":593,"../parcoords/merge_length":907,"./attributes":890}],894:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t("./base_plot"),categories:["noOpacity"],meta:{}}},{"./attributes":890,"./base_plot":891,"./calc":892,"./defaults":893,"./plot":896}],895:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-interpolate").interpolateNumber,a=t("../../plot_api/plot_api"),o=t("../../components/fx"),s=t("../../lib"),l=s.strTranslate,c=t("../../components/drawing"),u=t("tinycolor2"),f=t("../../lib/svg_text_utils");function h(t,e,r,i){var a=e._context.staticPlot,o=t.map(F.bind(0,e,r)),u=i.selectAll("g.parcatslayer").data([null]);u.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var h=u.selectAll("g.trace.parcats").data(o,p),y=h.enter().append("g").attr("class","trace parcats");h.attr("transform",(function(t){return l(t.x,t.y)})),y.append("g").attr("class","paths");var x=h.select("g.paths").selectAll("path.path").data((function(t){return t.paths}),p);x.attr("fill",(function(t){return t.model.color}));var w=x.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(t){return t.model.color})).attr("fill-opacity",0);_(w),x.attr("d",(function(t){return t.svgD})),w.empty()||x.sort(m),x.exit().remove(),x.on("mouseover",g).on("mouseout",v).on("click",b),y.append("g").attr("class","dimensions");var A=h.select("g.dimensions").selectAll("g.dimension").data((function(t){return t.dimensions}),p);A.enter().append("g").attr("class","dimension"),A.attr("transform",(function(t){return l(t.x,0)})),A.exit().remove();var M=A.selectAll("g.category").data((function(t){return t.categories}),p),S=M.enter().append("g").attr("class","category");M.attr("transform",(function(t){return l(0,t.y)})),S.append("rect").attr("class","catrect").attr("pointer-events","none"),M.select("rect.catrect").attr("fill","none").attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})),T(S);var E=M.selectAll("rect.bandrect").data((function(t){return t.bands}),p);E.each((function(){s.raiseToTop(this)})),E.attr("fill",(function(t){return t.color}));var z=E.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(t){return t.color})).attr("fill-opacity",0);E.attr("fill",(function(t){return t.color})).attr("width",(function(t){return t.width})).attr("height",(function(t){return t.height})).attr("y",(function(t){return t.y})).attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"perpendicular"===t.parcatsViewModel.arrangement?"ns-resize":"move"})),k(z),E.exit().remove(),S.append("text").attr("class","catlabel").attr("pointer-events","none");var D=e._fullLayout.paper_bgcolor;M.select("text.catlabel").attr("text-anchor",(function(t){return d(t)?"start":"end"})).attr("alignment-baseline","middle").style("text-shadow",f.makeTextShadow(D)).style("fill","rgb(0, 0, 0)").attr("x",(function(t){return d(t)?t.width+5:-5})).attr("y",(function(t){return t.height/2})).text((function(t){return t.model.categoryLabel})).each((function(t){c.font(n.select(this),t.parcatsViewModel.categorylabelfont),f.convertToTspans(n.select(this),e)})),S.append("text").attr("class","dimlabel"),M.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(t){return"fixed"===t.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(t){return t.width/2})).attr("y",-5).text((function(t,e){return 0===e?t.parcatsViewModel.model.dimensions[t.model.dimensionInd].dimensionLabel:null})).each((function(t){c.font(n.select(this),t.parcatsViewModel.labelfont)})),M.selectAll("rect.bandrect").on("mouseover",L).on("mouseout",C),M.exit().remove(),A.call(n.behavior.drag().origin((function(t){return{x:t.x,y:0}})).on("dragstart",P).on("drag",I).on("dragend",O)),h.each((function(t){t.traceSelection=n.select(this),t.pathSelection=n.select(this).selectAll("g.paths").selectAll("path.path"),t.dimensionSelection=n.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),h.exit().remove()}function p(t){return t.key}function d(t){var e=t.parcatsViewModel.dimensions.length,r=t.parcatsViewModel.dimensions[e-1].model.dimensionInd;return t.model.dimensionInd===r}function m(t,e){return t.model.rawColor>e.model.rawColor?1:t.model.rawColor"),L=n.mouse(f)[0];o.loneHover({trace:h,x:b-d.left+m.left,y:_-d.top+m.top,text:E,color:t.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:T,idealAlign:L1&&h.displayInd===f.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,v=m/u.parcatsViewModel.model.count,y={countLabel:m,categoryLabel:g,probabilityLabel:v.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",y.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+y.categoryLabel+"):",y.probabilityLabel].join(" "));var b=x.join("
");return{trace:p,x:o*(i-e.left),y:s*(d-e.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:p.hovertemplate,hovertemplateLabels:y,eventData:[{data:p._input,fullData:p,count:m,category:g,probability:v}]}}function L(t){if(!t.parcatsViewModel.dragDimension&&-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(n.mouse(this)[1]<-1)return;var e,r=t.parcatsViewModel.graphDiv,i=r._fullLayout,a=i._paperdiv.node().getBoundingClientRect(),l=t.parcatsViewModel.hoveron;if("color"===l?(!function(t){var e=n.select(t).datum(),r=A(e);w(r),r.each((function(){s.raiseToTop(this)})),n.select(t.parentNode).selectAll("rect.bandrect").filter((function(t){return t.color===e.color})).each((function(){s.raiseToTop(this),n.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(this),S(this,"plotly_hover",n.event)):(!function(t){n.select(t.parentNode).selectAll("rect.bandrect").each((function(t){var e=A(t);w(e),e.each((function(){s.raiseToTop(this)}))})),n.select(t.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(this),M(this,"plotly_hover",n.event)),-1===t.parcatsViewModel.hoverinfoItems.indexOf("none"))"category"===l?e=E(r,a,this):"color"===l?e=function(t,e,r){t._fullLayout._calcInverseTransform(t);var i,a,o=t._fullLayout._invScaleX,s=t._fullLayout._invScaleY,l=r.getBoundingClientRect(),c=n.select(r).datum(),f=c.categoryViewModel,h=f.parcatsViewModel,p=h.model.dimensions[f.model.dimensionInd],d=h.trace,m=l.y+l.height/2;h.dimensions.length>1&&p.displayInd===h.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=f.model.categoryLabel,v=c.parcatsViewModel.model.count,y=0;c.categoryViewModel.bands.forEach((function(t){t.color===c.color&&(y+=t.count)}));var x=f.model.count,b=0;h.pathSelection.each((function(t){t.model.color===c.color&&(b+=t.model.count)}));var _=y/v,w=y/b,T=y/x,k={countLabel:v,categoryLabel:g,probabilityLabel:_.toFixed(3)},A=[];-1!==f.parcatsViewModel.hoverinfoItems.indexOf("count")&&A.push(["Count:",k.countLabel].join(" ")),-1!==f.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(A.push("P(color \u2229 "+g+"): "+k.probabilityLabel),A.push("P("+g+" | color): "+w.toFixed(3)),A.push("P(color | "+g+"): "+T.toFixed(3)));var M=A.join("
"),S=u.mostReadable(c.color,["black","white"]);return{trace:d,x:o*(i-e.left),y:s*(m-e.top),text:M,color:c.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:S,fontSize:10,idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:k,eventData:[{data:d._input,fullData:d,category:g,count:v,probability:_,categorycount:x,colorcount:b,bandcolorcount:y}]}}(r,a,this):"dimension"===l&&(e=function(t,e,r){var i=[];return n.select(r.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(E(t,e,this))})),i}(r,a,this)),e&&o.loneHover(e,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:r})}}function C(t){var e=t.parcatsViewModel;if(!e.dragDimension&&(_(e.pathSelection),T(e.dimensionSelection.selectAll("g.category")),k(e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),o.loneUnhover(e.graphDiv._fullLayout._hoverlayer.node()),e.pathSelection.sort(m),-1===e.hoverinfoItems.indexOf("skip"))){"color"===t.parcatsViewModel.hoveron?S(this,"plotly_unhover",n.event):M(this,"plotly_unhover",n.event)}}function P(t){"fixed"!==t.parcatsViewModel.arrangement&&(t.dragDimensionDisplayInd=t.model.displayInd,t.initialDragDimensionDisplayInds=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),t.dragHasMoved=!1,t.dragCategoryDisplayInd=null,n.select(this).selectAll("g.category").select("rect.catrect").each((function(e){var r=n.mouse(this)[0],i=n.mouse(this)[1];-2<=r&&r<=e.width+2&&-2<=i&&i<=e.height+2&&(t.dragCategoryDisplayInd=e.model.displayInd,t.initialDragCategoryDisplayInds=t.model.categories.map((function(t){return t.displayInd})),e.model.dragY=e.y,s.raiseToTop(this.parentNode),n.select(this.parentNode).selectAll("rect.bandrect").each((function(e){e.yf.y+f.height/2&&(o.model.displayInd=f.model.displayInd,f.model.displayInd=l),t.dragCategoryDisplayInd=o.model.displayInd}if(null===t.dragCategoryDisplayInd||"freeform"===t.parcatsViewModel.arrangement){a.model.dragX=n.event.x;var h=t.parcatsViewModel.dimensions[r],p=t.parcatsViewModel.dimensions[i];void 0!==h&&a.model.dragXp.x&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t.dragDimensionDisplayInd),t.dragDimensionDisplayInd=a.model.displayInd}j(t.parcatsViewModel),N(t.parcatsViewModel),R(t.parcatsViewModel),D(t.parcatsViewModel)}}function O(t){if("fixed"!==t.parcatsViewModel.arrangement&&null!==t.dragDimensionDisplayInd){n.select(this).selectAll("text").attr("font-weight","normal");var e={},r=z(t.parcatsViewModel),i=t.parcatsViewModel.model.dimensions.map((function(t){return t.displayInd})),o=t.initialDragDimensionDisplayInds.some((function(t,e){return t!==i[e]}));o&&i.forEach((function(r,n){var i=t.parcatsViewModel.model.dimensions[n].containerInd;e["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==t.dragCategoryDisplayInd){var l=t.model.categories.map((function(t){return t.displayInd}));if(s=t.initialDragCategoryDisplayInds.some((function(t,e){return t!==l[e]}))){var c=t.model.categories.slice().sort((function(t,e){return t.displayInd-e.displayInd})),u=c.map((function(t){return t.categoryValue})),f=c.map((function(t){return t.categoryLabel}));e["dimensions["+t.model.containerInd+"].categoryarray"]=[u],e["dimensions["+t.model.containerInd+"].ticktext"]=[f],e["dimensions["+t.model.containerInd+"].categoryorder"]="array"}}if(-1===t.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!t.dragHasMoved&&t.potentialClickBand&&("color"===t.parcatsViewModel.hoveron?S(t.potentialClickBand,"plotly_click",n.event.sourceEvent):M(t.potentialClickBand,"plotly_click",n.event.sourceEvent)),t.model.dragX=null,null!==t.dragCategoryDisplayInd)t.parcatsViewModel.dimensions[t.dragDimensionDisplayInd].categories[t.dragCategoryDisplayInd].model.dragY=null,t.dragCategoryDisplayInd=null;t.dragDimensionDisplayInd=null,t.parcatsViewModel.dragDimension=null,t.dragHasMoved=null,t.potentialClickBand=null,j(t.parcatsViewModel),N(t.parcatsViewModel),n.transition().duration(300).ease("cubic-in-out").each((function(){R(t.parcatsViewModel,!0),D(t.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&a.restyle(t.parcatsViewModel.graphDiv,e,[r])}))}}function z(t){for(var e,r=t.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(e[s+1]+n)+" "+l[s]+","+(e[s]+n)+" "+(t[s]+r[s])+","+(e[s]+n),u+="l-"+r[s]+",0 ";return u+="Z"}function N(t){var e=t.dimensions,r=t.model,n=e.map((function(t){return t.categories.map((function(t){return t.y}))})),i=t.model.dimensions.map((function(t){return t.categories.map((function(t){return t.displayInd}))})),a=t.model.dimensions.map((function(t){return t.displayInd})),o=t.dimensions.map((function(t){return t.model.dimensionInd})),s=e.map((function(t){return t.x})),l=e.map((function(t){return t.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function f(t){var e=t.categoryInds.map((function(t,e){return i[e][t]}));return o.map((function(t){return e[t]}))}c.sort((function(e,r){var n=f(e),i=f(r);return"backward"===t.sortpaths&&(n.reverse(),i.reverse()),n.push(e.valueInds[0]),i.push(r.valueInds[0]),t.bundlecolors&&(n.unshift(e.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var h=new Array(c.length),p=e[0].model.count,d=e[0].categories.map((function(t){return t.height})).reduce((function(t,e){return t+e})),m=0;m0?d*(v.count/p):0;for(var y,x=new Array(n.length),b=0;b1?(t.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],f=t.model.maxCats,h=e.categories.length,p=e.count,d=t.height-8*(f-1),m=8*(f-h)/2,g=e.categories.map((function(t){return{displayInd:t.displayInd,categoryInd:t.categoryInd}}));for(g.sort((function(t,e){return t.displayInd-e.displayInd})),c=0;c0?o.count/p*d:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:t},m=m+a+8,u.push(s);return{key:e.dimensionInd,x:null!==e.dragX?e.dragX:r,y:0,width:16,model:e,categories:u,parcatsViewModel:t,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}e.exports=function(t,e,r,n){h(r,t,n,e)}},{"../../components/drawing":389,"../../components/fx":407,"../../lib":515,"../../lib/svg_text_utils":541,"../../plot_api/plot_api":552,"@plotly/d3":58,"d3-interpolate":116,tinycolor2:313}],896:[function(t,e,r){"use strict";var n=t("./parcats");e.exports=function(t,e,r,i){var a=t._fullLayout,o=a._paper,s=a._size;n(t,o,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},r,i)}},{"./parcats":895}],897:[function(t,e,r){"use strict";var n=t("../../components/colorscale/attributes"),i=t("../../plots/cartesian/layout_attributes"),a=t("../../plots/font_attributes"),o=t("../../plots/domain").attributes,s=t("../../lib/extend").extendFlat,l=t("../../plot_api/plot_template").templatedArray;e.exports={domain:o({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:a({editType:"plot"}),tickfont:a({editType:"plot"}),rangefont:a({editType:"plot"}),dimensions:l("dimension",{label:{valType:"string",editType:"plot"},tickvals:s({},i.tickvals,{editType:"plot"}),ticktext:s({},i.ticktext,{editType:"plot"}),tickformat:s({},i.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:s({editType:"calc"},n("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plot_api/plot_template":555,"../../plots/cartesian/layout_attributes":579,"../../plots/domain":593,"../../plots/font_attributes":594}],898:[function(t,e,r){"use strict";var n=t("./constants"),i=t("@plotly/d3"),a=t("../../lib/gup").keyFun,o=t("../../lib/gup").repeat,s=t("../../lib").sorterAsc,l=t("../../lib").strTranslate,c=n.bar.snapRatio;function u(t,e){return t*(1-c)+e*c}var f=n.bar.snapClose;function h(t,e){return t*(1-f)+e*f}function p(t,e,r,n){if(function(t,e){for(var r=0;r=e[r][0]&&t<=e[r][1])return!0;return!1}(r,n))return r;var i=t?-1:1,a=0,o=e.length-1;if(i<0){var s=a;a=o,o=s}for(var l=e[a],c=l,f=a;i*fe){h=r;break}}if(a=u,isNaN(a)&&(a=isNaN(f)||isNaN(h)?isNaN(f)?h:f:e-c[f][1]t[1]+r||e=.9*t[1]+.1*t[0]?"n":e<=.9*t[0]+.1*t[1]?"s":"ns"}(d,e);m&&(o.interval=l[a],o.intervalPix=d,o.region=m)}}if(t.ordinal&&!o.region){var g=t.unitTickvals,y=t.unitToPaddedPx.invert(e);for(r=0;r=x[0]&&y<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[r-a.grabPoint,r+a.barLength-a.grabPoint].map(e.unitToPaddedPx.invert):a.newExtent=[a.startExtent,e.unitToPaddedPx.invert(r)].sort(s),e.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(e),b(t.parentNode)}function T(t,e){var r=_(e,e.height-i.mouse(t)[1]-2*n.verticalPadding),a="crosshair";r.clickableOrdinalRange?a="pointer":r.region&&(a=r.region+"-resize"),i.select(document.body).style("cursor",a)}function k(t){t.on("mousemove",(function(t){i.event.preventDefault(),t.parent.inBrushDrag||T(this,t)})).on("mouseleave",(function(t){t.parent.inBrushDrag||y()})).call(i.behavior.drag().on("dragstart",(function(t){!function(t,e){i.event.sourceEvent.stopPropagation();var r=e.height-i.mouse(t)[1]-2*n.verticalPadding,a=e.unitToPaddedPx.invert(r),o=e.brush,s=_(e,r),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(e.unitToPaddedPx);c.grabPoint=r-u[0]-n.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=e.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(t){return t[0]!==l[0]&&t[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,e.parent.inBrushDrag=!0,c.brushStartCallback()}(this,t)})).on("drag",(function(t){w(this,t)})).on("dragend",(function(t){!function(t,e){var r=e.brush,n=r.filter,a=r.svgBrush;a._dragging||(T(t,e),w(t,e),e.brush.svgBrush.wasDragged=!1),a._dragging=!1,i.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,e.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&e.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&M(r)):M(r),a.brushCallback(e),b(t.parentNode),void a.brushEndCallback(r.filterSpecified?n.getConsolidated():[]);var s=function(){n.set(n.getConsolidated())};if(e.ordinal){var l=e.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||M(r),a.brushCallback(e),c?b(t.parentNode,s):(s(),b(t.parentNode))}else s();a.brushEndCallback(r.filterSpecified?n.getConsolidated():[])}(this,t)})))}function A(t,e){return t[0]-e[0]}function M(t){t.filterSpecified=!1,t.svgBrush.extent=[[-1/0,1/0]]}function S(t){for(var e,r=t.slice(),n=[],i=r.shift();i;){for(e=i.slice();(i=r.shift())&&i[0]<=e[1];)e[1]=Math.max(e[1],i[1]);n.push(e)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}e.exports={makeBrush:function(t,e,r,n,i,a){var o,l=function(){var t,e,r=[];return{set:function(n){1===(r=n.map((function(t){return t.slice().sort(s)})).sort(A)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),t=S(r),e=r.reduce((function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return t},getBounds:function(){return e}}}();return l.set(r),{filter:l,filterSpecified:e,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(o=i,function(t){var e=t.brush,r=function(t){return t.svgBrush.extent.map((function(t){return t.slice()}))}(e).slice();e.filter.set(r),o()}),brushEndCallback:a}}},ensureAxisBrush:function(t,e,r){var i=t.selectAll("."+n.cn.axisBrush).data(o,a);i.enter().append("g").classed(n.cn.axisBrush,!0),function(t,e,r){var i=r._context.staticPlot,a=t.selectAll(".background").data(o);a.enter().append("rect").classed("background",!0).call(d).call(m).style("pointer-events",i?"none":"auto").attr("transform",l(0,n.verticalPadding)),a.call(k).attr("height",(function(t){return t.height-n.verticalPadding}));var s=t.selectAll(".highlight-shadow").data(o);s.enter().append("line").classed("highlight-shadow",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width+n.bar.strokeWidth).attr("stroke",e).attr("opacity",n.bar.strokeOpacity).attr("stroke-linecap","butt"),s.attr("y1",(function(t){return t.height})).call(x);var c=t.selectAll(".highlight").data(o);c.enter().append("line").classed("highlight",!0).attr("x",-n.bar.width/2).attr("stroke-width",n.bar.width-n.bar.strokeWidth).attr("stroke",n.bar.fillColor).attr("opacity",n.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(t){return t.height})).call(x)}(i,e,r)},cleanRanges:function(t,e){if(Array.isArray(t[0])?(t=t.map((function(t){return t.sort(s)})),t=e.multiselect?S(t.sort(A)):[t[0]]):t=[t.sort(s)],e.tickvals){var r=e.tickvals.slice().sort(s);if(!(t=t.map((function(t){var e=[p(0,r,t[0],[]),p(1,r,t[1],[])];if(e[1]>e[0])return e})).filter((function(t){return t}))).length)return}return t.length>1?t:t[0]}}},{"../../lib":515,"../../lib/gup":512,"./constants":902,"@plotly/d3":58}],899:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t("./base_plot"),categories:["gl","regl","noOpacity","noHover"],meta:{}}},{"./attributes":897,"./base_plot":900,"./calc":901,"./defaults":903}],900:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../constants/xmlns_namespaces");r.name="parcoords",r.plot=function(t){var e=i(t.calcdata,"parcoords")[0];e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){var e=t._fullLayout._glimages,r=n.select(t).selectAll(".svg-container");r.filter((function(t,e){return e===r.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var t=this.toDataURL("image/png");e.append("svg:image").attr({xmlns:o.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:this.style.width,height:this.style.height})})),window.setTimeout((function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}},{"../../constants/xmlns_namespaces":492,"../../plots/get_data":602,"./plot":909,"@plotly/d3":58}],901:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale"),a=t("../../lib/gup").wrap;e.exports=function(t,e){var r,o;return i.hasColorscale(e,"line")&&n(e.line.color)?(r=e.line.color,o=i.extractOpts(e.line).colorscale,i.calc(t,e,{vals:r,containerStr:"line",cLetter:"c"})):(r=function(t){for(var e=new Array(t),r=0;rf&&(n.log("parcoords traces support up to "+f+" dimensions at the moment"),d.splice(f));var m=s(t,e,{name:"dimensions",layout:l,handleItemDefaults:p}),g=function(t,e,r,o,s){var l=s("line.color",r);if(i(t,"line")&&n.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),a(t,e,o,s,{prefix:"line.",cLetter:"c"}),l.length;e.line.color=r}return 1/0}(t,e,r,l,u);o(e,l,u),Array.isArray(m)&&m.length||(e.visible=!1),h(e,m,"values",g);var v={family:l.font.family,size:Math.round(l.font.size/1.2),color:l.font.color};n.coerceFont(u,"labelfont",v),n.coerceFont(u,"tickfont",v),n.coerceFont(u,"rangefont",v),u("labelangle"),u("labelside"),u("unselected.line.color"),u("unselected.line.opacity")}},{"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"../../lib":515,"../../plots/array_container_defaults":561,"../../plots/cartesian/axes":566,"../../plots/domain":593,"./attributes":897,"./axisbrush":898,"./constants":902,"./merge_length":907}],904:[function(t,e,r){"use strict";var n=t("../../lib").isTypedArray;r.convertTypedArray=function(t){return n(t)?Array.prototype.slice.call(t):t},r.isOrdinal=function(t){return!!t.tickvals},r.isVisible=function(t){return t.visible||!("visible"in t)}},{"../../lib":515}],905:[function(t,e,r){"use strict";var n=t("./base_index");n.plot=t("./plot"),e.exports=n},{"./base_index":899,"./plot":909}],906:[function(t,e,r){"use strict";var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nattribute vec4 p01_04, p05_08, p09_12, p13_16,\n p17_20, p21_24, p25_28, p29_32,\n p33_36, p37_40, p41_44, p45_48,\n p49_52, p53_56, p57_60, colors;\n\nuniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution, viewBoxPos, viewBoxSize;\nuniform float maskHeight;\nuniform float drwLayer; // 0: context, 1: focus, 2: pick\nuniform vec4 contextColor;\nuniform sampler2D maskTexture, palette;\n\nbool isPick = (drwLayer > 1.5);\nbool isContext = (drwLayer < 0.5);\n\nconst vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);\nconst vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * UNITS, UNITS);\n}\n\nfloat axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {\n float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);\n float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);\n return y1 * (1.0 - ratio) + y2 * ratio;\n}\n\nint iMod(int a, int b) {\n return a - b * (a / b);\n}\n\nbool fOutside(float p, float lo, float hi) {\n return (lo < hi) && (lo > p || p > hi);\n}\n\nbool vOutside(vec4 p, vec4 lo, vec4 hi) {\n return (\n fOutside(p[0], lo[0], hi[0]) ||\n fOutside(p[1], lo[1], hi[1]) ||\n fOutside(p[2], lo[2], hi[2]) ||\n fOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool mOutside(mat4 p, mat4 lo, mat4 hi) {\n return (\n vOutside(p[0], lo[0], hi[0]) ||\n vOutside(p[1], lo[1], hi[1]) ||\n vOutside(p[2], lo[2], hi[2]) ||\n vOutside(p[3], lo[3], hi[3])\n );\n}\n\nbool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {\n return mOutside(A, loA, hiA) ||\n mOutside(B, loB, hiB) ||\n mOutside(C, loC, hiC) ||\n mOutside(D, loD, hiD);\n}\n\nbool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {\n mat4 pnts[4];\n pnts[0] = A;\n pnts[1] = B;\n pnts[2] = C;\n pnts[3] = D;\n\n for(int i = 0; i < 4; ++i) {\n for(int j = 0; j < 4; ++j) {\n for(int k = 0; k < 4; ++k) {\n if(0 == iMod(\n int(255.0 * texture2D(maskTexture,\n vec2(\n (float(i * 2 + j / 2) + 0.5) / 8.0,\n (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight\n ))[3]\n ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),\n 2\n )) return true;\n }\n }\n }\n return false;\n}\n\nvec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {\n float x = 0.5 * sign(v) + 0.5;\n float y = axisY(x, A, B, C, D);\n float z = 1.0 - abs(v);\n\n z += isContext ? 0.0 : 2.0 * float(\n outsideBoundingBox(A, B, C, D) ||\n outsideRasterMask(A, B, C, D)\n );\n\n return vec4(\n 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,\n z,\n 1.0\n );\n}\n\nvoid main() {\n mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);\n mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);\n mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);\n mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);\n\n float v = colors[3];\n\n gl_Position = position(isContext, v, A, B, C, D);\n\n fragColor =\n isContext ? vec4(contextColor) :\n isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));\n}\n"]),a=n(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n"]),o=t("./constants").maxDimensionCount,s=t("../../lib"),l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function f(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function h(t,e,r,n,i,a){var o=a.key;r.drawCompleted||(!function(t){t.read({x:0,y:0,width:1,height:1,data:l})}(t),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],f(t,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,e(a),l*n+c>>8*e)%256/255}function m(t,e,r){for(var n=new Array(8*e),i=0,a=0;au&&(u=t[i].dim1.canvasX,o=i);0===s&&f(T,0,0,r.canvasWidth,r.canvasHeight);var p=function(t){var e,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!t&&no._length&&(S=S.slice(0,o._length));var L,C=o.tickvals;function P(t,e){return{val:t,text:L[e]}}function I(t,e){return t.val-e.val}if(Array.isArray(C)&&C.length){L=o.ticktext,Array.isArray(L)&&L.length?L.length>C.length?L=L.slice(0,C.length):C.length>L.length&&(C=C.slice(0,L.length)):L=C.map(a(o.tickformat));for(var O=1;O=r||l>=i)return;var c=t.lineLayer.readPixel(s,i-1-l),u=0!==c[3],f=u?c[2]+256*(c[1]+256*c[0]):null,h={x:s,y:l,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:f};f!==N&&(u?a.hover(h):a.unhover&&a.unhover(h),N=f)}})),B.style("opacity",(function(t){return t.pick?0:1})),p.style("background","rgba(255, 255, 255, 0)");var j=p.selectAll("."+y.cn.parcoords).data(F,d);j.exit().remove(),j.enter().append("g").classed(y.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),j.attr("transform",(function(t){return c(t.model.translateX,t.model.translateY)}));var U=j.selectAll("."+y.cn.parcoordsControlView).data(m,d);U.enter().append("g").classed(y.cn.parcoordsControlView,!0),U.attr("transform",(function(t){return c(t.model.pad.l,t.model.pad.t)}));var V=U.selectAll("."+y.cn.yAxis).data((function(t){return t.dimensions}),d);V.enter().append("g").classed(y.cn.yAxis,!0),U.each((function(t){O(V,t,T)})),B.each((function(t){if(t.viewModel){!t.lineLayer||a?t.lineLayer=b(this,t):t.lineLayer.update(t),(t.key||0===t.key)&&(t.viewModel[t.key]=t.lineLayer);var e=!t.context||a;t.lineLayer.render(t.viewModel.panels,e)}})),V.attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),V.call(n.behavior.drag().origin((function(t){return t})).on("drag",(function(t){var e=t.parent;R.linePickActive(!1),t.x=Math.max(-y.overdrag,Math.min(t.model.width+y.overdrag,n.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,V.sort((function(t,e){return t.x-e.x})).each((function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio})),O(V,e,T),V.filter((function(e){return 0!==Math.abs(t.xIndex-e.xIndex)})).attr("transform",(function(t){return c(t.xScale(t.xIndex),0)})),n.select(this).attr("transform",c(t.x,0)),V.each((function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer.render&&e.focusLayer.render(e.panels)})).on("dragend",(function(t){var e=t.parent;t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,O(V,e,T),n.select(this).attr("transform",(function(t){return c(t.x,0)})),e.contextLayer&&e.contextLayer.render(e.panels,!1,!E(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),R.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(e.key,e.dimensions.map((function(t){return t.crossfilterDimensionIndex})))}))),V.exit().remove();var H=V.selectAll("."+y.cn.axisOverlays).data(m,d);H.enter().append("g").classed(y.cn.axisOverlays,!0),H.selectAll("."+y.cn.axis).remove();var q=H.selectAll("."+y.cn.axis).data(m,d);q.enter().append("g").classed(y.cn.axis,!0),q.each((function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,i=r.domain();n.select(this).call(n.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?i:null).tickFormat((function(e){return v.isOrdinal(t)?e:z(t.model.dimensions[t.visibleIndex],e)})).scale(r)),f.font(q.selectAll("text"),t.model.tickFont)})),q.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),q.selectAll("text").style("text-shadow",u.makeTextShadow(A)).style("cursor","default");var G=H.selectAll("."+y.cn.axisHeading).data(m,d);G.enter().append("g").classed(y.cn.axisHeading,!0);var Y=G.selectAll("."+y.cn.axisTitle).data(m,d);Y.enter().append("text").classed(y.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),Y.text((function(t){return t.label})).each((function(e){var r=n.select(this);f.font(r,e.model.labelFont),u.convertToTspans(r,t)})).attr("transform",(function(t){var e=I(t.model.labelAngle,t.model.labelSide),r=y.axisTitleOffset;return(e.dir>0?"":c(0,2*r+t.model.height))+l(e.degrees)+c(-r*e.dx,-r*e.dy)})).attr("text-anchor",(function(t){var e=I(t.model.labelAngle,t.model.labelSide);return 2*Math.abs(e.dx)>Math.abs(e.dy)?e.dir*e.dx<0?"start":"end":"middle"}));var W=H.selectAll("."+y.cn.axisExtent).data(m,d);W.enter().append("g").classed(y.cn.axisExtent,!0);var Z=W.selectAll("."+y.cn.axisExtentTop).data(m,d);Z.enter().append("g").classed(y.cn.axisExtentTop,!0),Z.attr("transform",c(0,-y.axisExtentOffset));var X=Z.selectAll("."+y.cn.axisExtentTopText).data(m,d);X.enter().append("text").classed(y.cn.axisExtentTopText,!0).call(P),X.text((function(t){return D(t,!0)})).each((function(t){f.font(n.select(this),t.model.rangeFont)}));var J=W.selectAll("."+y.cn.axisExtentBottom).data(m,d);J.enter().append("g").classed(y.cn.axisExtentBottom,!0),J.attr("transform",(function(t){return c(0,t.model.height+y.axisExtentOffset)}));var K=J.selectAll("."+y.cn.axisExtentBottomText).data(m,d);K.enter().append("text").classed(y.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(P),K.text((function(t){return D(t,!1)})).each((function(t){f.font(n.select(this),t.model.rangeFont)})),x.ensureAxisBrush(H,A,t)}},{"../../components/colorscale":379,"../../components/drawing":389,"../../lib":515,"../../lib/gup":512,"../../lib/svg_text_utils":541,"../../plots/cartesian/axes":566,"./axisbrush":898,"./constants":902,"./helpers":904,"./lines":906,"@plotly/d3":58,"color-rgba":91}],909:[function(t,e,r){"use strict";var n=t("./parcoords"),i=t("../../lib/prepare_regl"),a=t("./helpers").isVisible,o={};function s(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}(e.exports=function(t,e){var r=t._fullLayout;if(i(t,[],o)){var l={},c={},u={},f={},h=r._size;e.forEach((function(e,r){var n=e[0].trace;u[r]=n.index;var i=f[r]=n._fullInput.index;l[r]=t.data[i].dimensions,c[r]=t.data[i].dimensions.slice()}));n(t,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,n,i){var a=c[e][n],o=i.map((function(t){return t.slice()})),s="dimensions["+n+"].constraintrange",l=r._tracePreGUI[t._fullData[u[e]]._fullInput.uid];if(void 0===l[s]){var h=a.constraintrange;l[s]=h||null}var p=t._fullData[u[e]].dimensions[n];o.length?(1===o.length&&(o=o[0]),a.constraintrange=o,p.constraintrange=o.slice(),o=[o]):(delete a.constraintrange,delete p.constraintrange,o=null);var d={};d[s]=o,t.emit("plotly_restyle",[d,[f[e]]])},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){var n=function(t,e){return function(r,n){return s(t,e,r)-s(t,e,n)}}(r,c[e].filter(a));l[e].sort(n),c[e].filter((function(t){return!a(t)})).sort((function(t){return c[e].indexOf(t)})).forEach((function(t){l[e].splice(l[e].indexOf(t),1),l[e].splice(c[e].indexOf(t),0,t)})),t.emit("plotly_restyle",[{dimensions:[l[e]]},[f[e]]])}})}}).reglPrecompiled=o},{"../../lib/prepare_regl":528,"./helpers":904,"./parcoords":908}],910:[function(t,e,r){"use strict";var n=t("../../plots/attributes"),i=t("../../plots/domain").attributes,a=t("../../plots/font_attributes"),o=t("../../components/color/attributes"),s=t("../../plots/template_attributes").hovertemplateAttrs,l=t("../../plots/template_attributes").texttemplateAttrs,c=t("../../lib/extend").extendFlat,u=a({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:s({},{keys:["label","color","value","percent","text"]}),texttemplate:l({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:i({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:"angle",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":366,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/domain":593,"../../plots/font_attributes":594,"../../plots/template_attributes":642}],911:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="pie",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":628}],912:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../../components/color"),o={};function s(t){return function(e,r){return!!e&&(!!(e=i(e)).isValid()&&(e=a.addOpacity(e,e.getAlpha()),t[r]||(t[r]=e),e))}}function l(t,e){var r,n=JSON.stringify(t),a=e[n];if(!a){for(a=t.slice(),r=0;r=0})),("funnelarea"===e.type?v:e.sort)&&a.sort((function(t,e){return e.v-t.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(t,e){var r=(e||{}).type;r||(r="pie");var n=t._fullLayout,i=t.calcdata,a=n[r+"colorway"],s=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=l(a,o));for(var c=0,u=0;u0){s=!0;break}}s||(o=0)}return{hasLabels:r,hasValues:a,len:o}}e.exports={handleLabelsAndValues:l,supplyDefaults:function(t,e,r,n){function c(r,n){return i.coerce(t,e,a,r,n)}var u=l(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 h,p=c("text"),d=c("texttemplate");if(d||(h=c("textinfo",Array.isArray(p)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),d||h&&"none"!==h){var m=c("textposition");s(t,e,n,c,m,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(m)||"auto"===m||"outside"===m)&&c("automargin"),("inside"===m||"auto"===m||Array.isArray(m))&&c("insidetextorientation")}o(e,n,c);var g=c("hole");if(c("title.text")){var v=c("title.position",g?"middle center":"top center");g||"middle center"!==v||(e.title.position="top center"),i.coerceFont(c,"title.font",n.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else e.visible=!1}}},{"../../lib":515,"../../plots/domain":593,"../bar/defaults":661,"./attributes":910,"fast-isnumeric":190}],914:[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,bbox:t.bbox,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":403}],915:[function(t,e,r){"use strict";var n=t("../../lib");function i(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=i((100*t).toPrecision(3));return n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=i(t.toPrecision(10));return n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r"),name:f.hovertemplate||-1!==h.indexOf("name")?f.name:void 0,idealAlign:t.pxmid[0]<0?"left":"right",color:g.castOption(_.bgcolor,t.pts)||t.color,borderColor:g.castOption(_.bordercolor,t.pts),fontFamily:g.castOption(w.family,t.pts),fontSize:g.castOption(w.size,t.pts),fontColor:g.castOption(w.color,t.pts),nameLength:g.castOption(_.namelength,t.pts),textAlign:g.castOption(_.align,t.pts),hovertemplate:g.castOption(f.hovertemplate,t.pts),hovertemplateLabels:t,eventData:[v(t,f)]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:e,inOut_bbox:T}),t.bbox=T[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,e.emit("plotly_hover",{points:[v(t,f)],event:n.event})}})),t.on("mouseout",(function(t){var r=e._fullLayout,i=e._fullData[c.index],o=n.select(this).datum();c._hasHoverEvent&&(t.originalEvent=n.event,e.emit("plotly_unhover",{points:[v(o,i)],event:n.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(a.loneUnhover(r._hoverlayer.node()),c._hasHoverLabel=!1)})),t.on("click",(function(t){var r=e._fullLayout,i=e._fullData[c.index];e._dragging||!1===r.hovermode||(e._hoverdata=[v(t,i)],a.click(e,n.event))}))}function b(t,e,r){var n=g.castOption(t.insidetextfont.color,e.pts);!n&&t._input.textfont&&(n=g.castOption(t._input.textfont.color,e.pts));var i=g.castOption(t.insidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.insidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n||o.contrast(e.color),family:i,size:a}}function _(t,e){for(var r,n,i=0;ie&&e>n||r=-4;g-=2)v(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)v(Math.PI*(g+1),"tan")}if(f||p){for(g=4;g>=-4;g-=2)v(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)v(Math.PI*(g+.5),"rad")}}if(s||d||f){var y=Math.sqrt(t.width*t.width+t.height*t.height);if((a={scale:i*n*2/y,rCenter:1-i,rotate:0}).textPosAngle=(e.startangle+e.stopangle)/2,a.scale>=1)return a;m.push(a)}(d||p)&&((a=T(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a)),(d||h)&&((a=k(t,n,o,l,c)).textPosAngle=(e.startangle+e.stopangle)/2,m.push(a));for(var x=0,b=0,_=0;_=1)break}return m[x]}function T(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.width/t.height,o=S(a,n,e,r);return{scale:2*o/t.height,rCenter:A(a,o/e),rotate:M(i)}}function k(t,e,r,n,i){e=Math.max(0,e-2*m);var a=t.height/t.width,o=S(a,n,e,r);return{scale:2*o/t.width,rCenter:A(a,o/e),rotate:M(i+Math.PI/2)}}function A(t,e){return Math.cos(e)-t*e}function M(t){return(180/Math.PI*t+720)%180-90}function S(t,e,r,n){var i=t+1/(2*Math.tan(e));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(t*t+n/2)+t))}function E(t,e){return t.v!==e.vTotal||e.trace.hole?Math.min(1/(1+1/Math.sin(t.halfangle)),t.ring/2):1}function L(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function C(t,e){var r,n,i,a=t.trace,o={x:t.cx,y:t.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*t.r,s.ty-=t.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*t.r);var l,c,u=(l=t.r,c=t.trace.aspectratio,l/(void 0===c?1:c)),f=e.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(f+=u,o.x-=(1+i)*u,s.tx+=t.titleBox.width/2):-1!==a.title.position.indexOf("center")?f*=2:-1!==a.title.position.indexOf("right")&&(f+=u,o.x+=(1+i)*u,s.tx-=t.titleBox.width/2),r=f/t.titleBox.width,n=P(t,e)/t.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function P(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 I(t){var e,r=t.pull;if(!r)return 0;if(Array.isArray(r))for(r=0,e=0;er&&(r=t.pull[e]);return r}function O(t,e){for(var r=[],n=0;n1?(c=r.r,u=c/i.aspectratio):(u=r.r,c=u*i.aspectratio),c*=(1+i.baseratio)/2,l=c*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(a){var x=l.castOption(i,e.i,"texttemplate");if(x){var b=function(t){return{label:t.label,value:t.v,valueLabel:g.formatPieValue(t.v,n.separators),percent:t.v/r.vTotal,percentLabel:g.formatPiePercent(t.v/r.vTotal,n.separators),color:t.color,text:t.text,customdata:l.castOption(i,t.i,"customdata")}}(e),_=g.getFirstFilled(i.text,e.pts);(y(_)||""===_)&&(b.text=_),e.text=l.texttemplateString(x,b,t._fullLayout._d3locale,b,i._meta||{})}else e.text=""}}function R(t,e){var r=t.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(e.left+e.right)/2,o=(e.top+e.bottom)/2;t.textX=a*n-o*i,t.textY=a*i+o*n,t.noCenter=!0}e.exports={plot:function(t,e){var r=t._context.staticPlot,a=t._fullLayout,h=a._size;d("pie",a),_(e,t),O(e,h);var m=l.makeTraceGroups(a._pielayer,e,"trace").each((function(e){var d=n.select(this),m=e[0],v=m.trace;!function(t){var e,r,n,i=t[0],a=i.r,o=i.trace,s=g.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(e=0;ei.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(e),d.attr("stroke-linejoin","round"),d.each((function(){var y=n.select(this).selectAll("g.slice").data(e);y.enter().append("g").classed("slice",!0),y.exit().remove();var _=[[[],[]],[[],[]]],T=!1;y.each((function(i,o){if(i.hidden)n.select(this).selectAll("path,g").remove();else{i.pointNumber=i.i,i.curveNumber=v.index,_[i.pxmid[1]<0?0:1][i.pxmid[0]<0?0:1].push(i);var c=m.cx,u=m.cy,h=n.select(this),d=h.selectAll("path.surface").data([i]);if(d.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),h.call(x,t,e),v.pull){var y=+g.castOption(v.pull,i.pts)||0;y>0&&(c+=y*i.pxmid[0],u+=y*i.pxmid[1])}i.cxFinal=c,i.cyFinal=u;var k=v.hole;if(i.v===m.vTotal){var A="M"+(c+i.px0[0])+","+(u+i.px0[1])+P(i.px0,i.pxmid,!0,1)+P(i.pxmid,i.px0,!0,1)+"Z";k?d.attr("d","M"+(c+k*i.px0[0])+","+(u+k*i.px0[1])+P(i.px0,i.pxmid,!1,k)+P(i.pxmid,i.px0,!1,k)+"Z"+A):d.attr("d",A)}else{var M=P(i.px0,i.px1,!0,1);if(k){var S=1-k;d.attr("d","M"+(c+k*i.px1[0])+","+(u+k*i.px1[1])+P(i.px1,i.px0,!1,k)+"l"+S*i.px0[0]+","+S*i.px0[1]+M+"Z")}else d.attr("d","M"+c+","+u+"l"+i.px0[0]+","+i.px0[1]+M+"Z")}D(t,i,m);var E=g.castOption(v.textposition,i.pts),C=h.selectAll("g.slicetext").data(i.text&&"none"!==E?[0]:[]);C.enter().append("g").classed("slicetext",!0),C.exit().remove(),C.each((function(){var r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),h=l.ensureUniformFontSize(t,"outside"===E?function(t,e,r){var n=g.castOption(t.outsidetextfont.color,e.pts)||g.castOption(t.textfont.color,e.pts)||r.color,i=g.castOption(t.outsidetextfont.family,e.pts)||g.castOption(t.textfont.family,e.pts)||r.family,a=g.castOption(t.outsidetextfont.size,e.pts)||g.castOption(t.textfont.size,e.pts)||r.size;return{color:n,family:i,size:a}}(v,i,a.font):b(v,i,a.font));r.text(i.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(s.font,h).call(f.convertToTspans,t);var d,y=s.bBox(r.node());if("outside"===E)d=L(y,i);else if(d=w(y,i,m),"auto"===E&&d.scale<1){var x=l.ensureUniformFontSize(t,v.outsidetextfont);r.call(s.font,x),d=L(y=s.bBox(r.node()),i)}var _=d.textPosAngle,k=void 0===_?i.pxmid:z(m.r,_);if(d.targetX=c+k[0]*d.rCenter+(d.x||0),d.targetY=u+k[1]*d.rCenter+(d.y||0),R(d,y),d.outside){var A=d.targetY;i.yLabelMin=A-y.height/2,i.yLabelMid=A,i.yLabelMax=A+y.height/2,i.labelExtraX=0,i.labelExtraY=0,T=!0}d.fontSize=h.size,p(v.type,d,a),e[o].transform=d,l.setTransormAndDisplay(r,d)}))}function P(t,e,r,n){var a=n*(e[0]-t[0]),o=n*(e[1]-t[1]);return"a"+n*m.r+","+n*m.r+" 0 "+i.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var k=n.select(this).selectAll("g.titletext").data(v.title.text?[0]:[]);if(k.enter().append("g").classed("titletext",!0),k.exit().remove(),k.each((function(){var e,r=l.ensureSingle(n.select(this),"text","",(function(t){t.attr("data-notex",1)})),i=v.title.text;v._meta&&(i=l.templateString(i,v._meta)),r.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(s.font,v.title.font).call(f.convertToTspans,t),e="middle center"===v.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}}(m):C(m,h),r.attr("transform",u(e.x,e.y)+c(Math.min(1,e.scale))+u(e.tx,e.ty))})),T&&function(t,e){var r,n,i,a,o,s,l,c,u,f,h,p,d;function m(t,e){return t.pxmid[1]-e.pxmid[1]}function v(t,e){return e.pxmid[1]-t.pxmid[1]}function y(t,r){r||(r={});var i,c,u,h,p=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),d=n?t.yLabelMin:t.yLabelMax,m=n?t.yLabelMax:t.yLabelMin,v=t.cyFinal+o(t.px0[1],t.px1[1]),y=p-d;if(y*l>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(c=0;c=(g.castOption(e.pull,u.pts)||0)||((t.pxmid[1]-u.pxmid[1])*l>0?(y=u.cyFinal+o(u.px0[1],u.px1[1])-d-t.labelExtraY)*l>0&&(t.labelExtraY+=y):(m+t.labelExtraY-v)*l>0&&(i=3*s*Math.abs(c-f.indexOf(t)),(h=u.cxFinal+a(u.px0[0],u.px1[0])+i-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*s>0&&(t.labelExtraX+=h)))}for(n=0;n<2;n++)for(i=n?m:v,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,(c=t[n][r]).sort(i),u=t[1-n][r],f=u.concat(c),p=[],h=0;hMath.abs(f)?s+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(a+t.labelExtraX+c):s+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+c}else s+="V"+(t.yLabelMid+t.labelExtraY)+"h"+c;l.ensureSingle(r,"path","textline").call(o.stroke,e.outsidetextfont.color).attr({"stroke-width":Math.min(2,e.outsidetextfont.size/8),d:s,fill:"none"})}else r.select("path.textline").remove()}))}(y,v),T&&v.automargin){var A=s.bBox(d.node()),M=v.domain,S=h.w*(M.x[1]-M.x[0]),E=h.h*(M.y[1]-M.y[0]),P=(.5*S-m.r)/h.w,I=(.5*E-m.r)/h.h;i.autoMargin(t,"pie."+v.uid+".automargin",{xl:M.x[0]-P,xr:M.x[1]+P,yb:M.y[0]-I,yt:M.y[1]+I,l:Math.max(m.cx-m.r-A.left,0),r:Math.max(A.right-(m.cx+m.r),0),b:Math.max(A.bottom-(m.cy+m.r),0),t:Math.max(m.cy-m.r-A.top,0),pad:5})}}))}));setTimeout((function(){m.selectAll("tspan").each((function(){var t=n.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))}))}),0)},formatSliceLabel:D,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:C,prerenderTitles:_,layoutAreas:O,attachFxHandlers:x,computeTransform:R}},{"../../components/color":367,"../../components/drawing":389,"../../components/fx":407,"../../lib":515,"../../lib/svg_text_utils":541,"../../plots/plots":628,"../bar/constants":659,"../bar/uniform_text":673,"./event_data":914,"./helpers":915,"@plotly/d3":58}],920:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("./style_one"),a=t("../bar/uniform_text").resizeText;e.exports=function(t){var e=t._fullLayout._pielayer.selectAll(".trace");a(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(i,t,e)}))}))}},{"../bar/uniform_text":673,"./style_one":921,"@plotly/d3":58}],921:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style("stroke-width",s).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":367,"./helpers":915}],922:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},{"../scatter/attributes":936}],923:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_pointcloud2d,i=t("../../lib/str2rgbarray"),a=t("../../plots/cartesian/autorange").findExtremes,o=t("../scatter/get_trace_color");function s(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=n(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var l=s.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,o,s,l,c=this.xData=this.pickXData=t.x,u=this.yData=this.pickYData=t.y,f=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,p=t.indices,d=this.bounds;if(f){if(n=f,e=f.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);if(p)r=p;else for(r=new Int32Array(e),l=0;ld[2]&&(d[2]=o),sd[3]&&(d[3]=s);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var m=i(t.marker.color),g=i(t.marker.border.color),v=t.opacity*t.marker.opacity;m[3]*=v,this.pointcloudOptions.color=m;var y=t.marker.blend;if(null===y){y=c.length<100||u.length<100}this.pointcloudOptions.blend=y,g[3]*=v,this.pointcloudOptions.borderColor=g;var x=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=x,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var _=this.scene.xaxis,w=this.scene.yaxis,T=b/2||.5;t._extremes[_._id]=a(_,[d[0],d[2]],{ppad:T}),t._extremes[w._id]=a(w,[d[1],d[3]],{ppad:T})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new s(t,e.uid);return r.update(e),r}},{"../../../stackgl_modules":1133,"../../lib/str2rgbarray":540,"../../plots/cartesian/autorange":565,"../scatter/get_trace_color":946}],924:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio"),e._length=null}},{"../../lib":515,"./attributes":922}],925:[function(t,e,r){"use strict";["*pointcloud* trace is deprecated!","Please consider switching to the *scattergl* trace type."].join(" ");e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("../scatter3d/calc"),plot:t("./convert"),moduleType:"trace",name:"pointcloud",basePlotModule:t("../../plots/gl2d"),categories:["gl","gl2d","showLegend"],meta:{}}},{"../../plots/gl2d":605,"../scatter3d/calc":965,"./attributes":922,"./convert":923,"./defaults":924}],926:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain").attributes,l=t("../../plots/template_attributes").hovertemplateAttrs,c=t("../../components/colorscale/attributes"),u=t("../../plot_api/plot_template").templatedArray,f=t("../../plots/cartesian/axis_format_attributes").descriptionOnlyNumbers,h=t("../../lib/extend").extendFlat,p=t("../../plot_api/edit_types").overrideAll;(e.exports=p({hoverinfo:h({},i.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:f("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]})},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:o.hoverlabel,hovertemplate:l({},{keys:["value","label"]}),colorscales:u("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(c().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},{"../../components/color/attributes":366,"../../components/colorscale/attributes":374,"../../components/fx/attributes":398,"../../lib/extend":505,"../../plot_api/edit_types":548,"../../plot_api/plot_template":555,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/domain":593,"../../plots/font_attributes":594,"../../plots/template_attributes":642}],927:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes"),s=t("../../lib/setcursor"),l=t("../../components/dragelement"),c=t("../../components/selections").prepSelect,u=t("../../lib"),f=t("../../registry");function h(t,e){var r=t._fullData[e],n=t._fullLayout,i=n.dragmode,a="pan"===n.dragmode?"move":"crosshair",o=r._bgRect;if(o&&"pan"!==i&&"zoom"!==i){s(o,a);var h={_id:"x",c2p:u.identity,_offset:r._sankey.translateX,_length:r._sankey.width},p={_id:"y",c2p:u.identity,_offset:r._sankey.translateY,_length:r._sankey.height},d={gd:t,element:o.node(),plotinfo:{id:e,xaxis:h,yaxis:p,fillRangeItems:u.noop},subplot:e,xaxes:[h],yaxes:[p],doneFnCompleted:function(r){var n,i=t._fullData[e],a=i.node.groups.slice(),o=[];function s(t){for(var e=i._sankey.graph.nodes,r=0;ry&&(y=a.source[e]),a.target[e]>y&&(y=a.target[e]);var x,b=y+1;t.node._count=b;var _=t.node.groups,w={};for(e=0;e<_.length;e++){var T=_[e];for(x=0;x0&&s(E,b)&&s(L,b)&&(!w.hasOwnProperty(E)||!w.hasOwnProperty(L)||w[E]!==w[L])){w.hasOwnProperty(L)&&(L=w[L]),w.hasOwnProperty(E)&&(E=w[E]),L=+L,h[E=+E]=h[L]=!0;var C="";a.label&&a.label[e]&&(C=a.label[e]);var P=null;C&&p.hasOwnProperty(C)&&(P=p[C]),c.push({pointNumber:e,label:C,color:u?a.color[e]:a.color,customdata:f?a.customdata[e]:a.customdata,concentrationscale:P,source:E,target:L,value:+S}),M.source.push(E),M.target.push(L)}}var I=b+_.length,O=o(r.color),z=o(r.customdata),D=[];for(e=0;eb-1,childrenNodes:[],pointNumber:e,label:R,color:O?r.color[e]:r.color,customdata:z?r.customdata[e]:r.customdata})}var F=!1;return function(t,e,r){for(var a=i.init2dArray(t,0),o=0;o1}))}(I,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:_,groupLookup:w}}e.exports=function(t,e){var r=c(e);return a({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}},{"../../components/colorscale":379,"../../lib":515,"../../lib/gup":512,"strongly-connected-components":307}],929:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},{}],930:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2"),s=t("../../plots/domain").defaults,l=t("../../components/fx/hoverlabel_defaults"),c=t("../../plot_api/plot_template"),u=t("../../plots/array_container_defaults");function f(t,e){function r(r,a){return n.coerce(t,e,i.link.colorscales,r,a)}r("label"),r("cmin"),r("cmax"),r("colorscale")}e.exports=function(t,e,r,h){function p(r,a){return n.coerce(t,e,i,r,a)}var d=n.extendDeep(h.hoverlabel,t.hoverlabel),m=t.node,g=c.newContainer(e,"node");function v(t,e){return n.coerce(m,g,i.node,t,e)}v("label"),v("groups"),v("x"),v("y"),v("pad"),v("thickness"),v("line.color"),v("line.width"),v("hoverinfo",t.hoverinfo),l(m,g,v,d),v("hovertemplate");var y=h.colorway;v("color",g.label.map((function(t,e){return a.addOpacity(function(t){return y[t%y.length]}(e),.8)}))),v("customdata");var x=t.link||{},b=c.newContainer(e,"link");function _(t,e){return n.coerce(x,b,i.link,t,e)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",t.hoverinfo),l(x,b,_,d),_("hovertemplate");var w,T=o(h.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)";_("color",n.repeat(T,b.value.length)),_("customdata"),u(x,b,{name:"colorscales",handleItemDefaults:f}),s(e,h,p),p("orientation"),p("valueformat"),p("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),p("arrangement",w),n.coerceFont(p,"textfont",n.extendFlat({},h.font)),e._length=null}},{"../../components/color":367,"../../components/fx/hoverlabel_defaults":405,"../../lib":515,"../../plot_api/plot_template":555,"../../plots/array_container_defaults":561,"../../plots/domain":593,"./attributes":926,tinycolor2:313}],931:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),moduleType:"trace",name:"sankey",basePlotModule:t("./base_plot"),selectPoints:t("./select.js"),categories:["noOpacity"],meta:{}}},{"./attributes":926,"./base_plot":927,"./calc":928,"./defaults":930,"./plot":932,"./select.js":934}],932:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=i.numberFormat,o=t("./render"),s=t("../../components/fx"),l=t("../../components/color"),c=t("./constants").cn,u=i._;function f(t){return""!==t}function h(t,e){return t.filter((function(t){return t.key===e.traceId}))}function p(t,e){n.select(t).select("path").style("fill-opacity",e),n.select(t).select("rect").style("fill-opacity",e)}function d(t){n.select(t).select("text.name").style("fill","black")}function m(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function v(t,e,r){e&&r&&h(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(x.bind(0,e,r,!1))}function y(t,e,r){e&&r&&h(r,e).selectAll("."+c.sankeyLink).filter(m(e)).call(b.bind(0,e,r,!1))}function x(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),i&&h(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){if(!t.link.concentrationscale)return.4})),r&&h(e,t).selectAll("."+c.sankeyNode).filter(g(t)).call(v)}function b(t,e,r,n){var i=n.datum().link.label;n.style("fill-opacity",(function(t){return t.tinyColorAlpha})),i&&h(e,t).selectAll("."+c.sankeyLink).filter((function(t){return t.link.label===i})).style("fill-opacity",(function(t){return t.tinyColorAlpha})),r&&h(e,t).selectAll(c.sankeyNode).filter(g(t)).call(y)}function _(t,e){var r=t.hoverlabel||{},n=i.nestedProperty(r,e).get();return!Array.isArray(n)&&n}e.exports=function(t,e){for(var r=t._fullLayout,i=r._paper,h=r._size,m=0;m"),color:_(o,"bgcolor")||l.addOpacity(m.color,1),borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:n.event.x"),color:_(o,"bgcolor")||i.tinyColorHue,borderColor:_(o,"bordercolor"),fontFamily:_(o,"font.family"),fontSize:_(o,"font.size"),fontColor:_(o,"font.color"),nameLength:_(o,"namelength"),textAlign:_(o,"align"),idealAlign:"left",hovertemplate:o.hovertemplate,hovertemplateLabels:y,eventData:[i.node]},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});p(w,.85),d(w)}}},unhover:function(e,i,a){!1!==t._fullLayout.hovermode&&(n.select(e).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,t.emit("plotly_unhover",{event:n.event,points:[i.node]})),s.loneUnhover(r._hoverlayer.node()))},select:function(e,r,i){var a=r.node;a.originalEvent=n.event,t._hoverdata=[a],n.select(e).call(y,r,i),s.click(t,{target:!0})}}})}},{"../../components/color":367,"../../components/fx":407,"../../lib":515,"./constants":929,"./render":933,"@plotly/d3":58}],933:[function(t,e,r){"use strict";var n=t("d3-force"),i=t("d3-interpolate").interpolateNumber,a=t("@plotly/d3"),o=t("@plotly/d3-sankey"),s=t("@plotly/d3-sankey-circular"),l=t("./constants"),c=t("tinycolor2"),u=t("../../components/color"),f=t("../../components/drawing"),h=t("../../lib"),p=h.strTranslate,d=h.strRotate,m=t("../../lib/gup"),g=m.keyFun,v=m.repeat,y=m.unwrap,x=t("../../lib/svg_text_utils"),b=t("../../registry"),_=t("../../constants/alignment"),w=_.CAP_SHIFT,T=_.LINE_SPACING;function k(t,e,r){var n,i=y(e),a=i.trace,u=a.domain,f="h"===a.orientation,p=a.node.pad,d=a.node.thickness,m=t.width*(u.x[1]-u.x[0]),g=t.height*(u.y[1]-u.y[0]),v=i._nodes,x=i._links,b=i.circular;(n=b?s.sankeyCircular().circularLinkGap(0):o.sankey()).iterations(l.sankeyIterations).size(f?[m,g]:[g,m]).nodeWidth(d).nodePadding(p).nodeId((function(t){return t.pointNumber})).nodes(v).links(x);var _,w,T,k=n();for(var A in n.nodePadding()=i||(r=i-e.y0)>1e-6&&(e.y0+=r,e.y1+=r),i=e.y1+p}))}(function(t){var e,r,n=t.map((function(t,e){return{x0:t.x0,index:e}})).sort((function(t,e){return t.x0-e.x0})),i=[],a=-1,o=-1/0;for(_=0;_o+d&&(a+=1,e=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=e-s.x0,s.x0+=r,s.x1+=r}return i}(v=k.nodes));n.update(k)}return{circular:b,key:r,trace:a,guid:h.randstr(),horizontal:f,width:m,height:g,nodePad:a.node.pad,nodeLineColor:a.node.line.color,nodeLineWidth:a.node.line.width,linkLineColor:a.link.line.color,linkLineWidth:a.link.line.width,linkArrowLength:a.link.arrowlen,valueFormat:a.valueformat,valueSuffix:a.valuesuffix,textFont:a.textfont,translateX:u.x[0]*t.width+t.margin.l,translateY:t.height-u.y[1]*t.height+t.margin.t,dragParallel:f?g:m,dragPerpendicular:f?m:g,arrangement:a.arrangement,sankey:n,graph:k,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function A(t,e,r){var n=c(e.color),i=e.source.label+"|"+e.target.label+"__"+r;return e.trace=t.trace,e.curveNumber=t.trace.index,{circular:t.circular,key:i,traceId:t.key,pointNumber:e.pointNumber,link:e,tinyColorHue:u.tinyRGB(n),tinyColorAlpha:n.getAlpha(),linkPath:M,linkLineColor:t.linkLineColor,linkLineWidth:t.linkLineWidth,linkArrowLength:t.linkArrowLength,valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,parent:t,interactionState:t.interactionState,flow:e.flow}}function M(){return function(t){var e=t.linkArrowLength;if(t.link.circular)return function(t,e){var r=t.width/2,n=t.circularPathData;return"top"===t.circularLinkType?"M "+(n.targetX-e)+" "+(n.targetY+r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 1 "+(n.rightFullExtent-r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 1 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY-n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.leftInnerExtent+" "+(n.sourceY-r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 0 "+(n.leftFullExtent-r)+" "+(n.sourceY-n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 0 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY-n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"L"+(n.targetX-e)+" "+(n.targetY-r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z":"M "+(n.targetX-e)+" "+(n.targetY-r)+" L"+(n.rightInnerExtent-e)+" "+(n.targetY-r)+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightSmallArcRadius+r)+" 0 0 0 "+(n.rightFullExtent-r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"L"+(n.rightFullExtent-r-e)+" "+n.verticalRightInnerExtent+"A"+(n.rightLargeArcRadius+r)+" "+(n.rightLargeArcRadius+r)+" 0 0 0 "+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent+r)+"L"+n.leftInnerExtent+" "+(n.verticalFullExtent+r)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftLargeArcRadius+r)+" 0 0 0 "+(n.leftFullExtent+r)+" "+n.verticalLeftInnerExtent+"L"+(n.leftFullExtent+r)+" "+(n.sourceY+n.leftSmallArcRadius)+"A"+(n.leftLargeArcRadius+r)+" "+(n.leftSmallArcRadius+r)+" 0 0 0 "+n.leftInnerExtent+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY-r)+"L"+n.sourceX+" "+(n.sourceY+r)+"L"+n.leftInnerExtent+" "+(n.sourceY+r)+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftSmallArcRadius-r)+" 0 0 1 "+(n.leftFullExtent-r)+" "+(n.sourceY+n.leftSmallArcRadius)+"L"+(n.leftFullExtent-r)+" "+n.verticalLeftInnerExtent+"A"+(n.leftLargeArcRadius-r)+" "+(n.leftLargeArcRadius-r)+" 0 0 1 "+n.leftInnerExtent+" "+(n.verticalFullExtent-r)+"L"+(n.rightInnerExtent-e)+" "+(n.verticalFullExtent-r)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightLargeArcRadius-r)+" 0 0 1 "+(n.rightFullExtent+r-e)+" "+n.verticalRightInnerExtent+"L"+(n.rightFullExtent+r-e)+" "+(n.targetY+n.rightSmallArcRadius)+"A"+(n.rightLargeArcRadius-r)+" "+(n.rightSmallArcRadius-r)+" 0 0 1 "+(n.rightInnerExtent-e)+" "+(n.targetY+r)+"L"+(n.targetX-e)+" "+(n.targetY+r)+(e>0?"L"+n.targetX+" "+n.targetY:"")+"Z"}(t.link,e);var r=Math.abs((t.link.target.x0-t.link.source.x1)/2);e>r&&(e=r);var n=t.link.source.x1,a=t.link.target.x0-e,o=i(n,a),s=o(.5),l=o(.5),c=t.link.y0-t.link.width/2,u=t.link.y0+t.link.width/2,f=t.link.y1-t.link.width/2,h=t.link.y1+t.link.width/2,p="M"+n+","+c,d="C"+s+","+c+" "+l+","+f+" "+a+","+f,m="C"+l+","+h+" "+s+","+u+" "+n+","+u,g=e>0?"L"+(a+e)+","+(f+t.link.width/2):"";return p+d+(g+="L"+a+","+h)+m+"Z"}}function S(t,e){var r=c(e.color),n=l.nodePadAcross,i=t.nodePad/2;e.dx=e.x1-e.x0,e.dy=e.y1-e.y0;var a=e.dx,o=Math.max(.5,e.dy),s="node_"+e.pointNumber;return e.group&&(s=h.randstr()),e.trace=t.trace,e.curveNumber=t.trace.index,{index:e.pointNumber,key:s,partOfGroup:e.partOfGroup||!1,group:e.group,traceId:t.key,trace:t.trace,node:e,nodePad:t.nodePad,nodeLineColor:t.nodeLineColor,nodeLineWidth:t.nodeLineWidth,textFont:t.textFont,size:t.horizontal?t.height:t.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:t.horizontal?e.dy/2+1:e.dx/2+1,left:1===e.originalLayer,sizeAcross:t.width,forceLayouts:t.forceLayouts,horizontal:t.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:u.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:t.valueFormat,valueSuffix:t.valueSuffix,sankey:t.sankey,graph:t.graph,arrangement:t.arrangement,uniqueNodeLabelPathId:[t.guid,t.key,s].join("_"),interactionState:t.interactionState,figure:t}}function E(t){t.attr("transform",(function(t){return p(t.node.x0.toFixed(3),t.node.y0.toFixed(3))}))}function L(t){t.call(E)}function C(t,e){t.call(L),e.attr("d",M())}function P(t){t.attr("width",(function(t){return t.node.x1-t.node.x0})).attr("height",(function(t){return t.visibleHeight}))}function I(t){return t.link.width>1||t.linkLineWidth>0}function O(t){return p(t.translateX,t.translateY)+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function z(t,e,r){t.on(".basic",null).on("mouseover.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.hover(this,t,e),t.interactionState.hovered=[this,t])})).on("mousemove.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.follow(this,t),t.interactionState.hovered=[this,t])})).on("mouseout.basic",(function(t){t.interactionState.dragInProgress||t.partOfGroup||(r.unhover(this,t,e),t.interactionState.hovered=!1)})).on("click.basic",(function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||t.partOfGroup||r.select(this,t,e)}))}function D(t,e,r,i){var o=a.behavior.drag().origin((function(t){return{x:t.node.x0+t.visibleWidth/2,y:t.node.y0+t.visibleHeight/2}})).on("dragstart",(function(a){if("fixed"!==a.arrangement&&(h.ensureSingle(i._fullLayout._infolayer,"g","dragcover",(function(t){i._fullLayout._dragCover=t})),h.raiseToTop(this),a.interactionState.dragInProgress=a.node,F(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+a.key;a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r,i){!function(t){for(var e=0;e0&&n.forceLayouts[e].alpha(0)}}(0,e,a,r)).stop()}(0,o,a),function(t,e,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var s=r.node.originalX;r.node.x0=s-r.visibleWidth/2,r.node.x1=s+r.visibleWidth/2,R(r,i)}}))}(t,e,a,o,i)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=a.event.x,i=a.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),i=Math.max(0,Math.min(r.size-r.visibleHeight/2,i)),r.node.y0=i-r.visibleHeight/2,r.node.y1=i+r.visibleHeight/2),F(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),C(t.filter(B(r)),e))}})).on("dragend",(function(t){if("fixed"!==t.arrangement){t.interactionState.dragInProgress=!1;for(var e=0;el&&C[v].gap;)v--;for(x=C[v].s,m=C.length-1;m>v;m--)C[m].s=x;for(;lM[u]&&u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],943:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./attributes"),o=t("./constants"),s=t("./subtypes"),l=t("./xy_defaults"),c=t("./period_defaults"),u=t("./stack_defaults"),f=t("./marker_defaults"),h=t("./line_defaults"),p=t("./line_shape_defaults"),d=t("./text_defaults"),m=t("./fillcolor_defaults"),g=t("../../lib").coercePattern;e.exports=function(t,e,r,v){function y(r,i){return n.coerce(t,e,a,r,i)}var x=l(t,e,v,y);if(x||(e.visible=!1),e.visible){c(t,e,v,y),y("xhoverformat"),y("yhoverformat");var b=u(t,e,v,y),_=!b&&x=Math.min(e,r)&&d<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(h.c2p(t.x)-d);return a=Math.min(e,r)&&m<=Math.max(e,r)?0:1/0}var n=Math.max(3,t.mrc||0),i=1-1/n,a=Math.abs(p.c2p(t.y)-m);return aW!=(N=z[I][1])>=W&&(R=z[I-1][0],F=z[I][0],N-B&&(D=R+(F-R)*(W-B)/(N-B),H=Math.min(H,D),q=Math.max(q,D)));H=Math.max(H,0),q=Math.min(q,h._length);var Z=s.defaultLine;return s.opacity(f.fillcolor)?Z=f.fillcolor:s.opacity((f.line||{}).color)&&(Z=f.line.color),n.extendFlat(t,{distance:t.maxHoverDistance,x0:H,x1:q,y0:W,y1:W,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":367,"../../components/fx":407,"../../lib":515,"../../registry":647,"./get_trace_color":946}],948:[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":578,"./arrays_to_calcdata":935,"./attributes":936,"./calc":937,"./cross_trace_calc":941,"./cross_trace_defaults":942,"./defaults":943,"./format_labels":945,"./hover":947,"./marker_colorbar":954,"./plot":957,"./select":958,"./style":960,"./subtypes":961}],949:[function(t,e,r){"use strict";var n=t("../../lib").isArrayOrTypedArray,i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s,l){l||(l={});var c=(t.marker||{}).color;(s("line.color",r),i(t,"line"))?a(t,e,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!n(c)&&c||r);s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}},{"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"../../lib":515}],950:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../../constants/numerical"),a=i.BADNUM,o=i.LOG_CLIP,s=o+.5,l=o-.5,c=t("../../lib"),u=c.segmentsIntersect,f=c.constrain,h=t("./constants");e.exports=function(t,e){var r,i,o,p,d,m,g,v,y,x,b,_,w,T,k,A,M,S,E=e.trace||{},L=e.xaxis,C=e.yaxis,P="log"===L.type,I="log"===C.type,O=L._length,z=C._length,D=e.backoff,R=E.marker,F=e.connectGaps,B=e.baseTolerance,N=e.shape,j="linear"===N,U=E.fill&&"none"!==E.fill,V=[],H=h.minTolerance,q=t.length,G=new Array(q),Y=0;function W(r){var n=t[r];if(!n)return!1;var i=e.linearized?L.l2p(n.x):L.c2p(n.x),o=e.linearized?C.l2p(n.y):C.c2p(n.y);if(i===a){if(P&&(i=L.c2p(n.x,!0)),i===a)return!1;I&&o===a&&(i*=Math.abs(L._m*z*(L._m>0?s:l)/(C._m*O*(C._m>0?s:l)))),i*=1e3}if(o===a){if(I&&(o=C.c2p(n.y,!0)),o===a)return!1;o*=1e3}return[i,o]}function Z(t,e,r,n){var i=r-t,a=n-e,o=.5-t,s=.5-e,l=i*i+a*a,c=i*o+a*s;if(c>0&&cot||t[1]lt)return[f(t[0],at,ot),f(t[1],st,lt)]}function ft(t,e){return t[0]===e[0]&&(t[0]===at||t[0]===ot)||(t[1]===e[1]&&(t[1]===st||t[1]===lt)||void 0)}function ht(t,e,r){return function(n,i){var a=ut(n),o=ut(i),s=[];if(a&&o&&ft(a,o))return s;a&&s.push(a),o&&s.push(o);var l=2*c.constrain((n[t]+i[t])/2,e,r)-((a||n)[t]+(o||i)[t]);l&&((a&&o?l>0==a[t]>o[t]?a:o:a||o)[t]+=l);return s}}function pt(t){var e=t[0],r=t[1],n=e===G[Y-1][0],i=r===G[Y-1][1];if(!n||!i)if(Y>1){var a=e===G[Y-2][0],o=r===G[Y-2][1];n&&(e===at||e===ot)&&a?o?Y--:G[Y-1]=t:i&&(r===st||r===lt)&&o?a?Y--:G[Y-1]=t:G[Y++]=t}else G[Y++]=t}function dt(t){G[Y-1][0]!==t[0]&&G[Y-1][1]!==t[1]&&pt([$,tt]),pt(t),et=null,$=tt=0}"linear"===N||"spline"===N?nt=function(t,e){for(var r=[],n=0,i=0;i<4;i++){var a=ct[i],o=u(t[0],t[1],e[0],e[1],a[0],a[1],a[2],a[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&&J(o,t)ot?ot:0,Q=e[1]lt?lt:0,K||Q){if(Y)if(et){var n=nt(et,e);n.length>1&&(dt(n[0]),G[Y++]=n[1])}else rt=nt(G[Y-1],e)[0],G[Y++]=rt;else G[Y++]=[K||e[0],Q||e[1]];var i=G[Y-1];K&&Q&&(i[0]!==K||i[1]!==Q)?(et&&($!==K&&tt!==Q?pt($&&tt?(a=et,s=(o=e)[0]-a[0],l=(o[1]-a[1])/s,(a[1]*o[0]-o[1]*a[0])/s>0?[l>0?at:ot,lt]:[l>0?ot:at,st]):[$||K,tt||Q]):$&&tt&&pt([$,tt])),pt([K,Q])):$-K&&tt-Q&&pt([K||$,Q||tt]),et=e,$=K,tt=Q}else et&&dt(nt(et,e)[0]),G[Y++]=e;var a,o,s,l}for(r=0;rX(m,vt))break;o=m,(w=y[0]*v[0]+y[1]*v[1])>b?(b=w,p=m,g=!1):w<_&&(_=w,d=m,g=!0)}if(g?(gt(p),o!==d&>(d)):(d!==i&>(d),o!==p&>(p)),gt(o),r>=t.length||!m)break;gt(m),i=m}}else gt(p)}et&&pt([$||et[0],tt||et[1]]),V.push(G.slice(0,Y))}var yt=N.slice(N.length-1);if(D&&"h"!==yt&&"v"!==yt){for(var xt=!1,bt=-1,_t=[],wt=0;wt=0?l=p:(l=p=h,h++),l0?Math.max(r,a):0}}},{"fast-isnumeric":190}],954:[function(t,e,r){"use strict";e.exports={container:"marker",min:"cmin",max:"cmax"}},{}],955:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/helpers").hasColorscale,a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient)&&("none"!==l("marker.gradient.type")&&l("marker.gradient.color"))}},{"../../components/color":367,"../../components/colorscale/defaults":377,"../../components/colorscale/helpers":378,"./subtypes":961}],956:[function(t,e,r){"use strict";var n=t("../../lib").dateTick0,i=t("../../constants/numerical").ONEWEEK;function a(t,e){return n(e,t%i==0?1:0)}e.exports=function(t,e,r,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",a(o,e.xcalendar)),n("xperiodalignment"))}if(i.y){var s=n("yperiod");s&&(n("yperiod0",a(s,e.ycalendar)),n("yperiodalignment"))}}},{"../../constants/numerical":491,"../../lib":515}],957:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../registry"),a=t("../../lib"),o=a.ensureSingle,s=a.identity,l=t("../../components/drawing"),c=t("./subtypes"),u=t("./line_points"),f=t("./link_traces"),h=t("../../lib/polygon").tester;function p(t,e,r,f,p,d,m){var g;!function(t,e,r,i,o){var s=r.xaxis,l=r.yaxis,u=n.extent(a.simpleMap(s.range,s.r2c)),f=n.extent(a.simpleMap(l.range,l.r2c)),h=i[0].trace;if(!c.hasMarkers(h))return;var p=h.marker.maxdisplayed;if(0===p)return;var d=i.filter((function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]})),m=Math.ceil(d.length/p),g=0;o.forEach((function(t,r){var n=t[0].trace;c.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function y(t){return v?t.transition():t}var x=r.xaxis,b=r.yaxis,_=f[0].trace,w=_.line,T=n.select(d),k=o(T,"g","errorbars"),A=o(T,"g","lines"),M=o(T,"g","points"),S=o(T,"g","text");if(i.getComponentMethod("errorbars","plot")(t,k,r,m),!0===_.visible){var E,L;y(T).style("opacity",_.opacity);var C=_.fill.charAt(_.fill.length-1);"x"!==C&&"y"!==C&&(C=""),f[0][r.isRangePlot?"nodeRangePlot3":"node3"]=T;var P,I,O="",z=[],D=_._prevtrace;D&&(O=D._prevRevpath||"",L=D._nextFill,z=D._polygons);var R,F,B,N,j,U,V,H="",q="",G=[],Y=a.noop;if(E=_._ownFill,c.hasLines(_)||"none"!==_.fill){for(L&&L.datum(f),-1!==["hv","vh","hvh","vhv"].indexOf(w.shape)?(R=l.steps(w.shape),F=l.steps(w.shape.split("").reverse().join(""))):R=F="spline"===w.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?l.smoothclosed(t.slice(1),w.smoothing):l.smoothopen(t,w.smoothing)}:function(t){return"M"+t.join("L")},B=function(t){return F(t.reverse())},G=u(f,{xaxis:x,yaxis:b,trace:_,connectGaps:_.connectgaps,baseTolerance:Math.max(w.width||1,3)/4,shape:w.shape,backoff:w.backoff,simplify:w.simplify,fill:_.fill}),V=_._polygons=new Array(G.length),g=0;g1){var r=n.select(this);if(r.datum(f),t)y(r.style("opacity",0).attr("d",P).call(l.lineGroupStyle)).style("opacity",1);else{var i=y(r);i.attr("d",P),l.singleLineStyle(f,i)}}}}}var W=A.selectAll(".js-line").data(G);y(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(Y(!0)),l.setClipUrl(W,r.layerClipId,t),G.length?(E?(E.datum(f),N&&U&&(C?("y"===C?N[1]=U[1]=b.c2p(0,!0):"x"===C&&(N[0]=U[0]=x.c2p(0,!0)),y(E).attr("d","M"+U+"L"+N+"L"+H.substr(1)).call(l.singleFillStyle,t)):y(E).attr("d",H+"Z").call(l.singleFillStyle,t))):L&&("tonext"===_.fill.substr(0,6)&&H&&O?("tonext"===_.fill?y(L).attr("d",H+"Z"+O+"Z").call(l.singleFillStyle,t):y(L).attr("d",H+"L"+O.substr(1)+"Z").call(l.singleFillStyle,t),_._polygons=_._polygons.concat(z)):(X(L),_._polygons=null)),_._prevRevpath=q,_._prevPolygons=V):(E?X(E):L&&X(L),_._polygons=_._prevRevpath=_._prevPolygons=null),M.datum(f),S.datum(f),function(e,i,a){var o,u=a[0].trace,f=c.hasMarkers(u),h=c.hasText(u),p=tt(u),d=et,m=et;if(f||h){var g=s,_=u.stackgroup,w=_&&"infer zero"===t._fullLayout._scatterStackOpts[x._id+b._id][_].stackgaps;u.marker.maxdisplayed||u._needsCull?g=w?K:J:_&&!w&&(g=Q),f&&(d=g),h&&(m=g)}var T,k=(o=e.selectAll("path.point").data(d,p)).enter().append("path").classed("point",!0);v&&k.call(l.pointStyle,u,t).call(l.translatePoints,x,b).style("opacity",0).transition().style("opacity",1),o.order(),f&&(T=l.makePointStyleFns(u)),o.each((function(e){var i=n.select(this),a=y(i);l.translatePoint(e,a,x,b)?(l.singlePointStyle(e,a,u,T,t),r.layerClipId&&l.hideOutsideRangePoint(e,a,x,b,u.xcalendar,u.ycalendar),u.customdata&&i.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()})),v?o.exit().transition().style("opacity",0).remove():o.exit().remove(),(o=i.selectAll("g").data(m,p)).enter().append("g").classed("textpoint",!0).append("text"),o.order(),o.each((function(t){var e=n.select(this),i=y(e.select("text"));l.translatePoint(t,i,x,b)?r.layerClipId&&l.hideOutsideRangePoint(t,e,x,b,u.xcalendar,u.ycalendar):e.remove()})),o.selectAll("text").call(l.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()}(M,S,f);var Z=!1===_.cliponaxis?null:r.layerClipId;l.setClipUrl(M,Z,t),l.setClipUrl(S,Z,t)}function X(t){y(t).attr("d","M0,0Z")}function J(t){return t.filter((function(t){return!t.gap&&t.vis}))}function K(t){return t.filter((function(t){return t.vis}))}function Q(t){return t.filter((function(t){return!t.gap}))}function $(t){return t.id}function tt(t){if(t.ids)return $}function et(){return!1}}e.exports=function(t,e,r,i,a,c){var u,h,d=!a,m=!!a&&a.duration>0,g=f(t,e,r);((u=i.selectAll("g.trace").data(g,(function(t){return t[0].trace.uid}))).enter().append("g").attr("class",(function(t){return"trace scatter trace"+t[0].trace.uid})).style("stroke-miterlimit",2),u.order(),function(t,e,r){e.each((function(e){var i=o(n.select(this),"g","fills");l.setClipUrl(i,r.layerClipId,t);var a=e[0].trace,c=[];a._ownfill&&c.push("_ownFill"),a._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,s);u.enter().append("g"),u.exit().each((function(t){a[t]=null})).remove(),u.order().each((function(t){a[t]=o(n.select(this),"path","js-fill")}))}))}(t,u,e),m)?(c&&(h=c()),n.transition().duration(a.duration).ease(a.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(t,n,e,r,g,this,a)}))}))):u.each((function(r,n){p(t,n,e,r,g,this,a)}));d&&u.exit().remove(),i.selectAll("path:not([d])").remove()}},{"../../components/drawing":389,"../../lib":515,"../../lib/polygon":527,"../../registry":647,"./line_points":950,"./link_traces":952,"./subtypes":961,"@plotly/d3":58}],958:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r0){var h=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=h),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,h)}}else o[s]=[-l[0]*r,l[1]*r]}return o}e.exports=function(t,e,r){var n=[i(t.x,t.error_x,e[0],r.xaxis),i(t.y,t.error_y,e[1],r.yaxis),i(t.z,t.error_z,e[2],r.zaxis)],a=function(t){for(var e=0;e-1?-1:t.indexOf("right")>-1?1:0}function b(t){return null==t?0:t.indexOf("top")>-1?-1:t.indexOf("bottom")>-1?1:0}function _(t,e){return e(4*t)}function w(t){return p[t]}function T(t,e,r,n,i){var a=null;if(l.isArrayOrTypedArray(t)){a=[];for(var o=0;o=0){var m=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],l=[];for(n=0;n=0&&f("surfacecolor",h||p);for(var d=["x","y","z"],m=0;m<3;++m){var g="projection."+d[m];f(g+".show")&&(f(g+".opacity"),f(g+".scale"))}var v=n.getComponentMethod("errorbars","supplyDefaults");v(t,e,h||p||r,{axis:"z"}),v(t,e,h||p||r,{axis:"y",inherit:"z"}),v(t,e,h||p||r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../lib":515,"../../registry":647,"../scatter/line_defaults":949,"../scatter/marker_defaults":955,"../scatter/subtypes":961,"../scatter/text_defaults":962,"./attributes":964}],969:[function(t,e,r){"use strict";e.exports={plot:t("./convert"),attributes:t("./attributes"),markerSymbols:t("../../constants/gl3d_markers"),supplyDefaults:t("./defaults"),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t("./calc"),moduleType:"trace",name:"scatter3d",basePlotModule:t("../../plots/gl3d"),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},{"../../constants/gl3d_markers":489,"../../plots/gl3d":607,"./attributes":964,"./calc":965,"./convert":967,"./defaults":968}],970:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../plots/template_attributes").hovertemplateAttrs,o=t("../../plots/template_attributes").texttemplateAttrs,s=t("../../components/colorscale/attributes"),l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a()}},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/attributes":562,"../../plots/template_attributes":642,"../scatter/attributes":936}],971:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e._carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e._length,p=new Array(h),d=!1;for(c=0;c")}return o}function y(t,e){var r;r=t.labelprefix&&t.labelprefix.length>0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}}},{"../../lib":515,"../scatter/hover":947}],976:[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:"scattercarpet",basePlotModule:t("../../plots/cartesian"),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},{"../../plots/cartesian":578,"../scatter/marker_colorbar":954,"../scatter/select":958,"../scatter/style":960,"./attributes":970,"./calc":971,"./defaults":972,"./event_data":973,"./format_labels":974,"./hover":975,"./plot":977}],977:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r,o){var s,l,c,u=r[0][0].carpet,f=i.getFromId(t,u.xaxis||"x"),h=i.getFromId(t,u.yaxis||"y"),p={xaxis:f,yaxis:h,plot:e.plot};for(s=0;s")}(c,m,t,l[0].t.labels),t.hovertemplate=c.hovertemplate,[t]}}},{"../../components/fx":407,"../../constants/numerical":491,"../../lib":515,"../scatter/get_trace_color":946,"./attributes":978}],984:[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"),calcGeoJSON:t("./plot").calcGeoJSON,plot:t("./plot").plot,style:t("./style"),styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("./select"),moduleType:"trace",name:"scattergeo",basePlotModule:t("../../plots/geo"),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/geo":598,"../scatter/marker_colorbar":954,"../scatter/style":960,"./attributes":978,"./calc":979,"./defaults":980,"./event_data":981,"./format_labels":982,"./hover":983,"./plot":985,"./select":986,"./style":987}],985:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../lib/topojson_utils").getTopojsonFeatures,o=t("../../lib/geojson_utils"),s=t("../../lib/geo_location_utils"),l=t("../../plots/cartesian/autorange").findExtremes,c=t("../../constants/numerical").BADNUM,u=t("../scatter/calc").calcMarkerSize,f=t("../scatter/subtypes"),h=t("./style");e.exports={calcGeoJSON:function(t,e){var r,n,i=t[0].trace,o=e[i.geo],f=o._subplot,h=i._length;if(Array.isArray(i.locations)){var p=i.locationmode,d="geojson-id"===p?s.extractTraceFeature(t):a(i,f.topojson);for(r=0;r=g,w=2*b,T={},k=l.makeCalcdata(e,"x"),A=y.makeCalcdata(e,"y"),M=s(e,l,"x",k),S=s(e,y,"y",A),E=M.vals,L=S.vals;e._x=E,e._y=L,e.xperiodalignment&&(e._origX=k,e._xStarts=M.starts,e._xEnds=M.ends),e.yperiodalignment&&(e._origY=A,e._yStarts=S.starts,e._yEnds=S.ends);var C=new Array(w),P=new Array(b);for(r=0;r1&&i.extendFlat(s.line,p.linePositions(t,r,n));if(s.errorX||s.errorY){var l=p.errorBarPositions(t,r,n,a,o);s.errorX&&i.extendFlat(s.errorX,l.x),s.errorY&&i.extendFlat(s.errorY,l.y)}s.text&&(i.extendFlat(s.text,{positions:n},p.textPosition(t,r,s.text,s.marker)),i.extendFlat(s.textSel,{positions:n},p.textPosition(t,r,s.text,s.markerSel)),i.extendFlat(s.textUnsel,{positions:n},p.textPosition(t,r,s.text,s.markerUnsel)));return s}(t,0,e,C,E,L),z=d(t,x);return f(o,e),_?O.marker&&(I=O.marker.sizeAvg||Math.max(O.marker.size,3)):I=c(e,b),u(t,e,l,y,E,L,I),O.errorX&&v(e,l,O.errorX),O.errorY&&v(e,y,O.errorY),O.fill&&!z.fill2d&&(z.fill2d=!0),O.marker&&!z.scatter2d&&(z.scatter2d=!0),O.line&&!z.line2d&&(z.line2d=!0),!O.errorX&&!O.errorY||z.error2d||(z.error2d=!0),O.text&&!z.glText&&(z.glText=!0),O.marker&&(O.marker.snap=b),z.lineOptions.push(O.line),z.errorXOptions.push(O.errorX),z.errorYOptions.push(O.errorY),z.fillOptions.push(O.fill),z.markerOptions.push(O.marker),z.markerSelectedOptions.push(O.markerSel),z.markerUnselectedOptions.push(O.markerUnsel),z.textOptions.push(O.text),z.textSelectedOptions.push(O.textSel),z.textUnselectedOptions.push(O.textUnsel),z.selectBatch.push([]),z.unselectBatch.push([]),T._scene=z,T.index=z.count,T.x=E,T.y=L,T.positions=C,z.count++,[{x:!1,y:!1,t:T,trace:e}]}},{"../../constants/numerical":491,"../../lib":515,"../../plots/cartesian/align_period":563,"../../plots/cartesian/autorange":565,"../../plots/cartesian/axis_ids":570,"../scatter/calc":937,"../scatter/colorscale_calc":939,"./constants":991,"./convert":992,"./scene_update":1e3,"@plotly/point-cluster":59}],991:[function(t,e,r){"use strict";e.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},{}],992:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("svg-path-sdf"),a=t("color-normalize"),o=t("../../registry"),s=t("../../lib"),l=t("../../components/drawing"),c=t("../../plots/cartesian/axis_ids"),u=t("../../lib/gl_format_color").formatColor,f=t("../scatter/subtypes"),h=t("../scatter/make_bubble_size_func"),p=t("./helpers"),d=t("./constants"),m=t("../../constants/interactions").DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=t("../../components/fx/helpers").appendArrayPointValue;function y(t,e){var r,i=t._fullLayout,a=e._length,o=e.textfont,l=e.textposition,c=Array.isArray(l)?l:[l],u=o.color,f=o.size,h=o.family,p={},d=t._context.plotGlPixelRatio,m=e.texttemplate;if(m){p.text=[];var g=i._d3locale,y=Array.isArray(m),x=y?Math.min(m.length,a):a,b=y?function(t){return m[t]}:function(){return m};for(r=0;rd.TOO_MANY_POINTS||f.hasMarkers(e)?"rect":"round";if(c&&e.connectgaps){var h=n[0],p=n[1];for(i=0;i1?l[i]:l[0]:l,d=Array.isArray(c)?c.length>1?c[i]:c[0]:c,m=g[p],v=g[d],y=u?u/.8+1:0,x=-v*y-.5*v;o.offset[i]=[m*y/h,x/h]}}return o}}},{"../../components/drawing":389,"../../components/fx/helpers":403,"../../constants/interactions":490,"../../lib":515,"../../lib/gl_format_color":511,"../../plots/cartesian/axis_ids":570,"../../registry":647,"../scatter/make_bubble_size_func":953,"../scatter/subtypes":961,"./constants":991,"./helpers":996,"color-normalize":89,"fast-isnumeric":190,"svg-path-sdf":311}],993:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry"),a=t("./helpers"),o=t("./attributes"),s=t("../scatter/constants"),l=t("../scatter/subtypes"),c=t("../scatter/xy_defaults"),u=t("../scatter/period_defaults"),f=t("../scatter/marker_defaults"),h=t("../scatter/line_defaults"),p=t("../scatter/fillcolor_defaults"),d=t("../scatter/text_defaults");e.exports=function(t,e,r,m){function g(r,i){return n.coerce(t,e,o,r,i)}var v=!!t.marker&&a.isOpenSymbol(t.marker.symbol),y=l.isBubble(t),x=c(t,e,m,g);if(x){u(t,e,m,g),g("xhoverformat"),g("yhoverformat");var b=x100},r.isDotSymbol=function(t){return"string"==typeof t?n.DOT_RE.test(t):t>200}},{"./constants":991}],997:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../scatter/get_trace_color");function o(t,e,r,o){var s=t.xa,l=t.ya,c=t.distance,u=t.dxy,f=t.index,h={pointNumber:f,x:e[f],y:r[f]};h.tx=Array.isArray(o.text)?o.text[f]:o.text,h.htx=Array.isArray(o.hovertext)?o.hovertext[f]:o.hovertext,h.data=Array.isArray(o.customdata)?o.customdata[f]:o.customdata,h.tp=Array.isArray(o.textposition)?o.textposition[f]:o.textposition;var p=o.textfont;p&&(h.ts=i.isArrayOrTypedArray(p.size)?p.size[f]:p.size,h.tc=Array.isArray(p.color)?p.color[f]:p.color,h.tf=Array.isArray(p.family)?p.family[f]:p.family);var d=o.marker;d&&(h.ms=i.isArrayOrTypedArray(d.size)?d.size[f]:d.size,h.mo=i.isArrayOrTypedArray(d.opacity)?d.opacity[f]:d.opacity,h.mx=i.isArrayOrTypedArray(d.symbol)?d.symbol[f]:d.symbol,h.ma=i.isArrayOrTypedArray(d.angle)?d.angle[f]:d.angle,h.mc=i.isArrayOrTypedArray(d.color)?d.color[f]:d.color);var m=d&&d.line;m&&(h.mlc=Array.isArray(m.color)?m.color[f]:m.color,h.mlw=i.isArrayOrTypedArray(m.width)?m.width[f]:m.width);var g=d&&d.gradient;g&&"none"!==g.type&&(h.mgt=Array.isArray(g.type)?g.type[f]:g.type,h.mgc=Array.isArray(g.color)?g.color[f]:g.color);var v=s.c2p(h.x,!0),y=l.c2p(h.y,!0),x=h.mrc||1,b=o.hoverlabel;b&&(h.hbg=Array.isArray(b.bgcolor)?b.bgcolor[f]:b.bgcolor,h.hbc=Array.isArray(b.bordercolor)?b.bordercolor[f]:b.bordercolor,h.hts=i.isArrayOrTypedArray(b.font.size)?b.font.size[f]:b.font.size,h.htc=Array.isArray(b.font.color)?b.font.color[f]:b.font.color,h.htf=Array.isArray(b.font.family)?b.font.family[f]:b.font.family,h.hnl=i.isArrayOrTypedArray(b.namelength)?b.namelength[f]:b.namelength);var _=o.hoverinfo;_&&(h.hi=Array.isArray(_)?_[f]:_);var w=o.hovertemplate;w&&(h.ht=Array.isArray(w)?w[f]:w);var T={};T[t.index]=h;var k=o._origX,A=o._origY,M=i.extendFlat({},t,{color:a(o,h),x0:v-x,x1:v+x,xLabelVal:k?k[f]:h.x,y0:y-x,y1:y+x,yLabelVal:A?A[f]:h.y,cd:T,distance:c,spikeDistance:u,hovertemplate:h.ht});return h.htx?M.text=h.htx:h.tx?M.text=h.tx:o.text&&(M.text=o.text),i.fillText(h,o,M),n.getComponentMethod("errorbars","hoverInfo")(h,o,M),M}e.exports={hoverPoints:function(t,e,r,n){var i,a,s,l,c,u,f,h,p,d,m=t.cd,g=m[0].t,v=m[0].trace,y=t.xa,x=t.ya,b=g.x,_=g.y,w=y.c2p(e),T=x.c2p(r),k=t.distance;if(g.tree){var A=y.p2c(w-k),M=y.p2c(w+k),S=x.p2c(T-k),E=x.p2c(T+k);i="x"===n?g.tree.range(Math.min(A,M),Math.min(x._rl[0],x._rl[1]),Math.max(A,M),Math.max(x._rl[0],x._rl[1])):g.tree.range(Math.min(A,M),Math.min(S,E),Math.max(A,M),Math.max(S,E))}else i=g.ids;var L=k;if("x"===n){var C=!!v.xperiodalignment,P=!!v.yperiodalignment;for(u=0;u=Math.min(I,O)&&w<=Math.max(I,O)?0:1/0}if(f=Math.min(z,D)&&T<=Math.max(z,D)?0:1/0}d=Math.sqrt(f*f+h*h),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=b[a=i[u]],c=_[a],f=y.c2p(l)-w,h=x.c2p(c)-T,(p=Math.sqrt(f*f+h*h))y.glText.length){var T=_-y.glText.length;for(m=0;mr&&(isNaN(e[n])||isNaN(e[n+1]));)n-=2;t.positions=e.slice(r,n+2)}return t})),y.line2d.update(y.lineOptions)),y.error2d){var A=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(A)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=s.repeat(null,_),y.fill2d&&(y.fillOptions=y.fillOptions.map((function(t,e){var n=r[e];if(t&&n&&n[0]&&n[0].trace){var i,a,o=n[0],s=o.trace,l=o.t,c=y.lineOptions[e],u=[];s._ownfill&&u.push(e),s._nexttrace&&u.push(e+1),u.length&&(y.fillOrder[e]=u);var f,h,p=[],d=c&&c.positions||l.positions;if("tozeroy"===s.fill){for(f=0;ff&&isNaN(d[h+1]);)h-=2;0!==d[f+1]&&(p=[d[f],0]),p=p.concat(d.slice(f,h+2)),0!==d[h+1]&&(p=p.concat([d[h],0]))}else if("tozerox"===s.fill){for(f=0;ff&&isNaN(d[h]);)h-=2;0!==d[f]&&(p=[0,d[f+1]]),p=p.concat(d.slice(f,h+2)),0!==d[h]&&(p=p.concat([0,d[h+1]]))}else if("toself"===s.fill||"tonext"===s.fill){for(p=[],i=0,t.splitNull=!0,a=0;a-1;for(m=0;m<_;m++){var L=r[m][0],C=L.trace,P=L.t,I=P.index,O=C._length,z=P.x,D=P.y;if(C.selectedpoints||S||E){if(S||(S=!0),C.selectedpoints){var R=y.selectBatch[I]=s.selIndices2selPoints(C),F={};for(g=0;g")}function u(t){return t+"\xb0"}}e.exports={hoverPoints:function(t,e,r){var o=t.cd,u=o[0].trace,f=t.xa,h=t.ya,p=t.subplot,d=[],m=l+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var v=p.map.queryRenderedFeatures(null,{layers:[m]});d=v.map((function(t){return t.id}))}var y=360*(e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),x=e-y;if(n.getClosest(o,(function(t){var e=t.lonlat;if(e[0]===s)return 1/0;if(g&&-1===d.indexOf(t.i+1))return 1/0;var n=i.modHalf(e[0],360),a=e[1],o=p.project([n,a]),l=o.x-f.c2p([x,a]),c=o.y-h.c2p([n,r]),u=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),t),!1!==t.index){var b=o[t.index],_=b.lonlat,w=[i.modHalf(_[0],360)+y,_[1]],T=f.c2p(w),k=h.c2p(w),A=b.mrc||1;t.x0=T-A,t.x1=T+A,t.y0=k-A,t.y1=k+A;var M={};M[u.subplot]={_subplot:p};var S=u._module.formatLabels(b,u,M);return t.lonLabel=S.lonLabel,t.latLabel=S.latLabel,t.color=a(u,b),t.extraText=c(u,b,o[0].t.labels),t.hovertemplate=u.hovertemplate,[t]}},getExtraText:c}},{"../../components/fx":407,"../../constants/numerical":491,"../../lib":515,"../../plots/mapbox/constants":620,"../scatter/get_trace_color":946}],1008:[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("../scattergeo/calc"),plot:t("./plot"),hoverPoints:t("./hover").hoverPoints,eventData:t("./event_data"),selectPoints:t("./select"),styleOnSelect:function(t,e){e&&e[0].trace._glTrace.update(e)},moduleType:"trace",name:"scattermapbox",basePlotModule:t("../../plots/mapbox"),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},{"../../plots/mapbox":622,"../scatter/marker_colorbar":954,"../scattergeo/calc":979,"./attributes":1002,"./defaults":1004,"./event_data":1005,"./format_labels":1006,"./hover":1007,"./plot":1009,"./select":1010}],1009:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./convert"),a=t("../../plots/mapbox/constants").traceLayerPrefix,o={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function s(t,e,r,n){this.type="scattermapbox",this.subplot=t,this.uid=e,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+e+"-fill",line:"source-"+e+"-line",circle:"source-"+e+"-circle",symbol:"source-"+e+"-symbol",cluster:"source-"+e+"-circle",clusterCount:"source-"+e+"-circle"},this.layerIds={fill:a+e+"-fill",line:a+e+"-line",circle:a+e+"-circle",symbol:a+e+"-symbol",cluster:a+e+"-cluster",clusterCount:a+e+"-cluster-count"},this.below=null}var l=s.prototype;l.addSource=function(t,e,r){var i={type:"geojson",data:e.geojson};r&&r.enabled&&n.extendFlat(i,{cluster:!0,clusterMaxZoom:r.maxzoom}),this.subplot.map.addSource(this.sourceIds[t],i)},l.setSourceData=function(t,e){this.subplot.map.getSource(this.sourceIds[t]).setData(e.geojson)},l.addLayer=function(t,e,r){var n={type:e.type,id:this.layerIds[t],source:this.sourceIds[t],layout:e.layout,paint:e.paint};e.filter&&(n.filter=e.filter),this.subplot.addLayer(n,r)},l.update=function(t){var e=t[0].trace,r=this.subplot,n=r.map,a=i(r.gd,t),s=r.belowLookup["trace-"+this.uid],l=!(!e.cluster||!e.cluster.enabled),c=!!this.clusterEnabled,u=this;function f(t){c?function(t){for(var e=o.cluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(u.layerIds[i])}t||n.removeSource(u.sourceIds.circle)}(t):function(t){for(var e=o.nonCluster,r=e.length-1;r>=0;r--){var i=e[r];n.removeLayer(u.layerIds[i]),t||n.removeSource(u.sourceIds[i])}}(t)}function h(t){l?function(t){t||u.addSource("circle",a.circle,e.cluster);for(var r=o.cluster,n=0;n=0;r--){var n=e[r];t.removeLayer(this.layerIds[n]),t.removeSource(this.sourceIds[n])}},e.exports=function(t,e){var r,n,a,l=e[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,f=new s(t,l.uid,c,u),h=i(t.gd,e),p=f.below=t.belowLookup["trace-"+l.uid];if(c)for(f.addSource("circle",h.circle,l.cluster),r=0;r")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":947}],1016:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults").supplyDefaults,colorbar:t("../scatter/marker_colorbar"),formatLabels:t("./format_labels"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,styleOnSelect:t("../scatter/style").styleOnSelect,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":631,"../scatter/marker_colorbar":954,"../scatter/select":958,"../scatter/style":960,"./attributes":1011,"./calc":1012,"./defaults":1013,"./format_labels":1014,"./hover":1015,"./plot":1017}],1017:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){for(var a=e.layers.frontplot.select("g.scatterlayer"),o=e.xaxis,s=e.yaxis,l={xaxis:o,yaxis:s,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},c=e.radialAxis,u=e.angularAxis,f=0;f=c&&(y.marker.cluster=d.tree),y.marker&&(y.markerSel.positions=y.markerUnsel.positions=y.marker.positions=_),y.line&&_.length>1&&l.extendFlat(y.line,s.linePositions(t,p,_)),y.text&&(l.extendFlat(y.text,{positions:_},s.textPosition(t,p,y.text,y.marker)),l.extendFlat(y.textSel,{positions:_},s.textPosition(t,p,y.text,y.markerSel)),l.extendFlat(y.textUnsel,{positions:_},s.textPosition(t,p,y.text,y.markerUnsel))),y.fill&&!h.fill2d&&(h.fill2d=!0),y.marker&&!h.scatter2d&&(h.scatter2d=!0),y.line&&!h.line2d&&(h.line2d=!0),y.text&&!h.glText&&(h.glText=!0),h.lineOptions.push(y.line),h.fillOptions.push(y.fill),h.markerOptions.push(y.marker),h.markerSelectedOptions.push(y.markerSel),h.markerUnselectedOptions.push(y.markerUnsel),h.textOptions.push(y.text),h.textSelectedOptions.push(y.textSel),h.textUnselectedOptions.push(y.textUnsel),h.selectBatch.push([]),h.unselectBatch.push([]),d.x=w,d.y=T,d.rawx=w,d.rawy=T,d.r=g,d.theta=v,d.positions=_,d._scene=h,d.index=h.count,h.count++}})),a(t,e,r)}},e.exports.reglPrecompiled={}},{"../../lib":515,"../scattergl/constants":991,"../scattergl/convert":992,"../scattergl/plot":999,"../scattergl/scene_update":1e3,"@plotly/point-cluster":59,"fast-isnumeric":190}],1026:[function(t,e,r){"use strict";var n=t("../../plots/template_attributes").hovertemplateAttrs,i=t("../../plots/template_attributes").texttemplateAttrs,a=t("../../lib/extend").extendFlat,o=t("../scatter/attributes"),s=t("../../plots/attributes"),l=o.line;e.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:i({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:a({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:a({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:a({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:o.fillcolor,hoverinfo:a({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:n(),selected:o.selected,unselected:o.unselected}},{"../../lib/extend":505,"../../plots/attributes":562,"../../plots/template_attributes":642,"../scatter/attributes":936}],1027:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../scatter/colorscale_calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection"),l=t("../scatter/calc").calcMarkerSize;e.exports=function(t,e){for(var r=t._fullLayout,c=e.subplot,u=r[c].realaxis,f=r[c].imaginaryaxis,h=u.makeCalcdata(e,"real"),p=f.makeCalcdata(e,"imag"),d=e._length,m=new Array(d),g=0;g")}}e.exports={hoverPoints:function(t,e,r,a){var o=n(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,i(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:i}},{"../scatter/hover":947}],1031:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scattersmith",basePlotModule:t("../../plots/smith"),categories:["smith","symbols","showLegend","scatter-like"],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").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/smith":638,"../scatter/marker_colorbar":954,"../scatter/select":958,"../scatter/style":960,"./attributes":1026,"./calc":1027,"./defaults":1028,"./format_labels":1029,"./hover":1030,"./plot":1032}],1032:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM,a=t("../../plots/smith/helpers").smith;e.exports=function(t,e,r){for(var o=e.layers.frontplot.select("g.scatterlayer"),s=e.xaxis,l=e.yaxis,c={xaxis:s,yaxis:l,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.forTraces:null},u=0;u"),o.hovertemplate=h.hovertemplate,a}function x(t,e){v.push(t._hovertitle+": "+e)}}},{"../scatter/hover":947}],1039:[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":643,"../scatter/marker_colorbar":954,"../scatter/select":958,"../scatter/style":960,"./attributes":1033,"./calc":1034,"./defaults":1035,"./event_data":1036,"./format_labels":1037,"./hover":1038,"./plot":1040}],1040:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=e.xaxis,o=e.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},l=e.layers.frontplot.select("g.scatterlayer"),c=0;ch?b.sizeAvg||Math.max(b.size,3):a(e,x),p=0;pa&&l||i-1,P=!0;if(o(x)||!!p.selectedpoints||C){var I=p._length;if(p.selectedpoints){m.selectBatch=p.selectedpoints;var O=p.selectedpoints,z={};for(l=0;l1&&(u=m[y-1],h=g[y-1],d=v[y-1]),e=0;eu?"-":"+")+"x")).replace("y",(f>h?"-":"+")+"y")).replace("z",(p>d?"-":"+")+"z");var L=function(){y=0,M=[],S=[],E=[]};(!y||y2?t.slice(1,e-1):2===e?[(t[0]+t[1])/2]:t}function p(t){var e=t.length;return 1===e?[.5,.5]:[t[1]-t[0],t[e-1]-t[e-2]]}function d(t,e){var r=t.fullSceneLayout,i=t.dataScale,u=e._len,f={};function d(t,e){var n=r[e],o=i[c[e]];return a.simpleMap(t,(function(t){return n.d2l(t)*o}))}if(f.vectors=l(d(e._u,"xaxis"),d(e._v,"yaxis"),d(e._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=d(e._Xs,"xaxis"),g=d(e._Ys,"yaxis"),v=d(e._Zs,"zaxis");if(f.meshgrid=[m,g,v],f.gridFill=e._gridFill,e._slen)f.startingPositions=l(d(e._startsX,"xaxis"),d(e._startsY,"yaxis"),d(e._startsZ,"zaxis"));else{for(var y=g[0],x=h(m),b=h(v),_=new Array(x.length*b.length),w=0,T=0;T=0};v?(r=Math.min(g.length,x.length),l=function(t){return A(g[t])&&M(t)},f=function(t){return String(g[t])}):(r=Math.min(y.length,x.length),l=function(t){return A(y[t])&&M(t)},f=function(t){return String(y[t])}),_&&(r=Math.min(r,b.length));for(var S=0;S1){for(var P=a.randstr(),I=0;I"),name:A||z("name")?y.name:void 0,color:k("hoverlabel.bgcolor")||x.color,borderColor:k("hoverlabel.bordercolor"),fontFamily:k("hoverlabel.font.family"),fontSize:k("hoverlabel.font.size"),fontColor:k("hoverlabel.font.color"),nameLength:k("hoverlabel.namelength"),textAlign:k("hoverlabel.align"),hovertemplate:A,hovertemplateLabels:P,eventData:l};g&&(F.x0=E-i.rInscribed*i.rpx1,F.x1=E+i.rInscribed*i.rpx1,F.idealAlign=i.pxmid[0]<0?"left":"right"),v&&(F.x=E,F.idealAlign=E<0?"left":"right");var B=[];o.loneHover(F,{container:a._hoverlayer.node(),outerContainer:a._paper.node(),gd:r,inOut_bbox:B}),l[0].bbox=B[0],d._hasHoverLabel=!0}if(v){var N=t.select("path.surface");h.styleOne(N,i,y,{hovered:!0})}d._hasHoverEvent=!0,r.emit("plotly_hover",{points:l||[f(i,y,h.eventDataKeys)],event:n.event})}})),t.on("mouseout",(function(e){var i=r._fullLayout,a=r._fullData[d.index],s=n.select(this).datum();if(d._hasHoverEvent&&(e.originalEvent=n.event,r.emit("plotly_unhover",{points:[f(s,a,h.eventDataKeys)],event:n.event}),d._hasHoverEvent=!1),d._hasHoverLabel&&(o.loneUnhover(i._hoverlayer.node()),d._hasHoverLabel=!1),v){var l=t.select("path.surface");h.styleOne(l,s,a,{hovered:!1})}})),t.on("click",(function(t){var e=r._fullLayout,a=r._fullData[d.index],s=g&&(c.isHierarchyRoot(t)||c.isLeaf(t)),u=c.getPtId(t),p=c.isEntry(t)?c.findEntryWithChild(m,u):c.findEntryWithLevel(m,u),v=c.getPtId(p),y={points:[f(t,a,h.eventDataKeys)],event:n.event};s||(y.nextLevel=v);var x=l.triggerHandler(r,"plotly_"+d.type+"click",y);if(!1!==x&&e.hovermode&&(r._hoverdata=[f(t,a,h.eventDataKeys)],o.click(r,n.event)),!s&&!1!==x&&!r._dragging&&!r._transitioning){i.call("_storeDirectGUIEdit",a,e._tracePreGUI[a.uid],{level:a.level});var b={data:[{level:v}],traces:[d.index]},_={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};o.loneUnhover(e._hoverlayer.node()),i.call("animate",r,b,_)}}))}},{"../../components/fx":407,"../../components/fx/helpers":403,"../../lib":515,"../../lib/events":504,"../../registry":647,"../pie/helpers":915,"./helpers":1064,"@plotly/d3":58}],1064:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color"),a=t("../../lib/setcursor"),o=t("../pie/helpers");function s(t){return t.data.data.pid}r.findEntryWithLevel=function(t,e){var n;return e&&t.eachAfter((function(t){if(r.getPtId(t)===e)return n=t.copy()})),n||t},r.findEntryWithChild=function(t,e){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a0)},r.getMaxDepth=function(t){return t.maxdepth>=0?t.maxdepth:1/0},r.isHeader=function(t,e){return!(r.isLeaf(t)||t.depth===e._maxDepth-1)},r.getParent=function(t,e){return r.findEntryWithLevel(t,s(e))},r.listPath=function(t,e){var n=t.parent;if(!n)return[];var i=e?[n.data[e]]:[n];return r.listPath(n,e).concat(i)},r.getPath=function(t){return r.listPath(t,"label").join("/")+"/"},r.formatValue=o.formatPieValue,r.formatPercent=function(t,e){var r=n.formatPercent(t,0);return"0%"===r&&(r=o.formatPiePercent(t,e)),r}},{"../../components/color":367,"../../lib":515,"../../lib/setcursor":536,"../pie/helpers":915}],1065:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"sunburst",basePlotModule:t("./base_plot"),categories:[],animatable:!0,attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc").calc,crossTraceCalc:t("./calc").crossTraceCalc,plot:t("./plot").plot,style:t("./style").style,colorbar:t("../scatter/marker_colorbar"),meta:{}}},{"../scatter/marker_colorbar":954,"./attributes":1058,"./base_plot":1059,"./calc":1060,"./defaults":1062,"./layout_attributes":1066,"./layout_defaults":1067,"./plot":1068,"./style":1069}],1066:[function(t,e,r){"use strict";e.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},{}],1067:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e){function r(r,a){return n.coerce(t,e,i,r,a)}r("sunburstcolorway",e.colorway),r("extendsunburstcolors")}},{"../../lib":515,"./layout_attributes":1066}],1068:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("d3-hierarchy"),a=t("d3-interpolate").interpolate,o=t("../../components/drawing"),s=t("../../lib"),l=t("../../lib/svg_text_utils"),c=t("../bar/uniform_text"),u=c.recordMinTextSize,f=c.clearMinTextSize,h=t("../pie/plot"),p=t("../pie/helpers").getRotationAngle,d=h.computeTransform,m=h.transformInsideText,g=t("./style").styleOne,v=t("../bar/style").resizeText,y=t("./fx"),x=t("./constants"),b=t("./helpers");function _(t,e,c,f){var h=t._context.staticPlot,v=t._fullLayout,_=!v.uniformtext.mode&&b.hasTransition(f),T=n.select(c).selectAll("g.slice"),k=e[0],A=k.trace,M=k.hierarchy,S=b.findEntryWithLevel(M,A.level),E=b.getMaxDepth(A),L=v._size,C=A.domain,P=L.w*(C.x[1]-C.x[0]),I=L.h*(C.y[1]-C.y[0]),O=.5*Math.min(P,I),z=k.cx=L.l+L.w*(C.x[1]+C.x[0])/2,D=k.cy=L.t+L.h*(1-C.y[0])-I/2;if(!S)return T.remove();var R=null,F={};_&&T.each((function(t){F[b.getPtId(t)]={rpx0:t.rpx0,rpx1:t.rpx1,x0:t.x0,x1:t.x1,transform:t.transform},!R&&b.isEntry(t)&&(R=t)}));var B=function(t){return i.partition().size([2*Math.PI,t.height+1])(t)}(S).descendants(),N=S.height+1,j=0,U=E;k.hasMultipleRoots&&b.isHierarchyRoot(S)&&(B=B.slice(1),N-=1,j=1,U+=1),B=B.filter((function(t){return t.y1<=U}));var V=p(A.rotation);V&&B.forEach((function(t){t.x0+=V,t.x1+=V}));var H=Math.min(N,E),q=function(t){return(t-j)/H*O},G=function(t,e){return[t*Math.cos(e),-t*Math.sin(e)]},Y=function(t){return s.pathAnnulus(t.rpx0,t.rpx1,t.x0,t.x1,z,D)},W=function(t){return z+w(t)[0]*(t.transform.rCenter||0)+(t.transform.x||0)},Z=function(t){return D+w(t)[1]*(t.transform.rCenter||0)+(t.transform.y||0)};(T=T.data(B,b.getPtId)).enter().append("g").classed("slice",!0),_?T.exit().transition().each((function(){var t=n.select(this);t.select("path.surface").transition().attrTween("d",(function(t){var e=function(t){var e,r=b.getPtId(t),n=F[r],i=F[b.getPtId(S)];if(i){var o=(t.x1>i.x1?2*Math.PI:0)+V;e=t.rpx1X?2*Math.PI:0)+V;e={x0:i,x1:i}}else e={rpx0:O,rpx1:O},s.extendFlat(e,Q(t));else e={rpx0:0,rpx1:0};else e={x0:V,x1:V};return a(e,n)}(t);return function(t){return Y(e(t))}})):f.attr("d",Y),c.call(y,S,t,e,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,t,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:t._transitioning}),f.call(g,i,A);var p=s.ensureSingle(c,"g","slicetext"),w=s.ensureSingle(p,"text","",(function(t){t.attr("data-notex",1)})),T=s.ensureUniformFontSize(t,b.determineTextFont(A,i,v.font));w.text(r.formatSliceLabel(i,S,A,e,v)).classed("slicetext",!0).attr("text-anchor","middle").call(o.font,T).call(l.convertToTspans,t);var M=o.bBox(w.node());i.transform=m(M,i,k),i.transform.targetX=W(i),i.transform.targetY=Z(i);var E=function(t,e){var r=t.transform;return d(r,e),r.fontSize=T.size,u(A.type,r,v),s.getTextTransform(r)};_?w.transition().attrTween("transform",(function(t){var e=function(t){var e,r=F[b.getPtId(t)],n=t.transform;if(r)e=r;else if(e={rpx1:t.rpx1,transform:{textPosAngle:n.textPosAngle,scale:0,rotate:n.rotate,rCenter:n.rCenter,x:n.x,y:n.y}},R)if(t.parent)if(X){var i=t.x1>X?2*Math.PI:0;e.x0=e.x1=i}else s.extendFlat(e,Q(t));else e.x0=e.x1=V;else e.x0=e.x1=V;var o=a(e.transform.textPosAngle,t.transform.textPosAngle),l=a(e.rpx1,t.rpx1),c=a(e.x0,t.x0),f=a(e.x1,t.x1),h=a(e.transform.scale,n.scale),p=a(e.transform.rotate,n.rotate),d=0===n.rCenter?3:0===e.transform.rCenter?1/3:1,m=a(e.transform.rCenter,n.rCenter);return function(t){var e=l(t),r=c(t),i=f(t),a=function(t){return m(Math.pow(t,d))}(t),s={pxmid:G(e,(r+i)/2),rpx1:e,transform:{textPosAngle:o(t),rCenter:a,x:n.x,y:n.y}};return u(A.type,n,v),{transform:{targetX:W(s),targetY:Z(s),scale:h(t),rotate:p(t),rCenter:a}}}}(t);return function(t){return E(e(t),M)}})):w.attr("transform",E(i,M))}))}function w(t){return e=t.rpx1,r=t.transform.textPosAngle,[e*Math.sin(r),-e*Math.cos(r)];var e,r}r.plot=function(t,e,r,i){var a,o,s=t._fullLayout,l=s._sunburstlayer,c=!r,u=!s.uniformtext.mode&&b.hasTransition(r);(f("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),u)?(i&&(o=i()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(e){_(t,e,this,r)}))}))):(a.each((function(e){_(t,e,this,r)})),s.uniformtext.mode&&v(t,s._sunburstlayer.selectAll(".trace"),"sunburst"));c&&a.exit().remove()},r.formatSliceLabel=function(t,e,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!(a||o&&"none"!==o))return"";var l=i.separators,c=n[0],u=t.data.data,f=c.hierarchy,h=b.isHierarchyRoot(t),p=b.getParent(f,t),d=b.getValue(t);if(!a){var m,g=o.split("+"),v=function(t){return-1!==g.indexOf(t)},y=[];if(v("label")&&u.label&&y.push(u.label),u.hasOwnProperty("v")&&v("value")&&y.push(b.formatValue(u.v,l)),!h){v("current path")&&y.push(b.getPath(t.data));var x=0;v("percent parent")&&x++,v("percent entry")&&x++,v("percent root")&&x++;var _=x>1;if(x){var w,T=function(t){m=b.formatPercent(w,l),_&&(m+=" of "+t),y.push(m)};v("percent parent")&&!h&&(w=d/b.getValue(p),T("parent")),v("percent entry")&&(w=d/b.getValue(e),T("entry")),v("percent root")&&(w=d/b.getValue(f),T("root"))}}return v("text")&&(m=s.castOption(r,u.i,"text"),s.isValidTextValue(m)&&y.push(m)),y.join("
")}var k=s.castOption(r,u.i,"texttemplate");if(!k)return"";var A={};u.label&&(A.label=u.label),u.hasOwnProperty("v")&&(A.value=u.v,A.valueLabel=b.formatValue(u.v,l)),A.currentPath=b.getPath(t.data),h||(A.percentParent=d/b.getValue(p),A.percentParentLabel=b.formatPercent(A.percentParent,l),A.parent=b.getPtLabel(p)),A.percentEntry=d/b.getValue(e),A.percentEntryLabel=b.formatPercent(A.percentEntry,l),A.entry=b.getPtLabel(e),A.percentRoot=d/b.getValue(f),A.percentRootLabel=b.formatPercent(A.percentRoot,l),A.root=b.getPtLabel(f),u.hasOwnProperty("color")&&(A.color=u.color);var M=s.castOption(r,u.i,"text");return(s.isValidTextValue(M)||""===M)&&(A.text=M),A.customdata=s.castOption(r,u.i,"customdata"),s.texttemplateString(k,A,i._d3locale,A,r._meta||{})}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../bar/style":671,"../bar/uniform_text":673,"../pie/helpers":915,"../pie/plot":919,"./constants":1061,"./fx":1063,"./helpers":1064,"./style":1069,"@plotly/d3":58,"d3-hierarchy":115,"d3-interpolate":116}],1069:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../bar/uniform_text").resizeText;function s(t,e,r){var n=e.data.data,o=!e.children,s=n.i,l=a.castOption(r,s,"marker.line.color")||i.defaultLine,c=a.castOption(r,s,"marker.line.width")||0;t.style("stroke-width",c).call(i.fill,n.color).call(i.stroke,l).style("opacity",o?r.leaf.opacity:null)}e.exports={style:function(t){var e=t._fullLayout._sunburstlayer.selectAll(".trace");o(t,e,"sunburst"),e.each((function(t){var e=n.select(this),r=t[0].trace;e.style("opacity",r.opacity),e.selectAll("path.surface").each((function(t){n.select(this).call(s,t,r)}))}))},styleOne:s}},{"../../components/color":367,"../../lib":515,"../bar/uniform_text":673,"@plotly/d3":58}],1070:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/attributes"),a=t("../../plots/cartesian/axis_format_attributes").axisHoverFormat,o=t("../../plots/template_attributes").hovertemplateAttrs,s=t("../../plots/attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;function u(t){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:n.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:n.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var f=e.exports=c(l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},i("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:l({},i.zauto,{}),zmin:l({},i.zmin,{}),zmax:l({},i.zmax,{})},hoverinfo:l({},s.hoverinfo),showlegend:l({},s.showlegend,{dflt:!1})}),"calc","nested");f.x.editType=f.y.editType=f.z.editType="calc+clearAxisTypes",f.transforms=void 0},{"../../components/color":367,"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plot_api/edit_types":548,"../../plots/attributes":562,"../../plots/cartesian/axis_format_attributes":569,"../../plots/template_attributes":642}],1071:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(t,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):n(t,e,{vals:e.z,containerStr:"",cLetter:"c"})}},{"../../components/colorscale/calc":375}],1072:[function(t,e,r){"use strict";var n=t("../../../stackgl_modules").gl_surface3d,i=t("../../../stackgl_modules").ndarray,a=t("../../../stackgl_modules").ndarray_linear_interpolate.d2,o=t("../heatmap/interp2d"),s=t("../heatmap/find_empties"),l=t("../../lib").isArrayOrTypedArray,c=t("../../lib/gl_format_color").parseColorScale,u=t("../../lib/str2rgbarray"),f=t("../../components/colorscale").extractOpts;function h(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=h.prototype;p.getXat=function(t,e,r,n){var i=l(this.data.x)?l(this.data.x[0])?this.data.x[e][t]:this.data.x[t]:t;return void 0===r?i:n.d2l(i,0,r)},p.getYat=function(t,e,r,n){var i=l(this.data.y)?l(this.data.y[0])?this.data.y[e][t]:this.data.y[e]:e;return void 0===r?i:n.d2l(i,0,r)},p.getZat=function(t,e,r,n){var i=this.data.z[e][t];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[e][t]),void 0===r?i:n.d2l(i,0,r)},p.handlePick=function(t){if(t.object===this.surface){var e=(t.data.index[0]-1)/this.dataScaleX-1,r=(t.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(e),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);t.index=[n,i],t.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],t.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=t.dataCoordinate[a];null!=o&&(t.dataCoordinate[a]*=this.scene.dataScale[a])}var s=this.data.hovertext||this.data.text;return Array.isArray(s)&&s[i]&&void 0!==s[i][n]?t.textLabel=s[i][n]:t.textLabel=s||"",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}};var d=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function m(t,e){if(t0){r=d[n];break}return r}function y(t,e){if(!(t<1||e<1)){for(var r=g(t),n=g(e),i=1,a=0;a_;)r--,r/=v(r),++r1?n:1},p.refineCoords=function(t){for(var e=this.dataScaleX,r=this.dataScaleY,n=t[0].shape[0],a=t[0].shape[1],o=0|Math.floor(t[0].shape[0]*e+1),s=0|Math.floor(t[0].shape[1]*r+1),l=1+n+1,c=1+a+1,u=i(new Float32Array(l*c),[l,c]),f=[1/e,0,0,0,1/r,0,0,0,1],h=0;h0&&null!==this.contourStart[t]&&null!==this.contourEnd[t]&&this.contourEnd[t]>this.contourStart[t]))for(i[t]=!0,e=this.contourStart[t];ea&&(this.minValues[e]=a),this.maxValues[e]",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1079:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../lib/extend").extendFlat,a=t("fast-isnumeric");function o(t){if(Array.isArray(t)){for(var e=0,r=0;r=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}e.exports=function(t,e){var r=l(e.cells.values),p=function(t){return t.slice(e.header.values.length,t.length)},d=l(e.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var m=d.concat(p(r).map((function(){return c((d[0]||[""]).length)}))),g=e.domain,v=Math.floor(t._fullLayout._size.w*(g.x[1]-g.x[0])),y=Math.floor(t._fullLayout._size.h*(g.y[1]-g.y[0])),x=e.header.values.length?m[0].map((function(){return e.header.height})):[n.emptyHeaderHeight],b=r.length?r[0].map((function(){return e.cells.height})):[],_=x.reduce(s,0),w=h(b,y-_+n.uplift),T=f(h(x,_),[]),k=f(w,T),A={},M=e._fullInput.columnorder.concat(p(r.map((function(t,e){return e})))),S=m.map((function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return a(n)?Number(n):1})),E=S.reduce(s,0);S=S.map((function(t){return t/E*v}));var L=Math.max(o(e.header.line.width),o(e.cells.line.width)),C={key:e.uid+t._context.staticPlot,translateX:g.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-g.y[1]),size:t._fullLayout._size,width:v,maxLineWidth:L,height:y,columnOrder:M,groupHeight:y,rowBlocks:k,headerRowBlocks:T,scrollY:0,cells:i({},e.cells,{values:r}),headerCells:i({},e.header,{values:m}),gdColumns:m.map((function(t){return t[0]})),gdColumnsOriginalOrder:m.map((function(t){return t[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:m.map((function(t,e){var r=A[t];return A[t]=(r||0)+1,{key:t+"__"+A[t],label:t,specIndex:e,xIndex:M[e],xScale:u,x:void 0,calcdata:void 0,columnWidth:S[e]}}))};return C.columns.forEach((function(t){t.calcdata=C,t.x=u(t)})),C}},{"../../lib/extend":505,"./constants":1078,"fast-isnumeric":190}],1080:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0,n=e?r+e.rows.length:0;return[r,n]}(t);return(t.values||[]).slice(e[0],e[1]).map((function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}}))}},{"../../lib/extend":505}],1081:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../plots/domain").defaults;e.exports=function(t,e,r,o){function s(r,a){return n.coerce(t,e,i,r,a)}a(e,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),n.coerceFont(s,"header.font",n.extendFlat({},o.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(t,e){return t-e})),o=i.map((function(t){return a.indexOf(t)})),s=o.length;s/i),l=!o||s;t.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"==typeof(c=i)&&c.match(n.latexCheck);t.latex=u;var f,h,p=u?"":T(t.calcdata.cells.prefix,e,r)||"",d=u?"":T(t.calcdata.cells.suffix,e,r)||"",m=u?null:T(t.calcdata.cells.format,e,r)||null,g=p+(m?a(m)(t.value):t.value)+d;if(t.wrappingNeeded=!t.wrapped&&!l&&!u&&(f=w(g)),t.cellHeightMayIncrease=s||u||t.mayHaveMarkup||(void 0===f?w(g):f),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex,t.wrappingNeeded){var v=(" "===n.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),e.each((function(t,e){t.page=c[e],t.scrollY=l})),e.attr("transform",(function(t){var e=D(t.rowBlocks,t.page)-t.scrollY;return u(0,e)})),t&&(C(t,r,e,c,n.prevPages,n,0),C(t,r,e,c,n.prevPages,n,1),x(r,t))}}function L(t,e,r,a){return function(o){var s=o.calcdata?o.calcdata:o,l=e.filter((function(t){return s.key===t.key})),c=r||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*i.event.dy:a;var f=l.selectAll("."+n.cn.yColumn).selectAll("."+n.cn.columnBlock).filter(A);return E(t,f,l),s.scrollY===u}}function C(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(t,e){return e===o&&n[e]!==i[e]}));b(t,e,a,r),i[o]=n[o]})))}function P(t,e,r,a){return function(){var o=i.select(e.parentNode);o.each((function(t){var e=t.fragments;o.selectAll("tspan.line").each((function(t,r){e[r].width=this.getComputedTextLength()}));var r,i,a=e[e.length-1].width,s=e.slice(0,-1),l=[],c=0,u=t.column.columnWidth-2*n.cellPad;for(t.value="";s.length;)c+(i=(r=s.shift()).width+a)>u&&(t.value+=l.join(n.wrapSpacer)+n.lineBreaker,l=[],c=0),l.push(r.text),c+=i;c&&(t.value+=l.join(n.wrapSpacer)),t.wrapped=!0})),o.selectAll("tspan.line").remove(),_(o.select("."+n.cn.cellText),r,t,a),i.select(e.parentNode.parentNode).call(z)}}function I(t,e,r,a,o){return function(){if(!o.settledY){var s=i.select(e.parentNode),l=B(o),c=o.key-l.firstRowIndex,f=l.rows[c].rowHeight,h=o.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*n.cellPad:f,p=Math.max(h,f);p-l.rows[c].rowHeight&&(l.rows[c].rowHeight=p,t.selectAll("."+n.cn.columnCell).call(z),E(null,t.filter(A),0),x(r,a,!0)),s.attr("transform",(function(){var t=this.parentNode.getBoundingClientRect(),e=i.select(this.parentNode).select("."+n.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),a=e.top-t.top+(r?r.matrix.f:n.cellPad);return u(O(o,i.select(this.parentNode).select("."+n.cn.cellTextHolder).node().getBoundingClientRect().width),a)})),o.settledY=!0}}}function O(t,e){switch(t.align){case"left":return n.cellPad;case"right":return t.column.columnWidth-(e||0)-n.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return n.cellPad}}function z(t){t.attr("transform",(function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce((function(t,e){return t+R(e,1/0)}),0),r=R(B(t),t.key);return u(0,r+e)})).selectAll("."+n.cn.cellRect).attr("height",(function(t){return(e=B(t),r=t.key,e.rows[r-e.firstRowIndex]).rowHeight;var e,r}))}function D(t,e){for(var r=0,n=e-1;n>=0;n--)r+=F(t[n]);return r}function R(t,e){for(var r=0,n=0;n","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:u({},s.textfont,{}),editType:"calc"},text:s.text,textinfo:l.textinfo,texttemplate:i({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:l.hoverinfo,hovertemplate:n({},{keys:c.eventDataKeys}),textfont:s.textfont,insidetextfont:s.insidetextfont,outsidetextfont:u({},s.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:s.sort,root:l.root,domain:o({name:"treemap",trace:!0,editType:"calc"})}},{"../../components/colorscale/attributes":374,"../../lib/extend":505,"../../plots/domain":593,"../../plots/template_attributes":642,"../pie/attributes":910,"../sunburst/attributes":1058,"./constants":1087}],1085:[function(t,e,r){"use strict";var n=t("../../plots/plots");r.name="treemap",r.plot=function(t,e,i,a){n.plotBasePlot(r.name,t,e,i,a)},r.clean=function(t,e,i,a){n.cleanBasePlot(r.name,t,e,i,a)}},{"../../plots/plots":628}],1086:[function(t,e,r){"use strict";var n=t("../sunburst/calc");r.calc=function(t,e){return n.calc(t,e)},r.crossTraceCalc=function(t){return n._runCrossTraceCalc("treemap",t)}},{"../sunburst/calc":1060}],1087:[function(t,e,r){"use strict";e.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},{}],1088:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("../../plots/domain").defaults,s=t("../bar/defaults").handleText,l=t("../bar/constants").TEXTPAD,c=t("../../components/colorscale"),u=c.hasColorscale,f=c.handleDefaults;e.exports=function(t,e,r,c){function h(r,a){return n.coerce(t,e,i,r,a)}var p=h("labels"),d=h("parents");if(p&&p.length&&d&&d.length){var m=h("values");m&&m.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),"squarify"===h("tiling.packing")&&h("tiling.squarifyratio"),h("tiling.flip"),h("tiling.pad");var g=h("text");h("texttemplate"),e.texttemplate||h("textinfo",Array.isArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate");var v=h("pathbar.visible");s(t,e,c,h,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition");var y=-1!==e.textposition.indexOf("bottom");h("marker.line.width")&&h("marker.line.color",c.paper_bgcolor);var x=h("marker.colors");(e._hasColorscale=u(t,"marker","colors")||(t.marker||{}).coloraxis)?f(t,e,c,h,{prefix:"marker.",cLetter:"c"}):h("marker.depthfade",!(x||[]).length);var b=2*e.textfont.size;h("marker.pad.t",y?b/4:b),h("marker.pad.l",b/4),h("marker.pad.r",b/4),h("marker.pad.b",y?b:b/4),e._hovered={marker:{line:{width:2,color:a.contrast(c.paper_bgcolor)}}},v&&(h("pathbar.thickness",e.pathbar.textfont.size+2*l),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),o(e,c,h),e._length=null}else e.visible=!1}},{"../../components/color":367,"../../components/colorscale":379,"../../lib":515,"../../plots/domain":593,"../bar/constants":659,"../bar/defaults":661,"./attributes":1084}],1089:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../sunburst/helpers"),a=t("../bar/uniform_text").clearMinTextSize,o=t("../bar/style").resizeText,s=t("./plot_one");e.exports=function(t,e,r,l,c){var u,f,h=c.type,p=c.drawDescendants,d=t._fullLayout,m=d["_"+h+"layer"],g=!r;(a(h,d),(u=m.selectAll("g.trace."+h).data(e,(function(t){return t[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(h,!0),u.order(),!d.uniformtext.mode&&i.hasTransition(r))?(l&&(f=l()),n.transition().duration(r.duration).ease(r.easing).each("end",(function(){f&&f()})).each("interrupt",(function(){f&&f()})).each((function(){m.selectAll("g.trace").each((function(e){s(t,e,this,r,p)}))}))):(u.each((function(e){s(t,e,this,r,p)})),d.uniformtext.mode&&o(t,m.selectAll(".trace"),h));g&&u.exit().remove()}},{"../bar/style":671,"../bar/uniform_text":673,"../sunburst/helpers":1064,"./plot_one":1098,"@plotly/d3":58}],1090:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx");e.exports=function(t,e,r,h,p){var d=p.barDifY,m=p.width,g=p.height,v=p.viewX,y=p.viewY,x=p.pathSlice,b=p.toMoveInsideSlice,_=p.strTransform,w=p.hasTransition,T=p.handleSlicesExit,k=p.makeUpdateSliceInterpolator,A=p.makeUpdateTextInterpolator,M={},S=t._context.staticPlot,E=t._fullLayout,L=e[0],C=L.trace,P=L.hierarchy,I=m/C._entryDepth,O=u.listPath(r.data,"id"),z=s(P.copy(),[m,g],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(z=z.filter((function(t){var e=O.indexOf(t.data.id);return-1!==e&&(t.x0=I*e,t.x1=I*(e+1),t.y0=d,t.y1=d+g,t.onPathbar=!0,!0)}))).reverse(),(h=h.data(z,u.getPtId)).enter().append("g").classed("pathbar",!0),T(h,!0,M,[m,g],x),h.order();var D=h;w&&(D=D.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),D.each((function(s){s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-Math.min(m,g)/2),s._hoverY=y(s.y1-g/2);var h=n.select(this),p=i.ensureSingle(h,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?p.transition().attrTween("d",(function(t){var e=k(t,!0,M,[m,g]);return function(t){return x(e(t))}})):p.attr("d",x),h.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),p.call(l,s,C,{hovered:!1}),s._text=(u.getPtLabel(s)||"").split("
").join(" ")||"";var d=i.ensureSingle(h,"g","slicetext"),T=i.ensureSingle(d,"text","",(function(t){t.attr("data-notex",1)})),L=i.ensureUniformFontSize(t,u.determineTextFont(C,s,E.font,{onPathbar:!0}));T.text(s._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(a.font,L).call(o.convertToTspans,t),s.textBB=a.bBox(T.node()),s.transform=b(s,{fontSize:L.size,onPathbar:!0}),s.transform.fontSize=L.size,w?T.transition().attrTween("transform",(function(t){var e=A(t,!0,M,[m,g]);return function(t){return _(e(t))}})):T.attr("transform",_(s))}))}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../sunburst/fx":1063,"../sunburst/helpers":1064,"./constants":1087,"./partition":1096,"./style":1099,"@plotly/d3":58}],1091:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../../lib/svg_text_utils"),s=t("./partition"),l=t("./style").styleOne,c=t("./constants"),u=t("../sunburst/helpers"),f=t("../sunburst/fx"),h=t("../sunburst/plot").formatSliceLabel;e.exports=function(t,e,r,p,d){var m=d.width,g=d.height,v=d.viewX,y=d.viewY,x=d.pathSlice,b=d.toMoveInsideSlice,_=d.strTransform,w=d.hasTransition,T=d.handleSlicesExit,k=d.makeUpdateSliceInterpolator,A=d.makeUpdateTextInterpolator,M=d.prevEntry,S=t._context.staticPlot,E=t._fullLayout,L=e[0].trace,C=-1!==L.textposition.indexOf("left"),P=-1!==L.textposition.indexOf("right"),I=-1!==L.textposition.indexOf("bottom"),O=!I&&!L.marker.pad.t||I&&!L.marker.pad.b,z=s(r,[m,g],{packing:L.tiling.packing,squarifyratio:L.tiling.squarifyratio,flipX:L.tiling.flip.indexOf("x")>-1,flipY:L.tiling.flip.indexOf("y")>-1,pad:{inner:L.tiling.pad,top:L.marker.pad.t,left:L.marker.pad.l,right:L.marker.pad.r,bottom:L.marker.pad.b}}).descendants(),D=1/0,R=-1/0;z.forEach((function(t){var e=t.depth;e>=L._maxDepth?(t.x0=t.x1=(t.x0+t.x1)/2,t.y0=t.y1=(t.y0+t.y1)/2):(D=Math.min(D,e),R=Math.max(R,e))})),p=p.data(z,u.getPtId),L._maxVisibleLayers=isFinite(R)?R-D+1:0,p.enter().append("g").classed("slice",!0),T(p,!1,{},[m,g],x),p.order();var F=null;if(w&&M){var B=u.getPtId(M);p.each((function(t){null===F&&u.getPtId(t)===B&&(F={x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1})}))}var N=function(){return F||{x0:0,x1:m,y0:0,y1:g}},j=p;return w&&(j=j.transition().each("end",(function(){var e=n.select(this);u.setSliceCursor(e,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),j.each((function(s){var p=u.isHeader(s,L);s._x0=v(s.x0),s._x1=v(s.x1),s._y0=y(s.y0),s._y1=y(s.y1),s._hoverX=v(s.x1-L.marker.pad.r),s._hoverY=y(I?s.y1-L.marker.pad.b/2:s.y0+L.marker.pad.t/2);var d=n.select(this),T=i.ensureSingle(d,"path","surface",(function(t){t.style("pointer-events",S?"none":"all")}));w?T.transition().attrTween("d",(function(t){var e=k(t,!1,N(),[m,g]);return function(t){return x(e(t))}})):T.attr("d",x),d.call(f,r,t,e,{styleOne:l,eventDataKeys:c.eventDataKeys,transitionTime:c.CLICK_TRANSITION_TIME,transitionEasing:c.CLICK_TRANSITION_EASING}).call(u.setSliceCursor,t,{isTransitioning:t._transitioning}),T.call(l,s,L,{hovered:!1}),s.x0===s.x1||s.y0===s.y1?s._text="":s._text=p?O?"":u.getPtLabel(s)||"":h(s,r,L,e,E)||"";var M=i.ensureSingle(d,"g","slicetext"),z=i.ensureSingle(M,"text","",(function(t){t.attr("data-notex",1)})),D=i.ensureUniformFontSize(t,u.determineTextFont(L,s,E.font));z.text(s._text||" ").classed("slicetext",!0).attr("text-anchor",P?"end":C||p?"start":"middle").call(a.font,D).call(o.convertToTspans,t),s.textBB=a.bBox(z.node()),s.transform=b(s,{fontSize:D.size,isHeader:p}),s.transform.fontSize=D.size,w?z.transition().attrTween("transform",(function(t){var e=A(t,!1,N(),[m,g]);return function(t){return _(e(t))}})):z.attr("transform",_(s))})),F}},{"../../components/drawing":389,"../../lib":515,"../../lib/svg_text_utils":541,"../sunburst/fx":1063,"../sunburst/helpers":1064,"../sunburst/plot":1068,"./constants":1087,"./partition":1096,"./style":1099,"@plotly/d3":58}],1092:[function(t,e,r){"use strict";e.exports=function t(e,r,n){var i;n.swapXY&&(i=e.x0,e.x0=e.y0,e.y0=i,i=e.x1,e.x1=e.y1,e.y1=i),n.flipX&&(i=e.x0,e.x0=r[0]-e.x1,e.x1=r[0]-i),n.flipY&&(i=e.y0,e.y0=r[1]-e.y1,e.y1=r[1]-i);var a=e.children;if(a)for(var o=0;o-1?C+O:-(I+O):0,D={x0:P,x1:P,y0:z,y1:z+I},R=function(t,e,r){var n=v.tiling.pad,i=function(t){return t-n<=e.x0},a=function(t){return t+n>=e.x1},o=function(t){return t-n<=e.y0},s=function(t){return t+n>=e.y1};return t.x0===e.x0&&t.x1===e.x1&&t.y0===e.y0&&t.y1===e.y1?{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}:{x0:i(t.x0-n)?0:a(t.x0-n)?r[0]:t.x0,x1:i(t.x1+n)?0:a(t.x1+n)?r[0]:t.x1,y0:o(t.y0-n)?0:s(t.y0-n)?r[1]:t.y0,y1:o(t.y1+n)?0:s(t.y1+n)?r[1]:t.y1}},F=null,B={},N={},j=null,U=function(t,e){return e?B[h(t)]:N[h(t)]},V=function(t,e,r,n){if(e)return B[h(x)]||D;var i=N[v.level]||r;return function(t){return t.data.depth-b.data.depth=(n-=(y?g:g.r)-s)){var x=(r+n)/2;r=x,n=x}var b;f?i<(b=a-(y?g:g.b))&&b"===tt?(l.x-=a,c.x-=a,u.x-=a,f.x-=a):"/"===tt?(u.x-=a,f.x-=a,o.x-=a/2,s.x-=a/2):"\\"===tt?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===tt&&(o.x-=a,s.x-=a),$(l),$(f),$(o),$(c),$(u),$(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(f.x,f.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:et,makeUpdateSliceInterpolator:nt,makeUpdateTextInterpolator:it,handleSlicesExit:at,hasTransition:A,strTransform:ot}):w.remove()}},{"../../lib":515,"../bar/constants":659,"../bar/plot":668,"../bar/uniform_text":673,"../sunburst/helpers":1064,"./constants":1087,"./draw_ancestors":1090,"@plotly/d3":58,"d3-interpolate":116}],1099:[function(t,e,r){"use strict";var n=t("@plotly/d3"),i=t("../../components/color"),a=t("../../lib"),o=t("../sunburst/helpers"),s=t("../bar/uniform_text").resizeText;function l(t,e,r,n){var s,l,c=(n||{}).hovered,u=e.data.data,f=u.i,h=u.color,p=o.isHierarchyRoot(e),d=1;if(c)s=r._hovered.marker.line.color,l=r._hovered.marker.line.width;else if(p&&h===r.root.color)d=100,s="rgba(0,0,0,0)",l=0;else if(s=a.castOption(r,f,"marker.line.color")||i.defaultLine,l=a.castOption(r,f,"marker.line.width")||0,!r._hasColorscale&&!e.onPathbar){var m=r.marker.depthfade;if(m){var g,v=i.combine(i.addOpacity(r._backgroundColor,.75),h);if(!0===m){var y=o.getMaxDepth(r);g=isFinite(y)?o.isLeaf(e)?0:r._maxVisibleLayers-(e.data.depth-r._entryDepth):e.data.height+1}else g=e.data.depth-r._entryDepth,r._atRootLevel||g++;if(g>0)for(var x=0;x0){var b,_,w,T,k,A=t.xa,M=t.ya;"h"===d.orientation?(k=e,b="y",w=M,_="x",T=A):(k=r,b="x",w=A,_="y",T=M);var S=p[t.index];if(k>=S.span[0]&&k<=S.span[1]){var E=i.extendFlat({},t),L=T.c2p(k,!0),C=s.getKdeValue(S,d,k),P=s.getPositionOnKdePath(S,d,L),I=w._offset,O=w._length;E[b+"0"]=P[0],E[b+"1"]=P[1],E[_+"0"]=E[_+"1"]=L,E[_+"Label"]=_+": "+a.hoverLabelText(T,k,d[_+"hoverformat"])+", "+p[0].t.labels.kde+" "+C.toFixed(3);for(var z=0,D=0;D")),u.color=function(t,e){var r=t[e.dir].marker,n=r.color,a=r.line.color,o=r.line.width;if(i(n))return n;if(i(a)&&o)return a}(h,g),[u]}function k(t){return n(m,t,h[d+"hoverformat"])}}},{"../../components/color":367,"../../constants/delta.js":485,"../../plots/cartesian/axes":566,"../bar/hover":664}],1122:[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"),plot:t("./plot"),style:t("./style").style,hoverPoints:t("./hover"),eventData:t("./event_data"),selectPoints:t("../bar/select"),moduleType:"trace",name:"waterfall",basePlotModule:t("../../plots/cartesian"),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},{"../../plots/cartesian":578,"../bar/select":669,"./attributes":1115,"./calc":1116,"./cross_trace_calc":1118,"./defaults":1119,"./event_data":1120,"./hover":1121,"./layout_attributes":1123,"./layout_defaults":1124,"./plot":1125,"./style":1126}],1123:[function(t,e,r){"use strict";e.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},{}],1124:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){var a=!1;function o(r,a){return n.coerce(t,e,i,r,a)}for(var s=0;s0&&(g+=h?"M"+f[0]+","+d[1]+"V"+d[0]:"M"+f[1]+","+d[0]+"H"+f[0]),"between"!==p&&(r.isSum||s path").each((function(t){if(!t.isBlank){var e=s[t.dir].marker;n.select(this).call(a.fill,e.color).call(a.stroke,e.line.color).call(i.dashLine,e.line.dash,e.line.width).style("opacity",s.selectedpoints&&!t.selected?o:1)}})),c(r,s,t),r.selectAll(".lines").each((function(){var t=s.connector.line;i.lineGroupStyle(n.select(this).selectAll("path"),t.width,t.color,t.dash)}))}))}}},{"../../components/color":367,"../../components/drawing":389,"../../constants/interactions":490,"../bar/style":671,"../bar/uniform_text":673,"@plotly/d3":58}],1127:[function(t,e,r){"use strict";var n=t("../plots/cartesian/axes"),i=t("../lib"),a=t("../plot_api/plot_schema"),o=t("./helpers").pointsAccessorFunction,s=t("../constants/numerical").BADNUM;r.moduleType="transform",r.name="aggregate";var l=r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},c=l.aggregations;function u(t,e,r,a){if(a.enabled){for(var o=a.target,l=i.nestedProperty(e,o),c=l.get(),u=function(t,e){var r=t.func,n=e.d2c,a=e.c2d;switch(r){case"count":return f;case"first":return h;case"last":return p;case"sum":return function(t,e){for(var r=0,i=0;ii&&(i=u,o=c)}}return i?a(o):s};case"rms":return function(t,e){for(var r=0,i=0,o=0;o":return function(t){return h(t)>s};case">=":return function(t){return h(t)>=s};case"[]":return function(t){var e=h(t);return e>=s[0]&&e<=s[1]};case"()":return function(t){var e=h(t);return e>s[0]&&e=s[0]&&es[0]&&e<=s[1]};case"][":return function(t){var e=h(t);return e<=s[0]||e>=s[1]};case")(":return function(t){var e=h(t);return es[1]};case"](":return function(t){var e=h(t);return e<=s[0]||e>s[1]};case")[":return function(t){var e=h(t);return e=s[1]};case"{}":return function(t){return-1!==s.indexOf(h(t))};case"}{":return function(t){return-1===s.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,s,i),h),x={},b={},_=0;d?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},v=function(t,e){var r=x[t.astr][e];t.get()[e]=r}):(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),k(g);for(var w=o(e.transforms,r),T=0;T1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=o.styles=[];if(l)for(a=0;a0?o-4:o;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[u++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e);return l},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)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 i,a,o=[],s=e;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){},{}],3:[function(t,e,r){(function(e){(function(){ /*! * The buffer module from node.js, for the browser. * diff --git a/package-lock.json b/package-lock.json index cb7216abea9..0b3794ade63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "plotly.js", - "version": "2.16.4", + "version": "2.16.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "plotly.js", - "version": "2.16.4", + "version": "2.16.5", "license": "MIT", "dependencies": { "@plotly/d3": "3.8.0", diff --git a/package.json b/package.json index 23f58c8b0f1..603f646f4e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plotly.js", - "version": "2.16.4", + "version": "2.16.5", "description": "The open source javascript graphing library that powers plotly", "license": "MIT", "main": "./lib/index.js", diff --git a/src/version.js b/src/version.js index 135e77c7104..738e610be8b 100644 --- a/src/version.js +++ b/src/version.js @@ -1,4 +1,4 @@ 'use strict'; // package version injected by `npm run preprocess` -exports.version = '2.16.4'; +exports.version = '2.16.5';