All Downloads are FREE. Search and download functionalities are using the official Maven repository.

report.js.plotly-latest.min.js Maven / Gradle / Ivy

There is a newer version: 1.6.10
Show newest version
/**
* plotly.js v1.33.1
* Copyright 2012-2018, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return i(r||t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;oMath.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],40:[function(t,e,r){"use strict";function n(t,e){this._controllerNames=Object.keys(t),this._controllerList=this._controllerNames.map(function(e){return t[e]}),this._mode=e,this._active=t[e],this._active||(this._mode="turntable",this._active=t.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}e.exports=function(t){var e=(t=t||{}).eye||[0,0,1],r=t.center||[0,0,0],s=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=i(),f=a(),h=o();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),new n({turntable:u,orbit:f,matrix:h},c)};var i=t("turntable-camera-controller"),a=t("orbit-camera-controller"),o=t("matrix-camera-controller"),s=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+u;if((r=a-u-f[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)(r=(e=t[n]).y+e.dy+u-a)>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(h).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(f[1]-(t.length-1)*u)/e.sum(t,s)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),d.forEach(function(e){e.dy=e.value*t})}(),n();for(var l=1;t>0;--t)!function(t){function r(t){return o(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,s);n.y+=(i-o(n))*t}})})}(l*=.99),n(),function(t){function r(t){return o(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,s);n.y+=(i-o(n))*t}})})}(l),n()}function a(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}h.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),h.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function o(t){return t.y+t.dy/2}function s(t){return t.value}var l={},c=24,u=8,f=[1,1],h=[],d=[];return l.nodeWidth=function(t){return arguments.length?(c=+t,l):c},l.nodePadding=function(t){return arguments.length?(u=+t,l):u},l.nodes=function(t){return arguments.length?(h=t,l):h},l.links=function(t){return arguments.length?(d=t,l):d},l.size=function(t){return arguments.length?(f=t,l):f},l.layout=function(r){return h.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),d.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=h[t.source]),"number"==typeof n&&(n=t.target=h[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),h.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,s),e.sum(t.targetLinks,s))}),t(),i(r),a(),l},l.relayout=function(){return a(),l},l.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,c=l+t.dy,u=t.target.y+t.ty,f=u+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+f+"C"+s+","+f+" "+o+","+c+" "+r+","+c+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},l},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":120,"d3-collection":121,"d3-interpolate":125}],42:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":165,"gl-vao":259,"weak-map":573}],43:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;si&&(i=t[o]),t[o]>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3])),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t.str2RgbaArray=function(t,n){var i,a;if("string"!=typeof t)return t;if(i=[],"#"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),a=parseInt(t,16),i[0]=a>>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3]),a[4]?i[3]=parseFloat(a[4]):i[3]=1),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t}()},{}],51:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!h(t[o],e[o],r,n))return!1;return!0}(t,e,r,s))}return r?t===e:t==e}function d(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function p(t,e,r){h(t,e,!0)&&u(t,e,r,"notDeepStrictEqual",p)}function m(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function g(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&u(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&v.isError(i),s=!t&&i&&!r;if((o&&a&&m(i,r)||s)&&u(i,r,"Got unwanted exception"+n),t&&i&&r&&!m(i,r)||!t&&i)throw i}var v=t("util/"),y=Object.prototype.hasOwnProperty,x=Array.prototype.slice,b="foo"===function(){}.name,_=e.exports=f,w=/\s*function\s+([^\(\s]*)\s*/;_.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return l(c(t.actual),128)+" "+t.operator+" "+l(c(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},v.inherits(_.AssertionError,Error),_.fail=u,_.ok=f,_.equal=function(t,e,r){t!=e&&u(t,e,r,"==",_.equal)},_.notEqual=function(t,e,r){t==e&&u(t,e,r,"!=",_.notEqual)},_.deepEqual=function(t,e,r){h(t,e,!1)||u(t,e,r,"deepEqual",_.deepEqual)},_.deepStrictEqual=function(t,e,r){h(t,e,!0)||u(t,e,r,"deepStrictEqual",_.deepStrictEqual)},_.notDeepEqual=function(t,e,r){h(t,e,!1)&&u(t,e,r,"notDeepEqual",_.notDeepEqual)},_.notDeepStrictEqual=p,_.strictEqual=function(t,e,r){t!==e&&u(t,e,r,"===",_.strictEqual)},_.notStrictEqual=function(t,e,r){t===e&&u(t,e,r,"!==",_.notStrictEqual)},_.throws=function(t,e,r){g(!0,t,e,r)},_.doesNotThrow=function(t,e,r){g(!1,t,e,r)},_.ifError=function(t){if(t)throw t};var M=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":563}],52:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],53:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0?r=r.ushln(f):f<0&&(u=u.ushln(-f)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":56,"./is-rat":58,"./lib/is-bn":62,"./lib/num-to-bn":63,"./lib/rationalize":64,"./lib/str-to-bn":65}],58:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":62}],59:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":73}],60:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},{"bit-twiddle":71,"double-bits":131}],62:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":73}],63:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":73,"double-bits":131}],64:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}},{"./bn-sign":59,"./num-to-bn":63}],65:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":73}],66:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":64}],67:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":59}],68:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":64}],69:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(h=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var f=r.bitLength()-l.bitLength()+53,h=n(l.ushln(f).divRound(r));return f<1023?c*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),c*h*Math.pow(2,1023-f))}},{"./lib/bn-to-num":60,"./lib/ctz":61}],70:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],71:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],72:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,s){for(var l=0;l=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}function c(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function f(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function h(){f.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){f.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){f.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){f.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function v(t){g.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var y;try{y=t("buffer").Buffer}catch(t){}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,l=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var x=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],b=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?x[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=b[t],u=_[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var h=f.modn(u).toString(t);r=(f=f.idivn(u)).isZero()?h+r:x[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==y),this.toArrayLike(y,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,d=0|o[1],p=8191&d,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,z=0|o[7],D=8191&z,I=z>>>13,P=0|o[8],O=8191&P,F=P>>>13,R=0|o[9],N=8191&R,j=R>>>13,B=0|s[0],U=8191&B,V=B>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(F,U)|0,a=Math.imul(F,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(F,H)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,W),i=(i=Math.imul(N,X))+Math.imul(j,W)|0,a=Math.imul(j,X),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,K)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,K))+Math.imul(j,J)|0,a=Math.imul(j,K),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(F,$)|0,a=a+Math.imul(F,tt)|0,n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,tt))+Math.imul(j,$)|0,a=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(F,rt)|0,a=a+Math.imul(F,nt)|0,n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(F,at)|0,a=a+Math.imul(F,ot)|0,n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,at),i=(i=Math.imul(N,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(F,lt)|0,a=a+Math.imul(F,ct)|0,n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(I,ft)|0,a=a+Math.imul(I,ht)|0;var zt=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(N,lt),i=(i=Math.imul(N,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(F,ft)|0,a=a+Math.imul(F,ht)|0;var Dt=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(N,ft),i=(i=Math.imul(N,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var It=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(F,pt)|0))<<13)|0;c=((a=a+Math.imul(F,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Pt=(c+(n=Math.imul(N,pt))|0)+((8191&(i=(i=Math.imul(N,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=zt,l[16]=Dt,l[17]=It,l[18]=Pt,0!==c&&(l[19]=c,r.length++),r};Math.imul||(w=l),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?w(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},u.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e)},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,f=1;0==(r.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var h;return(h=0===e.cmpn(1)?i:o).cmpn(0)<0&&h.iadd(t),h},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new g(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var M={k256:null,p224:null,p192:null,p25519:null};f.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},f.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},f.prototype.split=function(t,e){t.iushrn(this.n,0,e)},f.prototype.imulK=function(t){return t.imul(this.k)},i(h,f),h.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},h.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(M[t])return M[t];var e;if("k256"===t)e=new h;else if("p224"===t)e=new d;else if("p192"===t)e=new p;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new m}return M[t]=e,e},g.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},g.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new v(t)},i(v,g),v.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},v.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},v.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},v.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},v.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],74:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var f,h=l.mallocDouble(2*s*a),d=l.mallocInt32(a);if((a=i(t,s,h,d))>0){if(1===s&&n)c.init(a),f=c.sweepComplete(s,r,0,a,h,d,0,a,h,d);else{var p=l.mallocDouble(2*s*o),m=l.mallocInt32(o);(o=i(e,s,p,m))>0&&(c.init(a+o),f=1===s?c.sweepBipartite(s,r,0,a,h,d,0,o,p,m):u(s,r,n,a,h,d,o,p,m),l.free(p),l.free(m))}l.free(h),l.free(d)}return f}}}function o(t,e){s.push([t,e])}e.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return s=[],a(t,t,o,!0),s}(t);case 2:return"function"==typeof e?a(t,t,e,!0):function(t,e){return s=[],a(t,e,o,!1),s}(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var s,l=t("typedarray-pool"),c=t("./lib/sweep"),u=t("./lib/intersect")},{"./lib/intersect":77,"./lib/sweep":81,"typedarray-pool":554}],76:[function(t,e,r){"use strict";function n(t){function e(e,r){var s=function(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),s=["function ",n,"(",_.join(),"){","var ",l,"=2*",i,";"],w="for(var i="+c+","+d+"="+l+"*"+c+";i<"+u+";++i,"+d+"+="+l+"){var x0="+f+"["+a+"+"+d+"],x1="+f+"["+a+"+"+d+"+"+i+"],xi="+h+"[i];",M="for(var j="+p+","+y+"="+l+"*"+p+";j<"+m+";++j,"+y+"+="+l+"){var y0="+g+"["+a+"+"+y+"],"+(r?"y1="+g+"["+a+"+"+y+"+"+i+"],":"")+"yi="+v+"[j];";return t?s.push(w,b,":",M):s.push(M,b,":",w),r?s.push("if(y1"+m+"-"+p+"){"),t?(e(!0,!1),M.push("}else{"),e(!1,!1)):(M.push("if("+s+"){"),e(!0,!0),M.push("}else{"),e(!0,!1),M.push("}}else{if("+s+"){"),e(!1,!0),M.push("}else{"),e(!1,!1),M.push("}")),M.push("}}return "+r);var k=n.join("")+M.join("");return new Function(k)()}var i="d",a="ax",o="vv",s="fp",l="es",c="rs",u="re",f="rb",h="ri",d="rp",p="bs",m="be",g="bb",v="bi",y="bp",x="rv",b="Q",_=[i,a,o,c,u,f,h,p,m,g,v];r.partial=n(!1),r.full=n(!0)},{}],77:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){var c=M*t;A[c]=e,A[c+1]=r,A[c+2]=n,A[c+3]=i,A[c+4]=a,A[c+5]=o;var u=k*t;T[u]=s,T[u+1]=l}function i(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,d=c[h+e];t:for(var p=i,m=i*f;p0;){var P=(D-=1)*M,O=A[P],F=A[P+1],R=A[P+2],N=A[P+3],j=A[P+4],B=A[P+5],U=D*k,V=T[U],q=T[U+1],H=1&B,G=!!(16&B),Y=d,W=S,X=L,Z=C;if(H&&(Y=L,W=C,X=d,Z=S),!(2&B&&(R=x(t,O,F,R,Y,W,q),F>=R)||4&B&&(F=b(t,O,F,R,Y,W,V))>=R)){var J=R-F,K=j-N;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)",["p0","p1"]),y=d("lo===p0",["p0"]),x=d("lor&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;p>>1,h=2*t,d=f,p=s[h*f+e];c=x?(d=y,p=x):v>=_?(d=g,p=v):(d=b,p=_):x>=_?(d=y,p=x):_>=v?(d=g,p=v):(d=b,p=_);for(var w=h*(u-1),M=h*d,k=0;k=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],80:[function(t,e,r){"use strict";function n(t,e,r){for(var n=2*(t+1),i=t+1;i<=e;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >t;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>1,g=m-h,v=m+h,y=d,x=g,b=m,_=v,w=p,M=t+1,k=e-1,A=0;l(y,x,r)&&(A=y,y=x,x=A),l(_,w,r)&&(A=_,_=w,w=A),l(y,b,r)&&(A=y,y=b,b=A),l(x,b,r)&&(A=x,x=b,b=A),l(y,_,r)&&(A=y,y=_,_=A),l(b,_,r)&&(A=b,b=_,_=A),l(x,w,r)&&(A=x,x=w,w=A),l(x,b,r)&&(A=x,x=b,b=A),l(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*x],S=r[2*x+1],E=r[2*_],L=r[2*_+1],C=2*y,z=2*b,D=2*w,I=2*d,P=2*m,O=2*p,F=0;F<2;++F){var R=r[C+F],N=r[z+F],j=r[D+F];r[I+F]=R,r[P+F]=N,r[O+F]=j}a(g,t,r),a(v,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&i(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(o(B,M,k,r),++M,--k):(i(B,k,r),--k);break}if(--k>>1;s(m,S);var E=0,L=0;for(M=0;M=l)n(f,h,L--,C=C-l|0);else if(C>=0)n(c,u,E--,C);else if(C<=-l){C=-C-l|0;for(var z=0;z>>1;s(m,E);var L=0,C=0,z=0;for(k=0;k>1==m[2*k+3]>>1&&(I=2,k+=1),D<0){for(var P=-(D>>1)-1,O=0;O>1)-1,0===I?n(c,u,L--,P):1===I?n(f,h,C--,P):2===I&&n(d,p,z--,P)}},scanBipartite:function(t,e,r,a,o,f,h,d,p,g,v,y){var x=0,b=2*t,_=e,w=e+t,M=1,k=1;a?k=l:M=l;for(var A=o;A>>1;s(m,L);var C=0;for(A=0;A=l?(D=!a,T-=l):(D=!!a,T-=1),D)i(c,u,C++,T);else{var I=y[T],P=b*T,O=v[P+e+1],F=v[P+e+1+t];t:for(var R=0;R>>1;s(m,M);var k=0;for(x=0;x=l)c[k++]=b-l;else{var T=d[b-=1],S=g*b,E=h[S+e+1],L=h[S+e+1+t];t:for(var C=0;C=0;--C)if(c[C]===b){for(P=C+1;PP)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?function(t,e,r){if(e<0||t.byteLength=P)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P.toString(16)+" bytes");return 0|t}function u(t,e){if(i.isBuffer(t))return t.length;if(C(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(n)return S(t).length;e=(""+e).toLowerCase(),n=!0}}function f(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,z(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:p(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):p(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}var c;if(i){var u=-1;for(c=r;cs&&(r=s-l),c=r;c>=0;c--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,c,u,f;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(f=(15&a)<<12|(63&l)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(f=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nr)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function k(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function A(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),I.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),I.write(t,e,r,n,52,8),r+8}function S(t,e){e=e||1/0;for(var r,n=t.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function E(t){return D.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function z(t){return t!=t}var D=t("base64-js"),I=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},r.INSPECT_MAX_BYTES=50;var P=2147483647;r.kMaxLength=P,(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}(t,e,r)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),c=this.slice(n,a),u=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){M(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,!n){M(this,t,e,r,Math.pow(2,8*r)-1,0)}var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,r){return A(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return A(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function a(t,e,r){for(var n,a=[],o=e;o0?u-4:u;var f=0;for(e=0,r=0;e>16&255,c[f++]=a>>8&255,c[f++]=255&a;return 2===o?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,c[f++]=255&a):1===o&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,c[f++]=a>>8&255,c[f++]=255&a),c},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i="",s=[],l=0,c=r-n;lc?c:l+16383));return 1===n?(e=t[r-1],i+=o[e>>2],i+=o[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=o[e>>10],i+=o[e>>4&63],i+=o[e<<2&63],i+="="),s.push(i),s.join("")};for(var o=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=c.length;u0;){for(var d=r.pop(),p=(u=-1,f=-1,l=o[s=r.pop()],1);p=0||(e.flip(s,d),n(t,e,r,u,s,f),n(t,e,r,s,f,u),n(t,e,r,f,d,u),n(t,e,r,d,u,f))}}},{"binary-search-bounds":89,"robust-in-sphere":513}],86:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}var a=t("binary-search-bounds");e.exports=function(t,e,r){var a=function(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var p=0;p<3;++p){var m=h[3*d+p];m>=0&&0===c[m]&&(f[3*d+p]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var v=function(t,e,r){for(var n=0,i=0;i1&&h(r[u[d-2]],r[u[d-1]],n)>0;)t.push([u[d-1],u[d-2],i]),d-=1;u.length=d,u.push(i);var p=c.upperIds;for(d=p.length;d>1&&h(r[p[d-2]],r[p[d-1]],n)<0;)t.push([p[d-2],p[d-1],i]),d-=1;p.length=d,p.push(i)}}function l(t,e){var r;return(r=t.a[0]v[0]&&l.push(new i(v,g,m,f),new i(g,v,p,f))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),x=[new n([y,1],[y,0],-1,[],[],[],[])],b=[],_=(f=0,l.length);f<_;++f){var w=l[f],M=w.type;M===d?s(b,x,t,w.a,w.idx):M===m?c(x,0,w):u(x,0,w)}return b}},{"binary-search-bounds":89,"robust-orientation":515}],88:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),o.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},o.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},o.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],90:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],94:[function(t,e,r){"use strict";function n(t){var e=m(t);return[v(e,-1/0),v(e,1/0)]}function i(t){for(var e=new Array(t.length),r=0;re[2]?1:0)}function l(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[o=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=b;b=_,_=k}x[0]=b;var A,T=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===o;){var S,E=(S=n[--a])[1];i?e.push([T,E,A]):e.push([T,E]),T=E}i?e.push([T,_,A]):e.push([T,_])}return s}(t,e,o,c,r));return l(e,u,r),!!u||(o.length>0||c.length>0)}e.exports=function(t,e,r){var n;if(r){n=e;for(var o=new Array(e.length),s=0;s>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:93}],98:[function(t,e,r){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],99:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:93,"color-rgba":101,dtype:133}],100:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1);c=1,(h=u.length)<=4?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===h&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===h&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1];s=u=f.replace(/a$/,"");var h="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),f===u&&l.push(1),c=void 0===l[h]?1:l[h],l=l.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if("number"==typeof t)s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":98,defined:129,"is-plain-obj":286}],101:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e;if("string"!=typeof t)throw Error("Argument should be a string");var r=n(t);return r.space?(e=Array(3),e[0]=a(r.values[0],0,255),e[1]=a(r.values[1],0,255),e[2]=a(r.values[2],0,255),"h"===r.space[0]&&(e=i.rgb(e)),e.push(a(r.alpha,0,1)),e):[]}},{clamp:93,"color-parse":100,"color-space/hsl":102}],102:[function(t,e,r){"use strict";var n=t("./rgb");e.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,r,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return a=255*l,[a,a,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[c]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),c=l-s;return l===s?e=0:i===l?e=(a-o)/c:a===l?e=2+(o-i)/c:o===l&&(e=4+(i-a)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*r,100*n]}},{"./rgb":103}],103:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],104:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:0,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],105:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("clone"),s=t("./colorScales");e.exports=function(t){var e,r,l,c,u,f,h,d,p,m,g,v,y,x=[],b=[],_=[],w=[];if(a.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!s[h])throw Error(h+" not a supported colorscale");f=o(s[h])}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);f=o(h)}if(f.length>p)throw new Error(h+" map requires nshades to be at least size "+f.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:o(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=f.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y=0}e.exports=function(t,e,r,o){var s=i(e,r,o);if(0===s){var l=a(i(t,e,r)),c=a(i(t,e,o));if(l===c){if(0===l){var u=n(t,e,r);return u===n(t,e,o)?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,o)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:a(c-l)}var f=i(t,e,r);return f>0?s>0&&i(t,e,o)>0?1:-1:f<0?s>0||i(t,e,o)>0?1:-1:i(t,e,o)>0?1:n(t,e,r)?1:-1};var i=t("robust-orientation"),a=t("signum"),o=t("two-sum"),s=t("robust-product"),l=t("robust-sum")},{"robust-orientation":515,"robust-product":516,"robust-sum":520,signum:522,"two-sum":553}],107:[function(t,e,r){function n(t,e){return t-e}e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),c=i(e[0],e[1]);return i(l,t[2])-i(c,e[2])||i(l+t[2],o)-i(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return u+f+h+d-(p+m+g+v)||i(u,f,h,d)-i(p,m,g,v,p)||i(u+f,u+h,u+d,f+h,f+d,h+d)-i(p+m,p+g,p+v,m+g,m+v,g+v)||i(u+f+h,u+f+d,u+h+d,f+h+d)-i(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),x=e.slice().sort(n),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],111:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":45,"incremental-convex-hull":278}],113:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\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"}},{}],114:[function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in c)return c[e].slice();if("#"===e[0]){if(4===e.length){return(r=parseInt(e.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r;return(r=parseInt(e.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var u=e.substr(0,i),f=e.substr(i+1,l-(i+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=o(f[1]),m=o(f[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),h];default:return null}}return null}var c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],115:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],116:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":118}],117:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(l=0;l3&&v.push(i(t.pre,t,s));var M=i(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&v.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var A=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",A,"(",g.join(","),"){",v.join("\n"),"} return ",A].join(""))()}},{uniq:556}],118:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u=0?(a>=b?10:a>=_?5:a>=w?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=b?10:a>=_?5:a>=w?2:1)}function n(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=b?i*=10:a>=_?i*=5:a>=w&&(i*=2),ee?1:t>=e?0:NaN},o=function(t){return 1===t.length&&(t=function(t){return function(e,r){return a(t(e),r)}}(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},s=o(a),l=s.right,c=s.left,u=function(t){return null===t?NaN:+t},f=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},h=function(t,e){var r=f(t,e);return r?Math.sqrt(r):r},d=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},A=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},T=function(t){if(!(a=t.length))return[];for(var e=-1,r=A(t,i),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=h,t.extent=d,t.histogram=function(){function t(t){var a,o,s=t.length,c=new Array(s);for(a=0;ah;)d.pop(),--p;var m,g=new Array(p+1);for(a=0;a<=p;++a)(m=g[a]=[]).x0=a>0?d[a-1]:f,m.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=A,t.pairs=function(t,r){null==r&&(r=e);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l=u.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,c,f,h=-1,d=e.length,p=u[n++],m=r(),g=i();++hu.length)return t;var n,i=f[r-1];return null!=l&&r>=u.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,c,u=[],f=[];return c={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return u.push(t),c},sortKeys:function(t){return f[u.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return l=t,c}}},t.set=l,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})})},{}],122:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=E.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=L.exec(t))?i(parseInt(e[1],16)):(e=C.exec(t))?new l(e[1],e[2],e[3],1):(e=z.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=D.exec(t))?a(e[1],e[2],e[3],e[4]):(e=I.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=P.exec(t))?c(e[1],e[2]/100,e[3]/100,1):(e=O.exec(t))?c(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?i(F[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function c(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new f(t,e,r,n)}function u(t,e,i,a){return 1===arguments.length?function(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new f;if(t instanceof f)return t;var e=(t=t.rgb()).r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,c=s-o,u=(s+o)/2;return c?(l=e===s?(i-a)/c+6*(i0&&u<1?0:l,new f(l,c,u,t.opacity)}(t):new f(t,e,i,null==a?1:a)}function f(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function h(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function d(t){if(t instanceof m)return new m(t.l,t.a,t.b,t.opacity);if(t instanceof _){var e=t.h*R;return new m(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/j),s=g((.2126729*r+.7151522*n+.072175*i)/B);return new m(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/U)),t.opacity)}function p(t,e,r,n){return 1===arguments.length?d(t):new m(t,e,r,null==n?1:n)}function m(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>G?Math.pow(t,1/3):t/H+V}function v(t){return t>q?t*t*t:H*(t-V)}function y(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function b(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof _)return new _(t.h,t.c,t.l,t.opacity);t instanceof m||(t=d(t));var e=Math.atan2(t.b,t.a)*N;return new _(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function w(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,s=(X*(r-i)-Y*a)/W,c=Math.sqrt(s*s+a*a)/(X*i*(1-i)),u=c?Math.atan2(s,a)*N-120:NaN;return new M(u<0?u+360:u,c,i,t.opacity)}(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var k=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},A="\\s*([+-]?\\d+)\\s*",T="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E=/^#([0-9a-f]{3})$/,L=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[A,A,A]+"\\)$"),z=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),D=new RegExp("^rgba\\("+[A,A,A,T]+"\\)$"),I=new RegExp("^rgba\\("+[S,S,S,T]+"\\)$"),P=new RegExp("^hsl\\("+[T,S,S]+"\\)$"),O=new RegExp("^hsla\\("+[T,S,S,T]+"\\)$"),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};k(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),k(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),k(f,u,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(h(t>=240?t-240:t+120,i,n),h(t,i,n),h(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var R=Math.PI/180,N=180/Math.PI,j=.95047,B=1,U=1.08883,V=4/29,q=6/29,H=3*q*q,G=q*q*q;k(m,p,e(r,{brighter:function(t){return new m(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new m(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=B*v(t),e=j*v(e),r=U*v(r),new l(y(3.2404542*e-1.5371385*t-.4985314*r),y(-.969266*e+1.8760108*t+.041556*r),y(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),k(_,b,e(r,{brighter:function(t){return new _(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new _(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}));var Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=1.78277*X,K=1.78277*Y- -.14861*W;k(M,w,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*R,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(-.14861*n+1.78277*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=u,t.lab=p,t.hcl=b,t.cubehelix=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],123:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}(t+"",i),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var r,n,i=new Array(r),a=0;ad+s||np+s||if.index){var l=d-a.x-a.vx,u=p-a.y-a.vy,v=l*l+u*u;vt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e=m)){(t.data!==o||t.next)&&(0===i&&(i=h(),u+=i*i),0===a&&(a=h(),u+=a*a),u1?(null==e?g.remove(t):g.set(t,s(e)),l):g.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(y.on(t,e),l):y.on(t)}}},t.forceX=function(t){function e(t){for(var e,r=0,o=n.length;r180||r<-180?r-360*Math.round(r/360):r):x(isNaN(t)?e:t)}function a(t){return 1==(t=+t)?o:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):x(isNaN(e)?r:e)}}function o(t,e){var r=e-t;return r?n(t,r):x(isNaN(t)?e:t)}function s(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:A(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:A(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:A(t,r)},{i:s-2,x:A(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:A(r,n)})),a=E.lastIndex;return a=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=d,!(d=d[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}function r(t,e,r){var i=new n(null==e?function(t){return t[0]}:e,null==r?function(t){return t[1]}:r,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function n(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function i(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var a=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},o=r.prototype=n.prototype;o.copy=function(){var t,e,r=new n(this._x,this._y,this._x0,this._y0,this._x1,this._y1),a=this._root;if(!a)return r;if(!a.length)return r._root=i(a),r;for(t=[{source:a,target:r._root=new Array(4)}];a=t.pop();)for(var o=0;o<4;++o)(e=a.source[o])&&(e.length?t.push({source:e,target:a.target[o]=new Array(4)}):a.target[o]=i(e));return r},o.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},o.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));for(ft||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},o.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},o.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},o.find=function(t,e,r){var n,i,o,s,l,c,u,f=this._x0,h=this._y0,d=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new a(g,f,h,d,p)),null==r?r=1/0:(f=t-r,h=e-r,d=t+r,p=e+r,r*=r);c=m.pop();)if(!(!(g=c.node)||(i=c.x0)>d||(o=c.y0)>p||(s=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(p+g)/2))?p=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[h]=d:this._root=d),this):(this._root=i,this)},o.removeAll=function(t){for(var e=0,r=t.length;e=0&&r._call.call(null,t),r=r._next;--f}function o(){g=(m=y.now())+v,f=h=0;try{a()}finally{f=0,function(){var t,e,r=c,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);u=t,l(n)}(),g=0}}function s(){var t=y.now(),e=t-m;e>p&&(v-=e,m=t)}function l(t){if(!f){h&&(h=clearTimeout(h));var e=t-g;e>24?(t<1/0&&(h=setTimeout(o,e)),d&&(d=clearInterval(d))):(d||(m=g,d=setInterval(s,p)),f=1,x(o))}}var c,u,f=0,h=0,d=0,p=1e3,m=0,g=0,v=0,y="object"==typeof performance&&performance.now?performance:Date,x="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||u===this||(u?u._next=this:c=this,u=this),this._call=t,this._time=n,l()},stop:function(){this._call&&(this._call=null,this._time=1/0,l())}};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},t.interval=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],128:[function(t,e,r){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function n(t,e){return te?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function o(t){return{left:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}}function s(t){return t.length}function l(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function c(){this._=Object.create(null)}function u(t){return(t+="")===oa||t[0]===sa?sa+t:t}function f(t){return(t+="")[0]===sa?t.slice(1):t}function h(t){return u(t)in this._}function d(t){return(t=u(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(f(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function y(t){return t}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=la.length;r0&&(t=t.slice(0,a));var s=ya.get(t);return s&&(t=s,o=G),a?e?function(){var a=o(e,Ki(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}:n:e?b:function(){var e,r=new RegExp("^__on([^.]+)"+Zi.requote(t)+"$");for(var n in this)if(e=n.match(r)){var i=this[n];this.removeEventListener(e[1],i,i.$),delete this[n]}}}function H(t,e){return function(r){var n=Zi.event;Zi.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{Zi.event=n}}}function G(t,e){var r=H(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}function Y(e){var n=".dragsuppress-"+ ++ba,i="click"+n,a=Zi.select(r(e)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);if(null==xa&&(xa=!("onselectstart"in e)&&x(e.style,"userSelect")),xa){var o=t(e).style,s=o[xa];o[xa]="none"}return function(t){if(a.on(n,null),xa&&(o[xa]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){M(),e()},!0),setTimeout(e,0)}}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(_a<0){var a=r(t);if(a.scrollX||a.scrollY){var o=(n=Zi.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();_a=!(o.f||o.e),n.remove()}}return _a?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function X(){return Zi.event.changedTouches[0].identifier}function Z(t){return t>0?1:t<0?-1:0}function J(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function K(t){return t>1?0:t<-1?ka:Math.acos(t)}function Q(t){return t>1?Sa:t<-1?-Sa:Math.asin(t)}function $(t){return((t=Math.exp(t))+1/t)/2}function tt(t){return(t=Math.sin(t/2))*t}function et(){}function rt(t,e,r){return this instanceof rt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof rt?new rt(t.h,t.s,t.l):gt(""+t,vt,rt):new rt(t,e,r)}function nt(t,e,r){function n(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(a-i)*t/60:t<180?a:t<240?i+(a-i)*(240-t)/60:i}(t))}var i,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,a=r<=.5?r*(1+e):r+e-r*e,i=2*r-a,new ht(n(t+120),n(t),n(t-120))}function it(t,e,r){return this instanceof it?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof it?new it(t.h,t.c,t.l):t instanceof ot?lt(t.l,t.a,t.b):lt((t=yt((t=Zi.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new it(t,e,r)}function at(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ot(r,Math.cos(t*=Ea)*e,Math.sin(t)*e)}function ot(t,e,r){return this instanceof ot?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ot?new ot(t.l,t.a,t.b):t instanceof it?at(t.h,t.c,t.l):yt((t=ht(t)).r,t.g,t.b):new ot(t,e,r)}function st(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=ct(i)*Ra,n=ct(n)*Na,a=ct(a)*ja,new ht(ft(3.2404542*i-1.5371385*n-.4985314*a),ft(-.969266*i+1.8760108*n+.041556*a),ft(.0556434*i-.2040259*n+1.0572252*a))}function lt(t,e,r){return t>0?new it(Math.atan2(r,e)*La,Math.sqrt(e*e+r*r),t):new it(NaN,NaN,t)}function ct(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ut(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ft(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ht(t,e,r){return this instanceof ht?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ht?new ht(t.r,t.g,t.b):gt(""+t,ht,nt):new ht(t,e,r)}function dt(t){return new ht(t>>16,t>>8&255,255&t)}function pt(t){return dt(t)+""}function mt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function gt(t,e,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(bt(i[0]),bt(i[1]),bt(i[2]))}return(a=Va.get(t))?e(a.r,a.g,a.b):(null==t||"#"!==t.charAt(0)||isNaN(a=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===t.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),e(o,s,l))}function vt(t,e,r){var n,i,a=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=t==o?(e-r)/s+(e0&&l<1?0:n),new rt(n,i,l)}function yt(t,e,r){var n=ut((.4124564*(t=xt(t))+.3575761*(e=xt(e))+.1804375*(r=xt(r)))/Ra),i=ut((.2126729*t+.7151522*e+.072175*r)/Na);return ot(116*i-16,500*(n-i),200*(i-ut((.0193339*t+.119192*e+.9503041*r)/ja)))}function xt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function _t(t){return"function"==typeof t?t:function(){return t}}function wt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Mt(e,r,t,n)}}function Mt(t,e,r,n){function i(){var t,e=l.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=Zi.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=Zi.event;Zi.event=t;try{o.progress.call(a,l)}finally{Zi.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(Ki(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},Zi.rebind(a,o,"on"),null==n?a:a.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}function kt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return Ha?Ha.n=i:qa=i,Ha=i,Ga||(Ya=clearTimeout(Ya),Ga=1,Wa(At)),i}function At(){var t=Tt(),e=St()-t;e>24?(isFinite(e)&&(clearTimeout(Ya),Ya=setTimeout(At,e)),Ga=0):(Ga=1,Wa(At))}function Tt(){for(var t=Date.now(),e=qa;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function St(){for(var t,e=qa,r=1/0;e;)e.c?(e.t1?Date.UTC.apply(this,arguments):arguments[0])}function Ct(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3)}(+n[0]),r+n[0].length):-1}function Bt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ut(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Vt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function qt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function Ht(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Gt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Yt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Wt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Xt(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=aa(e)/60|0,i=aa(e)%60;return r+Dt(n,"0",2)+Dt(i,"0",2)}function Zt(t,e,r){ro.lastIndex=0;var n=ro.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Jt(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),c=Math.sin(e),u=a*c,f=i*l+u*Math.cos(s),h=u*o*Math.sin(s);lo.add(Math.atan2(h,f)),n=t,i=l,a=c}var e,r,n,i,a;co.point=function(o,s){co.point=t,n=(e=o)*Ea,i=Math.cos(s=(r=s)*Ea/2+ka/4),a=Math.sin(s)},co.lineEnd=function(){t(e,r)}}function ne(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function oe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function se(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function le(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ce(t){return[Math.atan2(t[1],t[0]),Q(t[2])]}function ue(t,e){return aa(t[0]-e[0])=0;--s)i.point((f=u[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function xe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(we))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=h,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=c,d=Zi.merge(d);var t=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;lo.reset();for(var s=0,l=e.length;s=0?1:-1,M=w*_,k=M>ka,A=p*x;if(lo.add(Math.atan2(A*w*Math.sin(M),m*b+A*Math.cos(M))),a+=k?_+w*Aa:_,k^h>=r^v>=r){var T=ae(ne(f),ne(t));le(T);var S=ae(i,T);le(S);var E=(k^_>=0?-1:1)*Q(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;h=v,p=x,m=b,f=t}}return(a<-wa||a1}function Me(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:b,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ke(t,e){return((t=t.x)[0]<0?t[1]-Sa-wa:Sa-t[1])-((e=e.x)[0]<0?e[1]-Sa-wa:Sa-e[1])}function Ae(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,f=1,h=s.x-l,d=s.y-c;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>u&&(u=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>u&&(u=a)}else if(d>0){if(a0&&(i.a={x:l+u*h,y:c+u*d}),f<1&&(i.b={x:l+f*h,y:c+f*d}),i}}}}}}function Te(t,e,r,n){function i(n,i){return aa(n[0]-t)0?0:3:aa(n[0]-r)0?2:1:aa(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(a,s,l,c){var u=0,f=0;if(null==a||(u=i(a,l))!==(f=i(s,l))||o(a,s)<0^l>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+l+4)%4)!==f);else c.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function u(t,e){c(t,e)&&s.point(t,e)}function f(t,e){var r=c(t=Math.max(-ko,Math.min(ko,t)),e=Math.max(-ko,Math.min(ko,e)));if(d&&p.push([t,e]),_)m=t,g=e,v=r,_=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&b)s.point(t,e);else{var n={a:{x:y,y:x},b:{x:t,y:e}};A(n)?(b||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),w=!1):r&&(s.lineStart(),s.point(t,e),w=!1)}y=t,x=e,b=r}var h,d,p,m,g,v,y,x,b,_,w,M=s,k=Me(),A=Ae(t,e,r,n),T={point:u,lineStart:function(){T.point=f,d&&d.push(p=[]),_=!0,b=!1,y=x=NaN},lineEnd:function(){h&&(f(m,g),v&&b&&k.rejoin(),h.push(k.buffer())),T.point=u,b&&s.lineEnd()},polygonStart:function(){s=k,h=[],d=[],w=!0},polygonEnd:function(){s=M,h=Zi.merge(h);var e=function(t){for(var e=0,r=d.length,n=t[1],i=0;in&&J(c,a,t)>0&&++e:a[1]<=n&&J(c,a,t)<0&&--e,c=a;return 0!==e}([t,n]),r=w&&e,i=h.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),i&&ye(h,a,e,l,s),s.polygonEnd()),h=d=p=null}};return T}}function Se(t){var e=0,r=ka/3,n=je(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*ka/180,r=t[1]*ka/180):[e/ka*180,r/ka*180]},i}function Ee(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,Q((a-(t*t+r*r)*i*i)/(2*i))]},r}function Le(){function t(t,e){To+=i*t-n*e,n=t,i=e}var e,r,n,i;zo.point=function(a,o){zo.point=t,e=n=a,r=i=o},zo.lineEnd=function(){t(e,r)}}function Ce(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ze(t,e){ho+=t,po+=e,++mo}function De(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);go+=o*(e+t)/2,vo+=o*(r+n)/2,yo+=o,ze(e=t,r=n)}var e,r;Io.point=function(n,i){Io.point=t,ze(e=n,r=i)}}function Ie(){Io.point=ze}function Pe(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);go+=o*(n+t)/2,vo+=o*(i+e)/2,yo+=o,xo+=(o=i*t-n*e)*(n+t),bo+=o*(i+e),_o+=3*o,ze(n=t,i=e)}var e,r,n,i;Io.point=function(a,o){Io.point=t,ze(e=n=a,r=i=o)},Io.lineEnd=function(){t(e,r)}}function Oe(t){function e(e){return(a?function(e){function n(r,n){r=t(r,n),e.point(r[0],r[1])}function i(){x=NaN,k.point=o,e.lineStart()}function o(n,i){var o=ne([n,i]),s=t(n,i);r(x,b,y,_,w,M,x=s[0],b=s[1],y=n,_=o[0],w=o[1],M=o[2],a,e),e.point(x,b)}function s(){k.point=n,e.lineEnd()}function l(){i(),k.point=c,k.lineEnd=u}function c(t,e){o(f=t,h=e),d=x,p=b,m=_,g=w,v=M,k.point=o}function u(){r(x,b,y,_,w,M,d,p,f,m,g,v,a,e),k.lineEnd=s,s()}var f,h,d,p,m,g,v,y,x,b,_,w,M,k={point:n,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=i}};return k}:function(e){return Re(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function r(e,a,o,s,l,c,u,f,h,d,p,m,g,v){var y=u-e,x=f-a,b=y*y+x*x;if(b>4*n&&g--){var _=s+d,w=l+p,M=c+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=aa(aa(M)-1)n||aa((y*C+x*z)/b-.5)>.3||s*d+l*p+c*m0&&16,e):Math.sqrt(n)},e}function Fe(t){this.stream=t}function Re(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Ne(t){return je(function(){return t})()}function je(t){function e(t){return t=o(t[0]*Ea,t[1]*Ea),[t[0]*f+s,l-t[1]*f]}function r(){o=ge(a=qe(g,v,x),i);var t=i(p,m);return s=h-t[0]*f,l=d+t[1]*f,n()}function n(){return c&&(c.valid=!1,c=null),e}var i,a,o,s,l,c,u=Oe(function(t,e){return t=i(t,e),[t[0]*f+s,l-t[1]*f]}),f=150,h=480,d=250,p=0,m=0,g=0,v=0,x=0,b=Mo,_=y,w=null,M=null;return e.stream=function(t){return c&&(c.valid=!1),c=Be(b(a,u(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(b=null==t?(w=t,Mo):function(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function r(t,e,r){var n=[1,0,0],a=ae(ne(t),ne(e)),o=ie(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=i*o/l,u=-i*s/l,f=ae(n,a),h=se(n,c);oe(h,se(a,u));var d=f,p=ie(h,d),m=ie(d,d),g=p*p-m*(ie(h,h)-1);if(!(g<0)){var v=Math.sqrt(g),y=se(d,(-p-v)/m);if(oe(y,h),y=ce(y),!r)return y;var x,b=t[0],_=e[0],w=t[1],M=e[1];_0^y[1]<(aa(y[0]-b)ka^(b<=y[0]&&y[0]<=_)){var T=se(d,(-p+v)/m);return oe(T,h),[y,ce(T)]}}}function n(e,r){var n=a?t:ka-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var i=Math.cos(t),a=i>0,o=aa(i)>wa;return _e(e,function(t){var i,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],m=e(f,h),g=a?m?0:n(f,h):m?n(f+(f<0?ka:-ka),h):0;if(!i&&(c=l=m)&&t.lineStart(),m!==l&&(d=r(i,p),(ue(i,d)||ue(p,d))&&(p[0]+=wa,p[1]+=wa,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=r(p,i),t.point(d[0],d[1])):(d=r(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(o&&i&&a^m){var v;g&s||!(v=r(p,i,!0))||(u=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||i&&ue(i,p)||t.point(p[0],p[1]),i=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},We(t,6*Ea),a?[0,-t]:[-ka,t-ka])}((w=+t)*Ea),n()):w},e.clipExtent=function(t){return arguments.length?(M=t,_=t?Te(t[0][0],t[0][1],t[1][0],t[1][1]):y,n()):M},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],r()):[h,d]},e.center=function(t){return arguments.length?(p=t[0]%360*Ea,m=t[1]%360*Ea,r()):[p*La,m*La]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Ea,v=t[1]%360*Ea,x=t.length>2?t[2]%360*Ea:0,r()):[g*La,v*La,x*La]},Zi.rebind(e,u,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&function(t){return(t=o.invert((t[0]-s)/f,(l-t[1])/f))&&[t[0]*La,t[1]*La]},r()}}function Be(t){return Re(t,function(e,r){t.point(e*Ea,r*Ea)})}function Ue(t,e){return[t,e]}function Ve(t,e){return[t>ka?t-Aa:t<-ka?t+Aa:t,e]}function qe(t,e,r){return t?e||r?ge(Ge(t),Ye(e,r)):Ge(t):e||r?Ye(e,r):Ve}function He(t){return function(e,r){return e+=t,[e>ka?e-Aa:e<-ka?e+Aa:e,r]}}function Ge(t){var e=He(t);return e.invert=He(-t),e}function Ye(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*n+s*i;return[Math.atan2(l*a-u*o,s*n-c*i),Q(u*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*a-l*o;return[Math.atan2(l*a+c*o,s*n+u*i),Q(u*n-s*i)]},r}function We(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Xe(r,i),a=Xe(r,a),(o>0?ia)&&(i+=o*Aa)):(i=t+o*Aa,a=t-.5*l);for(var c,u=i;o>0?u>a:u0?e<-Sa+wa&&(e=-Sa+wa):e>Sa-wa&&(e=Sa-wa);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(ka/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=Z(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Sa]},r):rr}function er(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return aa(i)1&&J(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function lr(t,e){return t[0]-e[0]||t[1]-e[1]}function cr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ur(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function fr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function hr(t){var e=Wo.pop()||new function(){Sr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function dr(t){_r(t),Ho.remove(t),Wo.push(t),Sr(t)}function pr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];dr(t);for(var l=a;l.circle&&aa(r-l.circle.x)wa)s=s.L;else{if(!((i=a-function(t,e){var r=t.N;if(r)return gr(r,e);var n=t.site;return n.y===e?n.x:1/0}(s,o))>wa)){n>-wa?(e=s.P,r=s):i>-wa?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=hr(t);if(Ho.insert(e,l),e||r){if(e===r)return _r(e),r=hr(e.site),Ho.insert(l,r),l.edge=r.edge=Mr(e.site,l.site),br(e),void br(r);if(r){_r(e),_r(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,d=t.y-f,p=r.site,m=p.x-u,g=p.y-f,v=2*(h*g-d*m),y=h*h+d*d,x=m*m+g*g,b={x:(g*y-d*x)/v+u,y:(h*x-m*y)/v+f};kr(r.edge,c,p,b),l.edge=Mr(c,t,null,b),r.edge=Mr(t,p,null,b),br(e),br(r)}else l.edge=Mr(e.site,l.site)}}function gr(t,e){var r=t.site,n=r.x,i=r.y,a=i-e;if(!a)return n;var o=t.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function vr(t){this.site=t,this.edges=[]}function yr(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=qo,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;owa||aa(i-r)>wa)&&(s.splice(o,0,new Ar(function(t,e,r){var n=new wr(t,null);return n.a=e,n.b=r,Vo.push(n),n}(a.site,u,aa(n-f)wa?{x:f,y:aa(e-f)wa?{x:aa(r-p)wa?{x:h,y:aa(e-h)wa?{x:aa(r-d)=-Ma)){var h=l*l+c*c,d=u*u+g*g,p=(g*h-c*d)/f,m=(l*d-u*h)/f,g=m+s,v=Xo.pop()||new function(){Sr(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=p+o,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var y=null,x=Yo._;x;)if(v.y=s)return;if(h>p){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.xa&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Nr(r,n)})),a=Ko.lastIndex;return a=0&&!(r=Zi.interpolators[n](t,e)););return r}function Ur(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(tn(r)+"rotate(",null,")")-2,x:Nr(t,e)})):e&&r.push(tn(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(tn(r)+"skewX(",null,")")-2,x:Nr(t,e)}):e&&r.push(tn(r)+"skewX("+e+")")}(t.skew,e.skew,r,n),function(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(tn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Nr(t[0],e[0])},{i:i-2,x:Nr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(tn(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function hn(t,e){for(var r=[t],n=[];null!=(t=r.pop());)if(n.push(t),(a=t.children)&&(i=a.length))for(var i,a,o=-1;++oi&&(n=r,i=e);return n}function Mn(t){return t.reduce(kn,0)}function kn(t,e){return t+e[1]}function An(t,e){return Tn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Tn(t,e){for(var r=-1,n=+t[0],i=(t[1]-n)/e,a=[];++r<=e;)a[r]=i*r+n;return a}function Sn(t){return[Zi.min(t),Zi.max(t)]}function En(t,e){return t.value-e.value}function Ln(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Cn(t,e){t._pack_next=e,e._pack_prev=t}function zn(t,e){var r=e.x-t.x,n=e.y-t.y,i=t.r+e.r;return.999*i*i>r*r+n*n}function Dn(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(c=r.length)){var r,n,i,a,o,s,l,c,u=1/0,f=-1/0,h=1/0,d=-1/0;if(r.forEach(In),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(i=r[1],i.x=i.r,i.y=0,e(i),c>2))for(Fn(n,i,a=r[2]),e(a),Ln(n,a),n._pack_prev=a,Ln(a,i),i=n._pack_next,o=3;o2?function(t,e,r,n){var i=[],a=[],o=0,s=Math.min(t.length,e.length)-1;for(t[s]0?0:-t))/Math.log(e)}function a(t){return r?Math.pow(e,t):-Math.pow(e,-t)}function o(e){return t(i(e))}return o.invert=function(e){return a(t.invert(e))},o.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((n=e.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(e=+r,t.domain(n.map(i)),o):e},o.nice=function(){var e=Yn(n.map(i),r?Math:fs);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Hn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;h--)o.push(a(c)*h);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return us;arguments.length<2?r=us:"function"!=typeof r&&(r=Zi.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function gi(t,e,r,n,i){var a=t[0]-e[0],o=t[1]-e[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,d=e[1]+c,p=(u+h)/2,m=(f+d)/2,g=h-u,v=d-f,y=g*g+v*v,x=r-n,b=u*d-h*f,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-g*_)/y,M=(-b*g-v*_)/y,k=(b*v+g*_)/y,A=(-b*g+v*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-c],[w*r/x,M*r/x]]}function vi(t){function e(e){function o(){c.push("M",a(t(u),s))}for(var l,c=[],u=[],f=-1,h=e.length,d=_t(r),p=_t(n);++f1?t.join("L"):t+"Z"}function xi(t){return t.join("L")+"Z"}function bi(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1){s=e[1],a=t[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;c9&&(i=3*e/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}function Li(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,f,h,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=kt(a,0,l),m=p[n]={tween:new c,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function Vi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function qi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function Hi(t){return t.toISOString()}function Gi(t,e,r){function n(e){return t(e)}function i(t,r){var n=(t[1]-t[0])/r,i=Zi.bisect(Fs,n);return i==Fs.length?[e.year,Kn(t.map(function(t){return t/31536e6}),r)[2]]:i?e[n/Fs[i-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=Yi(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=Yi(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Hn(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],Yi(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Gi(t.copy(),e,r)},Zn(n,t)}function Yi(t){return new Date(t)}function Wi(t){return JSON.parse(t.responseText)}function Xi(t){var e=Qi.createRange();return e.selectNode(Qi.body),e.createContextualFragment(t.responseText)}var Zi={version:"3.5.17"},Ji=[].slice,Ki=function(t){return Ji.call(t)},Qi=this.document;if(Qi)try{Ki(Qi.documentElement.childNodes)[0].nodeType}catch(t){Ki=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),Qi)try{Qi.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var $i=this.Element.prototype,ta=$i.setAttribute,ea=$i.setAttributeNS,ra=this.CSSStyleDeclaration.prototype,na=ra.setProperty;$i.setAttribute=function(t,e){ta.call(this,t,e+"")},$i.setAttributeNS=function(t,e,r){ea.call(this,t,e,r+"")},ra.setProperty=function(t,e,r){na.call(this,t,e+"",r)}}Zi.ascending=n,Zi.descending=function(t,e){return et?1:e>=t?0:NaN},Zi.min=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},Zi.max=function(t,e){var r,n,i=-1,a=t.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},Zi.extent=function(t,e){var r,n,i,a=-1,o=t.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return l/(u-1)},Zi.deviation=function(){var t=Zi.variance.apply(this,arguments);return t?Math.sqrt(t):t};var ia=o(n);Zi.bisectLeft=ia.left,Zi.bisect=Zi.bisectRight=ia.right,Zi.bisector=function(t){return o(1===t.length?function(e,r){return n(t(e),r)}:t)},Zi.shuffle=function(t,e,r){(a=arguments.length)<3&&(r=t.length,a<2&&(e=0));for(var n,i,a=r-e;a;)i=Math.random()*a--|0,n=t[a+e],t[a+e]=t[i+e],t[i+e]=n;return t},Zi.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},Zi.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r};var aa=Math.abs;Zi.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,i=[],a=function(t){for(var e=1;t*e%1;)e*=10;return e}(aa(r)),o=-1;if(t*=a,e*=a,(r*=a)<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,f,h,d=-1,p=o.length,m=a[s++],g=new c;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(Zi.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},Zi.set=function(t){var e=new v;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},Zi.event=null,Zi.requote=function(t){return t.replace(ca,"\\$&")};var ca=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ua={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},fa=function(t,e){return e.querySelector(t)},ha=function(t,e){return e.querySelectorAll(t)},da=function(t,e){var r=t.matches||t[x(t,"matchesSelector")];return(da=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(fa=function(t,e){return Sizzle(t,e)[0]||null},ha=Sizzle,da=Sizzle.matchesSelector),Zi.selection=function(){return Zi.select(Qi.documentElement)};var pa=Zi.selection.prototype=[];pa.select=function(t){var e,r,n,i,a=[];t=S(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),ga.hasOwnProperty(r)?{space:ga[r],local:t}:t}},pa.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=Zi.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},pa.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=D(t)).length,i=-1;if(e=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},pa.sort=function(t){t=function(t){return arguments.length||(t=n),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.transition().duration(E)),e.call(t.event)}function o(){b&&b.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){L++||t({type:"zoomstart"})}function l(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),m=null)}function u(){var t=this,n=P.of(t,arguments),a=0,o=Zi.select(r(t)).on(z,function(){a=1,i(Zi.mouse(t),u),l(n)}).on(D,function(){o.on(z,null).on(D,null),f(a),c(n)}),u=e(Zi.mouse(t)),f=Y(t);Ts.call(t),s(n)}function f(){function t(){var t=Zi.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=Zi.event.target;Zi.select(e).on(b,o).on(_,h),w.push(e);for(var r=Zi.event.changedTouches,n=0,i=r.length;n1){c=s[0];var u=s[1],f=c[0]-u[0],d=c[1]-u[1];v=f*f+d*d}}function o(){var t,e,r,a,o=Zi.touches(p);Ts.call(p);for(var s=0,c=o.length;s=c)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++8?function(t){return t/r}:function(t){return t*r},symbol:t}});Zi.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=Zi.round(t,Et(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Xa[8+r/3]};var Za=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ja=Zi.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=Zi.round(t,Et(t,e))).toFixed(Math.max(0,Math.min(20,Et(t*(1+1e-15),e))))}}),Ka=Zi.time={},Qa=Date;Lt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){$a.setUTCDate.apply(this._,arguments)},setDay:function(){$a.setUTCDay.apply(this._,arguments)},setFullYear:function(){$a.setUTCFullYear.apply(this._,arguments)},setHours:function(){$a.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){$a.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){$a.setUTCMinutes.apply(this._,arguments)},setMonth:function(){$a.setUTCMonth.apply(this._,arguments)},setSeconds:function(){$a.setUTCSeconds.apply(this._,arguments)},setTime:function(){$a.setTime.apply(this._,arguments)}};var $a=Date.prototype;Ka.year=Ct(function(t){return(t=Ka.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Ka.years=Ka.year.range,Ka.years.utc=Ka.year.utc.range,Ka.day=Ct(function(t){var e=new Qa(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Ka.days=Ka.day.range,Ka.days.utc=Ka.day.utc.range,Ka.dayOfYear=function(t){var e=Ka.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=Ka[t]=Ct(function(t){return(t=Ka.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=Ka.year(t).getDay();return Math.floor((Ka.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});Ka[t+"s"]=r.range,Ka[t+"s"].utc=r.utc.range,Ka[t+"OfYear"]=function(t){var r=Ka.year(t).getDay();return Math.floor((Ka.dayOfYear(t)+(r+e)%7)/7)}}),Ka.week=Ka.sunday,Ka.weeks=Ka.sunday.range,Ka.weeks.utc=Ka.sunday.utc.range,Ka.weekOfYear=Ka.sundayOfYear;var to={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,ro=/^%/;Zi.locale=function(t){return{numberFormat:function(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:y;return function(t){var r=Za.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",c=r[5],u=+r[6],f=r[7],h=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=Ja.get(d)||function(t){return t+""};var x=c&&f;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=Zi.formatPrefix(t,h);t=l.scale(t),r=l.symbol+g}else t*=p;var b,_,w=(t=d(t,h)).lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(b=t,_=""):(b=t.substring(0,M),_=t.substring(M))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=a(b,1/0));var k=m.length+b.length+_.length+(x?0:i.length),A=k"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(x?t:A+t))+r}}}(t),timeFormat:function(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=_[o in to?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}var n=t.dateTime,i=t.date,a=t.time,o=t.periods,s=t.days,l=t.shortDays,c=t.months,u=t.shortMonths;e.multi=(e.utc=function(t){function r(t){try{var e=new(Qa=Lt);return e._=t,n(e)}finally{Qa=Date}}var n=e(t);return r.parse=function(t){try{Qa=Lt;var e=n.parse(t);return e&&e._}finally{Qa=Date}},r.toString=n.toString,r}).multi=Jt;var f=Zi.map(),h=It(s),d=Pt(s),p=It(l),m=Pt(l),g=It(c),v=Pt(c),y=It(u),x=Pt(u);o.forEach(function(t,e){f.set(t.toLowerCase(),e)});var b={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:e(n),d:function(t,e){return Dt(t.getDate(),e,2)},e:function(t,e){return Dt(t.getDate(),e,2)},H:function(t,e){return Dt(t.getHours(),e,2)},I:function(t,e){return Dt(t.getHours()%12||12,e,2)},j:function(t,e){return Dt(1+Ka.dayOfYear(t),e,3)},L:function(t,e){return Dt(t.getMilliseconds(),e,3)},m:function(t,e){return Dt(t.getMonth()+1,e,2)},M:function(t,e){return Dt(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Dt(t.getSeconds(),e,2)},U:function(t,e){return Dt(Ka.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Dt(Ka.mondayOfYear(t),e,2)},x:e(i),X:e(a),y:function(t,e){return Dt(t.getFullYear()%100,e,2)},Y:function(t,e){return Dt(t.getFullYear()%1e4,e,4)},Z:Xt,"%":function(){return"%"}},_={a:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){h.lastIndex=0;var n=h.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,n){return r(t,b.c.toString(),e,n)},d:Vt,e:Vt,H:Ht,I:Ht,j:qt,L:Wt,m:Ut,M:Gt,p:function(t,e,r){var n=f.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:Yt,U:Ft,w:Ot,W:Rt,x:function(t,e,n){return r(t,b.x.toString(),e,n)},X:function(t,e,n){return r(t,b.X.toString(),e,n)},y:jt,Y:Nt,Z:Bt,"%":Zt};return e}(t)}};var no=Zi.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Zi.format=no.numberFormat,Zi.geo={},Kt.prototype={s:0,t:0,add:function(t){Qt(t,this.t,io),Qt(io.s,this.s,this),this.s?this.t+=io.t:this.s=io.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var io=new Kt;Zi.geo.stream=function(t,e){t&&ao.hasOwnProperty(t.type)?ao[t.type](t,e):$t(t,e)};var ao={Feature:function(t,e){$t(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ne([e*Ea,r*Ea]);if(v){var i=ae(v,n),a=ae([i[1],-i[0],0],i);le(a),a=ce(a);var o=e-p,l=o>0?1:-1,c=a[0]*La*l,m=aa(o)>180;if(m^(l*pd&&(d=g)}else if(c=(c+360)%360-180,m^(l*pd&&(d=r);m?es(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e):h>=u?(eh&&(h=e)):e>p?s(u,e)>s(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){b[0]=u,b[1]=h,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=aa(n)>180?n+(n>0?360:-360):n}else m=t,g=r;co.point(t,r),e(t,r)}function a(){co.lineStart()}function o(){i(m,g),co.lineEnd(),aa(y)>wa&&(u=-(h=180)),b[0]=u,b[1]=h,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:twa?d=90:y<-wa&&(f=-90),b[0]=u,b[1]=h}};return function(t){d=h=-(u=f=1/0),x=[],Zi.geo.stream(t,_);if(i=x.length){x.sort(l);for(var e=1,r=[p=x[0]];es(p[0],p[1])&&(p[1]=a[1]),s(a[0],p[1])>s(p[0],p[1])&&(p[0]=a[0])):r.push(p=a);for(var n,i,a,o=-1/0,p=(e=0,r[i=r.length-1]);e<=i;p=a,++e)a=r[e],(n=s(p[1],a[0]))>o&&(o=n,u=a[0],h=p[1])}return x=b=null,u===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,f],[h,d]]}}(),Zi.geo.centroid=function(t){uo=fo=ho=po=mo=go=vo=yo=xo=bo=_o=0,Zi.geo.stream(t,wo);var e=xo,r=bo,n=_o,i=e*e+r*r+n*n;return i0?ka:-ka,l=aa(a-r);aa(l-ka)0?Sa:-Sa),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=ka&&(aa(r-i)wa?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*Sa,n.point(-ka,i),n.point(0,i),n.point(ka,i),n.point(ka,0),n.point(ka,-i),n.point(0,-i),n.point(-ka,-i),n.point(-ka,0),n.point(-ka,i);else if(aa(t[0]-e[0])>wa){var a=t[0]=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),u=+e[0],f=+e[1];return r=a.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(l).point,n=o.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+wa,f+.12*c+wa],[u-.214*c-wa,f+.234*c-wa]]).stream(l).point,i=s.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+wa,f+.166*c+wa],[u-.115*c-wa,f+.234*c-wa]]).stream(l).point,t},t.scale(1070)};var Ao,To,So,Eo,Lo,Co,zo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){To=0,zo.lineStart=Le},polygonEnd:function(){zo.lineStart=zo.lineEnd=zo.point=b,Ao+=aa(To/2)}},Do={point:function(t,e){tLo&&(Lo=t),eCo&&(Co=e)},lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Io={point:ze,lineStart:De,lineEnd:Ie,polygonStart:function(){Io.lineStart=Pe},polygonEnd:function(){Io.point=ze,Io.lineStart=De,Io.lineEnd=Ie}};Zi.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),Zi.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Ao=0,Zi.geo.stream(t,i(zo)),Ao},t.centroid=function(t){return ho=po=mo=go=vo=yo=xo=bo=_o=0,Zi.geo.stream(t,i(Io)),_o?[xo/_o,bo/_o]:yo?[go/yo,vo/yo]:mo?[ho/mo,po/mo]:[NaN,NaN]},t.bounds=function(t){return Lo=Co=-(So=Eo=1/0),Zi.geo.stream(t,i(Do)),[[So,Eo],[Lo,Co]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||function(t){var e=Oe(function(e,r){return t([e*La,r*La])});return function(t){return Be(e(t))}}(t):y,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new function(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ce(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ce(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}:new function(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Aa)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:b};return s}(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(Zi.geo.albersUsa()).context(null)},Zi.geo.transform=function(t){return{stream:function(e){var r=new Fe(e);for(var n in t)r[n]=t[n];return r}}},Fe.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Zi.geo.projection=Ne,Zi.geo.projectionMutator=je,(Zi.geo.equirectangular=function(){return Ne(Ue)}).raw=Ue.invert=Ue,Zi.geo.rotation=function(t){function e(e){return e=t(e[0]*Ea,e[1]*Ea),e[0]*=La,e[1]*=La,e}return t=qe(t[0]%360*Ea,t[1]*Ea,t.length>2?t[2]*Ea:0),e.invert=function(e){return e=t.invert(e[0]*Ea,e[1]*Ea),e[0]*=La,e[1]*=La,e},e},Ve.invert=Ue,Zi.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=qe(-t[0]*Ea,-t[1]*Ea,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=La,t[1]*=La}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=We((e=+n)*Ea,i*Ea),t):e},t.precision=function(n){return arguments.length?(r=We(e*Ea,(i=+n)*Ea),t):i},t.angle(90)},Zi.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ea,i=t[1]*Ea,a=e[1]*Ea,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},Zi.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return Zi.range(Math.ceil(a/g)*g,i,g).map(h).concat(Zi.range(Math.ceil(c/v)*v,l,v).map(d)).concat(Zi.range(Math.ceil(n/p)*p,r,p).filter(function(t){return aa(t%g)>wa}).map(u)).concat(Zi.range(Math.ceil(s/m)*m,o,m).filter(function(t){return aa(t%v)>wa}).map(f))}var r,n,i,a,o,s,l,c,u,f,h,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[a,c],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,u=Ze(s,o,90),f=Je(n,r,y),h=Ze(c,l,90),d=Je(a,i,y),t):y},t.majorExtent([[-180,-90+wa],[180,90-wa]]).minorExtent([[-180,-80-wa],[180,80+wa]])},Zi.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=Ke,i=Qe;return t.distance=function(){return Zi.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},Zi.geo.interpolate=function(t,e){return function(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),c=i*Math.sin(t),u=o*Math.cos(r),f=o*Math.sin(r),h=2*Math.asin(Math.sqrt(tt(n-e)+i*o*tt(r-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,r=Math.sin(h-t)*d,n=r*l+e*u,i=r*c+e*f,o=r*a+e*s;return[Math.atan2(i,n)*La,Math.atan2(o,Math.sqrt(n*n+i*i))*La]}:function(){return[t*La,e*La]};return p.distance=h,p}(t[0]*Ea,t[1]*Ea,e[0]*Ea,e[1]*Ea)},Zi.geo.length=function(t){return Po=0,Zi.geo.stream(t,Oo),Po};var Po,Oo={sphere:b,point:b,lineStart:function(){function t(t,i){var a=Math.sin(i*=Ea),o=Math.cos(i),s=aa((t*=Ea)-e),l=Math.cos(s);Po+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Oo.point=function(i,a){e=i*Ea,r=Math.sin(a*=Ea),n=Math.cos(a),Oo.point=t},Oo.lineEnd=function(){Oo.point=Oo.lineEnd=b}},lineEnd:b,polygonStart:b,polygonEnd:b},Fo=$e(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Zi.geo.azimuthalEqualArea=function(){return Ne(Fo)}).raw=Fo;var Ro=$e(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},y);(Zi.geo.azimuthalEquidistant=function(){return Ne(Ro)}).raw=Ro,(Zi.geo.conicConformal=function(){return Se(tr)}).raw=tr,(Zi.geo.conicEquidistant=function(){return Se(er)}).raw=er;var No=$e(function(t){return 1/t},Math.atan);(Zi.geo.gnomonic=function(){return Ne(No)}).raw=No,rr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Sa]},(Zi.geo.mercator=function(){return nr(rr)}).raw=rr;var jo=$e(function(){return 1},Math.asin);(Zi.geo.orthographic=function(){return Ne(jo)}).raw=jo;var Bo=$e(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Zi.geo.stereographic=function(){return Ne(Bo)}).raw=Bo,ir.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Sa]},(Zi.geo.transverseMercator=function(){var t=nr(ir),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=ir,Zi.geom={},Zi.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=_t(r),a=_t(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[c[e]][2]]);for(e=+f;e=n&&c.x<=a&&c.y>=i&&c.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/wa)*wa,y:Math.round(o(t,e)/wa)*wa,i:e}})}var n=ar,i=or,a=n,o=i,s=Zo;return t?e(t):(e.links=function(t){return zr(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return zr(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(xr),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s=c,h=n>=u,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),f?i=c:s=c,h?o=u:l=u,a(t,e,r,n,i,o,s,l)}var u,f,h,d,p,m,g,v,y,x=_t(s),b=_t(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),f=[],h=[],p=t.length,o)for(d=0;dv&&(v=u.x),u.y>y&&(y=u.y),f.push(u.x),h.push(u.y);else for(d=0;dv&&(v=_),w>y&&(y=w),f.push(_),h.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null};if(A.add=function(t){a(A,t,+x(t,++d),+b(t,d),m,g,v,y)},A.visit=function(t){Or(t,A,m,g,v,y)},A.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,f,h,d){if(!(u>a||f>o||h=_)<<1|e>=b,M=w+4;w=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=$o.get(r)||Qo,n=ts.get(n)||y,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}(n(r.apply(null,Ji.call(arguments,1))))},Zi.interpolateHcl=function(t,e){t=Zi.hcl(t),e=Zi.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return at(r+a*t,n+o*t,i+s*t)+""}},Zi.interpolateHsl=function(t,e){t=Zi.hsl(t),e=Zi.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return nt(r+a*t,n+o*t,i+s*t)+""}},Zi.interpolateLab=function(t,e){t=Zi.lab(t),e=Zi.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return st(r+a*t,n+o*t,i+s*t)+""}},Zi.interpolateRound=Jr,Zi.transform=function(t){var e=Qi.createElementNS(Zi.ns.prefix.svg,"g");return(Zi.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Kr(r?r.matrix:es)})(t)},Kr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var es={a:1,b:0,c:0,d:1,e:0,f:0};Zi.interpolateTransform=en,Zi.layout={},Zi.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:i=0})):t>0&&(c.start({type:"start",alpha:i=t}),r=kt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;n&&(a.value=0),a.children=c}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return hn(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=mn,r=dn,n=pn;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(fn(e,function(t){t.children&&(t.value=0)}),hn(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},Zi.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=u[0]&&s<=u[1]&&((o=l[Zi.bisect(f,s,1,d)-1]).y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Sn,i=An;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=_t(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return Tn(t,e)}:_t(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},Zi.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,hn(s,function(t){t.r=+u(t.value)}),hn(s,Dn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;hn(s,function(t){t.r+=f}),hn(s,Dn),hn(s,function(t){t.r-=f})}return On(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}var e,r=Zi.layout.hierarchy().sort(En),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},un(t,r)},Zi.layout.tree=function(){function t(t,l){var c=i.call(this,t,l),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;null!=(e=n.pop());)for(var i,a=e.children,o=0,s=a.length;od.x&&(d=t),t.depth>p.depth&&(p=t)});var m=a(h,d)/2-h.x,g=o[0]/(d.x+a(d,h)/2+m),v=o[1]/(p.depth||1);fn(u,function(t){t.x=(t.x+m)*g,t.y=t.depth*v})}return c}function e(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.length){!function(t){for(var e,r=0,n=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(t);var i=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+a(t._,n._),t.m=t.z-i):t.z=i}else n&&(t.z=n.z+a(t._,n._));t.parent.A=function(t,e,r){if(e){for(var n,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,f=s.m,h=l.m;s=jn(s),i=Nn(i),s&&i;)l=Nn(l),(o=jn(o)).a=t,(n=s.z+f-i.z-c+a(s._,i._))>0&&(!function(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}(function(t,e,r){return t.a.parent===e.parent?t.a:r}(s,t,r),t,n),c+=n,u+=n),f+=s.m,c+=i.m,h+=l.m,u+=o.m;s&&!jn(o)&&(o.t=s,o.m+=f-u),i&&!Nn(l)&&(l.t=i,l.m+=c-h,r=t)}return r}(t,n,t.parent.A||r[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function n(t){t.x*=o[0],t.y=t.depth*o[1]}var i=Zi.layout.hierarchy().sort(null).value(null),a=Rn,o=[1,1],s=null;return t.separation=function(e){return arguments.length?(a=e,t):a},t.size=function(e){return arguments.length?(s=null==(o=e)?n:null,t):s?null:o},t.nodeSize=function(e){return arguments.length?(s=null==(o=e)?null:n,t):s?o:null},un(t,i)},Zi.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],c=0;hn(l,function(t){var e=t.children;e&&e.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(e),t.y=function(t){return 1+Zi.max(t,function(t){return t.y})}(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=Bn(l),f=Un(l),h=u.x-r(u,f)/2,d=f.x+r(f,u)/2;return hn(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(d-h)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=Zi.layout.hierarchy().sort(null).value(null),r=Rn,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},un(t,e)},Zi.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)c.push(a=f[s-1]),c.area+=a.area,"squarify"!==h||(o=function(t,e){var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;for(;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*d/n,n/(e*a*d)):1/0}(c,m))<=p?(f.pop(),p=o):(c.area-=c.pop().area,n(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(n(c,m,l,!0),c.length=c.area=0),i.forEach(e)}}function r(e){var i=e.children;if(i&&i.length){var a,o=u(e),s=i.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(n(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);i.forEach(r)}}function n(t,e,r,n){var i,a=-1,o=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++ar.dx)&&(u=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=Zi.random.normal.apply(Zi,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=Zi.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rf?0:1;if(c=Ta)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,x,b,_,w,M,k,A,T=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===gs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(S*=-1),c&&(S=Q(g/c*Math.sin(v))),t&&(T=Q(g/t*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(f-S),_=c*Math.sin(f-S);var L=Math.abs(f-u-2*S)<=ka?0:1;if(S&&mi(y,x,b,_)===d^L){var C=(u+f)/2;y=c*Math.cos(C),x=c*Math.sin(C),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),M=t*Math.sin(f-T),k=t*Math.cos(u+T),A=t*Math.sin(u+T);var z=Math.abs(u-f+2*T)<=ka?0:1;if(T&&mi(w,M,k,A)===1-d^z){var D=(u+f)/2;w=t*Math.cos(D),M=t*Math.sin(D),k=A=null}}else w=M=0;if(h>wa&&(p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){m=t1&&i.push("H",n[0]),i.join("")},"step-before":bi,"step-after":_i,basis:ki,"basis-open":function(t){if(t.length<4)return yi(t);for(var e,r=[],n=-1,i=t.length,a=[0],o=[0];++n<3;)e=t[n],a.push(e[0]),o.push(e[1]);for(r.push(Ai(bs,a)+","+Ai(bs,o)),--n;++nka)+",1 "+e}function n(t,e,r,n){return"Q 0,0 "+n}var i=Ke,a=Qe,o=zi,s=hi,l=di;return t.radius=function(e){return arguments.length?(o=_t(e),t):o},t.source=function(e){return arguments.length?(i=_t(e),t):i},t.target=function(e){return arguments.length?(a=_t(e),t):a},t.startAngle=function(e){return arguments.length?(s=_t(e),t):s},t.endAngle=function(e){return arguments.length?(l=_t(e),t):l},t},Zi.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=Ke,r=Qe,n=Di;return t.source=function(r){return arguments.length?(e=_t(r),t):e},t.target=function(e){return arguments.length?(r=_t(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},Zi.svg.diagonal.radial=function(){var t=Zi.svg.diagonal(),e=Di,r=t.projection;return t.projection=function(t){return arguments.length?r(function(t){return function(){var e=t.apply(this,arguments),r=e[0],n=e[1]-Sa;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},Zi.svg.symbol=function(){function t(t,n){return(_s.get(e.call(this,t,n))||Oi)(r.call(this,t,n))}var e=Pi,r=Ii;return t.type=function(r){return arguments.length?(e=_t(r),t):e},t.size=function(e){return arguments.length?(r=_t(e),t):r},t};var _s=Zi.map({circle:Oi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Ms)),r=e*Ms;return"M0,"+-e+"L"+r+",0 0,"+e+" "+-r+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ws),r=e*ws/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ws),r=e*ws/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});Zi.svg.symbolTypes=_s.keys();var ws=Math.sqrt(3),Ms=Math.tan(30*Ea);pa.transition=function(t){for(var e,r,n=ks||++Es,i=Bi(t),a=[],o=As||{time:Date.now(),ease:function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function a(){function a(){var t=Zi.mouse(x),r=!1;y&&(t[0]+=y[0],t[1]+=y[1]),S||(Zi.event.altKey?(v||(v=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(t[0]=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(u=0;u<_.length;++u)h=(b=_[u])[0],b[0]=b[1],b[1]=h;return _}},{"incremental-convex-hull":278,uniq:556}],131:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]};function a(t,e){return i[0]=t,i[1]=e,n[0]}e.exports.pack=a;function o(t){return n[0]=t,i[0]}e.exports.lo=o;function s(t){return n[0]=t,i[1]}e.exports.hi=s}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]};function l(t,e){return i[1]=t,i[0]=e,n[0]}e.exports.pack=l;function c(t){return n[0]=t,i[1]}e.exports.lo=c;function u(t){return n[0]=t,i[0]}e.exports.hi=u}else r=!1}if(!r){var f=new t(8);e.exports=function(t){return f.writeDoubleLE(t,0,!0),[f.readUInt32LE(0,!0),f.readUInt32LE(4,!0)]};function h(t,e){return f.writeUInt32LE(t,0,!0),f.writeUInt32LE(e,4,!0),f.readDoubleLE(0,!0)}e.exports.pack=h;function d(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(0,!0)}e.exports.lo=d;function p(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(4,!0)}e.exports.hi=p}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:82}],132:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{"abs-svg-path":43,"normalize-svg-path":460}],133:[function(t,e,r){e.exports=function(t){switch(t){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],134:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=f&&c(ar.x)&&d(n,t)&&(r=n,p=l),n=n.next;return r}(t,e)){var r=p(e,t);a(r,r.next)}}(m[o],r),r=a(r,r.next);return r}(t,e,u,r)),t.length>80*r){h=g=t[0],m=v=t[1];for(var _=r;_g&&(g=y),x>v&&(v=x);b=Math.max(g-h,v-m)}return o(u,f,r,h,m,b),f}function i(t,e,r,n,i){var a,o;if(i===y(t,e,r,n)>0)for(a=e;a=e;a-=n)o=m(a,t[a],t[a+1],o);return o&&f(o,o.next)&&(g(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!f(n,n.next)&&0!==u(n.prev,n,n.next))n=n.next;else{if(g(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,s,m){if(t){!m&&s&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=l(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,s);for(var v,y,x=t;t.prev!==t.next;)if(v=t.prev,y=t.next,s?function(t,e,r,n){var i=t.prev,a=t,o=t.next;if(u(i,a,o)>=0)return!1;var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,d=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=l(s,f,e,r,n),m=l(h,d,e,r,n),g=t.nextZ;for(;g&&g.z<=m;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.nextZ}g=t.prevZ;for(;g&&g.z>=p;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}(t,n,i,s):function(t){var e=t.prev,r=t,n=t.next;if(u(e,r,n)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(c(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&u(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(v.i/r),e.push(t.i/r),e.push(y.i/r),g(t),t=y.next,x=y.next;else if((t=y)===x){m?1===m?o(t=function(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!f(i,a)&&h(i,n,n.next,a)&&d(i,a)&&d(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),g(n),g(n.next),n=t=a),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,s,2):2===m&&function(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&h(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&d(t,e)&&d(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(l,c)){var u=p(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}(t,e,r,n,i,s):o(a(t),e,r,n,i,s,1);break}}}function s(t,e){return t.x-e.x}function l(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function c(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function u(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function f(t,e){return t.x===e.x&&t.y===e.y}function h(t,e,r,n){return!!(f(t,e)&&f(r,n)||f(t,n)&&f(r,e))||u(t,e,r)>0!=u(t,e,n)>0&&u(r,n,t)>0!=u(r,n,e)>0}function d(t,e){return u(t.prev,t,t.next)<0?u(t,e,t.next)>=0&&u(t,t.prev,e)>=0:u(t,e,t.prev)<0||u(t,t.next,e)<0}function p(t,e){var r=new v(t.i,t.x,t.y),n=new v(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function m(t,e,r,n){var i=new v(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function g(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function v(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function y(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],136:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],139:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],140:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],141:[function(t,e,r){"use strict";function n(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";return"("+("=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e,!0):"any"===e?o(t.slice(1),"||"):"all"===e?o(t.slice(1),"&&"):"none"===e?c(o(t.slice(1),"||")):"in"===e?s(t[1],t.slice(2)):"!in"===e?c(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true")+")"}function i(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var a=i(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+a+"=== typeof "+o+"&&":"")+a+r+o}function o(t,e){return t.map(n).join(e)}function s(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(u)),n=i(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1;    if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function u(t,e){return te?1:0}e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))};var f=["Unknown","Point","LineString","Polygon"]},{}],142:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var u=a.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},l.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)i.push(n(l[f-1],c[f-1],arguments[f])),a.push(0)}},l.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var d=n(c[h-1],u[h-1],arguments[h]);i.push(d),a.push((d-i[o++])*f)}}},l.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},l.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],c[h-1],i[o++]+d)),a.push(d*f)}}},l.idle=function(t){var e=this.lastT();if(!(t=0;--f)i.push(n(l[f],c[f],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":70,"cubic-hermite":115}],143:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var i=t[0].length,a=t.length*i;e&&"string"!=typeof e||(e=new(n(e||"float32"))(a+r));var o=e.length-r;if(a!==o)throw new Error("source length "+a+" ("+i+"x"+t.length+") does not match destination length "+o);for(var s=0,l=r;s0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(t,e,r,n,i.right)}function f(t,e){this.tree=t,this._stack=e}function h(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}e.exports=function(t){return new s(t||function(t,e){return te?1:0},null)};var d=0,p=1,m=s.prototype;Object.defineProperty(m,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(m,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(d,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(h._color===p||i._color===p)break;var m=l[f-2];if(m.left===h)if(h.left===i){if(!(g=m.right)||g._color!==d){if(m._color=d,m.left=h.right,h._color=p,h.right=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).left===m?v.left=h:v.right=h}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else{if(!(g=m.right)||g._color!==d){if(h.right=i.left,m._color=d,m.left=i.right,i._color=p,i.left=h,i.right=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){(v=l[f-3]).left===m?v.left=i:v.right=i}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else if(h.right===i){if(!(g=m.left)||g._color!==d){if(m._color=d,m.right=h.left,h._color=p,h.left=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).right===m?v.right=h:v.left=h}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}else{var g;if(!(g=m.left)||g._color!==d){if(h.left=i.right,m._color=d,m.right=i.left,i._color=p,i.right=h,i.left=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){var v;(v=l[f-3]).right===m?v.right=i:v.left=i}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}}return l[0]._color=p,new s(r,l[0])},m.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return c(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return u(e,r,this._compare,t,this.root)}},Object.defineProperty(m,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(m,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),m.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},m.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},m.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},m.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new f(this,n)},m.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new f(this,n)},m.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},m.remove=function(t){var e=this.find(t);return e?e.remove():this},m.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var g=f.prototype;Object.defineProperty(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new f(this.tree,this._stack.slice())},g.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if((r=e[e.length-1])._color===d){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=p);if((r=t[l-1]).left===e){if((n=r.right).right&&n.right._color===d)return n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=p,r._color=p,s._color=p,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),void(t[l-1]=n);if(n.left&&n.left._color===d)return n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).left===r?c.left=s:c.right=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.right=a(d,n));r.right=a(d,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=d,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11&&((c=t[l-2]).right===r?c.right=n:c.left=n),void(t[l-1]=n);if(n.right&&n.right._color===d)return n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).right===r?c.right=s:c.left=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.left=a(d,n));r.left=a(d,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=d,o(r),o(n),l>1){var c;(c=t[l-2]).right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),g.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(g,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),g.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},g.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(g,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],145:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],146:[function(t,e,r){function n(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}(t)===e?t:t.reverse()}var s=t("geojson-area");e.exports=n},{"geojson-area":146}],148:[function(t,e,r){"use strict";function n(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=function(t,e,r,a,o,s,l,c){if(r/=e,a/=e,l>=r&&c<=a)return t;if(l>a||c=r&&d<=a)u.push(p);else if(!(h>a||d=e&&s<=r&&i.push(o)}return i}(m,r,a,o):function(t,e,r,i,a,o){for(var s=[],l=0;lr?(b.push(a(c,p,e),a(c,p,r)),o||(b=n(s,b,g,v,y))):d>=e&&b.push(a(c,p,e)):h>r?dr&&(b.push(a(c,p,r)),o||(b=n(s,b,g,v,y))));c=m[x-1],(h=c[i])>=e&&h<=r&&b.push(c),f=b[b.length-1],o&&f&&(b[0][0]!==f[0]||b[0][1]!==f[1])&&b.push(b[0]),n(s,b,g,v,y)}return s}(m,r,a,o,s,3===g);v.length&&u.push(i(p.tags,g,v,p.id))}}return u.length?u:null};var i=t("./feature")},{"./feature":150}],149:[function(t,e,r){"use strict";function n(t,e,r){if(null!==e.geometry){var o,l,c,u,f=e.geometry,h=f.type,d=f.coordinates,p=e.properties,m=e.id;if("Point"===h)t.push(s(p,1,[a(d)],m));else if("MultiPoint"===h)t.push(s(p,1,i(d),m));else if("LineString"===h)t.push(s(p,2,[i(d,r)],m));else if("MultiLineString"===h||"Polygon"===h){for(c=[],o=0;o1?1:n,[r,n,0]}e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),x=this.tiles[y]=h(t,v,r,n,b,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(x.source=t,l){if(e===p.maxZoom||e===l)continue;var w=1<1&&console.time("clipping");var M,k,A,T,S,E,L=.5*p.buffer/p.extent,C=.5-L,z=.5+L,D=1+L;M=k=A=T=null,S=u(t,v,r-L,r+z,0,a,x.min[0],x.max[0]),E=u(t,v,r+C,r+D,0,a,x.min[0],x.max[0]),S&&(M=u(S,v,n-L,n+z,1,o,x.min[1],x.max[1]),k=u(S,v,n+C,n+D,1,o,x.min[1],x.max[1])),E&&(A=u(E,v,n-L,n+z,1,o,x.min[1],x.max[1]),T=u(E,v,n+C,n+D,1,o,x.min[1],x.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(A||[],e+1,2*r+1,2*n),d.push(T||[],e+1,2*r+1,2*n+1))}else l&&(g=e)}return g},n.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,l=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var f,h=t,d=e,p=r;!f&&h>0;)h--,d=Math.floor(d/2),p=Math.floor(p/2),f=this.tiles[i(h,d,p)];if(!f||!f.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",h,d,p),s(f,a,n.buffer))return c.tile(f,a);o>1&&console.time("drilling down");var m=this.splitTile(f.source,h,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<1?(n=a,i=o):f>0&&(n+=c*f,i+=u*f)}return c=s-n,u=l-i,c*c+u*u}(t[r],t[s],t[l]))>n&&(a=r,n=i);n>o?(t[a][2]=n,c.push(s),c.push(a),s=a):(l=c.pop(),s=c.pop())}}},{}],153:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){for(var o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},s=0;sf)&&(h.push(s),t.numSimplified++),t.numPoints++;3===c&&function(t,e){(function(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;io.max[0]&&(o.max[0]=c[0]),c[1]>o.max[1]&&(o.max[1]=c[1])}return o}},{}],154:[function(t,e,r){"use strict";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}e.exports=function(t,e){var r=new i(t);return r.update(e),r};var s=t("./lib/text.js"),l=t("./lib/lines.js"),c=t("./lib/background.js"),u=t("./lib/cube.js"),f=t("./lib/ticks.js"),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]}),c=!1,u=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,c=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),c=!0),c){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?c=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(c=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=s(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};var p=[new a,new a,new a],m=[0,0,0],g={model:h,view:h,projection:h};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];d.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||h,i=t.view||h,a=t.projection||h,s=this.bounds,l=u(r,i,a,s),c=l.cubeEdges,f=l.axis,d=i[12],b=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*d+a[7]*b+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=c[k],this.lastCubeProps.axis[k]=f[k];var A=p;for(k=0;k<3;++k)o(p[k],k,this.bounds,c,f);e=this.gl;var T=m;for(k=0;k<3;++k)this.backgroundEnable[k]?T[k]=f[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(k=0;k<3;++k){var S=[0,0,0];f[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(E=0;E<2;++E){L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var z=n(v,A[k].primalMinor),D=n(y,A[k].mirrorMinor),I=this.lineTickLength;for(E=0;E<3;++E){var P=M/r[5*E];z[E]*=I[E]*P,D[E]*=I[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,D,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(k=0;k<3;++k){var O=A[k].primalMinor,F=n(x,A[k].primalOffset);for(E=0;E<3;++E)this.lineTickEnable[k]&&(F[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],F,this.tickColor[k])}if(this.labelEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.labelPad[E]/r[5*E];F[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],F,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":158,"./lib/cube.js":159,"./lib/lines.js":160,"./lib/text.js":162,"./lib/ticks.js":163}],158:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[c]=p;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=c;c=u,u=g}var v=i(t,new Float32Array(e)),y=i(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=o(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new n(t,v,x,b)};var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders").bg,s=n.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":161,"gl-buffer":165,"gl-vao":259}],159:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eS&&(_|=1<S&&(_|=1<f[y][1]&&(O=y));var F=-1;for(y=0;y<3;++y)(N=O^1<f[R][0]&&(R=N))}var j=m;j[0]=j[1]=j[2]=0,j[a.log2(F^O)]=O&F,j[a.log2(O^R)]=O&R;var B=7^R;B===_||B===P?(B=7^F,j[a.log2(R^B)]=B&R):j[a.log2(F^B)]=B&F;var U=g,V=_;for(k=0;k<3;++k)U[k]=V&1< 0.0) {\n    vec3 nPosition = mix(bounds[0], bounds[1], 0.5 * (position + 1.0));\n    gl_Position = projection * view * model * vec4(nPosition, 1.0);\n  } else {\n    gl_Position = vec4(0,0,0,0);\n  }\n  colorChannel = abs(normal);\n}","precision mediump float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n  gl_FragColor = colorChannel.x * colors[0] + \n                 colorChannel.y * colors[1] +\n                 colorChannel.z * colors[2];\n}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":243}],162:[function(t,e,r){(function(r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}e.exports=function(t,e,r,o,l,c){var u=i(t),f=a(t,[{buffer:u,size:3}]),h=s(t);h.attributes.position.location=0;var d=new n(t,h,u,f);return d.update(e,r,o,l,c),d};var i=t("gl-buffer"),a=t("gl-vao"),o=t("vectorize-text"),s=t("./shaders").text,l=window||r.global||{},c=l.__TEXT_CACHE||{};l.__TEXT_CACHE={};var u=n.prototype,f=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.update=function(t,e,r,n,i){function a(t,e,r,n){var i=c[r];i||(i=c[r]={});var a=i[e];a||(a=i[e]=function(t,e){try{return o(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=a.positions,f=a.cells,h=0,d=f.length;h=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],d=0;d<3;++d){f[d]=s.length/3|0,a(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(s.length/3|0)-f[d],l[d]=s.length/3|0;for(var p=0;p=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function a(t,e){for(var r=o.malloc(t.length,e),n=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=o.malloc(t.size,r),u=l(n,t.shape);s.assign(u,t),this.length=e<0?i(this.gl,this.type,this.length,this.usage,n,e):i(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),o.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,f,e):i(this.gl,this.type,this.length,this.usage,f.subarray(0,t.length),e),o.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var a=new n(t,r,t.createBuffer(),0,i);return a.update(e),a}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],166:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],167:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":166}],168:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1}function i(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}function a(t,e,r,n){for(var i=f[n],a=0;a=1},u.isTransparent=function(){return this.opacity<1},u.drawTransparent=u.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var f=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();u.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=l;t:for(var u=0;u0){var m;(m=f.slice())[c]+=d[1][c],o.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,c)}}}this.lineCount[c]=l-this.lineOffset[c]}this.buffer.update(o)}},u.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":170,"gl-buffer":165,"gl-vao":259}],169:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&h.drawBuffersWEBGL(m[f]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=o(r,c,u,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=o(r,c,u,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=s(r,c,u,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=s(r,c,u,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=s(r,c,u,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null),v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(o),c=0;ca||r<0||r>a)throw new Error("gl-fbo: Parameters are too large for FBO");var o=1;if("color"in(n=n||{})){if((o=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(o>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(o>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+o+" draw buffers")}}var s=t.UNSIGNED_BYTE,c=t.getExtension("OES_texture_float");if(n.float&&o>0){if(!c)throw new Error("gl-fbo: Context does not support floating point textures");s=t.FLOAT}else n.preferFloat&&o>0&&c&&(s=t.FLOAT);var u=!0;"depth"in n&&(u=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new l(t,e,r,s,o,u,g,i)};var f,h,d,p,m=null,g=l.prototype;Object.defineProperties(g,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return c(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,c(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,c(this,this._shape[0],t),t},enumerable:!1}}),g.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},g.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),u.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},u.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),n=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=1/((h[2]=r[r.length-1])-d),g=1/((h[3]=n[n.length-1])-p),v=e[0],y=e[1];this.shape=[v,y];var x=(v-1)*(y-1)*(f.length>>>1);this.numVertices=x;for(var b=o.mallocUint8(4*x),_=o.mallocFloat32(2*x),w=o.mallocUint8(2*x),M=o.mallocUint32(x),k=0,A=0;A FLOAT_MAX) {\n    return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n  } else if(v < -FLOAT_MAX) {\n    return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n  }\n\n  highp vec4 c = vec4(0,0,0,0);\n\n  //Compute exponent and mantissa\n  highp float e = floor(log2(av));\n  highp float m = av * pow(2.0, -e) - 1.0;\n  \n  //Unpack mantissa\n  c[1] = floor(128.0 * m);\n  m -= c[1] / 128.0;\n  c[2] = floor(32768.0 * m);\n  m -= c[2] / 32768.0;\n  c[3] = floor(8388608.0 * m);\n  \n  //Unpack exponent\n  highp float ebias = e + 127.0;\n  c[0] = floor(ebias / 2.0);\n  ebias -= c[0] * 2.0;\n  c[1] += floor(ebias) * 128.0; \n\n  //Unpack sign bit\n  c[0] += 128.0 * step(0.0, -v);\n\n  //Scale back to range\n  return c / 255.0;\n}\n\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n  if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n    discard;\n  }\n  gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":243}],177:[function(t,e,r){"use strict";function n(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function i(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.dirty=!0,this.pixelRatio=1}e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=p(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var n=m(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=s(e),a=l(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),u=h(new Array(1024),[256,1,4]),f=0;f<1024;++f)u.data[f]=255;var d=c(e,u);d.wrap=e.REPEAT;var g=new o(e,r,n,i,a,d);return g.update(t),g};var s=t("gl-buffer"),l=t("gl-vao"),c=t("gl-texture2d"),u=t("glsl-read-float"),f=t("binary-search-bounds"),h=t("ndarray"),d=t("./lib/shaders"),p=d.createShader,m=d.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],v=o.prototype;v.isTransparent=function(){return this.opacity<1},v.isOpaque=function(){return this.opacity>=1},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],c=[],u=[],d=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e0){for(var x=0;x<24;++x)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var b,_;Array.isArray(o[0])?(b=o[e-1],_=o[e]):b=_=o,3===b.length&&(b=[b[0],b[1],b[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=d;if(d+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,b[0],b[1],b[2],b[3],y[0],y[1],y[2],v[0],v[1],v[2],d,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],d,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),c.push(d),u.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=u,this.arcLength=c,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,f=i*l,h=i*c,d=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,b=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*b,t[1]=(h+x)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(h-x)*_,t[5]=(1-(f+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,f=s+s,h=a*c,d=a*u,p=a*f,m=o*u,g=o*f,v=s*f,y=l*c,x=l*u,b=l*f,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+b)*_,t[2]=(p-x)*_,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(h+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+x)*M,t[9]=(g-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-f-p,t[1]=u+v,t[2]=h-g,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+g,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,c,u,f,h,d,p,m,g=e[0],v=e[1],y=e[2],x=a[0],b=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":199,"./mat3.js":202,"./vec3.js":206,"./vec4.js":207}],205:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*f+i[0]*h,t[1]=e[1]*c+r[1]*u+n[1]*f+i[1]*h,t[2]=e[2]*c+r[2]*u+n[2]*f+i[2]*h,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":199}],207:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;g+=m[u]}return Math.abs(g-1)>.001?null:[f,function(t,e){for(var r=[0,0,0],n=0;n 0.25) {\n    discard;\n  }\n  gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  gl_Position = projection * view * model * vec4(position, 1.0);\n  f_id        = id;\n  f_position  = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3  position;\nattribute float pointSize;\nattribute vec4  id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n  if(any(lessThan(position, clipBounds[0])) || \n     any(greaterThan(position, clipBounds[1]))) {\n    gl_Position = vec4(0,0,0,0);\n  } else {\n    gl_Position  = projection * view * model * vec4(position, 1.0);\n    gl_PointSize = pointSize;\n  }\n  f_id         = id;\n  f_position   = position;\n}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n  gl_Position = projection * view * model * vec4(position, 1.0);\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n  gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],210:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,g,v,y,x,b,_,w,k,A,T,S){this.gl=t,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=w,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this._model=M,this._view=M,this._projection=M,this._resolution=[1,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("gl-vao"),s=t("gl-texture2d"),l=t("normals"),c=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),f=t("ndarray"),h=t("colormap"),d=t("simplicial-complex-contour"),p=t("typedarray-pool"),m=t("./lib/shaders"),g=t("./lib/closest-point"),v=m.meshShader,y=m.wireShader,x=m.pointShader,b=m.pickShader,_=m.pointPickShader,w=m.contourShader,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=n.prototype;k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){(p=this.triShader).bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){(p=this.lineShader).bind(),p.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){(p=this.pointShader).bind(),p.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var p;(p=this.contourShader).bind(),p.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||M,n=t.view||M,i=t.projection||M,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};if((l=this.pickShader).bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l;(l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},k.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;al[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n]&&M&&(e[1^n]-=T*d*x[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,M)),e[1^n]=T*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],kl[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n+2]&&M&&(e[1^n]+=T*d*x[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n+2],a.uniforms.angle=_[n+2],c.drawArrays(c.TRIANGLES,w,M))}}(),c.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var c=0;c<2;++c){var u=a[c],f=a[c+2]-u,h=.5*(o[c+2]+o[c]),d=o[c+2]-o[c],p=l[c],m=l[c+2]-p,g=s[c],v=s[c+2]-g;e[c]=2*f/d*m/v,t[c]=2*(u-h)/d*m/v}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,s=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;w[x]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,b,w),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":218,"./lib/create-attributes":219,"./lib/create-uniforms":220,"./lib/reflect":221,"./lib/runtime-reflect":222,"./lib/shader-cache":223}],218:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}(n.prototype=new Error).name="GLError",n.prototype.constructor=n,e.exports=n},{}],219:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],c=[],u=0;u=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,s,f)}else{if(!(h.indexOf("mat")>=0))throw new o("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);a(t,e,d,n,p,s,f)}}}return s};var o=t("./GLError"),s=n.prototype;s.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},s.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(s,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}})},{"./GLError":218}],220:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new o("","Unknown uniform data type for "+name+": "+r)}var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new o("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new o("","Unrecognized data type for vector "+name+": "+r)}}}function c(t,e){if("object"!=typeof e)return[[t,e]];var r=[];for(var n in e){var i=e[n],a=t;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"==typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function u(e){for(var n=["return function updateProperty(obj){"],i=c("",e),a=0;a4)throw new o("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new o("","Unknown uniform data type for "+name+": "+t)}}(r[c].type)}function h(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],h[p]):o.drawLine(e[0],m,e[2],m,d[p],h[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function i(t){return"boolean"!=typeof t||t}e.exports=function(t){function e(){if(!x&&U.autoResize){var t=b.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*U.pixelRatio),i=0|Math.ceil(r*U.pixelRatio);if(n!==b.width||i!==b.height){b.width=n,b.height=i;var a=b.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",O=!0}}}function r(){for(var t=z.length,e=P.length,r=0;r0&&0===I[e-1];)I.pop(),P.pop().dispose()}function g(){if(U.contextLost)return!0;_.isContextLost()&&(U.contextLost=!0,U.mouseListener.enabled=!1,U.selection.object=null,U.oncontextloss&&U.oncontextloss())}function v(){if(!g()){e();var t=U.camera.tick();j.view=U.camera.matrix,O=O||t,F=F||t,E.pixelRatio=U.pixelRatio,C.pixelRatio=U.pixelRatio;var r=z.length,i=G[0],a=G[1];i[0]=i[1]=i[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;oM.distance)continue;for(var c=0;c>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:o.mallocFloat32(s.length),c=a?t.idToIndex:o.mallocInt32(n);if(i||l.set(s),!a)for(l.set(s),r=0;r>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,o),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/s,t[4]=2/l,t[6]=-2*o[0]/s-1,t[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=u<5,i.uniforms.pointSize=u,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=e,this.pickOffset=r);var f=a.getParameter(a.BLEND),h=a.getParameter(a.DITHER);return f&&!this.blend&&a.disable(a.BLEND),h&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),f&&!this.blend&&a.enable(a.BLEND),h&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":227,"gl-buffer":165,"gl-shader":228,"typedarray-pool":554}],236:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),t[0]=s*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t}},{}],237:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];if(r||(r=i[e]={}),t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(F[1])){var R=O;O=F,F=R,R=I,I=P,P=R;var N=z;z=D,D=N}O[0]<0&&(I[z]=-1),F[1]>0&&(P[D]=-1);var j=0,B=0;for(C=0;C<4;++C)j+=Math.pow(d[4*z+C],2),B+=Math.pow(d[4*D+C],2);I[z]/=Math.sqrt(j),P[D]/=Math.sqrt(B),h.axes[0]=I,h.axes[1]=P,h.fragClipBounds[0]=l(A,S[0],E,-1e8),h.fragClipBounds[1]=l(A,S[1],E,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function u(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||v,s.view=n.view||v,s.projection=n.projection||v,x[0]=2/o.drawingBufferWidth,x[1]=2/o.drawingBufferHeight,s.screenSize=x,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=S,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}c(e,r,n,i),r.vao.unbind()}var f=t("gl-buffer"),h=t("gl-vao"),d=t("typedarray-pool"),p=t("gl-mat4/multiply"),m=t("./lib/shaders"),g=t("./lib/glyphs"),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=function(t){var e=t.gl,r=m.createPerspective(e),n=m.createOrtho(e),i=m.createProject(e),o=m.createPickPerspective(e),s=m.createPickOrtho(e),l=m.createPickProject(e),c=f(e),u=f(e),d=f(e),p=f(e),g=new a(e,r,n,i,c,u,d,p,h(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o,s,l);return g.update(t),g};var y=a.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},y.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var x=[0,0],b=[0,0,0],_=[0,0,0],w=[0,0,0,1],M=[0,0,0,1],k=v.slice(),A=[0,0,0],T=[[0,0,0],[0,0,0]],S=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];y.draw=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},y.drawTransparent=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},y.drawPick=function(t){u(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(e>=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},y.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},y.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,c=t.color,u=t.size,f=t.angle,h=t.lineColor,p=0,m=0,v=0,y=n.length;t:for(var x=0;x0&&(C[0]=-a[0]*(1+k[0][0]));var q=w.cells,H=w.positions;for(_=0;_0){var v=r*u;o.drawBox(f-v,h-v,d+v,h+v,a),o.drawBox(f-v,p-v,d+v,p+v,a),o.drawBox(f-v,h-v,f+v,p+v,a),o.drawBox(d-v,h-v,d+v,p+v,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":240,"gl-buffer":165,"gl-shader":243}],242:[function(t,e,r){"use strict";function n(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}e.exports=function(t,e){return new n(t,i(t,e),a.mallocUint8(e[0]*e[1]*4))};var i=t("gl-fbo"),a=t("typedarray-pool"),o=t("ndarray"),s=t("bit-twiddle").nextPow2,l=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(s(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;_[w]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,x,_),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":244,"./lib/create-attributes":245,"./lib/create-uniforms":246,"./lib/reflect":247,"./lib/runtime-reflect":248,"./lib/shader-cache":249}],244:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],245:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":244,dup:219}],246:[function(t,e,r){arguments[4][220][0].apply(r,arguments)},{"./GLError":244,"./reflect":247,dup:220}],247:[function(t,e,r){arguments[4][221][0].apply(r,arguments)},{dup:221}],248:[function(t,e,r){arguments[4][222][0].apply(r,arguments)},{dup:222}],249:[function(t,e,r){arguments[4][223][0].apply(r,arguments)},{"./GLError":244,dup:223,"gl-format-compiler-error":172,"weakmap-shim":576}],250:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],251:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n  vec3 vertexPosition = mix(coordinates[0],\n    mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n  vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n  vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n  vec2 delta = weight * clipOffset * screenShape;\n  vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n  gl_Position   = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n  fragColor     = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n  gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":243}],252:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders/index");e.exports=function(t,e){function r(t,e,r,n,i,a){var o=[t,e,r,0,0,0,1];o[n+3]=1,o[n]=i,s.push.apply(s,o),o[6]=-1,s.push.apply(s,o),o[n]=a,s.push.apply(s,o),s.push.apply(s,o),o[6]=1,s.push.apply(s,o),o[n]=i,s.push.apply(s,o)}var s=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=i(t,s),c=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=o(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new n(t,l,c,u);return f.update(e),f};var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=n.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||s,o=t.view||s,l=t.projection||s;this.axes&&(i=this.axes.lastCubeProps.axis);for(var h=c,d=u,p=0;p<3;++p)i&&i[p]<0?(h[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(h[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,h,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":251,"gl-buffer":165,"gl-vao":259}],253:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  worldCoordinate = vec3(uv.zw, f.x);\n  vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n  vec4 clipPosition = projection * view * worldPosition;\n  gl_Position = clipPosition;\n  kill = f.y;\n  value = f.z;\n  planeCoordinate = uv.xy;\n\n  vColor = texture2D(colormap, vec2(value, value));\n\n  //Lighting geometry parameters\n  vec4 cameraCoordinate = view * worldPosition;\n  cameraCoordinate.xyz /= cameraCoordinate.w;\n  lightDirection = lightPosition - cameraCoordinate.xyz;\n  eyeDirection   = eyePosition - cameraCoordinate.xyz;\n  surfaceNormal  = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(float x, float roughness) {\n  float NdotH = max(x, 0.0001);\n  float cos2Alpha = NdotH * NdotH;\n  float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n  float roughness2 = roughness * roughness;\n  float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n  return exp(tan2Alpha / roughness2) / denom;\n}\n\n\n\nfloat beckmannSpecular_1_1(\n  vec3 lightDirection,\n  vec3 viewDirection,\n  vec3 surfaceNormal,\n  float roughness) {\n  return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\n\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  if (kill > 0.0 ||\n    any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n    discard;\n  }\n\n  vec3 N = normalize(surfaceNormal);\n  vec3 V = normalize(eyeDirection);\n  vec3 L = normalize(lightDirection);\n\n  if(gl_FrontFacing) {\n    N = -N;\n  }\n\n  float specular = max(beckmannSpecular_1_1(L, V, N, roughness), 0.);\n  float diffuse  = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n  //decide how to interpolate color \u2014 in vertex or in fragment\n  vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + step(.5, vertexColor) * vColor;\n\n  vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular,  1.0);\n\n  gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n  vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n  vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n  vec4 clipPosition = projection * view * worldPosition;\n  clipPosition.z = clipPosition.z + zOffset;\n\n  gl_Position = clipPosition;\n  value = f;\n  kill = -1.0;\n  worldCoordinate = dataCoordinate;\n  planeCoordinate = uv.zw;\n\n  vColor = texture2D(colormap, vec2(value, value));\n\n  //Don't do lighting for contours\n  surfaceNormal   = vec3(1,0,0);\n  eyeDirection    = vec3(0,1,0);\n  lightDirection  = vec3(0,0,1);\n}\n",s="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n  float vh = 255.0 * v;\n  float upper = floor(vh);\n  float lower = fract(vh);\n  return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n  if(kill > 0.0 ||\n    any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n    discard;\n  }\n  vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n  vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n  gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n";r.createShader=function(t){var e=n(t,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,i,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":243}],254:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=s,this._contourShader=l,this._contourPickShader=c,this._contourBuffer=u,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=d,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}function i(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||O,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=F.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],b(l,t.model,l);var c=F.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return F.showSurface=o,F.showContour=s,F}function a(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=t.model||C,n.view=t.view||C,n.projection=t.projection||C,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.contourColor=this.contourColor[0],n.inverseModel=_(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var o=n.clipBounds[a],s=0;s<3;++s)o[s]=Math.min(Math.max(this.clipBounds[a][s],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=j,n.vertexColor=this.vertexColor;var l=N;for(b(l,n.view,n.model),b(l,n.projection,l),_(l,l),a=0;a<3;++a)n.eyePosition[a]=l[12+a]/l[15];var c=l[15];for(a=0;a<3;++a)c+=this.lightPosition[a]*l[4*a+3];for(a=0;a<3;++a){var u=l[12+a];for(s=0;s<3;++s)u+=l[4*s+a]*this.lightPosition[s];n.lightPosition[a]=u/c}var f=i(n,this);if(f.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=f.projections[a],this._shader.uniforms.clipBounds=f.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),a=0;a<3;++a)for(h.uniforms.permutation=D[a],r.lineWidth(this.contourWidth[a]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t};var O=[0,0,0],F={showSurface:!1,showContour:!1,projections:[C.slice(),C.slice(),C.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},R={model:C,view:C,projection:C,inverseModel:C.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},N=C.slice(),j=[1,0,0,0,1,0,0,0,1];P.draw=function(t){return a.call(this,t,!1)},P.drawTransparent=function(t){return a.call(this,t,!0)};var B={model:C,view:C,projection:C,inverseModel:C,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};P.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=B;r.model=t.model||C,r.view=t.view||C,r.projection=t.projection||C,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=j;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);var s=i(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var c=this._contourVAO;for(c.bind(),o=0;o<3;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=D[o],n=0;n>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var d=i+u,p=s+h,m=f*(h?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*m;for(var v=this._pickResult.level,y=0;y<3;++y)if(v[y]=w.le(this.contourLevels[y],c[y]),v[y]<0)this.contourLevels[y].length>0&&(v[y]=0);else if(v[y]Math.abs(b-c[y])&&(v[y]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},P.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=s(t.contourWidth,Number)),"showContour"in t&&(this.showContour=s(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=s(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=c(t.contourColor)),"contourProject"in t&&(this.contourProject=s(t.contourProject,function(t){return s(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=c(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=s(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=s(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(p.freeFloat(this._field[2].data),this._field[2].data=p.mallocFloat(u.nextPow2(n))),this._field[2]=y(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),o(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(p.freeFloat(this._field[a].data),this._field[a].data=p.mallocFloat(this._field[2].size)),this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(a=0;a<2;++a){var f=l[a];for(w=0;w<2;++w)if(f.shape[w]!==i[w])throw new Error("gl-surface: coords have incorrect shape");o(this._field[a],f)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var d=h[a];if((Array.isArray(d)||d.length)&&(d=y(d)),d.shape[0]!==i[a])throw new Error("gl-surface: invalid tick length");var b=y(d.data,i);b.stride[a]=d.stride[0],b.stride[1^a]=0,o(this._field[a],b)}}else{for(a=0;a<2;++a){var _=[0,0];_[a]=1,this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2],_,0)}this._field[0].set(0,0,0);for(var w=0;w0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=p.mallocFloat(nt.length);for(a=0;ai||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function a(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}function o(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function s(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function l(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,l,e,r,n,i)}var c=t("ndarray"),u=t("ndarray-ops"),f=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(h||function(t){h=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],d=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],p=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return l(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return l(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=n(e)?e:e.raw;if(r)return function(t,e,r,n,i,o){var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,o,e),new a(t,l,r,n,i,o)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var l=o(n,e.stride.slice()),h=0;"float32"===r?h=t.FLOAT:"float64"===r?(h=t.FLOAT,l=!1,r="float32"):"uint8"===r?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,l=!1,r="uint8");var d=0;if(2===n.length)d=t.LUMINANCE,n=[n[0],n[1],1],e=c(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])d=t.ALPHA;else if(2===n[2])d=t.LUMINANCE_ALPHA;else if(3===n[2])d=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}h!==t.FLOAT||t.getExtension("OES_texture_float")||(h=t.UNSIGNED_BYTE,l=!1);var p,g,v=e.size;if(l)p=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[n[2],n[2]*n[0],1];g=f.malloc(v,r);var x=c(g,n,y,0);"float32"!==r&&"float64"!==r||h!==t.UNSIGNED_BYTE?u.assign(x,e):m(x,e),p=g.subarray(0,v)}var b=s(t);return t.texImage2D(t.TEXTURE_2D,0,d,n[0],n[1],0,d,h,p),l||f.free(g),new a(t,b,n[0],n[1],d,h)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var h=null,d=null,p=null,m=function(t,e){u.muls(t,e,255)},g=a.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),p.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),p.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(p.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),g.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},g.setPixels=function(t,e,r,i){var a=this.gl;this.bind(),Array.isArray(e)?(i=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),i=i||0;var s=n(t)?t:t.raw;if(s){this._mipLevels.indexOf(i)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(i)):a.texSubImage2D(a.TEXTURE_2D,i,e,r,this.format,this.type,s)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>i||r+t.shape[0]>this._shape[0]>>>i||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,n,i,a,s,l){var h=l.dtype,d=l.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,g=0,v=o(d,l.stride.slice());if("float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,v=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,v=!1,h="uint8"),2===d.length)g=t.LUMINANCE,d=[d[0],d[1],1],l=c(l.data,d,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])g=t.ALPHA;else if(2===d[2])g=t.LUMINANCE_ALPHA;else if(3===d[2])g=t.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}d[2]}if(g!==t.LUMINANCE&&g!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(g=i),g!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),p===a&&v)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var b;b=a===t.FLOAT?f.mallocFloat32(y):f.mallocUint8(y);var _=c(b,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&a===t.UNSIGNED_BYTE?m(_,l):u.assign(_,l),x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,b.subarray(0,y)),a===t.FLOAT?f.freeFloat32(b):f.freeUint8(b)}}(a,e,r,i,this.format,this.type,this._mipLevels,t)}}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],256:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],265:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],266:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],267:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r-1?y:j.indexOf(t)>-1?v:g,e(z.join("")),C=l,E}return z.push(A),T=A,E+1}();break;case x:E=/[^\s]/g.test(A)?(e(z.join("")),C=l,E):(z.push(A),T=A,E+1);break;case l:z=z.length?[]:z,E="/"===T&&"*"===A?(O=L+E-1,C=u,T=A,E+1):"/"===T&&"/"===A?(O=L+E-1,C=f,T=A,E+1):"#"===A?(C=h,O=L+E,E):/\s/.test(A)?(C=x,O=L+E,E):(F=/\d/.test(A),R=/[^\w_]/.test(A),O=L+E,C=F?p:R?d:c,E)}if(r!==E)switch(N[r]){case"\n":P=0,++I;break;default:++P}}return L+=E,N=N.slice(E),D}function M(){return"\r"!==A&&"\n"!==A||"\\"===T?(z.push(A),T=A,E+1):(e(z.join("")),C=l,E)}function k(t){for(var r,n,a=0;;){if(r=i.indexOf(t.slice(0,t.length+a).join("")),n=i[r],-1===r){if(a--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),O+=n.length,(z=z.slice(n.length)).length}}var A,T,S,E=0,L=0,C=l,z=[],D=[],I=1,P=0,O=0,F=!1,R=!1,N="",j=a,B=n;return"300 es"===(t=t||{}).version&&(j=s,B=o),function(t){return D=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):(z.length&&e(z.join("")),C=b,e("(eof)"),D)}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,f=1,h=2,d=3,p=4,m=5,g=6,v=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":270,"./lib/builtins-300es":269,"./lib/literals":272,"./lib/literals-300es":271,"./lib/operators":273}],269:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":270}],270:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],271:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":272}],272:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],273:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],274:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=i.concat(r(t)),i=i.concat(r(null))}},{"./index":268}],275:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=c[h+0]&&n>=c[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),f=s;f<=c;f++)for(var h=l;h<=u;h++){var d=this.d*h+f;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;t[r+d]=255&o,d+=p,o/=256,c-=8);t[r+d-p]|=128*m}},{}],278:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return l(t.vertices,e.vertices)}function o(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=c[t];i||(i=c[t]=function(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=s[t+1];return i||(i=s),n(i)}(t)),this.orient=i}e.exports=function(t,e){var r=t.length;if(0===r)throw new Error("Must have at least d+1 points");var i=t[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var a=t.slice(0,i+1),l=s.apply(void 0,a);if(0===l)throw new Error("Input not in general position");for(var c=new Array(i+1),u=0;u<=i;++u)c[u]=u;l<0&&(c[0]=1,c[1]=0);var f=new n(c,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var p=c.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);h[u]=v,d[u]=v}for(d[i+1]=f,u=0;u<=i;++u){p=h[u].vertices;var y=h[u].adjacent;for(m=0;m<=i;++m){var x=p[m];if(x<0)y[m]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[m]=h[b])}}var _=new o(i,a,d),w=!!e;for(u=i+1;u0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=o;++b)y[b]<0?(x=b,l[b]=t):l[b]=s[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=d.slice(),M=p.slice(),k=new n(w,M,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,M[m]=v,w[g]=-1,M[g]=e,p[g]=k,k.flip();for(b=0;b<=o;++b){var T=w[b];if(!(T<0||T===r)){for(var S=new Array(o-1),E=0,L=0;L<=o;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new i(S,k,b))}}}}}}h.sort(a);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":515,"simplicial-complex":526}],279:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}function i(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function a(t,e){var r=p(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?v:(r.splice(n,1),a(t,r),y)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function u(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,h),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);return 2===(o=this.left.remove(t))?(this.left=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return v;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);return 2===(o=this.right.remove(t))?(this.right=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:v;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,o=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=o}i(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return y}for(a=g.ge(this.leftPoints,t,h);athis.mid){if(this.right){var r;if(r=this.right.queryPoint(t,e))return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n;if(n=this.right.queryInterval(t,e,r))return n}return ethis.mid?c(this.rightPoints,t,r):u(this.leftPoints,r)};var b=m.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==v}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":70}],280:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r4))}},{}],288:[function(t,e,r){"use strict";function n(t,e,r,n,a){e=e||function(t){return t[0]},r=r||function(t){return t[1]},a=a||Array,this.nodeSize=n||64,this.points=t,this.ids=new a(t.length),this.coords=new a(2*t.length);for(var o=0;o=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(g))}}return u}},{}],290:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(o,Math.floor(r+(l-c)*f/l+h)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):a(t,e,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],291:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){for(var s=[0,t.length-1,0],l=[],c=a*a;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],g=e[2*p+1];n(m,g,r,i)<=c&&l.push(t[p]);var v=(u+1)%2;(0===u?r-a<=m:i-a<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?r+a>=m:i+a>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],292:[function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);this.nodeSize=e||64,this.coords=t.slice();var r=Math.floor(t.length/2);this.ids=Array(r);for(var i=0;in;){if(i-n>600){var l=i-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);o(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(i,Math.floor(r+(l-c)*f/l+h)),a)}var d=e[2*r+a],p=n,m=i;for(s(t,e,n,r),e[2*i+a]>d&&s(t,e,n,i);pd;)m--}e[2*n+a]===d?s(t,e,n,m):s(t,e,++m,i),m<=r&&(n=m+1),r<=m&&(i=m-1)}}function s(t,e,r,n){l(t,r,n),l(e,2*r,2*n),l(e,2*r+1,2*n+1)}function l(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype.range=function(t,e,r,n){for(var i,a,o=this.ids,s=this.coords,l=this.nodeSize,c=[0,o.length-1,0],u=[];c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=l)for(var p=d;p<=h;p++)i=s[2*p],a=s[2*p+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[p]);else{var m=Math.floor((d+h)/2);i=s[2*m],a=s[2*m+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[m]);var g=(f+1)%2;(0===f?t<=i:e<=a)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?r>=i:n>=a)&&(c.push(m+1),c.push(h),c.push(g))}}return u},n.prototype.within=function(t,e,r){for(var n=this.ids,a=this.coords,o=this.nodeSize,s=[0,n.length-1,0],l=[],c=r*r;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(a[2*d],a[2*d+1],t,e)<=c&&l.push(n[d]);else{var p=Math.floor((h+f)/2),m=a[2*p],g=a[2*p+1];i(m,g,t,e)<=c&&l.push(n[p]);var v=(u+1)%2;(0===u?t-r<=m:e-r<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?t+r>=m:e+r>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],293:[function(t,e,r){"use strict";function n(t,e){var r;if(u(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],f=c||void 0!==t.property,h=c||!f,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(c){for(var p={},m=[],g=0;g=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?function(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n    // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = mod(a_pos, 2.0);\n    normal.y = sign(normal.y - 0.5);\n    v_normal = normal;\n\n    float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n    float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    // Remove the texture normal bit of the position before scaling it with the\n    // model/view matrix.\n    gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n    // position of y on the screen\n    float y = gl_Position.y / gl_Position.w;\n\n    // how much features are squished in the y direction by the tilt\n    float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n    // how much features are squished in all directions by the perspectiveness\n    float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n    v_linewidth = vec2(outset, inset);\n    v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_linewidth.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_linewidth.t) or when fading out\n    // (v_linewidth.s)\n    float blur = u_blur * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n    float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n    float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n    float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n    float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n    vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n    vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n    vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n    alpha *= u_opacity;\n\n    gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n    float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n    // We store the texture normals in the most insignificant bit\n    // transform y so that 0 => -1 and 1 => 1\n    // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = mod(a_pos, 2.0);\n    normal.y = sign(normal.y - 0.5);\n    v_normal = normal;\n\n    float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n    float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    // Remove the texture normal bit of the position before scaling it with the\n    // model/view matrix.\n    gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n    v_linesofar = a_linesofar;\n\n    // position of y on the screen\n    float y = gl_Position.y / gl_Position.w;\n\n    // how much features are squished in the y direction by the tilt\n    float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n    // how much features are squished in all directions by the perspectiveness\n    float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n    v_linewidth = vec2(outset, inset);\n    v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_linewidth.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_linewidth.t) or when fading out\n    // (v_linewidth.s)\n    float blur = u_blur * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n    float sdfdist_a = texture2D(u_image, v_tex_a).a;\n    float sdfdist_b = texture2D(u_image, v_tex_b).a;\n    float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n    alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n    gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n    float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n    // We store the texture normals in the most insignificant bit\n    // transform y so that 0 => -1 and 1 => 1\n    // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = mod(a_pos, 2.0);\n    normal.y = sign(normal.y - 0.5);\n    v_normal = normal;\n\n    float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n    float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    // Remove the texture normal bit of the position before scaling it with the\n    // model/view matrix.\n    gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n    v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n    v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n    // position of y on the screen\n    float y = gl_Position.y / gl_Position.w;\n\n    // how much features are squished in the y direction by the tilt\n    float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n    // how much features are squished in all directions by the perspectiveness\n    float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n    v_linewidth = vec2(outset, inset);\n    v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n    #pragma mapbox: initialize lowp vec4 outline_color\n    #pragma mapbox: initialize lowp float opacity\n\n    float dist = length(v_pos - gl_FragCoord.xy);\n    float alpha = smoothstep(1.0, 0.0, dist);\n    gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp vec4 outline_color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    // find distance to outline for alpha interpolation\n\n    float dist = length(v_pos - gl_FragCoord.xy);\n    float alpha = smoothstep(1.0, 0.0, dist);\n    \n\n    gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n    vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n    // the correct offset needs to be calculated.\n    //\n    // The offset depends on how many pixels are between the world origin and\n    // the edge of the tile:\n    // vec2 offset = mod(pixel_coord, size)\n    //\n    // At high zoom levels there are a ton of pixels between the world origin\n    // and the edge of the tile. The glsl spec only guarantees 16 bits of\n    // precision for highp floats. We need more than that.\n    //\n    // The pixel_coord is passed in as two 16 bit values:\n    // pixel_coord_upper = floor(pixel_coord / 2^16)\n    // pixel_coord_lower = mod(pixel_coord, 2^16)\n    //\n    // The offset is calculated in a series of steps that should preserve this precision:\n    vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n    vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n    v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n    v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n    v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n    vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n    // the correct offset needs to be calculated.\n    //\n    // The offset depends on how many pixels are between the world origin and\n    // the edge of the tile:\n    // vec2 offset = mod(pixel_coord, size)\n    //\n    // At high zoom levels there are a ton of pixels between the world origin\n    // and the edge of the tile. The glsl spec only guarantees 16 bits of\n    // precision for highp floats. We need more than that.\n    //\n    // The pixel_coord is passed in as two 16 bit values:\n    // pixel_coord_upper = floor(pixel_coord / 2^16)\n    // pixel_coord_lower = mod(pixel_coord, 2^16)\n    //\n    // The offset is calculated in a series of steps that should preserve this precision:\n    vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n    vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n    v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n    v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n    // read and cross-fade colors from the main and parent tiles\n    vec4 color0 = texture2D(u_image0, v_pos0);\n    vec4 color1 = texture2D(u_image1, v_pos1);\n    vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n    vec3 rgb = color.rgb;\n\n    // spin\n    rgb = vec3(\n        dot(rgb, u_spin_weights.xyz),\n        dot(rgb, u_spin_weights.zxy),\n        dot(rgb, u_spin_weights.yzx));\n\n    // saturation\n    float average = (color.r + color.g + color.b) / 3.0;\n    rgb += (average - rgb) * u_saturation_factor;\n\n    // contrast\n    rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n    // brightness\n    vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n    vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n    gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n    v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n    lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n    gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n    vec2 a_tex = a_texture_pos.xy;\n    mediump float a_labelminzoom = a_data[0];\n    mediump vec2 a_zoom = a_data.pq;\n    mediump float a_minzoom = a_zoom[0];\n    mediump float a_maxzoom = a_zoom[1];\n\n    // u_zoom is the current zoom level adjusted for the change in font size\n    mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n    vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n    if (u_rotate_with_map) {\n        gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n        gl_Position.z += z * gl_Position.w;\n    } else {\n        gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n    }\n\n    v_tex = a_tex / u_texsize;\n    v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n    lowp float dist = texture2D(u_texture, v_tex).a;\n    lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n    lowp float gamma = u_gamma * v_gamma_scale;\n    lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n    gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n    vec2 a_tex = a_texture_pos.xy;\n    mediump float a_labelminzoom = a_data[0];\n    mediump vec2 a_zoom = a_data.pq;\n    mediump float a_minzoom = a_zoom[0];\n    mediump float a_maxzoom = a_zoom[1];\n\n    // u_zoom is the current zoom level adjusted for the change in font size\n    mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n    // pitch-alignment: map\n    // rotation-alignment: map | viewport\n    if (u_pitch_with_map) {\n        lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n        lowp float asin = sin(angle);\n        lowp float acos = cos(angle);\n        mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n        vec2 offset = RotationMatrix * a_offset;\n        vec2 extrude = u_extrude_scale * (offset / 64.0);\n        gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n        gl_Position.z += z * gl_Position.w;\n    // pitch-alignment: viewport\n    // rotation-alignment: map\n    } else if (u_rotate_with_map) {\n        // foreshortening factor to apply on pitched maps\n        // as a label goes from horizontal <=> vertical in angle\n        // it goes from 0% foreshortening to up to around 70% foreshortening\n        lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n        lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n        // use the lineangle to position points a,b along the line\n        // project the points and calculate the label angle in projected space\n        // this calculation allows labels to be rendered unskewed on pitched maps\n        vec4 a = u_matrix * vec4(a_pos, 0, 1);\n        vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n        lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n        lowp float asin = sin(angle);\n        lowp float acos = cos(angle);\n        mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n        vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n        vec2 extrude = u_extrude_scale * (offset / 64.0);\n        gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n        gl_Position.z += z * gl_Position.w;\n    // pitch-alignment: viewport\n    // rotation-alignment: viewport\n    } else {\n        vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n        gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n    }\n\n    v_gamma_scale = (gl_Position.w - 0.5);\n\n    v_tex = a_tex / u_texsize;\n    v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n    float alpha = 0.5;\n\n    gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n    if (v_placement_zoom > u_zoom) {\n        gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n    }\n\n    if (u_zoom >= v_max_zoom) {\n        gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n    }\n\n    if (v_placement_zoom >= u_maxzoom) {\n        gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n    }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n    v_max_zoom = a_data.x;\n    v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n    if (t < 1.0) {\n        return mix(values[0], values[1], t);\n    } else if (t < 2.0) {\n        return mix(values[1], values[2], t - 1.0);\n    } else {\n        return mix(values[2], values[3], t - 2.0);\n    }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n    if (t < 1.0) {\n        return mix(value0, value1, t);\n    } else if (t < 2.0) {\n        return mix(value1, value2, t - 1.0);\n    } else {\n        return mix(value2, value3, t - 2.0);\n    }\n}\n"},{path:468}],295:[function(t,e,r){"use strict";var n=t("util").format;e.exports=function(t,e){this.message=(t?t+": ":"")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:563}],296:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:h.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?f[c.type]:c}))}},{"../error/validation_error":295,"../util/extend":296,"../util/get_type":297,"./validate_array":300,"./validate_boolean":301,"./validate_color":302,"./validate_constants":303,"./validate_enum":304,"./validate_filter":305,"./validate_function":306,"./validate_layer":308,"./validate_number":310,"./validate_object":311,"./validate_source":313,"./validate_string":314}],300:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":295,"../util/get_type":297}],304:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298}],305:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(r=a(s[1]))?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var f=2;f=8&&(f&&!t.valueSpec["property-function"]?d.push(new n(t.key,t.value,"property functions not supported")):h&&!t.valueSpec["zoom-function"]&&d.push(new n(t.key,t.value,"zoom functions not supported"))),d}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299,"./validate_array":300,"./validate_number":310,"./validate_object":311}],307:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":295,"./validate_string":314}],308:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,f=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],311:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],f=i(r);if("object"!==f)return[new n(e,r,"object expected, %s found",f)];for(var h in r){var d=h.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:h})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[h],'unknown property "%s"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299}],312:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":295,"./validate":299}],313:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298,"./validate_enum":304,"./validate_object":311}],314:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],315:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:c}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),c=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":316,"./validate/validate":299,"./validate/validate_constants":303,"./validate/validate_filter":305,"./validate/validate_glyphs_url":307,"./validate/validate_layer":308,"./validate/validate_layout_property":309,"./validate/validate_paint_property":312,"./validate/validate_source":313}],316:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":317}],317:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],318:[function(t,e,r){"use strict";function n(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&function(t){void 0===i[t]&&(i[t]=function(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],319:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":433}],320:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},a=0;a1?p.name+b:p.name]=m[b]*g}}},n.VertexArrayType=function(t){return new c({members:t,alignment:4})},n.ElementArrayType=function(t){return new c({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":431,"../util/util":433,"./array_group":319,"./bucket/circle_bucket":321,"./bucket/fill_bucket":322,"./bucket/line_bucket":323,"./bucket/symbol_bucket":324,"./buffer_group":326,assert:51,"feature-filter":141}],321:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,(n.prototype=a.inherit(i,{})).addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||u<0||u>=s)){var f=this.prepareArrayGroup("circle",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,c,u,-1,-1);this.addCircleVertex(h,c,u,1,-1),this.addCircleVertex(h,c,u,1,1),this.addCircleVertex(h,c,u,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],322:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,(n.prototype=a.inherit(i,{})).programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var u=0;u=1&&n.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,c=t[0],u=t[a-1],f=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var h,d,p,m,g,v,y,x=r,b=f?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,f&&(h=t[a-2],g=c.sub(h)._unit()._perp());for(var w=0;w0){var S=h.dist(d);if(S>2*o){var E=h.sub(h.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?x:b;if(L&&"round"===C&&(An&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A100)M=g.clone();else{var z=m.x*g.y-m.y*g.x>0?-1:1,D=A*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(D*z)}this.addCurrentVertex(h,this.distance,M,0,0,!1),this.addCurrentVertex(h,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var I=m.x*g.y-m.y*g.x>0,P=-Math.sqrt(A*A-1);if(I?(y=0,v=P):(v=0,y=P),_||this.addCurrentVertex(h,this.distance,m,v,y,!1),"fakeround"===C){for(var O,F=Math.floor(8*(.5-(k-.5))),R=0;R=0;N--)O=m.mult((N+1)/(F+1))._add(g)._unit(),this.addPieSliceVertex(h,this.distance,O,I)}p&&this.addCurrentVertex(h,this.distance,g,-v,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(h,this.distance,m,0,0,!1),p&&this.addCurrentVertex(h,this.distance,g,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(h,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(h,this.distance,g,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(h,this.distance,m,0,0,!1),this.addCurrentVertex(h,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(h,this.distance,g,-1,-1,!0),this.addCurrentVertex(h,this.distance,g,0,0,!1)));if(T&&w2*o){var B=h.add(p.sub(h)._mult(o/j)._round());this.distance+=B.dist(h),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),h=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,f=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>c/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],324:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),c=t("../../util/token"),u=t("../../symbol/quads"),f=t("../../symbol/shaping"),h=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=f.shapeText,x=f.shapeIcon,b=u.getGlyphQuads,_=u.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,(n.prototype=m.inherit(o,{})).serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var f="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,h=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,v=24*a["text-letter-spacing"],b=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;kw||L.y<0||L.y>w);if(!d||C){var z=C||b;this.addSymbolInstance(L,T,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,f,g,x,{zoom:this.zoom},n.properties)}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,x=p.br,b=p.tex,_=p.anchorPoint,w=Math.max(f+Math.log(p.minScale)/Math.LN2,h),M=Math.min(f+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===h&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(u,_.x,_.y,g.x,g.y,b.x,b.y,w,M,h,k);i(u,_.x,_.y,v.x,v.y,b.x+b.w,b.y,w,M,h,k),i(u,_.x,_.y,y.x,y.y,b.x,b.y+b.h,w,M,h,k),i(u,_.x,_.y,x.x,x.y,b.x+b.w,b.y+b.h,w,M,h,k),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(I,P,O,F,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":382,"../../symbol/clip_line":384,"../../symbol/collision_feature":386,"../../symbol/get_anchors":388,"../../symbol/mergelines":391,"../../symbol/quads":392,"../../symbol/resolve_text":393,"../../symbol/shaping":394,"../../util/token":432,"../../util/util":433,"../bucket":320,"../load_geometry":328,"point-geometry":477}],325:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=l.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||h.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":433,"./bucket":320,assert:51}],329:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],330:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":433}],331:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":330}],332:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),c=t("../source/tile_coord"),u=t("../data/bucket").EXTENT,f=t("gl-matrix"),h=f.vec4,d=f.mat4,p=f.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.locationCoordinate(this.center)._zoomTo(e),i=new a(n.column-.5,n.row-.5);return c.cover(e,[this.pointCoordinate(new a(0,0))._zoomTo(e),this.pointCoordinate(new a(this.width,0))._zoomTo(e),this.pointCoordinate(new a(this.width,this.height))._zoomTo(e),this.pointCoordinate(new a(0,this.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return i.dist(t)-i.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];h.transformMat4(e,e,this.pixelMatrixInverse),h.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,c=e[1]/n,u=r[1]/i,f=e[2]/n,d=r[2]/i,p=f===d?0:(0-f)/(d-f),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return h.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof c&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/u,n/u,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":320,"../source/tile_coord":360,"../util/interpolate":427,"../util/util":433,"./coordinate":329,"./lng_lat":330,"gl-matrix":198,"point-geometry":477}],333:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,f,h,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&b,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{"../source/pixels_to_tile_units":354,"./create_uniform_pragmas":335}],337:[function(t,e,r){"use strict";var n=t("../util/browser");e.exports=function(t,e,r,i){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,h>>16),s.uniform2f(o.u_pixel_coord_lower,65535&f,65535&h),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}var i=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,i){var a=t.gl;a.enable(a.STENCIL_TEST);var o;if(o=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"],t.isOpaquePass===o){t.setDepthSublayer(1);for(var s=0;s0?1-1/(1.001-t):-t}(r.paint["raster-saturation"])),a.uniform1f(l.u_contrast_factor,function(t){return t>0?1/(1-t):1+t}(r.paint["raster-contrast"])),a.uniform3fv(l.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint["raster-hue-rotate"]));var c,u,f=o.source&&o.source.findLoadedParent(n,0,{}),h=function(t,e,r,n){var a=[1,0],o=r.paint["raster-fade-duration"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=n.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||f?(a[0]=i.clamp(l,0,1),a[1]=1-a[0]):(a[0]=i.clamp(1-c,0,1),a[1]=1-a[0])}var h=r.paint["raster-opacity"];return a[0]*=h,a[1]*=h,a}(o,f,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o.texture),a.activeTexture(a.TEXTURE1),f?(a.bindTexture(a.TEXTURE_2D,f.texture),c=Math.pow(2,f.coord.z-o.coord.z),u=[o.coord.x*c%1,o.coord.y*c%1]):(a.bindTexture(a.TEXTURE_2D,o.texture),h[1]=0);a.uniform2fv(l.u_tl_parent,u||[0,0]),a.uniform1f(l.u_scale_parent,c||1),a.uniform1f(l.u_buffer_scale,1),a.uniform1f(l.u_opacity0,h[0]),a.uniform1f(l.u_opacity1,h[1]),a.uniform1i(l.u_image0,0),a.uniform1i(l.u_image1,1);var d=o.boundsBuffer||t.rasterBoundsBuffer;(o.boundsVAO||t.rasterBoundsVAO).bind(a,l,d),a.drawArrays(a.TRIANGLE_STRIP,0,d.length)}(t,e,r,l)}a.depthFunc(a.LEQUAL)}}var i=t("../util/util"),a=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new a({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":431,"../util/util":433}],343:[function(t,e,r){"use strict";function n(t,e,r,n,a,s,l,c,u,f,h,d,p,m,g){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=(e-this.changeTimes[r])/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+n:this.changeOpacities[r]-n}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],345:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":320,"../data/buffer":325,"../source/pixels_to_tile_units":354,"../source/source_cache":358,"../util/browser":417,"../util/struct_array":431,"../util/util":433,"./create_uniform_pragmas":335,"./draw_background":336,"./draw_circle":337,"./draw_debug":339,"./draw_fill":340,"./draw_line":341,"./draw_raster":342,"./draw_symbol":343,"./frame_history":344,"./painter/use_program":347,"./vertex_array_object":348,"gl-matrix":198}],347:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),f=o[t],h="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":320,"../util/evented":425,"../util/util":433,"resolve-url":508}],350:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),f.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),c=t("supercluster"),u=t("geojson-vt"),f=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(f,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,c(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":416,"../util/util":433,"./geojson_wrapper":351,"./vector_tile_worker_source":362,"geojson-rewind":147,"geojson-vt":151,supercluster:538,"vt-pbf":570}],351:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;(a=this._tiles[s])&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),u={},f=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rf-(e||0)&&(this.findLoadedChildren(i,l,u)&&(u[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)u[y]||(this._coveredTiles[y]=!0);for(y in p)u[y]=!0;var x=h.keysDifference(this._tiles,u);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,u=0;u=0&&v[1].y>=0){for(var y=[],x=0;x=0&&t%1==0),s(!isNaN(e)&&e>=0&&e%1==0),s(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function a(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hu.dy&&(l=c,c=u,u=l),c.dy>f.dy&&(l=c,c=f,f=l),u.dy>f.dy&&(l=u,u=f,f=l),c.dy&&a(f,c,n,o,s),u.dy&&a(f,u,n,o,s)}var s=t("assert"),l=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<0;a--)i+=(e&(n=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var o,l;if(i>=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":425,"../util/mapbox":430,"../util/util":433,"./load_tilejson":353}],362:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new s(t);i.abort=this.loadVectorData(t,function(t,a){return delete this.loading[r][n],t?e(t):a?(i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},void(this.loaded[r][n]=i)):e(null,null)}.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){var r=i.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":416,"./worker_tile":365,pbf:470,"vector-tile":564}],363:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,c.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),c=t("../util/ajax"),u=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,h=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*u),Math.round((e.row-n.row)*u))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new f;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new h(e.serialize(),f.serialize(),h.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":320,"../data/buffer":325,"../geo/lng_lat":330,"../render/draw_raster":342,"../render/vertex_array_object":348,"../util/ajax":416,"../util/evented":425,"../util/util":433,"./tile_coord":360,"point-geometry":477}],364:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new c(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),c=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)x(E,P[e]);b()}}function x(t,e){if(e.populateArrays(A,N,R),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=u.create({layer:w,index:z++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")})).createFilter(),L[w.id]=k,t.layers&&(C[M=w.sourceLayer]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&v(w,C[M]);else v(t,L);var I=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var F in L)0!==(k=L[F]).features.length&&(T.bucketLayerIDs[k.index]=k.childLayers.map(s),I.push(k),"symbol"===k.type?P.push(k):O.push(k));var R={},N={},j=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(R),P[_].updateFont(N);for(var B in N)N[B]=Object.keys(N[B]).map(Number);R=Object.keys(R),r.send("get glyphs",{uid:this.uid,stacks:N},function(t,e){N=e,y(t)}),R.length?r.send("get icons",{icons:R},function(t,e){R=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)x(0,O[_]);if(0===P.length)return b()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new c(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var u=n.serialize(),f=s.filter(i);return{result:{buckets:f.map(a),collisionTile:u.data},transferables:o(f).concat(u.transferables)}}},{"../data/bucket":320,"../data/feature_index":327,"../symbol/collision_box":385,"../symbol/collision_tile":387,"../symbol/symbol_instances":396,"../symbol/symbol_quads":397,"../util/dictionary_coder":423,"../util/util":433}],366:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],367:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":416,"../util/browser":417,"../util/evented":425,"../util/mapbox":430}],368:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":433,"./style_function":371,csscolorparser:114}],369:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new c(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},u.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)this.fire("error",{error:t});else if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?f.getJSON(h(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),c=t("../render/line_atlas"),u=t("../util/util"),f=t("../util/ajax"),h=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),x=t("../source/source_cache"),b=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=u.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new x(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+r.id+".filter",e)?this:u.deepEqual(r.filter,e)?this:(r.filter=u.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return u.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(u.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);return!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:u.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=c+(1-c)*u,f*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-u)*c,a=t({zoom:o},r),i=t({zoom:o+1},r),f/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:f,to:a,toScale:1,t:n}}}(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var o=[],s=this.value.stops,l=0;l=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}},{}],384:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports=function(t,e,r,i,a){for(var o=[],s=0;s=i&&h.x>=i||(f.x>=i?f=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),l&&f.equals(l[l.length-1])||(l=[f],o.push(l)),l.push(h)))))}return o}},{"point-geometry":477}],385:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":431,"../util/util":433,"point-geometry":477}],386:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var f=o.top*s-l,h=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=h-f,g=p-d;if(m>0)if(m=Math.max(10*s,m),u){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,f,p,h,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var c=a/2,u=Math.floor(i/c),f=-a/2,h=this.boxes,d=r,p=n+1,m=f;do{if(--p<0)return h;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v=e.length)return h;g=e[p].dist(e[p+1])}var x=y-m,b=e[p],_=e[p+1].sub(b)._unit()._mult(x)._add(b)._round(),w=i/2/Math.max(Math.abs(y-f)-c/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return h}},{}],387:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(c.x1,c.y1).matMult(w),k=new i(c.x2,c.y1).matMult(w),A=new i(c.x1,c.y2).matMult(w),T=new i(c.x2,c.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,k.x,A.x,T.x),_.y1=Math.min(M.y,k.x,A.x,T.x),_.x2=Math.max(M.x,k.x,A.x,T.x),_.y2=Math.max(M.y,k.x,A.x,T.x),_.maxScale=c.maxScale}else _=c;for(var S=0;S=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new i(t,e)._matMult(c),f=this.tempCollisionBox;f.anchorX=u.x,f.anchorY=u.y,f.x1=0,f.y1=0,f.x2=r-t,f.y2=n-e,f.maxScale=a,a=f.maxScale;for(var h=[u.x+f.x1/a,u.y+f.y1/a*this.yStretch,u.x+f.x2/a,u.y+f.y2/a*this.yStretch],d=this.grid.query(h[0],h[1],h[2],h[3]),p=this.ignoredGrid.query(h[0],h[1],h[2],h[3]),m=0;m=a&&(o[y][x]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var f=Math.min(Math.max(s,l),Math.max(c,u)),h=i.maxScale,d=r.maxScale;return f>h&&(f=h),f>d&&(f=d),f>t&&f>=i.placementScale&&(t=f),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&A=0&&T=0&&v+d<=p){var S=new a(A,T,M,x)._round();s&&!o(t,S,c,s,l)||y.push(S)}}g+=w}return f||y.length||u||(y=n(t,g/2,r,s,l,c,u,!0,h)),y}var i=t("../util/interpolate"),a=t("../symbol/anchor"),o=t("./check_max_angle");e.exports=function(t,e,r,i,a,o,s,l,c){var u=i?.6*o*s:0,f=Math.max(i?i.right-i.left:0,a?a.right-a.left:0),h=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;return e-f*s=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=function(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}(t,256*e+"-"+(256*e+255),this.url);o(i,function(t,r){for(var i=!t&&new s(new c(new Uint8Array(r))),a=0;an&&null!==f){var x=g[f+1].x;m=Math.max(x,m);for(var b=f+1;b<=v;b++)g[b].y+=r,g[b].x-=x;if(c){var _=f;a[g[f].codePoint]&&_--,i(g,e,d,_,c)}d=f+1,f=null,h+=x,p++}o[y.codePoint]&&(f=v)}var w=g[g.length-1],M=w.x+e[w.codePoint].advance;m=Math.max(m,M);var k=(p+1)*r;i(g,e,d,g.length-1,c),function(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(f?(clearTimeout(f),f=null,o("dblclick",e)):f=setTimeout(r,300))},!1),l.addEventListener("touchend",function(t){s("touchend",t)},!1),l.addEventListener("touchmove",function(t){s("touchmove",t)},!1),l.addEventListener("touchcancel",function(t){s("touchcancel",t)},!1),l.addEventListener("click",function(t){n.mousePos(l,t).equals(u)&&o("click",t)},!1),l.addEventListener("dblclick",function(t){o("dblclick",t),t.preventDefault()},!1),l.addEventListener("contextmenu",function(t){c=t,t.preventDefault()},!1)}},{"../util/dom":419,"./handler/box_zoom":404,"./handler/dblclick_zoom":405,"./handler/drag_pan":406,"./handler/drag_rotate":407,"./handler/keyboard":408,"./handler/scroll_zoom":409,"./handler/touch_zoom_rotate":410,"point-geometry":477}],399:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),c=e.exports=function(){};n.extend(c.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&p.lng<0?p.lng+=360:c.center.lng<0&&p.lng>0&&(p.lng-=360));var y=c.zoomScale(m-f),x=c.point,b="center"in t?c.project(p).sub(u.div(y)):x,_=c.worldSize,w=t.curve,M=Math.max(c.width,c.height),k=M/y,A=b.sub(x).mag();if("minZoom"in t){var T=n.clamp(Math.min(t.minZoom,f,m),c.minZoom,c.maxZoom),S=M/c.zoomScale(T-f);w=Math.sqrt(S/A*2)}var E=w*w,L=r(0),C=function(t){return s(L)/s(L+w*t)},z=function(t){return M*((s(L)*function(t){return a(t)/s(t)}(L+w*t)-a(L))/E)/A},D=(r(1)-L)/w;if(Math.abs(A)<1e-6){if(Math.abs(M-k)<1e-6)return this.easeTo(t);var I=k=0)return!1;return!0})).join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],401:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":425,"../../util/util":433}],402:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433,"./control":401}],403:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],404:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":331,"../../util/dom":419,"../../util/util":433}],405:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],406:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)e();else{var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=a.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,f=l.mult(-u/2);this._map.panBy(f,{duration:1e3*u,easing:o,noMoveStart:!0},{originalEvent:t})}}}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],407:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;c+=f*d*(p/2),Math.abs(e._normalizeBearing(c,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433,"point-geometry":477}],408:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],409:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),c=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,c&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433}],410:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var c={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,c=(n[0]-i[0])/1e3,u=n[2];if(0!==c&&a!==s){var f=.15*l/c;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var h=1e3*Math.abs(f/(12*.15)),d=a+f*h/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:h,easing:o,around:r.unproject(u)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],411:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":433}],412:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),c=t("../util/dom"),u=t("../style/style"),f=t("../style/animation_loop"),h=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),x=t("point-geometry"),b=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=a.extend({},_,t)).workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new f,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new b(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new x(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(x.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof x||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[x.convert([0,0]),x.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof x||"number"==typeof t[0]){e=[x.convert(t)]}else{var r=[x.convert(t[0]),x.convert(t[1])];e=[r[0],new x(r[1].x,r[0].y),r[1],new x(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof u?t:new u(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new h(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":330,"../geo/lng_lat_bounds":331,"../geo/transform":332,"../render/painter":346,"../style/animation_loop":366,"../style/style":369,"../util/browser":417,"../util/canvas":418,"../util/dom":419,"../util/evented":425,"../util/util":433,"./bind_handlers":398,"./camera":399,"./control/attribution":400,"./hash":411,"point-geometry":477}],413:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":330,"../util/dom":419,"point-geometry":477}],414:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)r.appendChild(e);return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":330,"../util/dom":419,"../util/evented":425,"../util/util":433}],415:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],416:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":318}],418:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":433,"mapbox-gl-supported":318}],419:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var u=0;u=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i(e.y-t.y)*(r.x-t.x)}function a(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}(t,e[i-1],e[i])e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function s(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,r){for(var n=0;n=3)for(var u=0;u1){if(n(t,e))return!0;for(var i=0;ithis.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],430:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||a.ACCESS_TOKEN)&&a.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,a.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",a.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}var a=t("./config"),o=t("./browser"),s=t("url"),l=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=s.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==s.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=s.parse(t);if("mapbox:"!==r.protocol)return t;return n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=s.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,s.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=s.parse(t,!0);if(!e)return t;if("mapbox:"!==s.parse(e).protocol)return t;var i=o.supportsWebp?".webp":"$1",c=o.devicePixelRatio>=2||512===r?"@2x":"";return s.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,c+i),query:function(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?l.extend({},t,{access_token:a.ACCESS_TOKEN}):t}(n.query)})}},{"./browser":417,"./config":422,"./util":433,url:559}],431:[function(t,e,r){"use strict";function n(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function i(t,e){return Math.ceil(t/e)*e}function a(t){return f[t].BYTES_PER_ELEMENT}function o(t){return t.toLowerCase()}function s(t,e){var r="this._pos"+a(t.type).toFixed(0)+" + "+(t.offset/a(t.type)+e).toFixed(0);return"this._structArray."+o(t.type)+"["+r+"]"}function l(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function c(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var u=t("assert");e.exports=function(t){function e(){l.apply(this,arguments)}function r(){c.apply(this,arguments),this.members=e.prototype.members}var d=JSON.stringify(t);if(h[d])return h[d];void 0===t.alignment&&(t.alignment=1);var p=0,m=0,g=["Uint8"];return(e.prototype=Object.create(l.prototype)).members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},u(r.name.length),u(r.type in f),g.indexOf(r.type)<0&&g.push(r.type);var n=a(r.type);m=Math.max(m,n),r.offset=p=i(p,Math.max(t.alignment,n));for(var o=0;othis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},c.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":329,unitbezier:557}],434:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],435:[function(t,e,r){e.exports={_args:[["[email protected]","/Users/alex/plotly/plotly.js"]],_from:"[email protected]",_id:"[email protected]",_inBundle:!1,_integrity:"sha1-kqllVH1MLyTCLLxIfu2khpTLYno=",_location:"/mapbox-gl",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"[email protected]",name:"mapbox-gl",escapedName:"mapbox-gl",rawSpec:"0.22.1",saveSpec:null,fetchSpec:"0.22.1"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_spec:"0.22.1",_where:"/Users/alex/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},engines:{node:">=4.0.0"},homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",name:"mapbox-gl",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint  --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],436:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;ip[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":438,"gl-mat4/clone":180,"gl-mat4/create":181,"gl-mat4/determinant":182,"gl-mat4/invert":186,"gl-mat4/transpose":196,"gl-vec3/cross":260,"gl-vec3/dot":261,"gl-vec3/length":262,"gl-vec3/normalize":264}],438:[function(t,e,r){e.exports=function(t,e){var r=e[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)t[i]=e[i]*n;return!0}},{}],439:[function(t,e,r){function n(){return{translate:i(),scale:i(1),skew:i(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function i(t){return[t||0,t||0,t||0]}var a=t("gl-vec3/lerp"),o=t("mat4-recompose"),s=t("mat4-decompose"),l=t("gl-mat4/determinant"),c=t("quat-slerp"),u=n(),f=n(),h=n();e.exports=function(t,e,r,n){if(0===l(e)||0===l(r))return!1;var i=s(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),d=s(r,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!(!i||!d||(a(h.translate,u.translate,f.translate,n),a(h.skew,u.skew,f.skew,n),a(h.scale,u.scale,f.scale,n),a(h.perspective,u.perspective,f.perspective,n),c(h.quaternion,u.quaternion,f.quaternion,n),o(t,h.translate,h.scale,h.skew,h.perspective,h.quaternion),0))}},{"gl-mat4/determinant":182,"gl-vec3/lerp":263,"mat4-decompose":437,"mat4-recompose":440,"quat-slerp":490}],440:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.exports=function(t,e,r,a,o,s){return n.identity(t),n.fromRotationTranslation(t,s,e),t[3]=o[0],t[7]=o[1],t[11]=o[2],t[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(t,t,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(t,t,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(t,t,i)),n.scale(t,t,r),t}},{"gl-mat4/create":181,"gl-mat4/fromRotationTranslation":184,"gl-mat4/identity":185,"gl-mat4/multiply":188,"gl-mat4/scale":194,"gl-mat4/translate":195}],441:[function(t,e,r){"use strict";function n(t){this._components=t.slice(),this._time=[0],this.prevMatrix=t.slice(),this.nextMatrix=t.slice(),this.computedMatrix=t.slice(),this.computedInverse=t.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}var i=t("binary-search-bounds"),a=t("mat4-interpolate"),o=t("gl-mat4/invert"),s=t("gl-mat4/rotateX"),l=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),h=(t("gl-mat4/scale"),t("gl-vec3/normalize")),d=[0,0,0];e.exports=function(t){return new n((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=n.prototype;p.recalcMatrix=function(t){var e=this._time,r=i.le(e,t),n=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)n[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)f[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],d=d&&f[c]===p[c];if(u<1e-6||d)for(c=0;c<16;++c)n[c]=f[c];else a(n,f,p,(t-e[r])/u)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],h(m,m);var g=this.computedInverse;o(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-n[2+4*c]*b}},p.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var f=0,h=(i=0,o.length);i0;--d)r[f++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":515}],443:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==m.alt,m.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==m.shift,m.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==m.control,m.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==m.meta,m.meta=!!t.metaKey),e}function i(t,i){var a=n.x(i),o=n.y(i);"buttons"in i&&(t=0|i.buttons),(t!==h||a!==d||o!==p||r(i))&&(h=0|t,d=a||0,p=o||0,e&&e(h,d,p,m))}function a(t){i(0,t)}function o(){(h||d||p||m.shift||m.alt||m.meta||m.control)&&(d=p=0,h=0,m.shift=m.alt=m.control=m.meta=!1,e&&e(0,0,0,m))}function s(t){r(t)&&e&&e(h,d,p,m)}function l(t){0===n.buttons(t)?i(0,t):i(h,t)}function c(t){i(h|n.buttons(t),t)}function u(t){i(h&~n.buttons(t),t)}function f(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var h=0,d=0,p=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;f();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return g},set:function(e){e?f():g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",c),t.removeEventListener("mouseup",u),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":445}],444:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?n:t.getBoundingClientRect()}(e);return r[0]=i-o.left,r[1]=a-o.top,r}},{}],445:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.buttons=function(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){if(2===(e=t.which))return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<0;k=k-1&m)b.push(_+"["+A+"+"+g(k)+"]");for(b.push(v(0)),k=0;k=0;--e)L(e,0);var r=[];for(e=0;e0){",h(S[t]),"=1;"),D(t-1,e|1<0&&q.push(s(j,S[B-1])+"*"+o(S[B-1])),R.push(d(j,S[B])+"=("+q.join("-")+")|0")}for(j=0;j=0;--j)H.push(o(S[j]));R.push(k+"=("+H.join("*")+")|0",w+"=mallocUint32("+k+")",_+"=mallocUint32("+k+")",A+"=0"),R.push(p(0)+"=0");for(B=1;B<1< 0"),"function"!=typeof t.vertex&&e("Must specify vertex creation function"),"function"!=typeof t.cell&&e("Must specify cell creation function"),"function"!=typeof t.phase&&e("Must specify phase function");for(var a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return x(t.vertex,t.cell,t.phase,i,r,o)};var _="V",w="P",M="N",k="Q",A="X",T="T"},{"typedarray-pool":554}],448:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":119}],449:[function(t,e,r){"use strict";function n(t){if(t in o)return o[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(c=""),r>0){for(a.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");for(a.push("){grad",r,"(src.pick(",s.join(),")",c),l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",c);a.push(");")}for(l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",u,",0);"):a.push("zero(",f,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===r?a.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>2){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}var r=t.join();if(v=s[r])return v;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],l=0;l<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=a({args:["array","array"],pre:o,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":116}],453:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":454,ndarray:458}],454:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":116}],455:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[a.mallocUint8,a.freeUint8];case"uint16":return[a.mallocUint16,a.freeUint16];case"uint32":return[a.mallocUint32,a.freeUint32];case"int8":return[a.mallocInt8,a.freeInt8];case"int16":return[a.mallocInt16,a.freeInt16];case"int32":return[a.mallocInt32,a.freeInt32];case"float32":return[a.mallocFloat,a.freeFloat];case"float64":return[a.mallocDouble,a.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",f,"*n",f].join("")):s.push(["d",d,"=s",d].join("")),f=d);var p;0!=(p=t.length-1-l)&&(h>0?s.push(["e",p,"=s",p,"-e",h,"*n",h,",f",p,"=",c[p],"-f",h,"*n",h].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),h=p)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",o,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+a);var g=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),c=n(e),u=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var f=[],h=1;h1){for(o.push("dptr=0;sptr=ptr"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),h=t.length-1;h>=1;--h)o.push("sptr+=e"+h,"dptr+=f"+h,"}");for(o.push("dptr=cptr;sptr=cptr-s0"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));return o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c?new Function("malloc","free",o.join("\n"))(c[0],c[1]):new Function(o.join("\n"))()}(t,e);return g(v,function(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function s(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function l(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function c(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i)0!==(o=t[i])&&_.push(["for(i",o,"=0;i",o,"1)for(i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function u(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function f(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++A;u(o,[n,i],!1,["comp=",s("ptr0"),"-",s("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else _.push(["if(",s(a(n)),">",s(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?c([e,r],!1,l("ptr0",s("ptr1"))):_.push(l(a(e),s(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;u(i,[r],!0,[e,"=",s("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",s(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?c([e,r],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(c([e,r,n],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?c([e,r],!0,[l("ptr0",s("ptr1")),"\n",l("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(l(a(e),s(a(r))),l(a(r),"pivot"+n))}function x(e,r){_.push(["if((",r,"-",e,")<=",o,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function b(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),c([e],!0,["if(",s("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",s(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?c(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",s("ptr1"),"\n","pivot2[pivot_ptr]=",s("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",s("ptr0"),"\n","y=",s("ptr2"),"\n","z=",s("ptr4"),"\n",l("ptr5","x"),"\n",l("ptr6","y"),"\n",l("ptr7","z")].join("")):_.push(["pivot1=",s(a("el2")),"\n","pivot2=",s(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",s(a("el1")),"\n","y=",s(a("el3")),"\n","z=",s(a("el5")),"\n",l(a("index1"),"x"),"\n",l(a("index3"),"y"),"\n",l(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),b("less",1,"++less"),b("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k?new Function("insertionSort","malloc","free",_.join("\n"))(r,k[0],k[1]):new Function("insertionSort",_.join("\n"))(r)}(t,e,v))}},{"typedarray-pool":554}],456:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.exports=function(t){var e=t.order,r=t.dtype,a=[e,r].join(":"),o=i[a];return o||(i[a]=o=n(e,r)),o(t),t}},{"./lib/compile_sort.js":455}],457:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":119,"ndarray-linear-interpolate":451}],458:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");return new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],i)}var o=t("iota-array"),s=t("is-buffer"),l="undefined"!=typeof Float64Array,c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===r){r=new Array(i);for(var o=i-1,u=1;o>=0;--o)r[o]=u,u*=e[o]}if(void 0===n)for(n=0,o=0;o>>0;e.exports=function(t,e){if(isNaN(t)||isNaN(e))return NaN;if(t===e)return t;if(0===t)return e<0?-i:i;var r=n.hi(t),o=n.lo(t);return e>t==t>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},{"double-bits":131}],460:[function(t,e,r){function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(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]}function a(t,e,r,n,i,s,u,f,h,d){if(d)M=d[0],k=d[1],_=d[2],w=d[3];else{var p=o(t,e,-i);t=p.x,e=p.y;var m=(t-(f=(p=o(f,h,-i)).x))/2,g=(e-(h=p.y))/2,v=m*m/(r*r)+g*g/(n*n);v>1&&(r*=v=Math.sqrt(v),n*=v);var y=r*r,x=n*n,b=(s==u?-1:1)*Math.sqrt(Math.abs((y*x-y*g*g-x*m*m)/(y*g*g+x*m*m)));b==1/0&&(b=1);var _=b*r*g/n+(t+f)/2,w=b*-n*m/r+(e+h)/2,M=Math.asin(((e-w)/n).toFixed(9)),k=Math.asin(((h-w)/n).toFixed(9));M=t<_?l-M:M,k=f<_?l-k:k,M<0&&(M=2*l+M),k<0&&(k=2*l+k),u&&M>k&&(M-=2*l),!u&&k>M&&(k-=2*l)}if(Math.abs(k-M)>c){var A=k,T=f,S=h;k=M+c*(u&&k>M?1:-1);var E=a(f=_+r*Math.cos(k),h=w+n*Math.sin(k),r,n,i,0,u,T,S,[k,A,_,w])}var L=Math.tan((k-M)/4),C=4/3*r*L,z=4/3*n*L,D=[2*t-(t+C*Math.sin(M)),2*e-(e-z*Math.cos(M)),f+C*Math.sin(k),h-z*Math.cos(k),f,h];if(d)return D;E&&(D=D.concat(E));for(var I=0;I7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var x=d,b=p;"C"!=e&&"S"!=e||(x+=x-o,b+=b-l),v=["C",x,b,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(f=2*d-f,h=2*p-h):(f=d,h=p),v=i(d,p,f,h,v[1],v[2]);break;case"Q":f=v[1],h=v[2],v=i(d,p,v[1],v[2],v[3],v[4]);break;case"L":v=n(d,p,v[1],v[2]);break;case"H":v=n(d,p,v[1],p);break;case"V":v=n(d,p,d,v[1]);break;case"Z":v=n(d,p,c,u)}e=y,d=v[v.length-2],p=v[v.length-1],v.length>4?(o=v[v.length-4],l=v[v.length-3]):(o=d,l=p),r.push(v)}return r}},{}],461:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[c],_=1/Math.sqrt(g*y);for(x=0;x<3;++x){var w=(x+1)%3,M=(x+2)%3;b[x]+=_*(v[w]*m[M]-v[M]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.faceNormals=function(t,e,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(d):0;for(c=0;c<3;++c)h[c]*=d;i[o]=h}return i}},{}],462:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l0){var f=Math.sqrt(u+1);t[0]=.5*(o-l)/f,t[1]=.5*(s-n)/f,t[2]=.5*(r-a)/f,t[3]=.5*f}else{var h=Math.max(e,a,c);f=Math.sqrt(2*h-u+1),e>=h?(t[0]=.5*f,t[1]=.5*(i+r)/f,t[2]=.5*(s+n)/f,t[3]=.5*(o-l)/f):a>=h?(t[0]=.5*(r+i)/f,t[1]=.5*f,t[2]=.5*(l+o)/f,t[3]=.5*(s-n)/f):(t[0]=.5*(n+s)/f,t[1]=.5*(o+l)/f,t[2]=.5*f,t[3]=.5*(r-i)/f)}return t}},{}],464:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=s([r]),this.center=s(e),this.rotation=s(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),a(r=[].slice.call(r,0,4),r);var i=new o(r,e,Math.log(n));return i.setDistanceLimits(t.zoomMin,t.zoomMax),("eye"in t||"up"in t)&&i.lookAt(0,t.eye,t.center,t.up),i};var s=t("filtered-vector"),l=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),u=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),h=o.prototype;h.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},h.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(r,e);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var u=0,f=0;f<3;++f)u+=r[l+4*f]*i[f];r[12+l]=-u}},h.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},h.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},h.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},h.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d);u/=p,f/=p,h/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,x=m*u+g*f+v*h,b=n(m-=y*o+x*u,g-=y*s+x*f,v-=y*l+x*h);m/=b,g/=b,v/=b;var _=u*e+o*r,w=f*e+s*r,M=h*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},h.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],c=o[8],u=o[1],f=o[5],h=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*u,v=e*l+r*f,y=e*c+r*h,x=-(p*y-m*v),b=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),M=i(x,b,_,w);M>1e-6?(x/=M,b/=M,_/=M,w/=M):(x=b=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],S=k[2],E=k[3],L=A*w+E*x+T*_-S*b,C=T*w+E*b+S*x-A*_,z=S*w+E*_+A*b-T*x,D=E*w-A*x-T*b-S*_;if(a){x=d,b=p,_=m;var I=Math.sin(a)/n(x,b,_);x*=I,b*=I,_*=I,D=D*(w=Math.cos(e))-(L=L*w+D*x+C*_-z*b)*x-(C=C*w+D*b+z*x-L*_)*b-(z=z*w+D*_+L*b-C*x)*_}var P=i(L,C,z,D);P>1e-6?(L/=P,C/=P,z/=P,D/=P):(L=C=z=0,D=1),this.rotation.set(t,L,C,z,D)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;l(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,c=0;c<3;++c)s+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},h.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},h.setMatrix=function(t,e){var r=this.computedRotation;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;u(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},h.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},h.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},h.getDistanceLimits=function(t){var e=this.radius.bounds;return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},h.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},h.fromJSON=function(t){var e=this.lastT(),r=t.center;r&&this.center.set(e,r[0],r[1],r[2]);var n=t.rotation;n&&this.rotation.set(e,n[0],n[1],n[2],n[3]);var i=t.distance;i&&i>0&&this.radius.set(e,Math.log(i)),this.setDistanceLimits(t.zoomMin,t.zoomMax)}},{"./lib/quatFromFrame":463,"filtered-vector":142,"gl-mat4/fromQuat":183,"gl-mat4/invert":186,"gl-mat4/lookAt":187}],465:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":507}],466:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");(a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:function(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?function(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=d.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&function(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,i,e)},writePackedSVarint:function(t,e){this.writeMessage(t,a,e)},writePackedBoolean:function(t,e){this.writeMessage(t,l,e)},writePackedFloat:function(t,e){this.writeMessage(t,o,e)},writePackedDouble:function(t,e){this.writeMessage(t,s,e)},writePackedFixed32:function(t,e){this.writeMessage(t,c,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,u,e)},writePackedFixed64:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,h,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":469}],471:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":280,"typedarray-pool":554}],473:[function(t,e,r){"use strict";function n(t){return i[t]?i[t]:("string"==typeof t&&(t=i[t]=t.split(/\s*,\s*|\s+/)),t)}e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a0){o=c[u][i][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=c[f][i],d=0;d0&&(o=p,s=m,l=f)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=i(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],f=t,h=s[1],d=i(u,f,!0);if(n(e[u],e[f],e[h],e[d])<0)break;s.push(t),l=i(u,f)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;u0;){c[0][u].length;var m=a(u,d);o(0,m)?p.push.apply(p,m):(p.length>0&&h.push(p),p=m)}p.length>0&&h.push(p)}return h};var n=t("compare-angle")},{"compare-angle":106}],475:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r=n(t,e.length),i=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){i[d=o.pop()]=!1;var c=r[d];for(s=0;s0})).length,g=new Array(m),v=new Array(m);for(d=0;d0;){var N=O.pop(),j=E[N];c(j,function(t,e){return t-e});var B,U=j.length,V=F[N];for(0===V&&(B=[H=p[N]]),d=0;d=0)&&(F[q]=1^V,O.push(q),0===V)){var H;r(H=p[q])||(H.reverse(),B.push(H))}}0===V&&R.push(B)}return R};var i=t("edges-to-adjacency-list"),a=t("planar-dual"),o=t("point-in-big-polygon"),s=t("two-product"),l=t("robust-sum"),c=t("uniq"),u=t("./lib/trim-leaves")},{"./lib/trim-leaves":475,"edges-to-adjacency-list":136,"planar-dual":474,"point-in-big-polygon":478,"robust-sum":520,"two-product":552,uniq:556}],477:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],478:[function(t,e,r){function n(){return!0}function i(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var s=i.key,l=o(r,s[0],s[1]);if(s[0][0]0))return 0;a=-1,i=i.right}else if(l>0)i=i.left;else{if(!(l<0))return 0;a=1,i=i.right}}return a}}(g.slabs,g.coordinates);return 0===n.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(i(n),v)};var o=t("robust-orientation")[3],s=t("slab-decomposition"),l=t("interval-tree-1d"),c=t("binary-search-bounds")},{"binary-search-bounds":70,"interval-tree-1d":279,"robust-orientation":515,"slab-decomposition":532}],479:[function(t,e,r){function n(t,e,r){var n=i.segments(t),a=i.segments(e),o=r(i.combine(n,a));return i.polygon(o)}var i,a=t("./lib/build-log"),o=t("./lib/epsilon"),s=t("./lib/intersecter"),l=t("./lib/segment-chainer"),c=t("./lib/segment-selector"),u=t("./lib/geojson"),f=!1,h=o();i={buildLog:function(t){return!0===t?f=a():!1===t&&(f=!1),!1!==f&&f.list},epsilon:function(t){return h.epsilon(t)},segments:function(t){var e=s(!0,h,f);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:s(!1,h,f).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:c.union(t.combined,f),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:c.intersect(t.combined,f),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:c.difference(t.combined,f),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:c.differenceRev(t.combined,f),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:c.xor(t.combined,f),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,h,f),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(i,t)},polygonToGeoJSON:function(t){return u.fromPolygon(i,h,t)},union:function(t,e){return n(t,e,i.selectUnion)},intersect:function(t,e){return n(t,e,i.selectIntersect)},difference:function(t,e){return n(t,e,i.selectDifference)},differenceRev:function(t,e){return n(t,e,i.selectDifferenceRev)},xor:function(t,e){return n(t,e,i.selectXor)}},"object"==typeof window&&(window.PolyBool=i),e.exports=i},{"./lib/build-log":480,"./lib/epsilon":481,"./lib/geojson":482,"./lib/intersecter":483,"./lib/segment-chainer":485,"./lib/segment-selector":486}],480:[function(t,e,r){e.exports=function(){function t(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}var e,r=0,n=!1;return e={list:[],segmentId:function(){return r++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,n){return t("temp_status",{seg:e,above:r,below:n})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,n){return t("status",{seg:e,above:r,below:n})},vert:function(r){return r===n?e:(n=r,t("vert",{x:r}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1,"  ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}}}},{}],481:[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}},{}],482:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}if(e.length<=0)return t.segments({inverted:!1,regions:[]});for(var n=r(e[0]),i=1;i0})}function s(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),m=!d&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;p&&(d||(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 c=n.create(),f=[];!u.isEmpty();){var h=u.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=o(h),p=d.before?d.before.ev:null,m=d.after?d.after.ev:null;r&&r.tempStatus(h.seg,!!p&&p.seg,!!m&&m.seg);var g=function(){if(p){var t=s(h,p);if(t)return t}return!!m&&s(h,m)}();if(g&&(t?(v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(g.seg),h.other.remove(),h.remove()),u.getHead()!==h){r&&r.rewind(h.seg);continue}if(t){var v;v=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=v?!h.seg.myFill.below:h.seg.myFill.below}else if(null===h.seg.otherFill){var y;y=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?a:i,h.seg.otherFill={above:y,below:y}}r&&r.status(h.seg,!!p&&p.seg,!!m&&m.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(c.exists(x.prev)&&c.exists(x.next)&&s(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}f.push(h.seg)}u.getHead().remove()}return r&&r.done(),f}var u=n.create();return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p):(b=0,d>=0?(_=0,y=p):-d>=f?(_=1,y=f+2*d+p):y=d*(_=-d/f)+p);else if(_<0)_=0,h>=0?(b=0,y=p):-h>=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p;else{var w=1/x;y=(b*=w)*(c*b+u*(_*=w)+2*h)+_*(u*b+f*_+2*d)+p}else{var M,k,A,T;b<0?(k=f+d)>(M=u+h)?(A=k-M)>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p:(b=0,k<=0?(_=1,y=f+2*d+p):d>=0?(_=0,y=p):y=d*(_=-d/f)+p):_<0?(k=c+h)>(M=u+d)?(A=k-M)>=(T=c-2*u+f)?(_=1,b=0,y=f+2*d+p):y=(b=1-(_=A/T))*(c*b+u*_+2*h)+_*(u*b+f*_+2*d)+p:(_=0,k<=0?(b=1,y=c+2*h+p):h>=0?(b=0,y=p):y=h*(b=-h/c)+p):(A=f+d-u-h)<=0?(b=0,_=1,y=f+2*d+p):A>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p}var S=1-b-_;for(l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]);return n+a((t=t.replace(C,".")).split("."),e).join(".")}function s(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(e+=P((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=P(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:b}function u(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?I(t/k):t>>1,t+=I(t/e);t>D*w>>1;n+=b)t=I(t/D);return I(n+(D+1)*t/(t+M))}function h(t){var e,r,n,a,o,s,u,h,d,p,m=[],g=t.length,v=0,y=T,M=A;for((r=t.lastIndexOf(S))<0&&(r=0),n=0;n=128&&i("not-basic"),m.push(t.charCodeAt(n));for(a=r>0?r+1:0;a=g&&i("invalid-input"),((h=c(t.charCodeAt(a++)))>=b||h>I((x-v)/s))&&i("overflow"),v+=h*s,d=u<=M?_:u>=M+w?w:u-M,!(hI(x/(p=b-d))&&i("overflow"),s*=p;M=f(v-o,e=m.length+1,0==o),I(v/e)>x-y&&i("overflow"),y+=I(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function d(t){var e,r,n,a,o,l,c,h,d,p,m,g,v,y,M,k=[];for(g=(t=s(t)).length,e=T,r=0,o=A,l=0;l=e&&mI((x-r)/(v=n+1))&&i("overflow"),r+=(c-e)*v,e=c,l=0;lx&&i("overflow"),m==e){for(h=r,d=b;p=d<=o?_:d>=o+w?w:d-o,!(h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},D=b-_,I=Math.floor,P=String.fromCharCode;if(v={version:"1.4.1",ucs2:{decode:s,encode:l},decode:h,encode:d,toASCII:function(t){return o(t,function(t){return L.test(t)?"xn--"+d(t):t})},toUnicode:function(t){return o(t,function(t){return E.test(t)?h(t.slice(4).toLowerCase()):t})}},p&&m)if(e.exports==p)m.exports=v;else for(y in v)v.hasOwnProperty(y)&&(p[y]=v[y]);else n.punycode=v}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],490:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":236}],491:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(f=m.substr(0,g),h=m.substr(g+1)):(f=m,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],492:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;ne?1:0};a>r;){if(a-r>600){var s=a-r+1,l=e-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-l*u/s+f)),Math.min(a,Math.floor(e+(s-l)*u/s+f)),o)}var h=t[e],d=r,p=a;for(i(t,r,e),o(t[a],h)>0&&i(t,r,a);d0;)p--}0===o(t[r],h)?i(t,r,p):i(t,++p,a),p<=e&&(r=p+1),e<=p&&(a=p-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],495:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":90,"compare-cell":107,"compare-oriented-cell":108}],500:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,f=c.fract32;e.exports=function(t,e){function r(t){t?p(t):null===t&&m(),c()}function c(e){if("number"==typeof e)return d(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),k.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?d(r):t.draw=!0)})}function d(t){"number"==typeof t&&(t=k[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],g(t),t.after&&t.after(t))}function p(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(k=t.map(function(t,c){var u=k[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||(k[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},M,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;a2&&(t._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&x(e),e.thickness&&e.color&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],e.scaleRatio[0]>L||e.scaleRatio[1]>L?y(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.positions.length>=C)?y(e):v(e),e.after&&e.after(e)))}function m(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0;if(S=t.map(function(t,r){var s=S[r];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=l(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 stroke colors 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",after:"after callback done pass"}),s||(S[r]=s={id:r,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,offset:0,dashLength:0,hole:!0},t=o({},T,t)),c(s,t,[{thickness:parseFloat,opacity:parseFloat,miterLimit:parseFloat,overlay:Boolean,join:function(t){return t},after:function(t){return t},hole:function(t){return t||[]},positions:function(t,r,n){t=u(t,"float64");var i=Math.floor(t.length/2),o=a(t,2);return r.range||n.range||(n.range=o),r.count=i,r.bounds=o,e+=i,t},fill:function(t){return t?i(t,"uint8"):null},dashes:function(t,e,r){var n,i=e.dashLength;if(!t||t.length<2)i=1,n=new Uint8Array([255,255,255,255,255,255,255,255]);else{i=0;for(var a=0;a=4&&e.positions[0]===e.positions[e.positions.length-2]&&e.positions[1]===e.positions[e.positions.length-1]},positions:function(t,e,r){if(e.fill&&t.length){for(var n=[],i={},a=0,o=0,s=0,l=e.count;o 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 + translate) * scale;\n\tvec2 aBotPosition = (aBotCoord + translate) * scale;\n\n\tvec2 bTopPosition = (bTopCoord + translate) * scale;\n\tvec2 bBotPosition = (bBotCoord + translate) * scale;\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 + translate) * scaleRatio + viewport.xy;\n\tendCoord = (bCoord + translate) * scaleRatio + 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 + translate.xyxy) * scaleRatio.xyxy;\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 + translate.xyxy) * scaleRatio.xyxy;\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 + translate.xyxy) * scaleRatio.xyxy;\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 + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1},bColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset+4},divisor:1},prevCoord:{buffer:w,stride:8,offset:function(t,e){return 8*e.offset},divisor:1},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},nextCoord:{buffer:w,stride:8,offset:function(t,e){return 24+8*e.offset},divisor:1}}},z)),y=t(o({vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float thickness, pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nconst float MAX_LINES = 256.;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n  return (position + translate) * scale\n       + (positionFract + translateFract) * scale\n       + (position + translate) * scaleFract\n       + (positionFract + translateFract) * scaleFract;\n}\n\nvoid main() {\n\t// vec2 scaleRatio = scale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\tfloat depth = (MAX_LINES - 1. - id) / (MAX_LINES);\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scaleRatio);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},aCoordFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoordFract:{buffer:M,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},color:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1}}},z)),x=t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\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 + translate) * scale\n       + (positionFract + translateFract) * scale\n       + (position + translate) * scaleFract\n       + (positionFract + translateFract) * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= opacity;\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:w,stride:8,offset:function(t,e){return 8+8*e.offset}},positionFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset}}},blend:z.blend,depth:{enable:!1},scissor:z.scissor,stencil:z.stencil,viewport:z.viewport}),o(r,{update:m,draw:d,destroy:g,regl:t,gl:A,canvas:A.canvas,lines:S}),r}},{"array-bounds":48,"array-normalize":49,"color-normalize":99,earcut:135,"flatten-vertex-data":143,glslify:502,"object-assign":462,"pick-by-alias":473,"update-diff":558}],502:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],503:[function(t,e,r){"use strict";var n=t("color-normalize"),i=t("array-bounds"),a=t("color-id"),o=t("snap-points-2d"),s=t("object-assign"),l=t("glslify"),c=t("binary-search-bounds"),u=t("pick-by-alias"),f=t("update-diff"),h=t("flatten-vertex-data"),d=t("is-iexplorer"),p=t("to-float32"),m=p.float32,g=p.fract32;e.exports=function(t,e){function r(t){t?x(t):null===t&&M(),p()}function p(t){if("number"==typeof t)return v(t);Array.isArray(t)?t.forEach(function(t,e){if(null!=t)return t.length?v(t,e):v(t)}):O.forEach(function(t,e){t&&v(e)})}function v(e,r){"number"==typeof e&&(e=O[e]);var n;if(Array.isArray(e)&&(n=e,e=O[r]),e&&e.count&&e.opacity){var i;if(n){i=Array(e.count);for(var a=0;a1)){var g=m.offset,v=m.count+g,y=c.ge(f,i[0],g,v-1),x=c.lt(f,i[2],y,v-1)+1;if(!(x<=y))if(r){var b=n(t.data.subarray(y,x),r);l.push(s({},e,{elements:b,marker:F[h],offset:0,count:b.length}))}else l.push(s({},e,{elements:t.elements,marker:F[h],offset:y,count:x-y}))}}return l}function x(e){if(e){null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=0,n=0,a=0;O=e.map(function(e,l){var c=O[l];return e?("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),e=u(e,{positions:"positions data points",snap:"snap cluster",size:"sizes size radius",borderSize:"borderSizes borderSize stroke-width strokeWidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",palette:"palette swatch",marker:"markers marker shape",range:"range dataBox",viewport:"viewport viewBox",opacity:"opacity alpha"}),c||(O[l]=c={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,markerIds:[]},e=s({},P,e)),!e.positions||"marker"in e||(e.marker=c.marker,delete c.marker),f(c,e,[{snap:!0,size:function(t){return n+=t.length?1:0,t},borderSize:function(t){return n+=t.length?1:0,t},opacity:parseFloat,color:function(t){return t=w(t),a++,t},borderColor:function(t){return t=w(t),a++,t},positions:function(t,e,n){t=h(t,"float64");var a=e.count=Math.floor(t.length/2),o=e.bounds=a?i(t,2):null;return n.range||e.range||(delete e.range,n.range=o),e.offset=r,r+=a,n.marker||e.marker||(delete e.marker,n.marker=null),t}},{marker:function(t,e,r){if(e.markerIds.length=0,t&&"number"!=typeof t[0])for(var n=0,i=t.length;ni)){c.snap=!0;var h=c.x=Array(u),d=c.w=Array(u),p=void 0;if(n.length>1){p=Array(2*u);for(var m=0;m=0)return r;var n;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)n=e;else{n=new Uint8Array(e.length);for(var i=0,a=e.length;i 1.0) {\n    discard;\n  }\n\n  float centerFraction = fragBorderSize == 0. ? 2. : fragSize / (fragSize + fragBorderSize + 1.25);\n\n  vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n  float alpha = 1.0 - pow(1.0 - baseColor.a, 1.);\n  gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}\n"]),vert:l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth, fragBorderSize, fragSize;\n\nvoid main() {\n  float size = size * maxSize / 255.;\n  float borderSize = borderSize * maxSize / 255.;\n  fragBorderSize = borderSize;\n  fragSize = size;\n\n  gl_PointSize = (size + borderSize) * pixelRatio;\n\n  vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n  gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n  fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n  fragWidth = 1. / gl_PointSize;\n}\n"]),uniforms:{color:function(t,e){var r=e.color.length?e.color[0]:e.color;return D.slice(4*r,4*r+4).map(function(t){return t/255})},borderColor:function(t,e){var r=e.borderColor.length?e.borderColor[0]:e.borderColor;return D.slice(4*r,4*r+4).map(function(t){return t/255})},pixelRatio:t.context("pixelRatio"),palette:C,scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("marker")},attributes:{position:S,positionFract:E,size:B.attributes.size,borderSize:B.attributes.borderSize}}));else{var U=s({},B);U.frag=l(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nuniform sampler2D marker;\nuniform float pixelRatio, opacity;\n\nfloat smoothStep(float x, float y) {\n  return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n  float dist = texture2D(marker, gl_PointCoord).r, delta = fragWidth;\n\n  //max-distance alpha\n  if (dist < 0.003) discard;\n\n  //null-border case\n  if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n    float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n    gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a);\n    return;\n  }\n\n  float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n  float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n  vec4 color = fragBorderColor;\n  color.a *= borderColorAmt;\n  color = mix(color, fragColor, colorAmt);\n  color.a *= opacity;\n\n  gl_FragColor = color;\n}\n"]),U.vert=l(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius,\n\t\tfragWidth, fragBorderColorLevel, fragColorLevel;\n\nvoid main() {\n  vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n  vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n  float size = size * maxSize / 255.;\n  float borderSize = borderSize * maxSize / 255.;\n\n  gl_PointSize = 2. * size * pixelRatio;\n  fragPointSize = size * pixelRatio;\n\n  vec2 pos = (position + translate) * scale\n      + (positionFract + translateFract) * scale\n      + (position + translate) * scaleFract\n      + (positionFract + translateFract) * scaleFract;\n\n  gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n  fragColor = color;\n  fragBorderColor = borderColor;\n  fragWidth = 1. / gl_PointSize;\n\n  fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n  fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),k=t(U);var V=s({},B);V.frag=l(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\n\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif(radius > 1.0 + delta) {\n\t\tdiscard;\n\t\treturn;\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"]),V.vert=l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n  vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n  vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n  float size = size * maxSize / 255.;\n  float borderSize = borderSize * maxSize / 255.;\n\n  gl_PointSize = (size + borderSize) * pixelRatio;\n\n  vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n  gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n  fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n  fragColor = color;\n  fragBorderColor = borderColor;\n  fragWidth = 1. / gl_PointSize;\n}\n"]),A=t(V)}return s(r,{update:x,draw:p,destroy:M,regl:t,gl:z,canvas:z.canvas,groups:O,markers:R}),r}},{"array-bounds":48,"binary-search-bounds":504,"color-id":97,"color-normalize":99,"flatten-vertex-data":143,glslify:505,"is-iexplorer":284,"object-assign":462,"pick-by-alias":473,"snap-points-2d":534,"to-float32":547,"update-diff":558}],504:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=["function ",t,"(a,l,h,",n.join(","),"){",i?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],505:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],506:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.createREGL=n()}(this,function(){function t(t,e){this.id=j++,this.type=t,this.data=e}function e(t){if(0===t.length)return[];var r=t.charAt(0),n=t.charAt(t.length-1);if(1>>=e,r=(255>>=r,e|=r,r=(15>>=r,e|=r,r=(3>>r>>1}function c(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=G[l(t)>>2]).length?e.pop():new ArrayBuffer(t)}function u(t){G[l(t.byteLength)>>2].push(t)}function f(t,e,r,n,i,a){for(var o=0;o>>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 L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),s.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(ft).forEach(function(e){t+=ft[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?"number"==typeof e?A(a,0|t,0|e):A(a,0|t,0|t):t?(z(r,t),T(a,t)):A(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),S(a,3553),D(r,3553),O(),L(a),s.profile&&(i.stats.size=M(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=$[i.internalformat],n.type=tt[i.type],n.mag=et[r.magFilter],n.min=rt[r.minFilter],n.wrapS=ot[r.wrapS],n.wrapT=ot[r.wrapT],n}var i=new I(3553);return ft[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),O(),k(o),n},n.resize=function(e,r){var a=0|e,o=0|r||a;if(a===i.width&&o===i.height)return n;n.width=i.width=a,n.height=i.height=o,P(i);for(var l=0;i.mipmask>>l;++l)t.texImage2D(3553,l,i.format,a>>l,o>>l,0,i.format,i.type,null);return O(),s.profile&&(i.stats.size=M(i.internalformat,i.type,a,o,!1,!1)),n},n._reglType="texture2d",n._texture=i,s.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,o,l){function f(t,e,r,n,i,a){var o,l=h.texInfo;for(C.call(l),o=0;6>o;++o)g[o]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)T(g[0],t),T(g[1],e),T(g[2],r),T(g[3],n),T(g[4],i),T(g[5],a);else if(z(l,t),u(h,t),"faces"in t)for(t=t.faces,o=0;6>o;++o)c(g[o],h),T(g[o],t[o]);else for(o=0;6>o;++o)T(g[o],t)}else for(t=0|t||1,o=0;6>o;++o)A(g[o],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),o=0;6>o;++o)S(g[o],34069+o);for(D(l,34067),O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=$[h.internalformat],f.type=tt[h.type],f.mag=et[l.magFilter],f.min=rt[l.minFilter],f.wrapS=ot[l.wrapS],f.wrapT=ot[l.wrapT],o=0;6>o;++o)L(g[o]);return f}var h=new I(34067);ft[h.id]=h,a.cubeCount++;var g=Array(6);return f(e,r,n,i,o,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),O(),k(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 O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,s.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);D(e.texInfo,e.target)})}}}function A(){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 T(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;rt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);H(l).forEach(e),l={},H(c).forEach(e),c={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,u={},r.shaderCount=0},program:function(t,e,i){var a=u[e];a||(a=u[e]={});var o=a[t];return o||(o=new function(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(e,t),r.shaderCount++,s(o),a[t]=o,f.push(o)),o},restore:function(){l={},c={};for(var t=0;t="+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",u,"=",s,".createStream(",34962,",",i,".buffer);","}else{",u,"=",s,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l})}),o}(r),u.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=P(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=O(e,function(t,r){return t.invoke(r,e)})}),n}(o),u}function w(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a),i(n,".",a,"=",r[a].append(t,e),";")}),e(i)}function M(t,e,r,n){var i,a=(s=t.shared).gl,o=s.framebuffer;J&&(i=e.def(s.extensions,".webgl_draw_buffers"));var s=(l=t.constants).drawBuffer,l=l.backBuffer;t=r?r.append(t,e):e.def(o,".next"),n||e("if(",t,"!==",o,".cur){"),e("if(",t,"){",a,".bindFramebuffer(",36160,",",t,".framebuffer);"),J&&e(i,".drawBuffersWEBGL(",s,"[",t,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),J&&e(i,".drawBuffersWEBGL(",l,");"),e("}",o,".cur=",t,";"),n||e("}")}function k(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,l=n.current,c=n.next,u=t.cond(l,".dirty");$.forEach(function(e){if(!((e=g(e))in r.state)){var n,f;if(e in o){n=o[e],f=a[e];var h=s(K[e].length,function(t){return u.def(n,"[",t,"]")});u(t.cond(h.map(function(t,e){return t+"!=="+f+"["+e+"]"}).join("||")).then(i,".",rt[e],"(",h,");",h.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";"))}else n=u.def(c,".",e),h=t.cond(n,"!==",l,".",e),u(h),e in et?h(t.cond(n).then(i,".enable(",et[e],");").else(i,".disable(",et[e],");"),l,".",e,"=",n,";"):h(i,".",rt[e],"(",n,");",l,".",e,"=",n,";")}}),0===Object.keys(r.state).length&&u(l,".dirty=false;"),e(u)}function A(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;z(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(et[i]){var u=et[i];I(l)?c?e(s,".enable(",u,");"):e(s,".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(v(c)){var f=a[i];e(s,".",rt[i],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",rt[i],"(",c,");",o,".",i,"=",c,";")}})}function T(t,e){X&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function S(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(c=e.def(),"=",a(),";"),"string"==typeof i?t(h,".count+=",i,";"):t(h,".count++;"),p&&(n?(u=e.def(),t(u,"=",m,".getNumPendingQueries();")):t(m,".beginQuery(",h,");"))}function s(t){t(h,".cpuTime+=",a(),"-",c,";"),p&&(n?t(m,".pushScopeStats(",u,",",m,".getNumPendingQueries(),",h,");"):t(m,".endQuery();"))}function l(t){var r=e.def(d,".profile");e(d,".profile=",t,";"),e.exit(d,".profile=",r,";")}var c,u,f=t.shared,h=t.stats,d=f.current,m=f.timer;if(r=r.profile){if(I(r))return void(r.enable?(o(e),s(e.exit),l("true")):l("false"));l(r=r.append(t,e))}else r=e.def(d,".profile");o(f=t.block()),e("if(",r,"){",f,"}"),s(t=t.block()),e.exit("if(",r,"){",t,"}")}function F(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(yt))return;var c=t.scopeAttrib(s);o={},Object.keys(new Y).forEach(function(t){o[t]=e.def(c,".",t)})}!function(r,n,i){function o(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",d.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",34962,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",d.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),X&&(a=i.divisor,e("if(",u,".divisor!==",a,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,a],");",u,".divisor=",a,";}"))}function s(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",ht.map(function(t,e){return u+"."+t+"!=="+h[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",h,");",ht.map(function(t,e){return u+"."+t+"="+h[e]+";"}).join(""),"}")}var l=a.gl,c=e.def(r,".location"),u=e.def(a.attributes,"[",c,"]");r=i.state;var f=i.buffer,h=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];1===r?o():2===r?s():(e("if(",r,"===",1,"){"),o(),e("}else{"),s(),e("}"))}(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)})}function R(t,r,n,i,a){for(var o,l=t.shared,c=l.gl,u=0;u>1)",m],");")}function e(){r(g,".drawArraysInstancedANGLE(",[h,d,p,m],");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[h,d,p]+");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,c=s.draw,u=n.draw,f=function(){var i=u.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","elements"),i&&a("if("+i+")"+l+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),h=i("primitive"),d=i("offset"),p=function(){var i=u.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","count"),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,g;X&&(m=i("instances"),g=t.instancing);var v=f+".type",y=u.elements&&I(u.elements);X&&("number"!=typeof m||0<=m)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function U(t,e,r,n,i){return e=b(),i=e.proc("body",i),X&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function V(t,e,r,n){T(t,e),F(t,e,r,n.attributes,function(){return!0}),R(t,e,r,n.uniforms,function(){return!0}),j(t,e,e,r)}function q(t,e,r,n){function i(){return!0}t.batchId="a1",T(t,e),F(t,e,r,n.attributes,i),R(t,e,r,n.uniforms,i),j(t,e,e,r)}function H(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}T(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&&w(t,u,r.context),r.needsFramebuffer&&M(t,u,r.framebuffer),A(t,u,r.state,i),r.profile&&i(r.profile)&&S(t,u,r,!1,!0),n?(F(t,c,r,n.attributes,a),F(t,u,r,n.attributes,i),R(t,c,r,n.uniforms,a),R(t,u,r,n.uniforms,i),j(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 U(q,t,r,e,2)}),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function G(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];B.isDynamic(n)&&(n=t.invoke(e,n),e(u,".",r,"=",n,";"))})}var i=e.static[r];if(i&&function(t){if("object"==typeof t&&!v(t)){for(var e=Object.keys(t),r=0;r":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},gt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vt={cw:2304,ccw:2305},yt=new D(!1,!1,!1,function(){});return function(t){function e(){if(0===it.length)E&&E.update(),lt=null;else{lt=U.next(e),h();for(var t=it.length-1;0<=t;--t){var r=it[t];r&&r(D,null,0)}y.flush(),E&&E.update()}}function r(){!lt&&0=it.length&&n()}var r=R(it,t);it[r]=e}}}function f(){var t=rt.viewport,e=rt.scissor_box;t[0]=t[1]=e[0]=e[1]=0,D.viewportWidth=D.framebufferWidth=D.drawingBufferWidth=t[2]=e[2]=y.drawingBufferWidth,D.viewportHeight=D.framebufferHeight=D.drawingBufferHeight=t[3]=e[3]=y.drawingBufferHeight}function h(){D.tick+=1,D.time=v(),f(),et.procs.poll()}function g(){f(),et.procs.refresh(),E&&E.update()}function v(){return(V()-L)/1e3}if(!(t=a(t)))return null;var y=t.gl,x=y.getContextAttributes();y.isContextLost();var b=function(t,e){function r(e){e=e.toLowerCase();var r;try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;i(i=l)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=s,0>s&&(i=4,1===(s=n.buffer.dimension)&&(i=0),2===s&&(i=1),3===s&&(i=4)),n.primType=i}function s(t){n.elementsCount--,delete l[t.id],t.buffer.destroy(),t.buffer=null}var l={},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 l(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,s=0,h=0;Array.isArray(t)||q(t)||o(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=J[t.usage]),"primitive"in t&&(n=tt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?s=0|t.length:(s=i,5123===h||5122===h?s*=2:5125!==h&&5124!==h||(s*=4))),a(f,e,r,n,i,s,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return l}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,l(t),l._reglType="elements",l._elements=f,l.subdata=function(t,e){return c.subdata(t,e),l},l.destroy=function(){s(f)},l},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(){H(l).forEach(s)}}}(y,M,P,w),j=(C=function(t,e,r,n,i){for(t=r.maxAttributes,e=Array(t),r=0;r=--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?(a=e.shape,n=0|a[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=ct[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:(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=ct[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(){H(u).forEach(o)},restore:function(){H(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)}}}(y,M,0,w,t),X=function(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function c(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function f(t,e,r,a,s){return r?(t=n.create2D({width:t,height:e,format:a,type:s}),t._texture.refCount=0,new o(3553,t,null)):(t=i.create({width:t,height:e,format:a}),t._renderbuffer.refCount=0,new o(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function d(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function p(){this.id=M++,k[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete k[e.id]}function v(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;ni;++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(){H(k).forEach(g)},restore:function(){H(k).forEach(function(e){e.framebuffer=t.createFramebuffer(),v(e)})}})}(y,M,I,G,W,w),et=F(y,_,M,I,P,O,0,X,{},C,j,{elements:null,primitive:4,count:-1,offset:0,instances:-1},D,E,t),rt=(_=S(y,X,et.procs.poll,D),et.next),nt=y.canvas,it=[],at=[],ot=[],st=[t.onDestroy],lt=null;nt&&(nt.addEventListener("webglcontextlost",i,!1),nt.addEventListener("webglcontextrestored",s,!1));var ht=X.setFBO=l({framebuffer:B.define.call(null,1,"framebuffer")});return g(),x=N(l,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++e)ht(N({framebuffer:t.framebuffer.faces[e]},t),c);else ht(t,c);else c(0,t)},prop:B.define.bind(null,1),context:B.define.bind(null,2),this:B.define.bind(null,3),draw:l({}),buffer:function(t){return P.create(t,34962,!1,!1)},elements:function(t){return O.create(t,!1)},texture:G.create2D,cube:G.createCube,renderbuffer:W.create,framebuffer:X.create,framebufferCube:X.createCube,attributes:x,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=at;break;case"restore":r=ot;break;case"destroy":r=st}return r.push(e),{cancel:function(){for(var t=0;t=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+=t,i=i.substr(0,r)}},{}],508:[function(t,e,r){!function(t,n){"object"==typeof r?e.exports=n():t.resolveUrl=n()}(this,function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",i(t.slice(0,e)),",",i(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function o(t){return!0&t?"-":""}function s(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===n?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?i[t]:i)}var i=t("robust-determinant"),a=6,o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:d(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],l=e[1]-n[1],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-m)+f*(g-v)+h*(y-x),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(h));return b>_||-b>_?b:p(t,e,r,n)}];!function(){for(;m.length<=h;)m.push(s(m.length));for(var t=[],r=["slow"],n=0;n<=h;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=h;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&o>0||a<0&&o<0)return!1;var s=n(r,t,e),l=n(i,t,e);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(t,e,r,n){for(var i=0;i<2;++i){var a=t[i],o=e[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],f=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(c+=1)=n?(i=h,(c+=1)0){for(var s=0,l=0,c=0;cn.h||t>n.free||ru)&&(f=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(f,c),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],522:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],523:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":74,"reduce-simplicial-complex":499}],524:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n0&&c.push(","),c.push("[");for(var n=0;n0&&c.push(","),c.push("B(C,E,c[",i[0],"],c[",i[1],"])")}c.push("]")}c.push(");")}}var r=0,a=new Array(t+1);a[0]=[[]];for(var o=1;o<=t;++o)for(var s=a[o]=i(o),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--o){o>1,s=n(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(i=o-1)}return a}function l(t,e){for(var r=new Array(t.length),i=0,a=r.length;i=t.length||0!==n(t[g],o)););}return r}function c(t,e){if(e<0)return[];for(var r=[],n=(1<>>u&1&&c.push(i[u]);e.push(c)}return a(e)},r.skeleton=c,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=l(t);if(!(r>=0&&e0){var t=A[0];return o(0,S-1),S-=1,c(0),t}return-1}function h(t,e){var r=A[t];return x[r]===e?t:(x[r]=-1/0,u(t),f(),x[r]=e,S+=1,u(S-1))}function d(t){if(!b[t]){b[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&h(T[e],a(e)),T[r]>=0&&h(T[r],a(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,g=t.length,v=new Array(m),y=new Array(m),x=new Array(m),b=new Array(m),_=0;_>1;_>=0;--_)c(_);for(;;){var E=f();if(E<0||x[E]>r)break;d(E)}var L=[];for(_=0;_=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&C.push([n,i])}}),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":515,"simplicial-complex":528}],531:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var a=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?a-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],a=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=i(r,a,s),c=i(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=i(s,o,a),c=i(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var i=t("robust-orientation")},{"robust-orientation":515}],532:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=a(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=a(t.right,e))return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}e.exports=function(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var c=this.horizontal[e];if(c.length>0){var h=l.ge(c,t[1],i);if(h=c.length)return n;d=c[h]}}if(d.start)if(o){var p=u(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":531,"binary-search-bounds":70,"functional-red-black-tree":144,"robust-orientation":515}],533:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],f=a[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=c,i[h]=u,a[h]=f}}function i(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=c,a[e]=u}function a(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function o(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],c=i[2*t+1],u=a[t],f=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=c,a[r]=u,o[r]=f}function s(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function l(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function u(t,e,r,h,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,x=y-m,b=y+m,_=g,w=x,M=y,k=b,A=v,T=t+1,S=e-1,E=0;l(_,w,r,h,d)&&(E=_,_=w,w=E),l(k,A,r,h,d)&&(E=k,k=A,A=E),l(_,M,r,h,d)&&(E=_,_=M,M=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(_,k,r,h,d)&&(E=_,_=k,k=E),l(M,k,r,h,d)&&(E=M,M=k,k=E),l(w,A,r,h,d)&&(E=w,w=A,A=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(k,A,r,h,d)&&(E=k,k=A,A=E);var L=r[w],C=h[2*w],z=h[2*w+1],D=d[w],I=p[w],P=r[k],O=h[2*k],F=h[2*k+1],R=d[k],N=p[k],j=_,B=M,U=A,V=g,q=y,H=v,G=r[j],Y=r[B],W=r[U];r[V]=G,r[q]=Y,r[H]=W;for(var X=0;X<2;++X){var Z=h[2*j+X],J=h[2*B+X],K=h[2*U+X];h[2*V+X]=Z,h[2*q+X]=J,h[2*H+X]=K}var Q=d[j],$=d[B],tt=d[U];d[V]=Q,d[q]=$,d[H]=tt;var et=p[j],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,a(x,t,r,h,d,p),a(b,e,r,h,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,0,D,r,h,d))it!==T&&i(it,T,r,h,d,p),++T;else if(!c(it,P,O,0,R,r,h,d))for(;;){if(c(S,P,O,0,R,r,h,d)){c(S,L,C,0,D,r,h,d)?(o(it,T,S,r,h,d,p),++T,--S):(i(it,S,r,h,d,p),--S);break}if(--S=Math.max(.9*d,32)){var _=c+s>>>1;l(g,v,f,h,_,u+1),h=_}l(g,v,f,h,y,u+1),h=y}}}var c=t.length>>>1;if(c<1)return[];e||(e=Array(c)),r||(r=Array(c)),s||(s=[]);for(var u=0;u=s[2]||s[1]>=s[3]){var f=o(t,2);f[0]===f[2]&&(f[2]+=1),f[1]===f[3]&&(f[3]+=1),s[0]=f[0],s[1]=f[1],s[2]=f[2],s[3]=f[3]}var h=s[0],d=s[1],p=s[2],m=s[3],g=1/(p-h),v=1/(m-d),y=Math.max(p-h,m-d),x=new Int32Array(c),b=0;l(h,d,y,0,c,0),a(x,t,e,r,c);var _=[],w=0,M=c;for(b=c-1;b>=0;--b){t[2*b]=(t[2*b]-h)*g,t[2*b+1]=(t[2*b+1]-d)*v;var k=x[b];k!==w&&(_.push(new i(y*Math.pow(.5,k),b+1,M-(b+1))),M=b+1,w=k)}return _.push(new i(y*Math.pow(.5,k+1),0,M)),_}},{"./lib/sort":533,"array-bounds":48}],535:[function(t,e,r){"use strict";function n(t,e){var r=o(a(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=-e/(n-e);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=t.length,s=new Array(o),l=0;l0||o>0&&u<0){var f=i(s,u,l,o);r.push(f),a.push(f.slice())}u<0?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}},e.exports.positive=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r},e.exports.negative=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c<=0&&r.push(s.slice()),a=c}return r}},{"robust-dot-product":512,"robust-sum":520}],536:[function(t,e,r){!function(t){function e(){var t=arguments[0],r=e.cache;return r[t]&&r.hasOwnProperty(t)||(r[t]=e.parse(t)),e.format.call(null,r[t],arguments)}function n(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}var i={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};e.format=function(t,r){var a,o,s,l,c,u,f,h=1,d=t.length,p="",m=[],g=!0,v="";for(o=0;o=0),l[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,l[6]?parseInt(l[6]):0);break;case"e":a=l[7]?a.toExponential(l[7]):a.toExponential();break;case"f":a=l[7]?parseFloat(a).toFixed(l[7]):parseFloat(a);break;case"g":a=l[7]?parseFloat(a).toPrecision(l[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&l[7]?a.substring(0,l[7]):a;break;case"u":a>>>=0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}i.json.test(l[8])?m[m.length]=a:(!i.number.test(l[8])||g&&!l[3]?v="":(v=g?"+":"-",a=a.toString().replace(i.sign,"")),u=l[4]?"0"===l[4]?"0":l[4].charAt(1):" ",f=l[6]-(v+a).length,c=l[6]&&f>0?function(t,e){return Array(e+1).join(t)}(u,f):"",m[m.length]=l[5]?v+a+c:"0"===u?v+c+a:c+v+a)}return m.join("")},e.cache={},e.parse=function(t){for(var e=t,r=[],n=[],a=0;e;){if(null!==(r=i.text.exec(e)))n[n.length]=r[0];else if(null!==(r=i.modulo.exec(e)))n[n.length]="%";else{if(null===(r=i.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){a|=1;var o=[],s=r[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o[o.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))o[o.length]=l[1];else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=l[1]}r[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var a=function(t,r,n){return(n=(r||[]).slice(0)).splice(0,0,t),e.apply(null,n)};void 0!==r?(r.sprintf=e,r.vsprintf=a):(t.sprintf=e,t.vsprintf=a)}("undefined"==typeof window?this:window)},{}],537:[function(t,e,r){"use strict";e.exports=function(t){function e(e){var r=[e],c=[e];for(n[e]=i[e]=u,a[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var d=t[e];if(o[e]=0&&l[e].push(s[m])}o[e]=p}else{if(i[e]===n[e]){var g=[],v=[],y=0;for(p=r.length-1;p>=0;--p){var x=r[p];if(a[x]=!1,g.push(x),v.push(l[x]),y+=l[x].length,s[x]=f.length,x===e){r.length=p;break}}f.push(g);var b=new Array(y);for(p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return c(c({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function s(t){return t/360+.5}function l(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function c(t,e){for(var r in e)t[r]=e[r];return t}function u(t){return t.x}function f(t){return t.y}var h=t("kdbush");e.exports=function(t){return new n(t)},n.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(i);e&&console.timeEnd(r);for(var a=this.options.maxZoom;a>=this.options.minZoom;a--){var o=+Date.now();this.trees[a+1]=h(n,u,f,this.options.nodeSize,Float32Array),n=this._cluster(n,a),e&&console.log("z%d: %d clusters in %dms",a,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=h(n,u,f,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(s(t[0]),l(t[3]),s(t[2]),l(t[1])),i=[],o=0;o c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){"),c=0;c<1<<(1<128&&c%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+g[b]+"*c");var T=p[b].length/y*.5,S=.5+v[b]/y*.5;k.push("d"+b+"-"+S+"-"+T+"*("+p[b].join("+")+A+")/("+m[b].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");var E=[];for(c=0;c<1<1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)};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,m=void 0===p?0:p,g=t.sweepFlag,v=void 0===g?0:g,y=[];if(0===u||0===f)return[];var x=Math.sin(d*i/360),b=Math.cos(d*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 M=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);M>1&&(u*=Math.sqrt(M),f*=Math.sqrt(M));var k=function(t,e,r,n,a,o,l,c,u,f,h,d){var p=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(h,2),v=Math.pow(d,2),y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*d,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,M=(h-x)/a,k=(d-b)/o,A=(-h-x)/a,T=(-d-b)/o,S=s(1,0,M,k),E=s(M,k,A,T);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),T=A[0],S=A[1],E=A[2],L=A[3],C=Math.max(Math.ceil(Math.abs(L)/(i/4)),1);L/=C;for(var z=0;ze[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":43,assert:51,"is-svg-path":287,"normalize-svg-path":543,"parse-svg-path":466}],543:[function(t,e,r){"use strict";function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(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]}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,m=t.length;p4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=d),r.push(g)}return r};var a=t("svg-arc-to-cubic-bezier")},{"svg-arc-to-cubic-bezier":541}],544:[function(t,e,r){(function(r){"use strict";var n=t("svg-path-bounds"),i=t("parse-svg-path"),a=t("draw-svg-path"),o=t("is-svg-path"),s=t("bitmap-sdf"),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");e||(e={});var u,f;e.shape?(u=e.shape[0],f=e.shape[1]):(u=l.width=e.w||e.width||200,f=l.height=e.h||e.height||200);var h=Math.min(u,f),d=e.stroke||0,p=e.viewbox||e.viewBox||n(t),m=[u/(p[2]-p[0]),f/(p[3]-p[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d)),c.translate(.5*u,.5*f),c.scale(g,g),r.Path2D){var v=new Path2D(t);c.fill(v),d&&c.stroke(v)}else{var y=i(t);a(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bitmap-sdf":72,"draw-svg-path":132,"is-svg-path":287,"parse-svg-path":466,"svg-path-bounds":542}],545:[function(t,e,r){(function(r){"use strict";function n(t,e,r){r=r||{};var a=o[t];a||(a=o[t]={" ":{data:new Float32Array(0),shape:.2}});var s=a[e];if(!s)if(e.length<=1||!/\d/.test(e))s=a[e]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var d=new Float32Array(u),p=0,m=-.5*f;for(h=0;h1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;t=_(t,360),e=_(e,100),r=_(r,100);if(0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}(e.h,i,o),s=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=b(n),{ok:s,format:e.format||l,r:I(255,P(r.r,0)),g:I(255,P(r.g,0)),b:I(255,P(r.b,0)),a:n}}(e);this._originalInput=e,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=D(100*this._a)/100,this._format=n.format||i.format,this._gradientType=n.gradientType,this._r<1&&(this._r=D(this._r)),this._g<1&&(this._g=D(this._g)),this._b<1&&(this._b=D(this._b)),this._ok=i.ok,this._tc_id=z++}function n(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n,i,a=P(t,e,r),o=I(t,e,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e>1)+720)%360;--e;)i.h=(i.h+a)%360,o.push(r(i));return o}function x(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function b(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _(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=I(r,P(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function w(t){return I(1,P(0,t))}function M(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function A(t){return t<=1&&(t=100*t+"%"),t}function T(e){return t.round(255*parseFloat(e)).toString(16)}function S(t){return M(t)/255}function E(t){return!!N.CSS_UNIT.exec(t)}var L=/^\s+/,C=/\s+$/,z=0,D=t.round,I=t.min,P=t.max,O=t.random;r.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,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=b(t),this._roundA=D(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),n=D(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),i=D(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return a(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 a=[k(D(t).toString(16)),k(D(e).toString(16)),k(D(r).toString(16)),k(T(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:D(this._r),g:D(this._g),b:D(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+D(this._r)+", "+D(this._g)+", "+D(this._b)+")":"rgba("+D(this._r)+", "+D(this._g)+", "+D(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:D(100*_(this._r,255))+"%",g:D(100*_(this._g,255))+"%",b:D(100*_(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%)":"rgba("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+o(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=r(t);n="#"+o(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},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 r(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(u,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(l,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:A(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:O(),g:O(),b:O()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100;return r({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},r.readability=function(e,n){var i=r(e),a=r(n);return(t.max(i.getLuminance(),a.getLuminance())+.05)/(t.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,(i=function(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(n)).level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,c=0;a=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=r(e[u]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var F=r.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"},R=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(F),N=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==e&&e.exports?e.exports=r:window.tinycolor=r}(Math)},{}],547:[function(t,e,r){"use strict";function n(t){if(t instanceof Float32Array)return t;if("number"==typeof t)return new Float32Array([t])[0];var e=new Float32Array(t);return e.set(t),e}e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t){if("number"==typeof t)return n(t-n(t));for(var e=n(t),r=0,i=e.length;r1)n=function(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:s})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){switch(s=t,t.type){case"GeometryCollection":t.geometries.forEach(o);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":!function(t){t.forEach(a)}(t.arcs)}}var s,l=[],c=[];return o(e),c.forEach(null==r?function(t){l.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&l.push(t[0].i)}),l}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var i,s,l=1,u=a(n[0]);lu&&(s=n[0],n[0]=n[l],n[l]=s,u=i);return n})}}var a=function(t){return t},o=function(t){if(null==(e=t.transform))return a;var e,r,n,i=e.scale[0],o=e.scale[1],s=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+s,t[1]=(n+=t[1])*o+l,t}},s=function(t){function e(t){l[0]=t[0],l[1]=t[1],s(l),l[0]f&&(f=l[0]),l[1]h&&(h=l[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,s=o(t),l=new Array(2),c=1/0,u=c,f=-c,h=-c;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++ef&&(f=l[0]),l[1]h&&(h=l[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[c,u,f,h]}return n},l=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},c=function(t,e){function r(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}var n={},i={},a={},o=[],s=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++s],e[s]=r,e[n]=i)}),e.forEach(function(e){var r,n,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(e),r.end=l,n=i[l]){delete i[n.start];var c=n===r?r:r.concat(n);i[c.start=r.start]=a[c.end=n.end]=c}else i[r.start]=a[r.end]=r;else if(r=i[l])if(delete i[r.start],r.unshift(e),r.start=s,n=a[s]){delete a[n.end];var u=n===r?r:n.concat(r);i[u.start=n.start]=a[u.end=r.end]=u}else i[r.start]=a[r.end]=r;else i[(r=[e]).start=s]=a[r.end=l]=r}),r(a,i),r(i,a),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o},u=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=s(t),o=a[0],l=(a[2]-o)/(e-1)||1,c=a[1],u=(a[3]-c)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,s=t.length,f=t[0],h=f[0]=Math.round((f[0]-o)/l),d=f[1]=Math.round((f[1]-c)/u);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,l){this.center=s(r),this.up=s(n),this.right=s(i),this.radius=s([a]),this.angle=s([o,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(t,e),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];u(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=h(r,p)/s,g=h(i,p)/s;c=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)};var s=t("filtered-vector"),l=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),u=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),h=t("gl-vec3/dot"),d=o.prototype;d.setDistanceLimits=function(t,e){t=t>0?Math.log(t):-1/0,e=e>0?Math.log(e):1/0,e=Math.max(e,t),this.radius.bounds[0][0]=t,this.radius.bounds[1][0]=e},d.getDistanceLimits=function(t){var e=this.radius.bounds[0];return t?(t[0]=Math.exp(e[0][0]),t[1]=Math.exp(e[1][0]),t):[Math.exp(e[0][0]),Math.exp(e[1][0])]},d.recalcMatrix=function(t){this.center.curve(t),this.up.curve(t),this.right.curve(t),this.radius.curve(t),this.angle.curve(t);for(var e=this.computedUp,r=this.computedRight,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];var s=Math.sqrt(i),l=0;for(o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;var c=Math.sqrt(l);for(o=0;o<3;++o)r[o]/=c;var h=this.computedToward;u(h,e,r),f(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,M=x,k=-g*x,A=-v*x,T=y,S=this.computedEye,E=this.computedMatrix;for(o=0;o<3;++o){var L=_*r[o]+w*h[o]+M*e[o];E[4*o+1]=k*r[o]+A*h[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],z=E[5],D=E[9],I=E[2],P=E[6],O=E[10],F=z*O-D*P,R=D*I-C*O,N=C*P-z*I,j=n(F,R,N);F/=j,R/=j,N/=j,E[0]=F,E[4]=R,E[8]=N;for(o=0;o<3;++o)S[o]=b[o]+E[2+4*o]*d;for(o=0;o<3;++o){l=0;for(var B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[15]=1},d.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r};var p=[0,0,0];d.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;p[0]=i[2],p[1]=i[6],p[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,p);for(l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d),m=(u/=p)*e+o*r,g=(f/=p)*e+s*r,v=(h/=p)*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var c=e[o],u=e[o+4],f=e[o+8];if(a){var h=Math.abs(c),d=Math.abs(u),p=Math.abs(f),m=Math.max(h,d,p);h===m?(c=c<0?-1:1,u=f=0):p===m?(f=f<0?-1:1,c=u=0):(u=u<0?-1:1,c=f=0)}else{var g=n(c,u,f);c/=g,u/=g,f/=g}var v=e[s],y=e[s+4],x=e[s+8],b=v*c+y*u+x*f,_=n(v-=c*b,y-=u*b,x-=f*b),w=u*(x/=_)-f*(y/=_),M=f*(v/=_)-c*x,k=c*y-u*v,A=n(w,M,k);w/=A,M/=A,k/=A,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,c,u,f),this.right.jump(t,v,y,x);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],z=E*v+L*y+C*x,D=E*w+L*M+C*k;T=F<0?-Math.PI/2:Math.PI/2,S=Math.atan2(D,z)}else{var I=e[2],P=e[6],O=e[10],F=I*c+P*u+O*f,R=I*v+P*y+O*x,N=I*w+P*M+O*k;T=Math.asin(i(F)),S=Math.atan2(N,R)}this.angle.jump(t,S,T),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;l(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-j*W,G-B*W,Y-U*W)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},d.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},d.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var o=(a=a||this.computedUp)[0],s=a[1],l=a[2],c=n(o,s,l);if(!(c<1e-6)){o/=c,s/=c,l/=c;var u=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=n(u,f,h);if(!(d<1e-6)){u/=d,f/=d,h/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v,x=n(m-=y*o,g-=y*s,v-=y*l);if(!(x<.01&&(m=s*h-l*f,g=l*u-o*h,v=o*f-s*u,(x=n(m,g,v))<1e-6))){m/=x,g/=x,v/=x,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var b=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(b,_,w),k=o*u+s*f+l*h,A=m*u+g*f+v*h,T=(b/=M)*u+(_/=M)*f+(w/=M)*h,S=Math.asin(i(k)),E=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],z=L[L.length-2];C%=2*Math.PI;var D=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);D0?r.pop():new ArrayBuffer(t)}function o(t){return new Uint8Array(a(t),0,t)}function s(t){return new Uint16Array(a(2*t),0,t)}function l(t){return new Uint32Array(a(4*t),0,t)}function c(t){return new Int8Array(a(t),0,t)}function u(t){return new Int16Array(a(2*t),0,t)}function f(t){return new Int32Array(a(4*t),0,t)}function h(t){return new Float32Array(a(4*t),0,t)}function d(t){return new Float64Array(a(8*t),0,t)}function p(t){return x?new Uint8ClampedArray(a(t),0,t):o(t)}function m(t){return new DataView(a(t),0,t)}function g(t){t=v.nextPow2(t);var e=v.log2(t),r=w[e];return r.length>0?r.pop():new n(t)}var v=t("bit-twiddle"),y=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var x="undefined"!=typeof Uint8ClampedArray,b=e.__TYPEDARRAY_POOL;b.UINT8C||(b.UINT8C=y([32,0])),b.BUFFER||(b.BUFFER=y([32,0]));var _=b.DATA,w=b.BUFFER;r.free=function(t){if(n.isBuffer(t))w[v.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|v.log2(e);_[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){i(t.buffer)},r.freeArrayBuffer=i,r.freeBuffer=function(t){w[v.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(t);switch(e){case"uint8":return o(t);case"uint16":return s(t);case"uint32":return l(t);case"int8":return c(t);case"int16":return u(t);case"int32":return f(t);case"float":case"float32":return h(t);case"double":case"float64":return d(t);case"uint8_clamped":return p(t);case"buffer":return g(t);case"data":case"dataview":return m(t);default:return null}return null},r.mallocArrayBuffer=a,r.mallocUint8=o,r.mallocUint16=s,r.mallocUint32=l,r.mallocInt8=c,r.mallocInt16=u,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=h,r.mallocFloat64=r.mallocDouble=d,r.mallocUint8Clamped=p,r.mallocDataView=m,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)b.UINT8[t].length=0,b.UINT16[t].length=0,b.UINT32[t].length=0,b.INT8[t].length=0,b.INT16[t].length=0,b.INT32[t].length=0,b.FLOAT[t].length=0,b.DOUBLE[t].length=0,b.UINT8C[t].length=0,_[t].length=0,w[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":71,buffer:82,dup:134}],555:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],558:[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;n",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),h=["%","/","?",";","#"].concat(f),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=t("querystring");n.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n127?I+="x":I+=D[P];if(!I.match(p)){var F=C.slice(0,A),R=C.slice(A+1),N=D.match(m);N&&(F.push(N[1]),R.unshift(N[2])),R.length&&(u="/"+R.join(".")+u),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=a.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[w])for(A=0,z=f.length;A0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=M.slice(-1)[0],T=(r.host||t.host||M.length>1)&&("."===A||".."===A)||""===A,S=0,E=M.length;E>=0;E--)"."===(A=M[E])?M.splice(E,1):".."===A?(M.splice(E,1),S++):S&&(M.splice(E,1),S--);if(!_&&!w)for(;S--;S)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),T&&"/"!==M.join("/").substr(-1)&&M.push("");var L=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=L?"":M.length?M.shift():"";var C;(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return(_=_||r.host&&M.length)&&!L&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":560,punycode:489,querystring:493}],560:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],561:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],562:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],563:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(e)?n.showHidden=e:e&&r._extend(n,e),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t,e,n){if(t.customInspect&&e&&b(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return p(i)||(i=s(t,i,n)),i}var a=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(p(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(d(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),v=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),x(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(e);if(0===o.length){if(b(e)){var _=e.name?": "+e.name:"";return t.stylize("[Function"+_+"]","special")}if(g(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(y(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return l(e)}var w="",k=!1,A=["{","}"];if(u(e)&&(k=!0,A=["[","]"]),b(e)){w=" [Function"+(e.name?": "+e.name:"")+"]"}if(g(e)&&(w=" "+RegExp.prototype.toString.call(e)),y(e)&&(w=" "+Date.prototype.toUTCString.call(e)),x(e)&&(w=" "+l(e)),0===o.length&&(!k||0==e.length))return A[0]+w+A[1];if(n<0)return g(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var T;return T=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(T,w,A)}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,a){var o,l,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),l||(t.seen.indexOf(c.value)<0?(l=h(r)?s(t,c.value,null):s(t,c.value,r-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(t){return"  "+t}).join("\n").substr(2):"\n"+l.split("\n").map(function(t){return"   "+t}).join("\n")):l=t.stylize("[Circular]","special")),m(o)){if(a&&i.match(/^\d+$/))return l;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+l}function u(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function h(t){return null===t}function d(t){return"number"==typeof t}function p(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return v(t)&&"[object RegExp]"===_(t)}function v(t){return"object"==typeof t&&null!==t}function y(t){return v(t)&&"[object Date]"===_(t)}function x(t){return v(t)&&("[object Error]"===_(t)||t instanceof Error)}function b(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function w(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;r.format=function(t){if(!p(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),ac&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":566}],568:[function(t,e,r){"use strict";e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":569}],569:[function(t,e,r){"use strict";function n(t,e,r,n){var i=function(t,e){var r=a(t,128);return e?s(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,n),o=function(t,e,r){for(var n=e.textAlign||"start",i=e.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=t.length,l=0;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}var o=t("pbf"),s=t("./vector-tile-pb"),l=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new l(t[r].features),e[r].name=r;return n({layers:e})},e.exports.GeoJSONWrapper=l},{"./lib/geojson_wrapper":571,"./vector-tile-pb":572,pbf:470}],571:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e=0?e[o]:a})},has___:{value:i(function(e){var i=n(e);return i?r in i:t.indexOf(e)>=0})},set___:{value:i(function(i,a){var o,s=n(i);return s?s[r]=a:(o=t.indexOf(i))>=0?e[o]=a:(o=t.length,e[o]=a,t[o]=i),this})},delete___:{value:i(function(i){var a,o,s=n(i);return s?r in s&&delete s[r]:!((a=t.indexOf(i))<0||(o=t.length-1,t[a]=void 0,e[a]=e[o],t[a]=t[o],t.length=o,e.length=o,0))})}})};b.prototype=Object.create(Object.prototype,{get:{value:function(t,e){return this.get___(t,e)},writable:!0,configurable:!0},has:{value:function(t){return this.has___(t)},writable:!0,configurable:!0},set:{value:function(t,e){return this.set___(t,e)},writable:!0,configurable:!0},delete:{value:function(t){return this.delete___(t)},writable:!0,configurable:!0}}),"function"==typeof s?function(){function r(){this instanceof b||a();var e,r=new s,n=void 0,l=!1;return e=o?function(t,e){return r.set(t,e),r.has(t)||(n||(n=new b),n.set(t,e)),this}:function(t,e){if(l)try{r.set(t,e)}catch(r){n||(n=new b),n.set___(t,e)}else r.set(t,e);return this},Object.create(b.prototype,{get___:{value:i(function(t,e){return n?r.has(t)?r.get(t):n.get___(t,e):r.get(t,e)})},has___:{value:i(function(t){return r.has(t)||!!n&&n.has___(t)})},set___:{value:i(e)},delete___:{value:i(function(t){var e=!!r.delete(t);return n?n.delete___(t)||e:e})},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");l=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=b.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=b)}}()},{}],574:[function(t,e,r){var n=t("./hidden-store.js");e.exports=function(){var t={};return function(e){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw new Error("Weakmap-shim: Key must be object");var r=e.valueOf(t);return r&&r.identity===t?r:n(e,t)}}},{"./hidden-store.js":575}],575:[function(t,e,r){e.exports=function(t,e){var r={identity:e},n=t.valueOf;return Object.defineProperty(t,"valueOf",{value:function(t){return t!==e?n.apply(this,arguments):r},writable:!0}),r}},{}],576:[function(t,e,r){var n=t("./create-store.js");e.exports=function(){var t=n();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){return t(e).value=r,this},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}},{"./create-store.js":574}],577:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":156}],578:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),c=0,u=l.length;c2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?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 i.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 n,a=this._validateYear(t,i.local.invalidyear),s=h[a-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(n=o.newDate(l,c,u)).add(4-(n.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-n.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 i.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 n=this._validate(t,s,r,i.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var a=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{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");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var p=0;p>9&4095,v=m>>5&15,y=31&m,x=new Date(g,v-1,y+l);return a.year=x.getFullYear(),a.month=1+x.getMonth(),a.day=x.getDate(),a}(t,s,r,a);return o.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=o.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;var l,c=(o=h[a.year-h[0]])>>9&4095,u=o>>5&15,d=31&o,p=new Date(c,u-1,d),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-p)/864e5);var g,v=f[a.year-f[0]];for(g=0;g<13;g++){var y=v&1<<12-g?30:29;if(l>13;return!x||g=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:a[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.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 a={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":595,"object-assign":462}],584:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidYear||i.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,i.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 n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.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)}}),i.calendars.ethiopian=n},{"../main":595,"object-assign":462}],585:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main");t("object-assign")(n.prototype=new a.baseCalendar,{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,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.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,a.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,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(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 n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.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)}}),a.calendars.hebrew=n},{"../main":595,"object-assign":462}],586:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.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 n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+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)}}),i.calendars.islamic=n},{"../main":595,"object-assign":462}],587:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.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 n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.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)}}),i.calendars.julian=n},{"../main":595,"object-assign":462}],588:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main");t("object-assign")(n.prototype=new o.baseCalendar,{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,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);t%=400,t+=t<0?400:0;return 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,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.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)}}),o.calendars.mayan=n},{"../main":595,"object-assign":462}],589:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.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,i.local.invalidYear||i.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,i.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 n=this._validate(t,e,r,i.local.invalidMonth);(t=n.year())<0&&t++;for(var a=n.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)}}),i.calendars.nanakshahi=n},{"../main":595,"object-assign":462}],590:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.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 n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.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=i.instance().fromJD(t),r=e.year(),n=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;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);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,a.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 n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/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=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+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)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":595,"object-assign":462}],592:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.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 n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.taiwan=n},{"../main":595,"object-assign":462}],593:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.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 n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.thai=n},{"../main":595,"object-assign":462}],594:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth).toJD()-24e5+.5,n=0,o=0;or)return a[n]-a[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),o=12*(n.year()-1)+n.month()-15292;return n.day()+a[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,o=Math.floor((i-1)/12),s=o+1,l=i-12*o,c=e-a[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var a=[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":595,"object-assign":462}],595:[function(t,e,r){function n(){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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.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]}}}),l(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(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?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.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 i(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?"-":"")+a(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 n;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s},{"object-assign":462}],596:[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=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,c=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n1}),u=function(t,e,r,n){var i=""+e;if(c(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){d=1,p=m;for(var E=this.daysInMonth(h,d);p>E;E=this.daysInMonth(h,d))d++,p-=E}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":595,"object-assign":462}],597:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n        var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n        var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n        if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n          _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n        }\n      }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":116}],598:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":597}],599:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var u=c("visible",!(l=l||{}).itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;a(t,e,r,c);for(var h=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},g=0;g<2;g++){var v=d[g],y=i.coerceRef(t,e,m,v,"","paper");if(i.coercePosition(e,m,c,y,v,.5),h){var x="a"+v,b=i.coerceRef(t,e,m,x,"pixel");"pixel"!==b&&b!==y&&(b=e[x]="pixel");var _="pixel"===b?p[g]:.4;i.coercePosition(e,m,c,b,x,_)}c(v+"anchor"),c(v+"shift")}if(n.noneOrAll(t,e,["x","y"]),h&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":743,"../../plots/cartesian/axes":789,"./attributes":601,"./common_defaults":604}],600:[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}]},{}],601:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},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:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},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:"calcIfAutorange"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},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:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},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"}}}},{"../../plots/cartesian/constants":794,"../../plots/font_attributes":816,"./arrow_paths":600}],602:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i,o,s=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,i=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(a.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,o)})):(i=e.ax?i+e.ax:i,o=e.ax?o-e.ax:o,a.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,i=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(a.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,o)})):(i=e.ay?i+e.ay:i,o=e.ay?o-e.ay:o,a.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,o)})))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=1,s[t.yref]=1});for(var l in s){var c=a.getFromId(t,l);if(c&&c.autorange)return i.syncOrAsync([o,n],t)}}}},{"../../lib":743,"../../plots/cartesian/axes":789,"./draw":607}],603:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s,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,i=n(t,e),o=i.on,s=i.off.concat(i.explicitOff),l={};if(o.length||s.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var a=N.selectAll("a");if(1===a.size()&&a.text()===N.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":a.attr("xlink:href"),"xlink:xlink:show":a.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(P.node())}var c=C.select(".annotation-text-math-group"),h=!c.empty(),v=f.bBox((h?c:N).node()),y=v.width,L=v.height,D=e.width||y,R=e.height||L,j=Math.round(D+2*I),B=Math.round(R+2*I);e._w=D,e._h=R;for(var U=!1,V=["x","y"],q=0;q1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;H=Q._offset+Q.r2p(e[Z]),W=.5}else"x"===Z?(Y=e[Z],H=_.l+_.w*Y):(Y=1-e[Z],H=_.t+_.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){at.head=H;var st=e["a"+Z];X=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=X):(at.tail=H+st,G=X+st),at.text=at.tail+X;var lt=b["x"===Z?"width":"height"];if("paper"===J&&(at.head=l.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else G=X=rt*r(W,nt),at.text=H+X;at.text+=it,X+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=X}if(U)C.remove();else{var ft=0,ht=0;if("left"!==e.align&&(ft=(D-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(R-L)*("middle"===e.valign?.5:1)),h)c.select("svg").attr({x:I+ft-1,y:I+ht}).call(f.setClipUrl,O?M:null);else{var dt=I+ht-v.top,pt=I+ft-v.left;N.call(d.positionText,pt,dt).call(f.setClipUrl,O?M:null)}F.select("rect").call(f.setRect,I,I,D,R),P.call(f.setRect,z/2,z/2,j-z,B-z),C.call(f.setTranslate,Math.round(k.x.text-j/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+A+","+k.x.text+","+k.y.text+")"});var mt=function(r,a){T.selectAll(".annotation-arrow-g").remove();var c=k.x.head,h=k.y.head,d=k.x.tail+r,p=k.y.tail+a,v=k.x.text+r,y=k.y.text+a,b=l.rotationXYMatrix(A,v,y),M=l.apply2DTransform(b),E=l.apply2DTransform2(b),L=+P.attr("width"),z=+P.attr("height"),D=v-.5*L,I=D+L,O=y-.5*z,F=O+z,R=[[D,O,D,F],[D,F,I,F],[I,F,I,O],[I,O,D,O]].map(E);if(!R.reduce(function(t,e){return t^!!l.segmentsIntersect(c,h,c+1e6,h+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=l.segmentsIntersect(d,p,c,h,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var N=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,U=T.append("g").style({opacity:u.opacity(j)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+d+","+p+"L"+c+","+h).style("stroke-width",N+"px").call(u.stroke,u.rgb(j));if(g(V,B,e),w.annotationPosition&&V.node().parentNode&&!n){var q=c,H=h;if(e.standoff){var G=Math.sqrt(Math.pow(c-d,2)+Math.pow(h-p,2));q+=e.standoff*(d-c)/G,H+=e.standoff*(p-h)/G}var Y,W,X,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-q)+","+(p-H),transform:"translate("+q+","+H+")"}).style("stroke-width",N+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");m.init({element:Z.node(),gd:t,prepFn:function(){var t=f.getTranslate(C);W=t.x,X=t.y,Y={},i&&i.autorange&&(Y[i._name+".autorange"]=!0),s&&s.autorange&&(Y[s._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(W,X),a=n[0]+t,o=n[1]+r;C.call(f.setTranslate,a,o),Y[x+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,Y[x+".y"]=s?s.p2r(s.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(Y[x+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[x+".ay"]=s.p2r(s.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),S.attr({transform:"rotate("+A+","+a+","+o+")"})},doneFn:function(){o.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),E){var gt,vt;m.init({element:C.node(),gd:t,prepFn:function(){vt=S.attr("transform"),gt={}},moveFn:function(t,r){var a="pointer";if(e.showarrow)e.axref===e.xref?gt[x+".ax"]=i.p2r(i.r2p(e.ax)+t):gt[x+".ax"]=e.ax+t,e.ayref===e.yref?gt[x+".ay"]=s.p2r(s.r2p(e.ay)+r):gt[x+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)gt[x+".x"]=e.x+t/i._m;else{var o=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-o/2;gt[x+".x"]=m.align(l+t/_.w,o,0,1,e.xanchor)}if(s)gt[x+".y"]=e.y+r/s._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;gt[x+".y"]=m.align(u-r/_.h,c,0,1,e.yanchor)}i&&s||(a=m.getCursor(i?.5:gt[x+".x"],s?.5:gt[x+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+r+")"+vt}),p(C,a)},doneFn:function(){p(C),o.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}var y,x,b=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,x=n+".annotations["+r+"]"):(y="annotation",x="annotations["+r+"]"),b._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+b._uid+"_ann"+r;if(e._input&&!1!==e.visible){var k={x:{},y:{}},A=+e.textangle||0,T=b._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),S=T.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||E,C=S.append("g").style("pointer-events",L?"all":null).call(p,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:a.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();h.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:t})}).on("mouseout",function(){h.loneUnhover(b._hoverlayer.node())});var z=e.borderwidth,D=e.borderpad,I=z+D,P=C.append("rect").attr("class","bg").style("stroke-width",z+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),O=e.width||e.height,F=b._topclips.selectAll("#"+M).data(O?[0]:[]);F.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),F.exit().remove();var R=e.font,N=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?N.call(d.makeEditable,{delegate:C,gd:t}).call(c).on("edit",function(r){e.text=r,this.call(c);var n={};n[x+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),s&&s.autorange&&(n[s._name+".autorange"]=!0),o.relayout(t,n)}):N.call(c)}else a.selectAll("#"+M).remove()}var a=t("d3"),o=t("../../plotly"),s=t("../../plots/plots"),l=t("../../lib"),c=t("../../plots/cartesian/axes"),u=t("../color"),f=t("../drawing"),h=t("../fx"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),m=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,x=d.backoff*m+r.standoff,b=p.backoff*g+r.startstandoff;if("line"===h.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var _=l.x-c.x,w=l.y-c.y;if(u=Math.atan2(w,_),f=u+Math.PI,x&&b&&x+b>Math.sqrt(_*_+w*w))return void o();if(x){if(x*x>_*_+w*w)return void o();var M=x*Math.cos(u),k=x*Math.sin(u);c.x+=M,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>_*_+w*w)return void o();var A=b*Math.cos(u),T=b*Math.sin(u);l.x-=A,l.y-=T,t.attr({x1:l.x,y1:l.y})}}else if("path"===h.nodeName){var S=h.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":841,"../annotations/draw":607}],614:[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)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 i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||c).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);1!==n.getAlpha()&&(n=i(o.combine(t,c)));return(n.isDark()?e?n.lighten(e):c:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e0?E>=O:E<=O));L++)E>R&&E0?E>=O:E<=O));L++)E>C[0]&&E1){var ot=Math.pow(10,Math.floor(Math.log(at)/Math.LN10));nt*=ot*u.roundUp(at/ot,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[K+X,K+G-X],et.setScale();var st=T._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var lt=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");et._axislayer=st.select(".cbaxis");var ct=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ut,ft=S.l+(k.x+Y)*S.w,ht=et.titlefont.size;ut="top"===k.titleside?(1-(K+G-X))*S.h+S.t+3+.75*ht:(1-(K+X))*S.h+S.t-3-.25*ht,A(et._id+"title",{attributes:{x:ft,y:ut,"text-anchor":"start"}})}var dt=u.syncOrAsync([o.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k.titleside)){var e=st.select(".cbtitle"),r=e.select("text"),a=[-k.outlinewidth/2,k.outlinewidth/2],o=e.select(".h"+et._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=parseInt(r.node().style.fontSize,10)*v),o?(ct=d.bBox(o).height)>s&&(a[1]-=(ct-s)/2):r.node()&&!r.classed(w.jsPlaceholder)&&(ct=d.bBox(r.node()).height),ct){if(ct+=5,"top"===k.titleside)et.domain[1]-=ct/S.h,a[1]*=-1;else{et.domain[0]+=ct/S.h;var c=g.lineCount(r);a[1]+=(1-c)*s}e.attr("transform","translate("+a+")"),et.setScale()}}st.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(S.h*(1-et.domain[1]))+")"),et._axislayer.attr("transform","translate(0,"+Math.round(-S.t)+")");var f=st.select(".cbfills").selectAll("rect.cbfill").data(D);f.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?C[0]:(D[e]+D[e-1])/2,e===D.length-1?C[1]:(D[e]+D[e+1])/2].map(et.c2p).map(Math.round);e!==D.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=P(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Z,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var h=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?z:[]);return h.enter().append("path").classed(w.cbline,!0),h.exit().remove(),h.each(function(t){n.select(this).attr("d","M"+Z+","+(Math.round(et.c2p(t))+k.line.width/2%1)+"h"+V).call(d.lineGroupStyle,k.line.width,I(t),k.line.dash)}),et._axislayer.selectAll("g."+et._id+"tick,path").remove(),et._pos=Z+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),et.side="right",u.syncOrAsync([function(){return l.doTicks(t,et,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=et.titlefont.size,r=et._offset+et._length/2,i=S.l+(et.position||0)*S.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));A("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:k.titleside,offsetLeft:S.l,offsetTop:0,maxShift:T.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},o.previousPromises,function(){var r=V+k.outlinewidth/2+d.bBox(et._axislayer.node()).width;if((j=lt.select("text")).node()&&!j.classed(w.jsPlaceholder)){var n,i=lt.select(".h"+et._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(k.titleside)?d.bBox(i).width:d.bBox(lt.node()).right-Z-S.l,r=Math.max(r,n)}var a=2*k.xpad+r+k.borderwidth+k.outlinewidth/2,s=Q-$;st.select(".cbbg").attr({x:Z-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:$-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,k.bgcolor).call(p.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:Z,y:$+k.ypad+("top"===k.titleside?ct:0),width:Math.max(V,2),height:Math.max(s-2*k.ypad-ct,2)}).call(p.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var l=({center:.5,right:1}[k.xanchor]||0)*a;st.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:k.x,y:k.y,l:a*({right:1,center:.5}[k.xanchor]||0),r:a*({left:1,center:.5}[k.xanchor]||0),t:s*({bottom:1,middle:.5}[k.yanchor]||0),b:s*({top:1,middle:.5}[k.yanchor]||0)})}],t);if(dt&&dt.then&&(t._promises||[]).push(dt),t._context.edits.colorbarPosition){var pt,mt,gt;c.init({element:st.node(),gd:t,prepFn:function(){pt=st.attr("transform"),h(st)},moveFn:function(t,e){st.attr("transform",pt+" translate("+t+","+e+")"),mt=c.align(J+t/S.w,q,0,1,k.xanchor),gt=c.align(K-e/S.h,G,0,1,k.yanchor);var r=c.getCursor(mt,gt,k.xanchor,k.yanchor);h(st,r)},doneFn:function(){h(st),void 0!==mt&&void 0!==gt&&a.restyle(t,{"colorbar.x":mt,"colorbar.y":gt},M().index)}})}return dt}T._infolayer.selectAll("g."+e).remove()}function M(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":743,"./flip_scale":630,"./scales":637}],626:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":732,"./attributes":624,"./scales.js":637}],627:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":637}],628:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,h=u.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,m=f?i.nestedProperty(e,d).get()||{}:e,g=p[h+"min"],v=p[h+"max"],y=p.colorscale;c(f+h+"auto",!(n(g)&&n(v)&&g=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],631:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":627,"./is_valid_scale_array":635,"./scales":637}],632:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],639:[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":743}],640:[function(t,e,r){"use strict";function n(){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 i(t){return a(t.changedTouches?t.changedTouches[0]:t,document.body)}var a=t("mouse-event-offset"),o=t("has-hover"),s=t("../../plotly"),l=t("../../lib"),c=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),f=e.exports={};f.align=t("./align"),f.getCursor=t("./cursor");var h=t("./unhover");f.unhover=h.wrapped,f.unhoverRaw=h.raw;var d=l.eventListenerOptionsSupported();f.init=function(t){function e(e){_._dragged=!1,_._dragging=!0;var s=i(e);return h=s[0],p=s[1],x=e.target,y=e,b=e.buttons&&2===e.buttons||e.ctrlKey,(m=(new Date).getTime())-_._mouseDownTimeM&&(w=Math.max(w-1,1)),_._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(w,y),!b){var n;try{n=new MouseEvent("click",e)}catch(t){var c=i(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,c[0],c[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}x.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&s.plot(t)}(_),_._dragged=!1,l.pauseEvent(e)}_._dragged=!1}var h,p,m,g,v,y,x,b,_=t.gd,w=1,M=u.DBLCLICKDELAY,k=t.element;_._mouseDownTime||(_._mouseDownTime=0),k.style.pointerEvents="all",k.onmousedown=e,d?(k._ontouchstart&&k.removeEventListener("touchstart",k._ontouchstart),k._ontouchstart=e,k.addEventListener("touchstart",e,{passive:!1})):k.ontouchstart=e;var A=t.clampFn||function(t,e,r){return Math.abs(t)=200?k:"")}function i(t,e,r,n){var i=l.select(t.node().parentNode),a=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",o=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=n?n/.8+1:0,c=(m.lineCount(t)-1)*v+1,u=S[o]*s,f=.75*r+S[a]*s+(S[a]-1)*c*r/2;t.attr("text-anchor",o),i.attr("transform","translate("+u+","+f+")")}function a(t,e){var r=t.ts||e.textfont.size;return c(r)&&r>0?r:0}function o(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],c=Math.pow(i*i+a*a,E/2),u=Math.pow(o*o+s*s,E/2),f=(u*u*i-c*c*o)*n,h=(u*u*a-c*c*s)*n,d=3*u*(c+u),p=3*c*(c+u);return[[l.round(e[0]+(d&&f/d),2),l.round(e[1]+(d&&h/d),2)],[l.round(e[0]-(p&&f/p),2),l.round(e[1]-(p&&h/p),2)]]}function s(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var l=t("d3"),c=t("fast-isnumeric"),u=t("tinycolor2"),f=t("../../registry"),h=t("../color"),d=t("../colorscale"),p=t("../../lib"),m=t("../../lib/svg_text_utils"),g=t("../../constants/xmlns_namespaces"),v=t("../../constants/alignment").LINE_SPACING,y=t("../../constants/interactions").DESELECTDIM,x=t("../../traces/scatter/subtypes"),b=t("../../traces/scatter/make_bubble_size_func"),_=e.exports={};_.font=function(t,e,r,n){p.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(h.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,i){t.call(_.setPosition,e,r).call(_.setSize,n,i)},_.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(c(i)&&c(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},_.translatePoints=function(t,e,r){t.each(function(t){var n=l.select(this);_.translatePoint(t,n,e,r)})},_.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(e){var i=e[0].trace,a=i.xcalendar,o=i.ycalendar;t.selectAll(".point,.textpoint").each(function(t){_.hideOutsideRangePoint(t,l.select(this),r,n,a,o)})})}},_.crispRound=function(t,e,r){return e&&c(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.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||"";h.stroke(e,n||a.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,o=n||i.dash||"";l.select(this).call(h.stroke,r||i.color).call(_.dashLine,o,a)})},_.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){var e=(((l.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(h.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=l.select(this);try{r.call(h.fill,e[0].trace.fillcolor)}catch(e){p.error(e,t),r.remove()}})};var w=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(w).forEach(function(t){var e=w[t];_.symbolList=_.symbolList.concat([e.n,t,e.n+100,t+"-open"]),_.symbolNames[e.n]=t,_.symbolFuncs[e.n]=e.f,e.needLine&&(_.symbolNeedLines[e.n]=!0),e.noDot?_.symbolNoDot[e.n]=!0:_.symbolList=_.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(_.symbolNoFill[e.n]=!0)});var M=_.symbolNames.length,k="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";_.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=M||t>=400?0:Math.floor(Math.max(t,0))};var A={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0};_.gradient=function(t,e,r,n,i,a){var o=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],p.identity);o.exit().remove(),o.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=l.select(this);"horizontal"===n?t.attr(A):"vertical"===n&&t.attr(T),t.attr("id",r);var e=u(i),o=u(a);t.append("stop").attr({offset:"0%","stop-color":h.tinyRGB(o),"stop-opacity":o.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":h.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},_.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},_.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;!function(t,e,r,i,a,o,s,l){if(f.traceIs(r,"symbols")){var c=b(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:x.isBubble(r)?c(t.ms):(o.size||6)/2,t.mrc=e;var i=_.symbolNumber(t.mx||o.symbol)||0;return t.om=i%200>=100,n(i,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var u,d,p,m=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,u=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?h.defaultLine:s.color,Array.isArray(o.color)&&(u=h.defaultLine,m=!0),u="mc"in t?t.mcc=i(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(h.stroke,u).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=o.gradient,v=t.mgt;if(v?m=!0:v=g&&g.type,v&&"none"!==v){var y=t.mgc;y?m=!0:y=g.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(_.gradient,l,w,v,u,y)}else e.call(h.fill,u);p&&e.call(h.stroke,d)}}(t,e,r,i,a,s,s.line,o)},_.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=_.tryColorscale(n,""),a=_.tryColorscale(n,"line");t.each(function(t){_.singlePointStyle(t,l.select(this),e,i,a,r)})}},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},s=i.marker||{},c=a.opacity,u=o.opacity,d=s.opacity,p=void 0!==u,m=void 0!==d;t.each(function(t){var e,r=l.select(this),n=t.mo,i=void 0!==n;(i||p||m)&&(t.selected?p&&(e=u):e=m?d:y*(i?n:c)),void 0!==e&&r.style("opacity",e)});var g=o.color,v=s.color;(g||v)&&t.each(function(t){var e,r=l.select(this);t.selected?g&&(e=g):v&&(e=v),e&&h.fill(r,e)});var x=o.size,b=s.size,w=void 0!==x,M=void 0!==b;f.traceIs(e,"symbols")&&(w||M)&&t.each(function(t){var e,r=l.select(this),i=t.mrc,o=t.mx||a.symbol||0;e=t.selected?w?x/2:i:M?b/2:i,r.attr("d",n(_.symbolNumber(o),e)),t.mrc2=e})}},_.tryColorscale=function(t,e){var r=e?p.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?d.makeColorScaleFunc(d.extractScale(n,r.cmin,r.cmax)):p.identity};var S={start:1,end:-1,middle:0,bottom:1,top:-1};_.textPointStyle=function(t,e,r){t.each(function(t){var n=l.select(this),o=p.extractOption(t,e,"tx","text");if(o){var s=t.tp||e.textposition,c=a(t,e);n.call(_.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).text(o).call(m.convertToTspans,r).call(i,s,c,t.mrc)}else n.remove()})},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},n=e.unselected||{};t.each(function(t){var o,s=l.select(this),c=t.tc||e.textfont.color,u=t.tp||e.textposition,f=a(t,e),d=(r.textfont||{}).color,p=(n.textfont||{}).color;t.selected?d&&(o=d):p?o=p:d||(o=h.addOpacity(c,y)),o&&h.fill(s,o),i(s,u,f,t.mrc2||t.mrc)})}};var E=.5;_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(_.savedBBoxes={},C=0),r&&(_.savedBBoxes[r]=v),C++,p.extendFlat({},v)},_.setClipUrl=function(t,e){if(e){var r="#"+e,n=l.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}else t.attr("clip-path",null)},_.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",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.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",i=t.attr?"attr":"setAttribute",a=t[n]("transform")||"";return e=e||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var z=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=l.select(this),i=n.select("text");if(i.node()){var a=parseFloat(i.attr("x")||0),o=parseFloat(i.attr("y")||0),s=(n.attr("transform")||"").match(z);t=1===e&&1===r?[]:["translate("+a+","+o+")","scale("+e+","+r+")","translate("+-a+","+-o+")"],s&&t.push(s),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../constants/xmlns_namespaces":723,"../../lib":743,"../../lib/svg_text_utils":766,"../../registry":873,"../../traces/scatter/make_bubble_size_func":1083,"../../traces/scatter/subtypes":1088,"../color":618,"../colorscale":633,"./symbol_defs":644,d3:128,"fast-isnumeric":140,tinycolor2:546}],644:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:128}],645:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],646:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=[];if(a.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(a),u=0;u0;t.each(function(t){var f,h=t[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,f);if(g.exit().remove(),t.length){d.visible||g.selectAll("path.xerror").remove(),p.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(r.duration).style("opacity",1),a.setClipUrl(g,e.layerClipId),g.each(function(t){var e=n.select(this),a=function(t,e,r){var n={x:e.c2p(t.x),y:r.c2p(t.y)};return void 0!==t.yh&&(n.yh=r.c2p(t.yh),n.ys=r.c2p(t.ys),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))),n}(t,l,c);if(!m||t.vis){var o;if(p.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var f=p.width;o="M"+(a.x-f)+","+a.yh+"h"+2*f+"m-"+f+",0V"+a.ys,a.noYS||(o+="m-"+f+",0h"+2*f);var h=e.select("path.yerror");(s=!h.size())?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(h=h.transition().duration(r.duration).ease(r.easing)),h.attr("d",o)}if(d.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var g=(d.copy_ystyle?p:d).width;o="M"+a.xh+","+(a.y-g)+"v"+2*g+"m0,-"+g+"H"+a.xs,a.noXS||(o+="m0,-"+g+"v"+2*g);var v=e.select("path.xerror");(s=!v.size())?v=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(v=v.transition().duration(r.duration).ease(r.easing)),v.attr("d",o)}}})}})}},{"../../traces/scatter/subtypes":1088,"../drawing":643,d3:128,"fast-isnumeric":140}],651:[function(t,e,r){"use strict";var n=t("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":618,d3:128}],652:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":816}],653:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");e.exports=function(t){function e(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},a)}}for(var r=t.calcdata,a=t._fullLayout,o=0;o=0&&r.indextt.width||$<0||$>tt.height)return v.unhoverRaw(t,e);e.pointerX=e.offsetX,e.pointerY=e.offsetY}if(P="xval"in e?b.flat(m,e.xval):b.p2c(S,Q),O="yval"in e?b.flat(m,e.yval):b.p2c(E,$),!c(P[0])||!c(O[0]))return f.warn("Fx.hover failed",e,t),v.unhoverRaw(t,e)}var et=1/0;for(R=0;RY&&(Z.splice(0,Y),et=Z[0].distance),_._has("cartesian")&&0!==X&&0===Z.length){G.distance=X,G.index=!1;var ot=j._module.hoverPoints(G,q,H,"closest",_._hoverlayer);if(ot){var st,lt=ot.filter(function(t){return t.xa.showspikes});if(lt.length){var ct=lt[0];c(ct.x0)&&c(ct.y0)&&(st=d(ct),(!K.vLinePoint||K.vLinePoint.distance>st.distance)&&(K.vLinePoint=st))}var ut=ot.filter(function(t){return t.ya.showspikes});if(ut.length){var ft=ut[0];c(ft.x0)&&c(ft.y0)&&(st=d(ft),(!K.hLinePoint||K.hLinePoint.distance>st.distance)&&(K.hLinePoint=st))}}}}var ht={fullLayout:_,container:_._hoverlayer,outerContainer:_._paperdiv,event:e},dt=t._spikepoints,pt={vLinePoint:K.vLinePoint,hLinePoint:K.hLinePoint};if(t._spikepoints=pt,_._has("cartesian")&&0!==X&&0!==Z.length){var mt=u(Z.filter(function(t){return t.ya.showspikes}),X);K.hLinePoint=d(mt);var gt=u(Z.filter(function(t){return t.xa.showspikes}),X);K.vLinePoint=d(gt)}if(0===Z.length){var vt=v.unhoverRaw(t,e);return!_._has("cartesian")||null===K.hLinePoint&&null===K.vLinePoint||s(dt)&&o(K,ht),vt}_._has("cartesian")&&s(dt)&&o(K,ht),Z.sort(function(t,e){return t.distance-e.distance});var yt=t._hoverdata,xt=[];for(F=0;F1,wt=i(Z,{hovermode:I,rotateLabels:_t,bgColor:g.combine(_.plot_bgcolor||g.background,_.paper_bgcolor),container:_._hoverlayer,outerContainer:_._paperdiv,commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance},t);if(function(t,e,r){function n(t){var e=t[0],r=t[t.length-1];if(a=e.pmin-e.pos-e.dp+e.size,o=r.pos+r.dp+r.size-e.pmax,a>.01){for(l=t.length-1;l>=0;l--)t[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=t.length-1;l>=0;l--)t[l].dp-=o;i=!1}if(i){var n=0;for(s=0;se.pmax&&n++;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}var i,a,o,s,l,c,u,f=0,h=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?k:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});for(;!i&&f<=t.length;){for(f++,i=!0,s=0;s.01&&m.pmin===g.pmin&&m.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),h.splice(s+1,1),u=0,l=d.length-1;l>=0;l--)u+=d[l].dp;for(o=u/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;i=!1}else s++}h.forEach(n)}for(s=h.length-1;s>=0;s--){var v=h[s];for(l=v.length-1;l>=0;l--){var y=v[l],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(Z,_t?"xa":"ya",_),a(wt,_t),e.target&&e.target.tagName){var Mt=x.getComponentMethod("annotations","hasClickToShow")(t,xt);p(l.select(e.target),Mt?"pointer":"")}e.target&&!n&&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))return!0}return!1}(t,0,yt)&&(yt&&t.emit("plotly_unhover",{event:e,points:yt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,c=e.container,u=e.outerContainer,f=e.commonLabelOpts||{},h=e.fontFamily||_.HOVERFONT,p=e.fontSize||_.HOVERFONTSIZE,v=t[0],y=v.xa,x=v.ya,b="y"===a?"yLabel":"xLabel",M=v[b],k=(String(M)||"").split(" ")[0],A=u.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,z=v.distance<=e.hoverdistance&&("x"===a||"y"===a);for(n=0;n-1&&n.length>v&&(n=v>3?n.substr(0,v-3)+"...":n.substr(0,v))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
"),i+=(i?"z: ":"")+t.zLabel):z&&t[a+"Label"]===M?i=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
":"")+t.text),""===i&&(""===n&&e.remove(),i=n);var y=e.select("text.nums").call(m.font,t.fontFamily||h,t.fontSize||p,t.fontColor||f).text(i).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==i?(x.call(m.font,t.fontFamily||h,t.fontSize||p,u).text(n).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*E):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:f});var _,k,A=y.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,I=t.ya._offset+(t.y0+t.y1)/2,P=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),F=A.width+S+E+b;t.ty0=T-A.top,t.bx=A.width+2*E,t.by=A.height+2*E,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,_=I+O/2+F<=C,k=I-O/2-F>=0,"top"!==t.idealAlign&&_||!k?_?(I+=O/2,t.anchor="start"):t.anchor="middle":(I-=O/2,t.anchor="end")):(t.pos=I,_=D+P/2+F<=L,k=D-P/2-F>=0,"left"!==t.idealAlign&&_||!k?_?(D+=P/2,t.anchor="start"):t.anchor="middle":(D-=P/2,t.anchor="end")),y.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+I+")"+(o?"rotate("+w+")":""))}),P}function a(t,e){t.each(function(t){var r=l.select(this);if(t.del)r.remove();else{var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(S+E),s=o+a*(t.txwidth+E),c=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-T,c=t.offset*A),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+c)+","+(S+u)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+c)+"V"+(u-S)+"Z"),i.call(d.positionText,o+c,u+t.ty0-t.by/2+E),t.tx2width&&(r.select("text.name").call(d.positionText,s+a*E+c,u+t.ty0-t.by/2+E),r.select("rect").call(m.setRect,s+(a-1)*t.tx2width/2+c,u-t.by/2-1,t.tx2width,t.by+2))}})}function o(t,e){var r,n,i=e.container,a=e.fullLayout,o=e.event,s=!!t.hLinePoint,l=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),l||s){var c=g.combine(a.plot_bgcolor,a.paper_bgcolor);if(s){var f,h,d=t.hLinePoint;r=d&&d.xa;"cursor"===(n=d&&d.ya).spikesnap?(f=o.pointerX,h=o.pointerY):(f=r._offset+(d.x0+d.x1)/2,h=n._offset+(d.y0+d.y1)/2);var p,v,y=u.readability(d.color,c)<1.5?g.contrast(c):d.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,M=(w.left+w.right)/2=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],670:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":816,"../color/attributes":617}],671:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],672:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var c,u,f,h,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,h="bottom"):(c=0,f="left",u=-.1,h="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",c),l("xanchor",f),l("y",u),l("yanchor",h),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":743,"../../plots/layout_attributes":843,"../../registry":873,"./attributes":670,"./helpers":676}],673:[function(t,e,r){"use strict";function n(t,e){function r(r){m.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*x;if(o){var l=d.bBox(o);n=l.height,i=l.width,d.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),u=m.lineCount(c),f=c.node();n=s*u,i=f?d.bBox(f).width:0;var h=s*(.3+(1-u)/2);m.positionText(c,40,h)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,o=f.traceIs(a,"pie"),s=a.index,u=o?n.label:a.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(d.font,i.legend.font).text(u),e._context.edits.legendText&&!o?h.call(m.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(o.type))u[(a=n.trace.transforms)[a.length-1].direction+".name"]=t;else if(f.hasTransform(o,"groupby")){var h=f.getTransformIndices(o,"groupby"),d=h[h.length-1],p=c.keyedContainer(o,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),u=p.constructUpdate()}else u.name=t;return l.restyle(e,u,s)}):h.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(p.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimek&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){g(t,e,n)},k):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,g(t,e,n))}})}function a(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=w.isGrouped(i),l=0;if(i.width=0,i.height=0,w.isVertical(i))o&&e.each(function(t,e){d.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;d.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),l=40;else if(o){for(var c=[i.width],u=e.data(),f=0,h=u.length;fa+_-M,r.each(function(t){var e=t[0],r=g?40+t[0].width:x;a+b+M+r>n.width-(n.margin.r+n.margin.l)&&(b=0,v+=y,i.height=i.height+y,y=0),d.setTranslate(this,a+b,5+a+e.height/2+v),i.width+=M+r,i.height=Math.max(i.height,e.height),b+=M+r,y=Math.max(e.height,y)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];s.select(this).select(".legendtoggle").call(d.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+l,r.height)})}function o(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center");var n="top";M.isBottomAnchor(e)?n="bottom":M.isMiddleAnchor(e)&&(n="middle"),u.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:e.height*({top:1,middle:.5}[n]||0),t:e.height*({bottom:1,middle:.5}[n]||0)})}var s=t("d3"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/plots"),f=t("../../registry"),h=t("../dragelement"),d=t("../drawing"),p=t("../color"),m=t("../../lib/svg_text_utils"),g=t("./handle_click"),v=t("./constants"),y=t("../../constants/interactions"),x=t("../../constants/alignment").LINE_SPACING,b=t("./get_legend_data"),_=t("./style"),w=t("./helpers"),M=t("./anchor_utils"),k=y.DBLCLICKDELAY;e.exports=function(t){function e(t,e){E.attr("data-scroll",e).call(d.setTranslate,0,e),L.call(d.setRect,N,t,v.scrollBarWidth,v.scrollBarHeight),T.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,m="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,x=r.showlegend&&b(t.calcdata,y),w=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+m).remove(),void u.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=r._topdefs.selectAll("#"+m).data([0]);T.enter().append("clipPath").attr("id",m).append("rect");var S=A.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(p.stroke,y.bordercolor),S.call(p.fill,y.bgcolor),S.style("stroke-width",y.borderwidth+"px");var E=A.selectAll("g.scrollbox").data([0]);E.enter().append("g").attr("class","scrollbox");var L=A.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(p.fill,"#808BA4");var C=E.selectAll("g.groups").data(x);C.enter().append("g").attr("class","groups"),C.exit().remove();var z=C.selectAll("g.traces").data(c.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.call(_,t).style("opacity",function(t){var e=t[0].trace;return f.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){s.select(this).call(n,t).call(i,t)});var D=0!==A.enter().size();D&&(a(t,C,z),o(t));var I=r.width,P=r.height;a(t,C,z),y.height>P?function(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center"),u.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:0,t:0})}(t):o(t);var O=r._size,F=O.l+O.w*y.x,R=O.t+O.h*(1-y.y);M.isRightAnchor(y)?F-=y.width:M.isCenterAnchor(y)&&(F-=y.width/2),M.isBottomAnchor(y)?R-=y.height:M.isMiddleAnchor(y)&&(R-=y.height/2);var N=y.width,j=O.w;N>j?(F=O.l,N=j):(F+N>I&&(F=I-N),F<0&&(F=0),N=Math.min(I-F,y.width));var B=y.height,U=O.h;B>U?(R=O.t,B=U):(R+B>P&&(R=P-B),R<0&&(R=0),B=Math.min(P-R,y.height)),d.setTranslate(A,F,R);var V,q,H=B-v.scrollBarHeight-2*v.scrollBarMargin,G=y.height-B;if(y.height<=B||t._context.staticPlot)S.attr({width:N-y.borderwidth,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),d.setTranslate(E,0,0),T.select("rect").attr({width:N-2*y.borderwidth,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),E.call(d.setClipUrl,m);else{V=v.scrollBarMargin,q=E.attr("data-scroll")||0,S.attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),T.select("rect").attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-q}),E.call(d.setClipUrl,m),D&&e(V,q),A.on("wheel",null),A.on("wheel",function(){q=c.constrain(E.attr("data-scroll")-s.event.deltaY/H*G,-G,0),e(V=v.scrollBarMargin-q/G*H,q),0!==q&&q!==-G&&s.event.preventDefault()}),L.on(".drag",null),E.on(".drag",null);var Y=s.behavior.drag().on("drag",function(){V=c.constrain(s.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+H),q=-(V-v.scrollBarMargin)/H*G,e(V,q)});L.call(Y),E.call(Y)}if(t._context.edits.legendPosition){var W,X,Z,J;A.classed("cursor-move",!0),h.init({element:A.node(),gd:t,prepFn:function(){var t=d.getTranslate(A);Z=t.x,J=t.y},moveFn:function(t,e){var r=Z+t,n=J+e;d.setTranslate(A,r,n),W=h.align(r,0,O.l,O.l+O.w,y.xanchor),X=h.align(n,0,O.t+O.h,O.t,y.yanchor)},doneFn:function(){void 0!==W&&void 0!==X&&l.relayout(t,{"legend.x":W,"legend.y":X})},clickFn:function(e,n){var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&(1===e?A._clickTimeout=setTimeout(function(){g(i,t,e)},k):2===e&&(A._clickTimeout&&clearTimeout(A._clickTimeout),g(i,t,e)))}})}}}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../../registry":873,"../color":618,"../dragelement":640,"../drawing":643,"./anchor_utils":669,"./constants":671,"./get_legend_data":674,"./handle_click":675,"./helpers":676,"./style":678,d3:128}],674:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+f;l.push(n),s[n]=[[r]],f++}}var a,o,s={},l=[],c=!1,u={},f=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,c,u=t[0],f=u.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var m={},g={};h&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(u,m)],c=a.minExtend(f,g)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(h?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,c,e),h&&(s[0].mrc=3);var x=v.selectAll("g.pointtext").data(d?s:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)})}},{"../../lib":743,"../../registry":873,"../../traces/pie/style_one":1052,"../../traces/scatter/subtypes":1088,"../color":618,"../drawing":643,d3:128}],679:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},c=h.list(t,null,!0),f="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),i(x,r);h&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var b=function(t){for(var e=a.list({_fullLayout:t},null,!0),r=0;r0)){var d=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;ad&&(d=f)));return d>=h?[h,d]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sV&&n>q&&!t.shiftKey?f.getCursor(i/r,1-a/n):"move";h(e,o),U=o.split("-")[0]}var c,u,d,m,g,v,y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P,O,F,R,N,j,B,U,V=10,q=10,H={element:e.node(),gd:t,prepFn:function(o){O=l.getFromId(t,r.xref),F=l.getFromId(t,r.yref),R=p.getDataToPixel(t,O),N=p.getDataToPixel(t,F,!0),j=p.getPixelToData(t,O),B=p.getPixelToData(t,F,!0);var f="shapes["+n+"]";"path"===r.type?(I=r.path,P=f+".path"):(u=R(r.x0),d=N(r.y0),m=R(r.x1),g=N(r.y1),v=f+".x0",y=f+".y0",x=f+".x1",b=f+".y1");uq&&(c[A]=r[L]=B(u),c[T]=r[C]=B(f)),d-h>V&&(c[S]=r[z]=j(h),c[E]=r[D]=j(d))}e.attr("d",i(t,r))}},doneFn:function(){h(e),o.relayout(t,c)}},G=H.element.getBoundingClientRect();f.init(H),e.node().onmousemove=s}(t,m,s,e)}t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var n=(t.layout.shapes||[])[e],s=t._fullLayout.shapes[e];if(n&&!1!==s.visible)if("below"!==s.layer)r(t._fullLayout._shapeUpperLayer);else if("paper"===s.xref||"paper"===s.yref)r(t._fullLayout._shapeLowerLayer);else{var d=t._fullLayout._plots[s.xref+s.yref];if(d){r((d.mainplotinfo||d).shapelayer)}else r(t._fullLayout._shapeLowerLayer)}}function i(t,e){var r,n,i,a,o=e.type,c=l.getFromId(t,e.xref),u=l.getFromId(t,e.yref),f=t._fullLayout._size;if(c?(r=p.shapePositionToRange(c),n=function(t){return c._offset+c.r2p(r(t,!0))}):n=function(t){return f.l+f.w*t},u?(i=p.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return f.t+f.h*(1-t)},"path"===o)return c&&"date"===c.type&&(n=p.decodeDate(n)),u&&"date"===u.type&&(a=p.decodeDate(a)),function(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],l=d.numParams[i],c=t.substr(1).replace(d.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),++n>l&&(t="X"),t});return n>l&&(c=c.replace(/[\s,]*X.*/,""),s.log("Ignoring extra params in segment "+t)),i+c})}(e.path,n,a);var h=n(e.x0),m=n(e.x1),g=a(e.y0),v=a(e.y1);if("line"===o)return"M"+h+","+g+"L"+m+","+v;if("rect"===o)return"M"+h+","+g+"H"+m+"V"+v+"H"+h+"Z";var y=(h+m)/2,x=(g+v)/2,b=Math.abs(y-h),_=Math.abs(x-g),w="A"+b+","+_,M=y+b+","+x;return"M"+M+w+" 0 1,1 "+(y+","+(x-_))+w+" 0 0,1 "+M+"Z"}function a(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?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var o=t("../../plotly"),s=t("../../lib"),l=t("../../plots/cartesian/axes"),c=t("../color"),u=t("../drawing"),f=t("../dragelement"),h=t("../../lib/setcursor"),d=t("./constants"),p=t("./helpers");e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r0)){n("active"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font);n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.steps;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":704,"./constants":705}],707:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-M.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=M.currentValueInset,i="left"}a.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(b.font,e.currentvalue.font).text(o).call(_.convertToTspans,e.gd);var s=_.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*k;return _.positionText(a,n,l),a}}function a(t,e,r){var n=t.selectAll("rect."+M.gripRectClass).data([0]);n.enter().append("rect").classed(M.gripRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:M.gripWidth,height:M.gripHeight,rx:M.gripRadius,ry:M.gripRadius}).call(x.stroke,r.bordercolor).call(x.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function o(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(b.font,r.font).text(e.step.label).call(_.convertToTspans,r.gd),n}function s(t,e){var r=t.selectAll("g."+M.labelsClass).data([0]);r.enter().append("g").classed(M.labelsClass,!0);var n=r.selectAll("g."+M.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(M.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=v.select(this);r.call(o,t,e),b.setTranslate(r,d(e,t.fraction),M.tickOffset+e.ticklen+e.font.size*k+M.labelOffset+e.currentValueTotalHeight)})}function l(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&c(t,e,r,a,!0,i)}function c(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(h,r,r.active/(r.steps.length-1),o),e.call(i,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&y.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function u(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=v.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+M.gripRectClass);v.event.stopPropagation(),v.event.preventDefault(),o.call(x.fill,t.activebgcolor);var s=p(t,v.mouse(i)[0]);l(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=p(t,v.mouse(i)[0]);l(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(x.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function f(t,e){var r=t.selectAll("rect."+M.tickRectClass).data(e.steps);r.enter().append("rect").classed(M.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=v.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(x.fill,e.tickcolor),b.setTranslate(i,d(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?M.tickOffset:M.minorTickOffset)+e.currentValueTotalHeight)})}function h(t,e,r,n){var i=t.select("rect."+M.gripRectClass),a=d(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*M.gripWidth)+","+e.currentValueTotalHeight+")")}}function d(t,e){return t.inputAreaStart+M.stepInset+(t.inputAreaLength-2*M.stepInset)*Math.min(1,Math.max(0,e))}function p(t,e){return Math.min(1,Math.max(0,(e-M.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*M.stepInset-2*t.inputAreaStart)))}function m(t,e,r){var n=t.selectAll("rect."+M.railTouchRectClass).data([0]);n.enter().append("rect").classed(M.railTouchRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,M.tickOffset+r.ticklen+r.labelHeight)}).call(x.fill,r.bgcolor).attr("opacity",0),b.setTranslate(n,0,r.currentValueTotalHeight)}function g(t,e){var r=t.selectAll("rect."+M.railRectClass).data([0]);r.enter().append("rect").classed(M.railRectClass,!0);var n=e.inputAreaLength-2*M.railInset;r.attr({width:n,height:M.railWidth,rx:M.railRadius,ry:M.railRadius,"shape-rendering":"crispEdges"}).call(x.stroke,e.bordercolor).call(x.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),b.setTranslate(r,M.railInset,.5*(e.inputAreaWidth-M.railWidth)+e.currentValueTotalHeight)}var v=t("d3"),y=t("../../plots/plots"),x=t("../color"),b=t("../drawing"),_=t("../../lib/svg_text_utils"),w=t("../legend/anchor_utils"),M=t("./constants"),k=t("../../constants/alignment").LINE_SPACING;e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[M.name],n=[],i=0;i0?[0]:[]);if(l.enter().append("g").classed(M.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n=r.steps.length&&(r.active=0),e.call(i,r).call(g,r).call(s,r).call(f,r).call(m,t,r).call(a,t,r),b.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(h,r,r.active/(r.steps.length-1),!1),e.call(i,r)}(t,v.select(this),e)}})}}},{"../../constants/alignment":716,"../../lib/svg_text_utils":766,"../../plots/plots":852,"../color":618,"../drawing":643,"../legend/anchor_utils":669,"./constants":705,d3:128}],708:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":704,"./constants":705,"./defaults":706,"./draw":707}],709:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),h=/ [XY][0-9]* /;(e.exports={}).draw=function(t,e,r){function d(t){s.syncOrAsync([p,m],t)}function p(e){var r;return M?(r="",M.rotate&&(r+="rotate("+[M.rotate,w.x,w.y]+")"),M.offset&&(r+="translate(0, "+M.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":S,"font-size":n.round(E,2)+"px",fill:c.rgb(L),opacity:C*c.opacity(L),"font-weight":o.fontWeight}).attr(w).call(u.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&D){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,c=i(_.pad)?_.pad:2,u=l.bBox(e.node()),f={left:0,top:0,right:A.width,bottom:A.height},h=_.maxShift||(f[_.side]-u[_.side])*("left"===_.side||"top"===_.side?-1:1);if(h<0)r=h;else{var d=_.offsetLeft||0,p=_.offsetTop||0;u.left-=d,u.right-=d,u.top-=p,u.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[_.side]-u[a])+c))}),r=Math.min(h,r)}if(r>0||h<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,x=r.placeholder,b=r.traceIndex,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=v.titlefont||{},S=T.family,E=T.size,L=T.color,C=1,z=!1,D=(v.title||"").trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var I=t._context.edits[g];""===D?C=0:D.replace(h," % ")===x.replace(h," % ")&&(C=.2,z=!0,I||(D=""));var P=D||I;k||(k=A._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var O=k.selectAll("text").data(P?[0]:[]);return O.enter().append("text"),O.text(D).attr("class",e),O.exit().remove(),P?(O.call(d),I&&(D?O.on(".opacity",null):(C=0,z=!0,O.text(x).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)})),O.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),O.classed("js-placeholder",z),k):k}},{"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../color":618,"../drawing":643,d3:128,"fast-isnumeric":140}],710:[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");e.exports=o({_isLinkedToArray:"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:{_isLinkedToArray:"button",method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}},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,{}),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":732,"../../plot_api/edit_types":773,"../../plots/font_attributes":816,"../../plots/pad_attributes":851,"../color/attributes":617}],711:[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"}}},{}],712:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,o,r,n)}n("visible",function(t,e){function r(t,e){return i.coerce(n,a,l,t,e)}var n,a,o=t.buttons||[],s=e.buttons=[];for(var c=0;c0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.buttons;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":710,"./constants":711}],713:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e){return+t.attr(M.menuIndexAttrName)===e._index}function a(t,e,r,n,i,a,l,c){e._input.active=e.active=l,"buttons"===e.type?s(t,n,null,null,e):"dropdown"===e.type&&(i.attr(M.menuIndexAttrName,"-1"),o(t,n,i,a,e),c||s(t,n,i,a,e))}function o(t,e,r,n,a){var o=e.selectAll("g."+M.headerClassName).data([0]);o.enter().append("g").classed(M.headerClassName,!0).style("pointer-events","all");var c=a.active,u=a.buttons[c]||M.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},g={width:a.headerWidth,height:a.headerHeight};o.call(l,a,u,t).call(p,a,f,g);var v=e.selectAll("text."+M.headerArrowClassName).data([0]);v.enter().append("text").classed(M.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(x.font,a.font).text(M.arrowSymbol[a.direction]),v.attr({x:a.headerWidth-M.arrowOffsetX+a.pad.l,y:a.headerHeight/2+M.textOffsetY+a.pad.t}),o.on("click",function(){r.call(m),r.attr(M.menuIndexAttrName,i(r,a)?-1:String(a._index)),s(t,e,r,n,a)}),o.on("mouseover",function(){o.call(h)}),o.on("mouseout",function(){o.call(d,a)}),x.setTranslate(e,a.lx,a.ly)}function s(t,e,r,n,i){r||(r=e).attr("pointer-events","all");var o=function(t){return-1==+t.attr(M.menuIndexAttrName)}(r)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?M.dropdownButtonClassName:M.buttonClassName,c=r.selectAll("g."+s).data(o),u=c.enter().append("g").classed(s,!0),m=c.exit();"dropdown"===i.type?(u.attr("opacity","0").transition().attr("opacity","1"),m.transition().attr("opacity","0").remove()):m.remove();var y=0,x=0,b=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(b?x=i.headerHeight+M.gapButtonHeader:y=i.headerWidth+M.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(x=-M.gapButtonHeader+M.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-M.gapButtonHeader+M.gapButton-i.openWidth);var _={x:i.lx+y+i.pad.l,y:i.ly+x+i.pad.t,yPad:M.gapButton,xPad:M.gapButton,index:0},w={l:_.x+i.borderwidth,t:_.y+i.borderwidth};c.each(function(o,s){var u=g.select(this);u.call(l,i,o,t).call(p,i,_),u.on("click",function(){g.event.defaultPrevented||(a(t,i,0,e,r,n,s),o.execute&&v.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:i,button:o,active:i.active}))}),u.on("mouseover",function(){u.call(h)}),u.on("mouseout",function(){u.call(d,i),c.call(f,i)})}),c.call(f,i),b?(w.w=Math.max(i.openWidth,i.headerWidth),w.h=_.y-w.t):(w.w=_.x-w.l,w.h=Math.max(i.openHeight,i.headerHeight)),w.direction=i.direction,n&&(c.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,f=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(c.enter().append("g").classed(M.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;nw,A=n.barLength+2*n.barPad,T=n.barWidth+2*n.barPad,S=p,E=g+v;E+T>c&&(E=c-T);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,n.barColor),k?(this.hbar=L.attr({rx:n.barRadius,ry:n.barRadius,x:S,y:E,width:A,height:T}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>M,z=n.barWidth+2*n.barPad,D=n.barLength+2*n.barPad,I=p+m,P=g;I+z>l&&(I=l-z);var O=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),C?(this.vbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:I,y:P,width:z,height:D}),this._vbarYMin=P+D/2,this._vbarTranslateMax=M-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,R=u-.5,N=C?f+z+.5:f+.5,j=h-.5,B=k?d+T+.5:d+.5,U=s._topdefs.selectAll("#"+F).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(R),y:Math.floor(j),width:Math.ceil(N)-Math.floor(R),height:Math.ceil(B)-Math.floor(j)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||C){var V=i.behavior.drag().on("dragstart",function(){i.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=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),C&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":743,"../color":618,"../drawing":643,d3:128}],716:[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},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],717:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],718:[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]}},{}],719:[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"}},{}],720:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],721:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],722:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],723:[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}},{}],724:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.33.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.register([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":609,"./components/annotations3d":614,"./components/fx":660,"./components/images":668,"./components/legend":677,"./components/rangeselector":689,"./components/rangeslider":695,"./components/shapes":702,"./components/sliders":708,"./components/updatemenus":714,"./fonts/mathjax_config":725,"./lib/queue":757,"./locale-en":771,"./locale-en-us":770,"./plot_api/plot_schema":778,"./plot_api/register":779,"./plot_api/set_plot_config":780,"./plot_api/to_image":782,"./plot_api/validate":783,"./plotly":784,"./snapshot":878,"./snapshot/download":875,"./traces/scatter":1078,d3:128,"es6-promise":137}],725:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],726:[function(t,e,r){"use strict";var n=Math.PI;r.deg2rad=function(t){return t/180*n},r.rad2deg=function(t){return t/n*180},r.wrap360=function(t){var e=t%360;return e<0?e+360:e},r.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],727:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":721,"fast-isnumeric":140}],728:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.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(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){"string"==typeof t&&l(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}function s(t){return t.formatDate("yyyy")}var l=t("d3"),c=t("fast-isnumeric"),u=t("./loggers"),f=t("./mod"),h=t("../constants/numerical"),d=h.BADNUM,p=h.ONEDAY,m=h.ONEHOUR,g=h.ONEMIN,v=h.ONESEC,y=h.EPOCHJD,x=t("../registry"),b=l.time.format.utc,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,w=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,M=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?x.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:x.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?x.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var k,A;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*g)>=k&&t<=A?t:d;if("string"!=typeof t&&"number"!=typeof t)return d;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?w:_);if(!s)return d;var l=s[1],c=s[3]||"1",u=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),b=Number(s[11]||0);if(i){if(2===l.length)return d;l=Number(l);var T;try{var S=x.getComponentMethod("calendars","getCal")(e);if(o){var E="i"===c.charAt(c.length-1);c=parseInt(c,10),T=S.newDate(l,S.toMonthIndex(l,c,E),u)}else T=S.newDate(l,Number(c),u)}catch(t){return d}return T?(T.toJD()-y)*p+f*m+h*g+b*v:d}l=2===l.length?(Number(l)+2e3-M)%100+M:Number(l),c-=1;var L=new Date(Date.UTC(2e3,c,u,f,h));return L.setUTCFullYear(l),L.getUTCMonth()!==c?d:L.getUTCDate()!==u?d:L.getTime()+b*v},k=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)!==d};var T=90*p,S=3*m,E=5*g;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=k&&t<=A))return d;e||(e=0);var i,o,s,l,c,u,h=Math.floor(10*f(t+.05,1)),_=Math.round(t-h/10);if(n(r)){var w=Math.floor(_/p)+y,M=Math.floor(f(t,p));try{i=x.getComponentMethod("calendars","getCal")(r).fromJD(w).formatDate("yyyy-mm-dd")}catch(t){i=b("G%Y-%m-%d")(new Date(_))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=k+p&&t<=A-p))return d;var e=Math.floor(10*f(t+.05,1)),r=new Date(Math.round(t-e/10));return a(l.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return u.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,i))return u.error("unrecognized date",t),e;return t};var L=/%\d?f/g,C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,i,a){var l,c;if(a=n(a)&&a,e)return function(t,e,r,i){t=t.replace(L,function(t){var r=Math.min(+t.charAt(1)||6,6);return(e/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"});var a=new Date(Math.floor(e+.05));if(n(i))try{t=x.getComponentMethod("calendars","worldCalFmt")(t,e,i)}catch(t){return"Invalid"}return r(t)(a)}(e,t,i,a);if(a)try{var u=Math.floor((t+.05)/p)+y,f=x.getComponentMethod("calendars","getCal")(a).fromJD(u);"y"===r?c=s(f):"m"===r?c=function(t){return t.formatDate("M yyyy")}(f):"d"===r?(l=s(f),c=function(t){return t.formatDate("M d")}(f)):(l=function(t){return t.formatDate("M d, yyyy")}(f),c=o(t,r))}catch(t){return"Invalid"}else{var h=new Date(Math.floor(t+.05));"y"===r?c=i("%Y")(h):"m"===r?c=i("%b %Y")(h):"d"===r?(l=i("%Y")(h),c=i("%b %-d")(h)):(l=i("%b %-d, %Y")(h),c=o(t,r))}return c+(l?"\n"+l:"")};var z=3*p;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=f(t,p);if(t=Math.round(t-i),r)try{var a=Math.round(t/p)+y,o=x.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-y)*p+i}catch(e){u.error("invalid ms "+t+" in calendar "+r)}var l=new Date(t+z);return l.setUTCMonth(l.getUTCMonth()+e)+i-z},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&x.getComponentMethod("calendars","getCal")(e),f=0;f0&&(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 i(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}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,c){if(n(t,e,r,a,o,s,l,c))return 0;var u=r-t,f=a-e,h=l-o,d=c-s,p=u*u+f*f,m=h*h+d*d,g=Math.min(i(u,f,p,o-t,s-e),i(u,f,p,l-t,c-e),i(h,d,m,t-o,e-s),i(h,d,m,r-o,a-s));return Math.sqrt(g)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),c=t.getPointAtLength(a(r+n/2,e)),u=Math.atan((c.y-i.y)/(c.x-i.x)),f=t.getPointAtLength(a(r,e)),h={x:(4*f.x+i.x+c.x)/6,y:(4*f.y+i.y+c.y)/6,theta:u};return o[r]=h,h},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===f&&(a=r);var n=r.xs?r.x-s:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var i,a,o=e.left,s=e.right,l=e.top,c=e.bottom,u=0,f=t.getTotalLength(),h=f,d=n(u);d;){if((u+=d+r)>h)return;d=n(u)}for(d=n(h);d;){if(h-=d+r,u>h)return;d=n(h)}return{min:u,max:h,len:h-u,total:f,isClosed:0===u&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.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":750}],738:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],739:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(o(t))return u;var e=s(t);return e.length?e:u}function a(t){return o(t)?t:f}var o=t("fast-isnumeric"),s=t("color-normalize"),l=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,u=s(c),f=1;e.exports=function(t,e,r){var o,c,h,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?l.makeColorScaleFunc(l.extractScale(t.colorscale,t.cmin,t.cmax)):i,c=g?function(t,e){return void 0===t[e]?u:s(o(t[e]))}:i,h=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,g||v)for(var x=0;x=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}(t))))}},{"../constants/string_mappings":722,"superscript-text":539}],742:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],743:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var u=t("./dates");l.dateTime2ms=u.dateTime2ms,l.isDateTime=u.isDateTime,l.ms2DateTime=u.ms2DateTime,l.ms2DateTimeLocal=u.ms2DateTimeLocal,l.cleanDate=u.cleanDate,l.isJSDate=u.isJSDate,l.formatDate=u.formatDate,l.incrementMonth=u.incrementMonth,l.dateTick0=u.dateTick0,l.dfltRange=u.dfltRange,l.findExactDates=u.findExactDates,l.MIN_MS=u.MIN_MS,l.MAX_MS=u.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var h=t("./stats");l.aggNums=h.aggNums,l.len=h.len,l.mean=h.mean,l.variance=h.variance,l.stdev=h.stdev,l.interp=h.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./angles");l.deg2rad=p.deg2rad,l.rad2deg=p.rad2deg,l.wrap360=p.wrap360,l.wrap180=p.wrap180;var m=t("./geometry2d");l.segmentsIntersect=m.segmentsIntersect,l.segmentDistance=m.segmentDistance,l.getTextLocation=m.getTextLocation,l.clearLocationCache=m.clearLocationCache,l.getVisibleSegment=m.getVisibleSegment,l.findPointOnPath=m.findPointOnPath;var g=t("./extend");l.extendFlat=g.extendFlat,l.extendDeep=g.extendDeep,l.extendDeepAll=g.extendDeepAll,l.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");l.log=v.log,l.warn=v.warn,l.error=v.error;var y=t("./regex");l.counterRegex=y.counter;var x=t("./throttle");l.throttle=x.throttle,l.throttleDone=x.done,l.clearThrottle=x.clear,l.getGraphDiv=t("./get_graph_div"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.bBoxIntersect=function(t,e,r){return r=r||0,t.left<=e.right+r&&e.left<=t.right+r&&t.top<=e.bottom+r&&e.top<=t.bottom+r},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.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},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n=0&&t%1==0}function a(e){return void 0!==e&&e1?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};var w=/%{([^\s%{}]*)}/g,M=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(w,function(t,n){return M.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=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},l.eventListenerOptionsSupported=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}},{"../constants/numerical":721,"./angles":726,"./clean_number":727,"./coerce":728,"./dates":729,"./ensure_array":730,"./extend":732,"./filter_unique":733,"./filter_visible":734,"./geometry2d":737,"./get_graph_div":738,"./identity":742,"./is_array":744,"./is_plain_object":745,"./keyed_container":746,"./localize":747,"./loggers":748,"./matrix":749,"./mod":750,"./nested_property":751,"./noop":752,"./notifier":753,"./push_unique":756,"./regex":758,"./relative_attr":759,"./relink_private":760,"./search":761,"./stats":764,"./throttle":767,"./to_log_range":768,d3:128,"fast-isnumeric":140}],744:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],745:[function(t,e,r){"use strict";e.exports=function(t){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(t):"[object Object]"===Object.prototype.toString.call(t)&&Object.getPrototypeOf(t)===Object.prototype}},{}],746:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(u){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,c(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}(d)):f[e[u]]=n}}function o(t,e){var r=e;return l(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}var l=t("fast-isnumeric"),c=t("./is_array"),u=t("./is_plain_object"),f=t("../plot_api/container_array_match");e.exports=function(t,e){if(l(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s/g),s=0;so||a===i||al||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||ao||c===i||cl)return!1;var u,f,h,d,p,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){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var c=l+1;c1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":721,"./matrix":749}],756:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else if(!(void 0===t.undoQueue||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r=t.undoQueue.queue.length)){for(e=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,r=0;r1?(e[l-1]-e[0])/(l-1):1;for(o=u>=0?r?function(t,e){return t=e}:function(t,e){return t>e},t+=1e-9*u*(r?-1:1)*(u>=0?1:-1);s90&&i.log("Long binary search..."),s-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},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;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":140}],765:[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":99}],766:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t,e,r){var n="math-output-"+c.randstr([],64),i=l.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(function(t){return t.replace(p,"\\lt ").replace(m,"\\gt ")}(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=l.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())c.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function a(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function o(t,e){function r(){p++;var e=document.createElementNS(u.svg,"tspan");l.select(e).attr({class:"line",dy:p*h+"em"}),t.appendChild(e),s=e;var r=d;if(d=[{node:e}],r.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),s=d[d.length-1].node}else c.log("Ignoring unexpected end tag .",e)}e=function(t){return function(t,e){if(!t)return"";for(var r=0;r|>|>)/g,g={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"},v={sub:"0.3em",sup:"-0.6em"},y={sub:"-0.21em",sup:"0.42em"},x="\u200b",b=["http:","https:","mailto:","",void 0,":"],_=new RegExp("]*)?/?>","g"),w=Object.keys(f.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:f.entityToUnicode[t]}}),M=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,A=/<(\/?)([^ >]*)(\s+(.*))?>/i,T=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,E=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,C=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,z=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(_," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=l.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){!function(){var r=l.select(i).select(".svg-container"),a=r.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12);a.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(s(t,r,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=l.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;l.select(this).transition().duration(0).remove(),l.select(document).on("mouseup",null),o.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,l.select(document).on("mouseup",function(){if(l.event.target===t)return!1;document.activeElement===a.node()&&a.node().blur()})}).on("keyup",function(){27===l.event.which?(i._editing=!1,t.style({opacity:1}),l.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),l.select(this).call(s(t,r,e)))}).on("keydown",function(){13===l.event.which&&this.blur()}).call(n)}(),t.style({opacity:0});var r,a=c.attr("class");(r=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(r).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}var i=e.gd,a=e.delegate,o=l.dispatch("edit","input","cancel"),c=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():c.on("click",r),l.rebind(t,o,"on")}},{"../constants/alignment":716,"../constants/string_mappings":722,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],767:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e?a():o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[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)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],768:[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":140}],769:[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":818,"topojson-client":549}],770:[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"}}},{}],771:[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"],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:["$",""]}}},{}],772:[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)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axis_ids"),d=h.cleanId,p=h.getFromTrace,m=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;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=(f.subplotsRegistry.cartesian||{}).attrRegex,o=(f.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(T.x=1.02,T.xanchor="left"):T.x<-2&&(T.x=-.02,T.xanchor="right"),T.y>3?(T.y=1.02,T.yanchor="bottom"):T.y<-2&&(T.y=-.02,T.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),m.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s1&&o.warn("Full array edits are incompatible with other edits",f);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(g,v),d(t),!0)}var x,b,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(v,f).get(),C=[],z=-1,D=E.length;for(x=0;xE.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?C.push(_):A?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,k),-1===z&&(z=_);else for(b=0;b=0;x--)E.splice(C[x],1),L&&L.splice(C[x],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(h(g,v),p!==a){var I;if(-1===z)I=T;else{for(D=Math.max(E.length,D),I=[],x=0;x=z);x++)I.push(_);for(x=z;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 s(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 l(t,e,r,n,i,s){!function(t,e,r,n){var i=v.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!v.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");o(t,r,"indices");for(var a in 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,c,u,f=function(t,e,r,n){var i,o,s,l,c,u=v.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=a(r,t.data.length-1);for(var h in e)for(var d=0;d=0&&uY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&r(j+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(j+".range[0]",Math.log(Z)/Math.LN10),r(j+".range[1]",Math.log(J)/Math.LN10)):(r(j+".range[0]",Math.pow(10,Z)),r(j+".range[1]",Math.pow(10,J)))}else r(j+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[E.parts[0]]&&"radialaxis"===E.parts[1]&&delete u[E.parts[0]]._subplot.viewInitial["radialaxis.range"],b.getComponentMethod("annotations","convertCoords")(t,U,L,r),b.getComponentMethod("images","convertCoords")(t,U,L,r)}else r(j+".autorange",!0),r(j+".range",null);v.nestedProperty(u,j+"._inputRange").set(null)}else if(F.match(P.AX_NAME_PATTERN)){var K=v.nestedProperty(u,S).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),b.getComponentMethod("annotations","convertCoords")(t,K,Q,r),b.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=C.containerArrayMatch(S);if($){a=$.array,o=$.index;var tt=$.property,et=(v.nestedProperty(l,a)||[])[o]||{},rt=et,nt=q||{editType:"calc"},it=-1!==nt.editType.indexOf("calcIfAutorange");""===o?(it?M.calc=!0:I.update(M,nt),it=!1):""===tt&&(rt=L,C.isAddVal(L)?A[S]=null:C.isRemoveVal(L)?(A[S]=et,rt=et):v.warn("unrecognized full object value",e)),it&&(n(rt,"x")||n(rt,"y"))?M.calc=!0:I.update(M,nt),d[a]||(d[a]={});var at=d[a][o];at||(at=d[a][o]={}),at[tt]=L,delete e[S]}else"reverse"===F?(B.range?B.range.reverse():(r(j+".autorange",!0),B.range=[1,0]),U.autorange?M.calc=!0:M.plot=!0):((!u._has("gl2d")&&!u._has("regl")||"dragmode"!==S||"lasso"!==L&&"select"!==L||"lasso"===V||"select"===V)&&q?I.update(M,q):M.calc=!0,E.set(L))}}for(a in d){C.applyContainerArrayChanges(t,v.nestedProperty(l,a),d[a],M)||(M.plot=!0)}var ot=u._axisConstraintGroups||[];for(x in T)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=v.getGraphDiv(t),!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]);var s=(r=w.supplyAnimationDefaults(r)).transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,c){function u(e){if(0!==e.length){for(var s=0;so._timeToNext&&function(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,w.transition(t,e.frame.data,e.frame.layout,z.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(o._animationRaf),o._animationRaf=null}()};e()}()}}function f(t){return Array.isArray(s)?p>=s.length?t.transitionOpts=s[p]:t.transitionOpts=s[0]:t.transitionOpts=s,p++,t}var h,d,p=0,m=[],g=void 0===e||null===e,y=Array.isArray(e);if(!g&&!y&&v.isPlainObject(e))m.push({type:"object",data:f(v.extendFlat({},e))});else if(g||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&__)&&M.push(d);m=M}}m.length>0?u(m):(t.emit("plotly_animated"),l())})},g.addFrames=function(t,e,r){t=v.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var i,a,o,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=l.length+2*e.length,f=[];for(i=e.length-1;i>=0;i--)if(v.isPlainObject(e[i])){var h=(c[e[i].name]||{}).name,d=e[i].name;h&&d&&"number"==typeof d&&c[h]&&(n++,v.warn('addFrames: overwriting frame "'+c[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&v.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:w.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:u+i})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if("number"==typeof(a=f[i].frame).name&&v.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(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=w.modifyFrames,l=w.modifyFrames,c=[t,o],u=[t,a];return x&&x.add(t,s,c,l,u),w.modifyFrames(t,a)},g.purge=function(t){var e=(t=v.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return w.cleanPlot([],{},r,e),w.purge(t),y.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":618,"../components/drawing":643,"../components/errorbars":649,"../constants/xmlns_namespaces":723,"../lib":743,"../lib/events":731,"../lib/queue":757,"../lib/svg_text_utils":766,"../plotly":784,"../plots/cartesian/axis_ids":792,"../plots/cartesian/constants":794,"../plots/cartesian/constraints":796,"../plots/cartesian/graph_interact":798,"../plots/plots":852,"../plots/polar/legacy":860,"../registry":873,"./edit_types":773,"./helpers":774,"./manage_arrays":775,"./plot_schema":778,"./subroutines":781,d3:128,"fast-isnumeric":140,"has-hover":276}],777:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],778:[function(t,e,r){"use strict";function n(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(i(e[r]))r++;else if(r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function a(){var t,e,r={};x(r,h);for(t in c.subplotsRegistry)if((e=c.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)s(r,e,"xaxis"),s(r,e,"yaxis");else{s(r,e,"subplot"===e.attr?e.name:e.attr)}r=function(t){return y(t,{radialaxis:g.radialaxis,angularaxis:g.angularaxis}),y(t,g.layout),t}(r);for(t in c.componentsRegistry){var n=(e=c.componentsRegistry[t]).schema;if(n&&(n.subplots||n.layout)){var i=n.subplots;if(i&&i.xaxis&&!i.yaxis)for(var a in i.xaxis)delete r.yaxis[a]}else e.layoutAttributes&&l(r,e.layoutAttributes,e.name)}return{layoutAttributes:o(r)}}function o(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):u.isPlainObject(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[_];if(!n)return;delete t[_],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function s(t,e,r){var n=u.nestedProperty(t,r),i=x({},e.layoutAttributes);i[b]=!0,n.set(i)}function l(t,e,r){var n=u.nestedProperty(t,r);n.set(x(n.get()||{},e))}var c=t("../registry"),u=t("../lib"),f=t("../plots/attributes"),h=t("../plots/layout_attributes"),d=t("../plots/frame_attributes"),p=t("../plots/animation_attributes"),m=t("../plots/polar/legacy/area_attributes"),g=t("../plots/polar/legacy/axis_attributes"),v=t("./edit_types"),y=u.extendFlat,x=u.extendDeepAll,b="_isSubplotObj",_="_isLinkedToArray",w=[b,_,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=b,r.IS_LINKED_TO_ARRAY=_,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=w,r.get=function(){var t={};c.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:m},r={}):r=(e=c.modules[t]._module).basePlotModule;var n={};n.type=null,x(n,f),x(n,e.attributes),r.attributes&&x(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:o(n)};if(e.layoutAttributes){var a={};x(a,e.layoutAttributes),i.layoutAttributes=o(a)}return i}(e)});var e={};return Object.keys(c.transformsRegistry).forEach(function(t){e[t]=function(t){var e=c.transformsRegistry[t],r=x({},e.attributes);return Object.keys(c.componentsRegistry).forEach(function(e){var n=c.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){l(r,n.schema.transforms[t][e],e)})}),{attributes:o(r)}}(t)}),{defs:{valObjects:u.valObjectMeta,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:v.traces,layout:v.layout},impliedEdits:{}},traces:t,layout:a(),transforms:e,frames:function(){var t={frames:u.extendDeepAll({},d)};return o(t),t.frames}(),animation:o(p)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===w.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||u.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,a,o){i=i.slice(0,o).concat([r]);if(e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[o-1]&&("ticktext"===r||"tickvals"===r))){var s=function(t){return t.join(".")}(i),l=u.nestedProperty(t,s).get();Array.isArray(l)&&n.push(s)}}var n=[],i=[];if(r.crawl(f,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var a=t.transforms,o=0;o=t.transforms.length)return!1;a=(r=(c.transformsRegistry[t.transforms[l].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=m[o];else{var u=t._module;if(u||(u=(c.modules[t.type||f.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(a=r&&r[o])){var h=u.basePlotModule;h&&h.attributes&&(a=h.attributes[o])}a||(a=f[o])}return n(a,e,s)},r.getLayoutValObject=function(t,e){return n(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(r,n,w)?(_.push(t),w.push([r,n])):i=[0];var a=e.plotgroup.selectAll(".bg").data(i);a.enter().append("rect").classed("bg",!0),a.exit().remove(),a.each(function(){e.bg=a;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var M=l._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){l._plots[t].bg=o.select(this)}),b.each(function(t){function r(t){return"M"+k+","+t+"H"+A}function o(t){return"M"+y._offset+","+t+"h"+y._length}function s(t){return"M"+t+","+z+"V"+C}function c(t){return"M"+t+","+x._offset+"v"+x._length}function p(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}var v=l._plots[t],y=v.xaxis,x=v.yaxis;v.bg&&m&&v.bg.call(h.setRect,y._offset-u,x._offset-u,y._length+2*u,x._length+2*u).call(f.fill,l.plot_bgcolor).style("stroke-width",0),v.clipId="clip"+l._uid+t+"plot";var b=l._clips.selectAll("#"+v.clipId).data([0]);b.enter().append("clipPath").attr({class:"plotclip",id:v.clipId}).append("rect"),b.selectAll("rect").attr({width:y._length,height:x._length}),h.setTranslate(v.plot,y._offset,x._offset);var _,w;for(v._hasClipOnAxisFalse?(_=null,w=v.clipId):(_=v.clipId,w=null),h.setClipUrl(v.plot,_),i=0;i1&&d.push(a("object","layout"))),l.supplyDefaults(p);for(var m=p._fullData,g=r.length,v=0;v10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=T&&i<=10||e>=15*T)t._tickround="d";else if(e>=E&&i<=16||e>=S)t._tickround="M";else if(e>=L&&i<=19||e>=E)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(m(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);m(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(c(t.exponentformat)&&!u(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function s(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}}function l(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=f(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}function r(t,n){return e(n,0)?t:r(n,t%n)}var n=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),i=t*n,a=Math.abs(r(i,n));return[Math.round(i/a),Math.round(n/a)]}(a);if(o[1]>=100)e.text=f(v.deg2rad(e.x),t,i,n);else{var s=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(""),s&&(e.text=C+e.text)}}}}function c(t){return"SI"===t||"B"===t}function u(t){return t>14||t<-15}function f(t,e,r,n){var i=t<0,a=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,f=I.getTickFormat(e),h=e.separatethousands;if(n){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:m(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};o(d),a=(Number(d._tickround)||0)+4,l=d._tickexponent,e.hoverformat&&(f=e.hoverformat)}if(f)return e._numFormat(f)(t).replace(/-/g,C);var p=Math.pow(10,-a)/2;if("none"===s&&(l=0),(t=Math.abs(t))"+x+"":"B"===s&&9===l?t+="B":c(s)&&(t+=H[l/3+5])}return i?C+t:t}function h(t,e){for(var r=0;r2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},I.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&f/u>h&&(l=o,c=s,h=f/u);if(n===i){var m=n-1,g=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),h=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-h*l.pad,c.val+h*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),v.simpleMap(r,t.l2r||Number)},I.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=I.getAutoRange(t),t._r=t.range.slice(),t._rl=v.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},I.saveRangeInitial=function(t,e){for(var r=I.list(t,"",!0),n=!1,i=0;i=h?d=!1:s.val>=c&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:b&&0===c?0:h})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=f?d=!1:s.val<=u&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:b&&0===u?0:f})}}}if((t.autorange||!!v.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,f,h,d,p,g,y=e.length,x=r.padded?.05*t._length:0,b=r.tozero&&("linear"===t.type||"-"===t.type);x&&"domain"===t.constrain&&t._inputDomain&&(x*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var _=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),A=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=y-1;a>5;a--)i(a)}},I.autoBin=function(t,e,r,n,i){var a=v.aggNums(Math.min,null,t),o=v.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:a-.5,end:o+.5,size:1,_count:o-a+1};var s;if(r)s=(o-a)/r;else{var l=v.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*v.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*v.stdev(t)/Math.pow(t.length,n?.25:.4)),m(s)||(s=1)}var f;f="log"===e.type?{type:"linear",range:[a,o]}:{type:e.type,range:v.simpleMap([a,o],e.c2r,0,i),calendar:i},I.setConvert(f),I.autoTicks(f,s);var h,d,p=I.tickIncrement(I.tickFirst(f),f.dtick,"reverse",i);if("number"==typeof f.dtick)h=(p=function(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,c=0,u=0;u.3*f||a(n)||a(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=I.tickIncrement(t,"M6","reverse")+1.5*T:a.exactMonths>.8?t=I.tickIncrement(t,"M1","reverse")+15.5*T:t-=T/2;var s=I.tickIncrement(t,r);if(s<=n)return s}return t}(p,t,f.dtick,a,i)),h=p,d=0;h<=o;)h=I.tickIncrement(h,f.dtick,!1,i),d++;return{start:e.c2r(p,0,i),end:e.c2r(h,0,i),size:f.dtick,_count:d}},I.calcTicks=function(t){var e=v.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=v.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),I.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),o(t),"array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=v.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(l,c),f=Math.max(l,c),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e=l:f<=l)&&!(a.length>u||f===c);f=I.tickIncrement(f,t.dtick,i,t.calendar))c=f,a.push(f);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(a.length),d=0;dk?(e/=k,n=r(10),t.dtick="M"+12*a(e,n,R)):i>A?(e/=A,t.dtick="M"+a(e,1,N)):i>T?(t.dtick=a(e,T,B),t.tick0=v.dateTick0(t.calendar,!0)):i>S?t.dtick=a(e,S,N):i>E?t.dtick=a(e,E,j):i>L?t.dtick=a(e,L,j):(n=r(10),t.dtick=a(e,n,R))}else if("log"===t.type){t.tick0=0;var o=v.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,n=r(10),t.dtick="L"+a(e,n,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,n=1,t.dtick=a(e,n,q)):(t.tick0=0,n=r(10),t.dtick=a(e,n,R));if(0===t.dtick&&(t.dtick=1),!m(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},I.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(m(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return v.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?V:U,l=t+.01*i,c=v.roundUp(v.mod(l,1),s,r);return Math.floor(l)+Math.log(p.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},I.tickFirst=function(t){var e=t.r2l||Number,r=v.simpleMap(t.range,e),n=r[1]"+o,t._prevDateHead=o)),e.text=s}(t,o,r,d):"log"===t.type?function(t,e,r,n,i){var a=t.dtick,o=e.x,s=t.tickformat;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),s||"string"==typeof a&&"L"===a.charAt(0))e.text=f(Math.pow(10,o),t,i,n);else if(m(a)||"D"===a.charAt(0)&&v.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||c(t.exponentformat)&&u(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+C+-l+"",e.fontSize*=1.25):(e.text=f(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,v.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}(t,o,0,d,i):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):"angular"===t._id?l(t,o,r,d,i):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=f(e.x,t,i,n)}(t,o,0,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o},I.hoverLabelText=function(t,e,r){if(r!==z&&r!==e)return I.hoverLabelText(t,e)+" - "+I.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=I.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":C+i:i};var H=["f","p","n","\u03bc","m","","k","M","G","T"];I.getTickFormat=function(t){function e(t){return"string"!=typeof t?t:Number(t.replace("M",""))*A}function r(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function n(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!=typeof i||n(i)<=n(t))&&(!a&&"number"!=typeof a||n(a)>=n(t))}function i(t,e){var n=null===e[0],i=null===e[1],a=r(t,e[0])>=0,o=r(t,e[1])<=0;return(n||a)&&(i||o)}var a,o;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(a=0;a1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":873,"./constants":794}],793:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],794:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":743}],795:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,a,o){var s=o._axisConstraintGroups,l=e._id,c=l.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var a,o,s,l,c=n[i(e)].type,u=[];for(o=0;oo*v)||_)for(r=0;rz&&IL&&(L=I);f/=(L-E)/(2*C),E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=A.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function c(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:k.background,stroke:k.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function u(t){t.selectAll(".select-outline").remove()}function f(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 d(t){y.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function p(t){j&&t.data&&t._context.showTips&&(w.notifier(w._(t,"Double-click to zoom back out"),"long"),j=!1)}function m(t){return"lasso"===t||"select"===t}function g(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,R)/2);return"M"+(t.l-3.5)+","+(t.t-.5+e)+"h3v"+-e+"h"+e+"v-3h-"+(e+3)+"ZM"+(t.r+3.5)+","+(t.t-.5+e)+"h-3v"+-e+"h"+-e+"v-3h"+(e+3)+"ZM"+(t.r+3.5)+","+(t.b+.5-e)+"h-3v"+e+"h"+-e+"v3h"+(e+3)+"ZM"+(t.l-3.5)+","+(t.b+.5-e)+"h3v"+e+"h"+e+"v3h-"+(e+3)+"Z"}function v(t,e){if(N){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}var y=t("d3"),x=t("tinycolor2"),b=t("../../plotly"),_=t("../../registry"),w=t("../../lib"),M=t("../../lib/svg_text_utils"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("../../components/fx"),S=t("../../lib/setcursor"),E=t("../../components/dragelement"),L=t("../../constants/alignment").FROM_TL,C=t("../plots"),z=t("./axes").doTicks,D=t("./axis_ids").getFromId,I=t("./select"),P=t("./scale_zoom"),O=t("./constants"),F=O.MINDRAG,R=O.MINZOOM,N=w.eventListenerOptionsSupported(),j=!0;e.exports={makeDragBox:function(t,e,r,n,h,k,S,N){function j(){X=[e.xaxis],Z=[e.yaxis];var r=X[0],n=Z[0];Q=r._length,$=n._length;var i=ot._axisConstraintGroups,o=[r._id],s=[n._id];W=[e].concat(S&&N?e.overlays:[]);for(var l=1;lR||s>R?(xt="xy",o/Q>s/$?(s=o*$/Q,pt>a?mt.t=pt-s:mt.b=pt+s):(o=s*Q/$,dt>i?mt.l=dt-o:mt.r=dt+o),_t.attr("d",g(mt))):n():!et||s10||n.scrollWidth-n.clientWidth>10)){clearTimeout(kt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=Tt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,c=(s.bottom-e.clientY)/s.height;if(N||nt){for(N||(l=.5),a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(j(),"ew"===tt||"ns"===et)return tt&&s(X,e),et&&s(Z,r),Y([tt?-e:0,et?-r:0,Q,$]),void H(et,tt);if(nt&&tt&&et){var i="w"===tt==("n"===et)?1:-1,a=(e/Q+i*r/$)/2;e=a*Q,r=i*a*$}"w"===tt?e=n(X,0,e):"e"===tt?e=n(X,1,-e):tt||(e=0),"n"===et?r=n(Z,1,r):"s"===et?r=n(Z,0,-r):et||(r=0);var o="w"===tt?e:0,l="n"===et?r:0;if(nt){var c;if(!tt&&1===et.length){for(c=0;c rect").call(A.setTranslate,s,l).call(A.setScale,a,o);var T=m.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");m.plot.call(A.setTranslate,M,k).call(A.setScale,1/a,1/o),T.selectAll(".point").call(A.setPointGroupScale,a,o),T.selectAll(".textpoint").call(A.setTextPointsScale,a,o),T.call(A.hideOutsideRangePoints,m)}}}var W,X,Z,J,K,Q,$,tt,et,rt,nt,it,at,ot=t._fullLayout,st=t._fullLayout._zoomlayer,lt=S+N==="nsew",ct=1===(S+N).length;j();var ut=i(e,S+N+"drag",rt,r,n,h,k),ft=!et&&!tt;if(ft&&!lt)return ut.onmousedown=null,ut.style.pointerEvents="none",ut;var ht={element:ut,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;ft||(lt?e.shiftKey?"pan"===i?i="zoom":m(i)||(i="pan"):e.ctrlKey&&(i="pan"):i="pan"),ht.minDrag="lasso"===i?1:void 0,m(i)?(ht.xaxes=X,ht.yaxes=Z,I(e,r,n,ht,i)):ft?u(st):"zoom"===i?(ht.moveFn=B,ht.doneFn=U,ht.minDrag=1,function(e,r,n){var i=ut.getBoundingClientRect();dt=r-i.left,pt=n-i.top,mt={l:dt,r:dt,w:0,t:pt,b:pt,h:0},gt=t._hmpixcount?t._hmlumcount/t._hmpixcount:x(t._fullLayout.plot_bgcolor).getLuminance(),yt=!1,xt="xy",bt=l(st,gt,J,K,vt="M0,0H"+Q+"V"+$+"H0V0"),_t=c(st,J,K),u(st)}(0,r,n)):"pan"===i&&(ht.moveFn=q,ht.doneFn=G,u(st))},clickFn:function(r,n){if(d(t),2!==r||ct||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(tt?X:[]).concat(et?Z:[]),o={};if("reset+autosize"===i)for(i="autosize",r=0;ru[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":743,"fast-isnumeric":140}],806:[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)]}},{"../../constants/alignment":716}],807:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n0)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-3*M*Math.abs(n-i))}return d}function f(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!a(e))return d;i=c(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function b(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,i,s=o.nestedProperty(t,e).get();if(i="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:r.dfltRange||p.DFLTRANGEX,i=i.slice(),s&&2===s.length)for("date"===t.type&&(s[0]=o.cleanDate(s[0],d,t.calendar),s[1]=o.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(s[n],t.calendar)){t[e]=i;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!a(s[n])){if(!a(s[1-n])){t[e]=i;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-h?s[n]=-h:s[n]>h&&(s[n]=h),s[0]===s[1]){var c=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=c,s[1]+=c}}else o.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:i.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:i.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":721,"../../lib":743,"./axis_ids":792,"./constants":794,d3:128,"fast-isnumeric":140}],809:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a,o){var s=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);r("tickprefix")&&r("showtickprefix",s);r("ticksuffix",o.tickSuffixDflt)&&r("showticksuffix",s);if(r("showticklabels")){var l=o.font||{},c=e.color===t.color?e.color:l.color;if(n.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:c}),r("tickangle"),"category"!==a){var u=r("tickformat");!function(t,e){function r(t,e){return n.coerce(s,l,i.tickformatstops,t,e)}var a=t.tickformatstops,o=e.tickformatstops=[];if(Array.isArray(a))for(var s,l,c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),h=u.substr(1);((h=n(h)?Number(h):0)<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],812:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(t){var e=t.xaxis,r=t.yaxis;d._defs.select("#"+t.clipId+"> rect").call(o.setTranslate,0,0).call(o.setScale,1,1),t.plot.call(o.setTranslate,e._offset,r._offset).call(o.setScale,1,1);var n=t.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(o.setPointGroupScale,1,1),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1),n.call(o.hideOutsideRangePoints,t)}function f(e,r){var n,i,l,c=m[e.xaxis._id],u=m[e.yaxis._id],f=[];if(c){i=(n=t._fullLayout[c.axisName])._r,l=c.to,f[0]=(i[0]*(1-r)+r*l[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],p=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[2]=e.xaxis._length*(1-r+r*p/h)}else f[0]=0,f[2]=e.xaxis._length;if(u){i=(n=t._fullLayout[u.axisName])._r,l=u.to,f[1]=(i[1]*(1-r)+r*l[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var g=i[1]-i[0],v=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[3]=e.yaxis._length*(1-r+r*v/g)}else f[1]=0,f[3]=e.yaxis._length;!function(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,k,A).call(o.setScale,1/w,1/M),e.plot.call(o.setTranslate,E,L).call(o.setScale,w,M).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/w,1/M),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/w,1/M)}function h(){b=Date.now();for(var e=Math.min(1,(b-x)/r.duration),n=w(e),a=0;ar.duration?(!function(){for(var e={},r=0;r0?".":"")+i;l.isPlainObject(a)?o(a,e,s,n+1):e(s,i,a)}})}var s=t("../plotly"),l=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(c)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(c){n(t,c,o.cache),o.check=function(){if(s){var e=n(t,c,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fn*Math.PI/180}return!1},r.getPath=function(){return i.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(m.precision),n&&r.clipAngle(n-m.clipPad),r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*n.x[0],r.t+r.h*(1-n.y[1])],[r.l+r.w*n.x[1],r.t+r.h*(1-n.y[0])]],h=e.lonaxis,d=e.lataxis,p=function(t,e){var r=m.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&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]]]}}(h.range,d.range);u.fitExtent(f,p);var g=this.bounds=u.getBounds(p),v=this.fitScale=u.scale(),y=u.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M0&&w<0&&(w+=360);var M,k=(_+w)/2;if(!c){var A=u?o.projRotate:[k,0,0];M=r("projection.rotation.lon",A[0]),r("projection.rotation.lat",A[1]),r("projection.rotation.roll",A[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}var T,S;if(c?(T=-96.6,S=38.7):(T=u?k:M,S=(b[0]+b[1])/2),r("center.lon",T),r("center.lat",S),f){r("projection.parallels",o.projParallels||[0,60])}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":865,"../constants":818,"./layout_attributes":823}],823:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,s={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=o({domain:i({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:s,lataxis:s},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"../constants":818}],824:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!M.hasOwnProperty(e.type))return null;var i=M[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){return t>1?S:t<-1?-S:Math.asin(t)}function a(t){return t>1?0:t<-1?T:Math.acos(t)}function o(t,e){var r=(2+S)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>k;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(T*(4+T))*t*(1+Math.cos(e)),2*Math.sqrt(T/(4+T))*Math.sin(e)]}function s(t,e){function r(r,n){var i=D(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?D:e===1/0?l:(r.invert=function(r,n){var i=D.invert(r/t,n);return i[0]*=e,i},r)}function l(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function c(t,e){return[3*t/(2*T)*Math.sqrt(T*T/3-e*e),e]}function u(t,e){return[t,1.25*Math.log(Math.tan(T/4+.4*e))]}function f(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>k&&--i>0);return e/2}}function h(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function d(t,e){var r,n=Math.min(18,36*Math.abs(e)/T),i=Math.floor(n),a=n-i,o=(r=P[i])[0],s=r[1],l=(r=P[++i])[0],c=r[1],u=(r=P[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?S:-S)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function p(t,e){return[t*Math.cos(e),e]}function m(t,e){var r=Math.cos(e),n=function(t){return t?t/Math.sin(t):1}(a(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function g(t,e){var r=m(t,e);return[(r[0]+t/S)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&v.hasOwnProperty(t.type)?v[t.type]:r)(t,n)};var v={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},y=[],x=[],b={point:function(t,e){y.push([t,e])},result:function(){var t=y.length?y.length<2?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y}:null;return y=[],t}},_={lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){y.length&&(x.push(y),y=[])},result:function(){var t=x.length?x.length<2?{type:"LineString",coordinates:x[0]}:{type:"MultiLineString",coordinates:x}:null;return x=[],t}},w={polygonStart:n,lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){var t=y.length;if(t){do{y.push(y[0].slice())}while(++t<4);x.push(y),y=[]}},polygonEnd:n,result:function(){if(!x.length)return null;var t=[],e=[];return x.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(h-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),x=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},M={Point:b,MultiPoint:b,LineString:_,MultiLineString:_,Polygon:w,MultiPolygon:w,Sphere:w},k=1e-6,A=k*k,T=Math.PI,S=T/2,E=(Math.sqrt(T),T/180),L=180/T,C=t.geo.projection,z=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=a[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],l}function n(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a=0;--r){var f;o=180*(f=a[1][r])[0][0]/T,s=180*f[0][1]/T,l=180*f[1][1]/T,c=180*f[2][0]/T,u=180*f[2][1]/T,e.push(n([[c-1e-6,u-1e-6],[c-1e-6,l+1e-6],[o+1e-6,l+1e-6],[o+1e-6,s-1e-6]],30))}return{type:"Polygon",coordinates:[t.merge(e)]}}(),l)},i},o.lobes=function(t){return arguments.length?(a=t.map(function(t){return t.map(function(t){return[[t[0][0]*T/180,t[0][1]*T/180],[t[1][0]*T/180,t[1][1]*T/180],[t[2][0]*T/180,t[2][1]*T/180]]})}),i=a.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),o):a.map(function(t){return t.map(function(t){return[[180*t[0][0]/T,180*t[0][1]/T],[180*t[1][0]/T,180*t[1][1]/T],[180*t[2][0]/T,180*t[2][1]/T]]})})},o},o.invert=function(t,e){var r=.5*e*Math.sqrt((4+T)/T),n=i(r),a=Math.cos(n);return[t/(2/Math.sqrt(T*(4+T))*(1+a)),i((n+r*(a+2))/(2+S))]},(t.geo.eckert4=function(){return C(o)}).raw=o;var D=t.geo.azimuthalEqualArea.raw;l.invert=function(t,e){var r=2*i(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=z(s),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=s,c.invert=function(t,e){return[2/3*T*t/Math.sqrt(T*T/3-e*e),e]},(t.geo.kavrayskiy7=function(){return C(c)}).raw=c,u.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*T]},(t.geo.miller=function(){return C(u)}).raw=u,f(T);var I=function(t,e,r){function n(r,n){return[t*r*Math.cos(n=a(n)),e*Math.sin(n)]}var a=f(r);return n.invert=function(n,a){var o=i(a/e);return[n/(t*Math.cos(o)),i((2*o+Math.sin(2*o))/r)]},n}(Math.SQRT2/S,Math.SQRT2,T);(t.geo.mollweide=function(){return C(I)}).raw=I,h.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>k&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return C(h)}).raw=h;var P=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];P.forEach(function(t){t[1]*=1.0144}),d.invert=function(t,e){var r=e/S,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,d=f*(1-h*f*(1-2*h*f));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],n-=(p=(e>=0?S:-S)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*L}while(Math.abs(p)>A&&--m>0);break}}while(--a>=0);var g=P[a][0],v=P[a+1][0],y=P[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*E]},(t.geo.robinson=function(){return C(d)}).raw=d,p.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return C(p)}).raw=p,m.invert=function(t,e){if(!(t*t+4*e*e>T*T+k)){var r=t,n=e,i=25;do{var o,s=Math.sin(r),l=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),f=Math.cos(n),h=Math.sin(2*n),d=u*u,p=f*f,m=l*l,g=1-p*c*c,v=g?a(f*c)*Math.sqrt(o=1/g):o=0,y=2*v*f*l-t,x=v*u-e,b=o*(p*m+v*f*c*d),_=o*(.5*s*h-2*v*u*l),w=.25*o*(h*l-v*u*p*s),M=o*(d*c+v*m*f),A=_*w-M*b;if(!A)break;var S=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=S,n-=E}while((Math.abs(S)>k||Math.abs(E)>k)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return C(m)}).raw=m,g.invert=function(t,e){var r=t,n=e,i=25;do{var o,s=Math.cos(n),l=Math.sin(n),c=Math.sin(2*n),u=l*l,f=s*s,h=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-f*d*d,v=g?a(s*d)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*s*p+r/S)-t,x=.5*(v*l+n)-e,b=.5*o*(f*m+v*s*d*u)+.5/S,_=o*(h*c/4-v*l*p),w=.125*o*(c*p-v*l*f*h),M=.5*o*(u*d+v*m*s)+.5,A=_*w-M*b,T=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=T,n-=E}while((Math.abs(T)>k||Math.abs(E)>k)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return C(g)}).raw=g}},{}],825:[function(t,e,r){"use strict";function n(t,e){return d.behavior.zoom().translate(e.translate()).scale(e.scale())}function i(t,e,r){function n(t,e){var r=p.nestedProperty(s,t);r.get()!==e&&(r.set(e),p.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function a(t,e){function r(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}var a=n(0,e);return a.on("zoomstart",function(){d.select(this).style(v)}).on("zoom",function(){e.scale(d.event.scale).translate(d.event.translate),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,r)}),a}function o(t,e){function r(t){return e.invert(t)}function a(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])}var o,s,l,c,u,f,h,p,m=n(0,e),g=2;return m.on("zoomstart",function(){d.select(this).style(v),o=d.mouse(this),s=e.rotate(),l=e.translate(),c=s,u=r(o)}).on("zoom",function(){if(f=d.mouse(this),function(t){var n=e(r(t));return Math.abs(n[0]-t[0])>g||Math.abs(n[1]-t[1])>g}(o))return m.scale(e.scale()),void m.translate(e.translate());e.scale(d.event.scale),e.translate([l[0],d.event.translate[1]]),u?r(f)&&(p=r(f),h=[c[0]+(p[0]-u[0]),s[1],s[2]],e.rotate(h),c=h):u=r(o=f),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,a)}),m}function s(t,e){function r(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var a,o={r:e.rotate(),k:e.scale()},s=n(0,e),u=function(t){var e=0,r=arguments.length,n=[];for(;++em?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/m)*g-p,i=Math.sqrt(m*m-h*h));var v=180-a-2*p,y=(Math.atan2(d,u)-Math.atan2(l,i))*g,x=(Math.atan2(d,u)-Math.atan2(l,-i))*g,b=c(r[0],r[1],a,y),_=c(r[0],r[1],v,x);return b<=_?[a,y,r[2]]:[v,x,r[2]]}(v,a,n);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=n),e.rotate(x),n=x}}else a=l(e,t=s);!function(t){t({type:"zoom"})}(u.of(this,arguments))}),function(t){p++||t({type:"zoomstart"})}(u.of(this,arguments))}).on("zoomend",function(){d.select(this).style(y),x.call(s,"zoom",null),function(t){--p||t({type:"zoomend"})}(u.of(this,arguments)),i(t,e,r)}).on("zoom.redraw",function(){t.render()}),d.rebind(s,u,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*m,r=t[1]*m,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function c(t,e,r,n){var i=u(r-t),a=u(n-e);return Math.sqrt(i*i+a*a)}function u(t){return(t%360+540)%360-180}function f(t,e,r){var n=r*m,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function h(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(s)*_*(u>=0?1:-1),c.boxEnd[1]f[3]&&(c.boxEnd[1]=f[3],c.boxEnd[0]=c.boxStart[0]+(f[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(u)/_*(s>=0?1:-1),c.boxEnd[0]f[2]&&(c.boxEnd[0]=f[2],c.boxEnd[1]=c.boxStart[1]+(f[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(s=c.boxStart[0]!==c.boxEnd[0],u=c.boxStart[1]!==c.boxEnd[1],s||u?(s&&(a(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),u&&(a(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,r?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)h[p+2]&&(h[p]=-1,h[p+2]=1),(d=this[b[p]])._length=o.viewBox[p+2]-o.viewBox[p],s.doAutoRange(d),d.setScale();y(l),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],832:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;s(t,e,r,{type:"gl3d",attributes:c,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return i.validate(t[e],c[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":618,"../../../lib":743,"../../../registry":873,"../../subplot_defaults":865,"./axis_defaults":835,"./layout_attributes":838}],838:[function(t,e,r){"use strict";function n(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"}}var i=t("./axis_attributes"),a=t("../../domain_attributes"),o=t("../../../lib/extend").extendFlat,s=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[s("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:o(n(0,0,1),{}),center:o(n(0,0,0),{}),eye:o(n(1.25,1.25,1.25),{}),editType:"camera"},domain:a({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":743,"../../../lib/extend":732,"../../domain_attributes":815,"./axis_attributes":834}],839:[function(t,e,r){"use strict";function n(){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]}var i=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=i(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 n;return e.merge(t),e}},{"../../../lib/str2rgbarray":765}],840:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var f=l[o[u]];if(f._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(f._length)===1/0)c[u]=[];else{f.range[0]=r[u].lo/t.dataScale[u],f.range[1]=r[u].hi/t.dataScale[u],f._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||i.constrain(f._length/40,4,9);n.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=n.calcTicks(f),m=0;mh[1][s]?d[s]=1:h[1][s]===h[0][s]?d[s]=1:d[s]=1/(h[1][s]-h[0][s]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var T=m[1][a]-m[0][a];m[0][a]-=T/32,m[1][a]+=T/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){var L=y[c=(l=u[k[a]]).type];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===u.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===u.aspectmode)C=[1,1,1];else if("data"===u.aspectmode)C=E;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=u.aspectratio;C=[z.x,z.y,z.z]}u.aspectratio.x=f.aspectratio.x=C[0],u.aspectratio.y=f.aspectratio.y=C[1],u.aspectratio.z=f.aspectratio.z=C[2],this.glplot.aspect=C;var D=u.domain||null,I=e._size||null;if(D&&I){var P=this.container.style;P.position="absolute",P.left=I.l+D.x[0]*I.w+"px",P.top=I.t+(1-D.y[1])*I.h+"px",P.width=I.w*(D.x[1]-D.x[0])+"px",P.height=I.h*(D.y[1]-D.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),s(this.glplot.camera)},M.setCamera=function(t){this.glplot.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(t))},M.saveCamera=function(t){function e(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 r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}var a=t("../../lib"),o=t("./convert_text_opts"),s=n.prototype;s.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},s.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",{visibility:"visible"})}},s.updateStyle=function(t){var e=function(t){var e={},r={};switch(t.type){case"circle":a.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":a.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":a.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=o(n.textposition,n.iconsize);a.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),a.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},s.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":743,"./convert_text_opts":845}],848:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain_attributes"),o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,c=o({});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:c,textposition:n.extendFlat({},s,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":618,"../../lib":743,"../../plot_api/edit_types":773,"../../traces/scatter/attributes":1066,"../domain_attributes":815,"../font_attributes":816}],849:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),function(t,e){function r(t,e){return i.coerce(n,a,o.layers,t,e)}var n,a,s=t.layers||[],l=e.layers=[];for(var c=0;c=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(){p.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()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=i.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],h=t.data||[];t._transitionData||p.createTransitionData(t),n._dfltTitle={plot:f(t,"Click to enter Plot title"),x:f(t,"Click to enter X axis title"),y:f(t,"Click to enter Y axis title"),colorbar:f(t,"Click to enter Colorscale title"),annotation:f(t,"new text")},n._traceWord=f(t,"trace");var d=function(t){function e(t){for(var e=!0,r=0;r=0)return!0}return!1},p.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i0){var c=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,d=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(d*(m.width-f)),i=Math.round(d*(m.height-h))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var v=p.layoutAttributes.width.min,y=p.layoutAttributes.height.min;n1,b=!e.height&&Math.abs(r.height-i)>1;(b||x)&&(x&&(r.width=n),b&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand){u.base={l:{val:0,size:i},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}};for(var f in u){var h=u[f].l||{},d=u[f].b||{},p=h.val,m=h.size,g=d.val,v=d.size;for(var y in u){if(a(m)&&u[y].r){var x=u[y].r.val,b=u[y].r.size;if(x>p){var _=(m*x+(b-e.width)*p)/(x-p),w=(b*(1-p)+(m-e.width)*(1-x))/(x-p);_>=0&&w>=0&&_+w>i+s&&(i=_,s=w)}}if(a(v)&&u[y].t){var M=u[y].t.val,k=u[y].t.size;if(M>g){var A=(v*M+(k-e.height)*g)/(M-g),T=(k*(1-g)+(v-e.height)*(1-M))/(M-g);A>=0&&T>=0&&A+T>c+l&&(c=A,l=T)}}}}}if(r.l=Math.round(i),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(u.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(c.layout=a(s)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=a(l)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){d=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var s,l,c=0,f=0,p=t._fullLayout._basePlotModules,m=!1;if(r)for(l=0;l=0;o--)if(_[o].enabled){r._indexToPoints=_[o]._indexToPoints;break}i&&i.calc&&(b=i.calc(t,r))}Array.isArray(b)&&b[0]||(b=[{x:d,y:d}]),b[0].t||(b[0].t={}),b[0].trace=r,p[a]=b}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i=0?h.angularAxis.domain:n.extent(M),E=Math.abs(M[1]-M[0]);A&&!k&&(E=0);var L=S.slice();T&&k&&(L[1]+=E);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(L[1]-L[0])/C);var z=h.angularAxis.ticksStep||(L[1]-L[0])/(C*(h.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),L[2]||(L[2]=z);var D=n.range.apply(this,L);if(D=D.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=T?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),P=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));t=n.select(P)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,F=t.select(".chart-group"),R={fill:"none",stroke:h.tickColor},N={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=O.node().getBBox();x=Math.min(h.width-B.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*x+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title){var V=t.select("g.title-group text").style(N).text(h.title),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var H=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=H.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(R),G.attr("r",r),G.exit().remove()}H.select("circle.outside-circle").attr({r:x}).style(R);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),H.selectAll(".domain").style(R),H.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+c(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(R),Z.selectAll(".minor").style({stroke:h.minorTickColor}),X.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(N);var J=X.select("text.axis-text").attr({x:x+h.labelOffset,dy:a+"em",transform:function(t,e){var r=c(t),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(N);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));O.attr({transform:"translate("+[x+K,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,$=t.select("g.geometry-group").selectAll("g.geometry").data(p);if($.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),$.exit().remove(),p[0]||Q){var tt=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=$.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var rt,nt,it=t.select(".guides-group"),at=t.select(".tooltips-group"),ot=o.tooltipPanel().config({container:at,fontSize:8})(),st=o.tooltipPanel().config({container:at,fontSize:8})(),lt=o.tooltipPanel().config({container:at,hasTick:!0})();if(!k){var ct=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Y).angle;ct.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;rt=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);ot.text(o.util.round(rt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ut=it.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Y).radius;ut.attr({r:n}).style({opacity:.5}),nt=r.invert(o.util.getMousePos(Y).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);st.text(o.util.round(nt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ut.style({opacity:0}),lt.hide(),ot.hide(),st.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];lt.config({color:s}).text(u),lt.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return u},h.getinputConfig=function(){return c},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=t.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(e){return t.radialScale(l+(e[2]||0))}).outerRadius(function(e){return t.radialScale(l+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(e,r){return"rotate("+(t.orientation+s(e[0])+90)+")"}})};var p={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(p).each(c[t.geometryType]),g.exit().remove(),m.exit().remove()})}var e=[o.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],o.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[u?"linear":"ordinal"]().domain(p).range(l),g=n.scale[u?"linear":"ordinal"]().domain(p)[u?"range":"rangePoints"]([0,f]);if(u){var v=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,g(e)+c/2]+")"},d:function(t,e){return function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()}(t.symbol,c)},fill:function(t,e){return m(e)}}),y.exit().remove()}var x=n.svg.axis().scale(g).orient("right"),b=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),b.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},m=d.width+2*h+l,g=d.height+2*h;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[a.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../../constants/alignment":716,"../../../lib":743,d3:128}],862:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,i){return i&&(f=i),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),u=o.adapter.plotly().convert(r),a.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,i,a,u,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":618,"../../../lib":743,"./micropolar":861,"./undo_manager":863,d3:128}],863:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n0?1:-1}function d(t){return h(Math.cos(t))}function p(t){return h(Math.sin(t))}var m=t("d3"),g=t("tinycolor2"),v=t("../../plotly"),y=t("../../registry"),x=t("../../lib"),b=t("../../components/color"),_=t("../../components/drawing"),w=t("../plots"),M=t("../cartesian/axes"),k=t("../../components/dragelement"),A=t("../cartesian/dragbox"),T=t("../../components/fx"),S=t("../../components/titles"),E=t("../cartesian/select"),L=t("../../lib/setcursor"),C=t("../../constants/alignment").MID_SHIFT,z=x._,D=x.deg2rad,I=x.rad2deg,P=x.wrap360,O=x.wrap180,F=t("./helpers").setConvertAngular,R=t("./constants"),N=n.prototype;e.exports=function(t,e){return new n(t,e)},N.plot=function(t,e){var r=e[this.id];this._hasClipOnAxisFalse=!1;for(var n=0;n=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),[e,r,n,i]}(g),y=v[2]-v[0],x=v[3]-v[1],w=m/p,k=Math.abs(x/y);w>k?(l=p,d=(m-(c=p*k))/i.h/2,f=[a[0],a[1]],h=[o[0]+d,o[1]-d]):(c=m,d=(p-(l=m/k))/i.w/2,f=[a[0]+d,a[1]-d],h=[o[0],o[1]]),r.xLength2=l,r.yLength2=c,r.xDomain2=f,r.yDomain2=h;var A=r.xOffset2=i.l+i.w*f[0],T=r.yOffset2=i.t+i.h*(1-h[1]),S=r.radius=l/y,E=r.cx=A-S*v[0],L=r.cy=T+S*v[3],C=r.cxx=E-A,z=r.cyy=L-T;r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.updateAngularAxis(t,e);var I=r.radialAxis.range,O=I[1]-I[0],F=r.xaxis={type:"linear",_id:"x",range:[v[0]*O,v[2]*O],domain:f};M.setConvert(F,t),F.setScale();var R=r.yaxis={type:"linear",_id:"y",range:[v[1]*O,v[3]*O],domain:h};M.setConvert(R,t),R.setScale(),F.isPtWithinRange=function(t){return r.isPtWithinSector(t)},R.isPtWithinRange=function(){return!0},n.frontplot.attr("transform",u(A,T)).call(_.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.circle),n.bgcircle.attr({d:s(S,g),transform:u(E,L)}).call(b.fill,e.bgcolor),r.clipPaths.circle.select("path").attr("d",s(S,g)).attr("transform",u(C,z)),r.framework.selectAll(".crisp").classed("crisp",0)},N.updateRadialAxis=function(t,e){var r=this.gd,n=this.layers,s=this.radius,l=this.cx,h=this.cy,d=t._size,p=e.radialaxis,m=e.sector,g=P(m[0]);this.fillViewInitialKey("radialaxis.angle",p.angle);var v=this.radialAxis=x.extendFlat({},p,{_axislayer:n["radial-axis"],_gridlayer:n["radial-grid"],_id:"x",_pos:0,side:{counterclockwise:"top",clockwise:"bottom"}[p.side],domain:[0,s/d.w],anchor:"free",position:0,_counteraxis:!0});i(v,p,t),M.doAutoRange(v),p.range=v.range.slice(),p._input.range=v.range.slice(),this.fillViewInitialKey("radialaxis.range",v.range.slice()),"auto"===v.tickangle&&g>90&&g<=270&&(v.tickangle=180),v._transfn=function(t){return"translate("+v.l2p(t.x)+",0)"},v._gridpath=function(t){return o(v.r2p(t.x),m)};var y=a(p);this.radialTickLayout!==y&&(n["radial-axis"].selectAll(".xtick").remove(),this.radialTickLayout=y),M.doTicks(r,v,!0),c(n["radial-axis"],p.showticklabels||p.ticks,{transform:u(l,h)+f(-p.angle)}),c(n["radial-grid"],p.showgrid,{transform:u(l,h)}).selectAll("path").attr("transform",null),c(n["radial-line"].select("line"),p.showline,{x1:0,y1:0,x2:s,y2:0,transform:u(l,h)+f(-p.angle)}).attr("stroke-width",p.linewidth).call(b.stroke,p.linecolor)},N.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:s.angle,u=D(c),f=Math.cos(u),h=Math.sin(u),d=0;if(s.title){var p=_.bBox(this.layers["radial-axis"].node()).height,m=s.titlefont.size;d="counterclockwise"===s.side?-p-.4*m:p+.8*m}this.layers["radial-axis-title"]=S.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:z(n,"Click to enter radial axis title"),attributes:{x:a+i/2*f+d*h,y:o-i/2*h+d*f,"text-anchor":"middle"},transform:{rotate:-c}})},N.updateAngularAxis=function(t,e){function r(t){return T.c2rad(t.x,"degrees")}function n(t){return[v*Math.cos(t),v*Math.sin(t)]}var o=this,h=o.gd,g=o.layers,v=o.radius,y=o.cx,_=o.cy,w=e.angularaxis,k=e.sector,A=k.map(D);o.fillViewInitialKey("angularaxis.rotation",w.rotation);var T=o.angularAxis=x.extendFlat({},w,{_axislayer:g["angular-axis"],_gridlayer:g["angular-grid"],_id:"angular",_pos:0,side:"right",domain:[0,Math.PI],anchor:"free",position:0,_counteraxis:!0});"linear"===T.type?(T.autorange=!1,l(k)?T.range=k.slice():T.range=A.map(T.unTransformRad).map(I),"radians"===T.thetaunit&&(T.tick0=I(T.tick0),T.dtick=I(T.dtick))):"category"===T.type&&(T._tickFilter=function(t){return o.isPtWithinSector({r:o.radialAxis.range[1],rad:T.c2rad(t.x)})}),i(T,w,t),M.doAutoRange(T),T._transfn=function(t){var e=r(t),i=n(e),a=u(y+i[0],_-i[1]),o=m.select(this);return o&&o.node()&&o.classed("ticks")&&(a+=f(-I(e))),a},T._gridpath=function(t){var e=n(r(t));return"M0,0L"+-e[0]+","+e[1]};var S="outside"!==w.ticks?.7:.5;T._labelx=function(t){var e=r(t),n=T._labelStandoff,i=T._pad;return(0===p(e)?0:Math.cos(e)*(n+i+S*t.fontSize))+d(e)*(t.dx+n+i)},T._labely=function(t){var e=r(t),n=T._labelStandoff,i=T._labelShift,a=T._pad;return t.dy+t.fontSize*C-i+-Math.sin(e)*(n+a+S*t.fontSize)},T._labelanchor=function(t,e){var n=r(e);return 0===p(n)?d(n)>0?"start":"end":"middle"};var E=a(w);o.angularTickLayout!==E&&(g["angular-axis"].selectAll(".angulartick").remove(),o.angularTickLayout=E),M.doTicks(h,T,!0),c(g["angular-line"].select("path"),w.showline,{d:s(v,k),transform:u(y,_)}).attr("stroke-width",w.linewidth).call(b.stroke,w.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t,e),this.updateRadialDrag(t,e),this.updateMainDrag(t,e))},N.updateMainDrag=function(t,e){function r(t,e){var r=t-w,n=e-M;return Math.sqrt(r*r+n*n)}function n(t,e){return Math.atan2(M-e,t-w)}function i(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function a(t,e){var r=R.cornerLen,n=R.cornerHalfWidth;if(0===t)return s(2*n,S);var a=r/t/2,o=e-a,l=e+a,c=Math.max(0,Math.min(t,x)),u=c-n,f=c+n;return"M"+i(u,o)+"A"+[u,u]+" 0,0,0 "+i(u,l)+"L"+i(f,l)+"A"+[f,f]+" 0,0,1 "+i(f,o)+"Z"}function o(t,e){var i=C+t,o=z+e,l=r(C,z),c=Math.min(r(i,o),x),u=n(C,z),f=n(i,o);lp?(l0!=n>g[0])return;P=h.range[1]=n,M.doTicks(a,i.radialAxis,!0),o["radial-grid"].attr("transform",u(l,c)).selectAll("path").attr("transform",null);var f=P-g[0],d=i.sectorBBox;i.xaxis.range=[d[0]*f,d[2]*f],i.yaxis.range=[d[1]*f,d[3]*f],i.xaxis.setScale(),i.yaxis.setScale();for(var m in i.traceHash){var v=i.traceHash[m],_=x.filterVisible(v),w=v[0][0].trace._module,k=a._fullLayout[i.id];if(w.plot(a,i,_,k),!y.traceIs(m,"gl"))for(var A=0;A<_.length;A++)w.style(a,_[A])}})}}function n(){null!==z?v.relayout(a,i.id+".radialaxis.angle",z):null!==P&&v.relayout(a,i.id+".radialaxis.range[1]",P)}var i=this,a=i.gd,o=i.layers,s=i.radius,l=i.cx,c=i.cy,h=i.radialAxis,d=e.radialaxis,p=D(d.angle),g=h.range.slice(),b=g[1]-g[0],_=R.radialDragBoxSize,w=_/2;if(d.visible){var T=A.makeRectDragger(o,"radialdrag","crosshair",-w,-w,_,_),S={element:T,gd:a},E=l+(s+w)*Math.cos(p),L=c-(s+w)*Math.sin(p);m.select(T).attr("transform",u(E,L));var C,z,P;S.prepFn=function(){C=null,z=null,P=null,S.moveFn=r,S.doneFn=n,A.clearSelect(t._zoomlayer)},S.clampFn=function(t,e){return Math.sqrt(t*t+e*e)o&&(o+=360);var s,c,u=P(I(t.rad)),f=u+360;return n[1]>=n[0]?(s=n[0],c=n[1]):(s=n[1],c=n[0]),i>=s&&i<=c&&(l(e)||u>=a&&u<=o||f>=a&&f<=o)},N.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../constants/alignment":716,"../../lib":743,"../../lib/setcursor":762,"../../plotly":784,"../../registry":873,"../cartesian/axes":789,"../cartesian/dragbox":797,"../cartesian/select":807,"../plots":852,"./constants":853,"./helpers":854,d3:128,tinycolor2:546}],865:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r,i){function a(t,e){return n.coerce(o,s,c,t,e)}for(var o,s,l=i.type,c=i.attributes,u=i.handleDefaults,f=i.partition||"x",h=e._subplots[l],d=h.length,p=0;p=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":618,"../../subplot_defaults":865,"./axis_defaults":869,"./layout_attributes":871}],871:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("./axis_attributes"),o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"./axis_attributes":868}],872:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),c=l._,u=t("../../components/color"),f=t("../../components/drawing"),h=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),m=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),y=t("../../components/titles"),x=t("../cartesian/select"),b=t("../cartesian/constants");e.exports=n;var _=n.prototype;_.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},_.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iw*x?i=(a=x)*w:a=(i=y)/w,o=g*i/y,s=v*a/x,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[_+2*k-b,b-_-2*M],domain:[p-o/2,p+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[_,b-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var A=l.yaxis.domain[0],T=l.aaxis=d({},t.aaxis,{visible:!0,range:[_,b-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*w],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(T,l.graphDiv._fullLayout),T.setScale();var S=l.baxis=d({},t.baxis,{visible:!0,range:[b-_-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(S,l.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=l.caxis=d({},t.caxis,{visible:!0,range:[b-_-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*w],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var z="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),l.clipDefRelative.select("path").attr("transform",null);var D="translate("+(r-S._offset)+","+(n+a)+")";l.layers.baxis.attr("transform",D),l.layers.bgrid.attr("transform",D);var I="translate("+(r+i/2)+","+n+")rotate(30)translate(0,-"+T._offset+")";l.layers.aaxis.attr("transform",I),l.layers.agrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,-"+E._offset+")";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),f.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},_.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(m.doTicks(e,n,!0),m.doTicks(e,i,!0),m.doTicks(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));this.layers["a-title"]=y.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:c(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var s=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;this.layers["b-title"]=y.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:c(e,"Click to enter Component B title"),attributes:{x:this.x0-s,y:this.y0+this.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),this.layers["c-title"]=y.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:c(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+s,y:this.y0+this.h+.83*a.titlefont.size+s,"text-anchor":"middle"}})}};var M=b.MINZOOM/2+.87,k="m-0.87,.5h"+M+"v3h-"+(M+5.2)+"l"+(M/2+2.6)+",-"+(.87*M+4.5)+"l2.6,1.5l-"+M/2+","+.87*M+"Z",A="m0.87,.5h-"+M+"v3h"+(M+5.2)+"l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-2.6,1.5l"+M/2+","+.87*M+"Z",T="m0,1l"+M/2+","+.87*M+"l2.6,-1.5l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-"+(M/2+2.6)+","+(.87*M+4.5)+"l2.6,1.5l"+M/2+",-"+.87*M+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;_.initInteractions=function(){function t(t,e){return 1-e/O.h}function e(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function r(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function n(n,i){var a=m+n,o=y+i,s=Math.max(0,Math.min(1,t(0,y),t(0,o))),l=Math.max(0,Math.min(1,e(m,y),e(a,o))),c=Math.max(0,Math.min(1,r(m,y),r(a,o))),u=(s/2+c)*O.w,f=(1-s/2-l)*O.w,h=(u+f)/2,d=f-u,p=(1-s)*O.h,g=p-d/w;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),P.transition().style("opacity",1).duration(200),D=!0)}function a(){if(i(R),L!==_){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t),E&&R.data&&R._context.showTips&&(l.notifier(c(R,"Double-click to zoom back out"),"long"),E=!1)}}function h(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m,i=[(L={a:_.a-n,b:_.b+(r+n)/2,c:_.c-(r-n)/2}).a,L.b,L.c].sort(),a=i.indexOf(L.a),o=i.indexOf(L.b),s=i.indexOf(L.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),L={a:i[a],b:i[o],c:i[s]},e=(_.a-L.a)*O.yaxis._m,t=(_.c-L.c-_.b+L.b)*O.xaxis._m);var l="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",l);var c="translate("+-t+","+-e+")";O.clipDefRelative.select("path").attr("transform",c),O.aaxis.range=[L.a,O.sum-L.b-L.c],O.baxis.range=[O.sum-L.a-L.c,L.b],O.caxis.range=[O.sum-L.a-L.b,L.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1),O._hasClipOnAxisFalse&&O.plotContainer.select(".scatterlayer").selectAll(".trace").call(f.hideOutsideRangePoints,O)}function d(){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t)}function p(){N.selectAll(".select-outline").remove()}var m,y,_,M,L,C,z,D,I,P,O=this,F=O.layers.plotbg.select("path").node(),R=O.graphDiv,N=R._fullLayout._zoomlayer,j={element:F,gd:R,plotinfo:{xaxis:O.xaxis,yaxis:O.yaxis},subplot:O.id,prepFn:function(t,e,r){j.xaxes=[O.xaxis],j.yaxes=[O.yaxis];var i=R._fullLayout.dragmode;t.shiftKey&&(i="pan"===i?"zoom":"pan"),j.minDrag="lasso"===i?1:void 0,"zoom"===i?(j.moveFn=n,j.doneFn=a,function(t,e,r){var n=F.getBoundingClientRect();m=e-n.left,y=r-n.top,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,M=O.aaxis.range[1]-_.a,C=o(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),z="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",D=!1,I=N.append("path").attr("class","zoombox").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:C>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),P=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}(0,e,r)):"pan"===i?(j.moveFn=h,j.doneFn=d,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,p()):"select"!==i&&"lasso"!==i||x(t,e,r,j,i)},clickFn:function(t,e){if(i(R),2===t){var r={};r[O.id+".aaxis.min"]=0,r[O.id+".baxis.min"]=0,r[O.id+".caxis.min"]=0,R.emit("plotly_doubleclick",null),s.relayout(R,r)}v.click(R,e,O.id)}};F.onmousemove=function(t){v.hover(R,t,O.id),R._fullLayout._lasthover=F,R._fullLayout._hoversubplot=O.id},F.onmouseout=function(t){R._dragging||g.unhover(R,t)},g.init(j)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../lib":743,"../../lib/extend":732,"../../plotly":784,"../cartesian/axes":789,"../cartesian/constants":794,"../cartesian/select":807,"../cartesian/set_convert":808,"../plots":852,d3:128,tinycolor2:546}],873:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=a.extendFlat,s=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,l=t.layout,c=s([],a),u=s({},l,n(e.tileClass)),f=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var h=Object.keys(u);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(w),w=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}(w),w=w.replace(u,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},{"../components/color":618,"../components/drawing":643,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],882:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&E>0&&(S<=F&&E<=R||S<=R&&E<=F||("h"===M?F>=S*(R/E):R>=E*(F/S)))?m="inside":(m="outside",A.remove(),A=null)}else m="inside";if(!A&&(A=d(e,k,"outside"===m?z:C),T=p.bBox(A.node()),S=T.width,E=T.height,S<=0||E<=0))A.remove();else{var N;N="outside"===m?function(t,e,r,n,a,o,s){var l,c="h"===o?Math.abs(n-r):Math.abs(e-t);c>2*w&&(l=w);var u=1;s&&(u="h"===o?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,h,d,p,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2;f=u*a.width,h=u*a.height,"h"===o?er?(d=(t+e)/2,p=n+l+h/2):(d=(t+e)/2,p=n-l-h/2);return i(m,g,d,p,u,!1)}(l,c,u,f,T,M,"both"===g.constraintext||"outside"===g.constraintext):function(t,e,r,n,a,o,s){var l,c,u,f,h,d=a.width,p=a.height,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*w&&y>2*w?(v-=2*(h=w),y-=2*h):h=0;var x,b;d<=v&&p<=y?(x=!1,b=1):d<=y&&p<=v?(x=!0,b=1):dr?(u=(t+e)/2,f=n-h-c/2):(u=(t+e)/2,f=n+h+c/2);return i(m,g,u,f,b,x)}(l,c,u,f,T,M,"both"===g.constraintext||"inside"===g.constraintext),A.attr("transform",N)}}}function i(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");return"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function a(t,e,r,n){var i=o((e=e||{}).family,r),a=o(e.size,r),l=o(e.color,r);return{family:s(t.family,i,n.family),size:function(t,e,r){if(c(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&ei;if(!a)return e}return void 0!==r?r:t.dflt}(t.size,a,n.size),color:function(t,e,r){return u(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,n.color)}}function o(t,e){var r;return Array.isArray(t)?e.01?f:function(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)};g=A(g,m=A(m,g)),y=A(y,v=A(v,y))}var T=l.select(this);T.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+m+","+v+"V"+y+"H"+g+"V"+v+"Z"),n(t,T,e,s,m,g,v,y)}else l.select(this).remove()})}),s.call(m.plot,e)}},{"../../components/color":618,"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/svg_text_utils":766,"./attributes":883,d3:128,"fast-isnumeric":140,tinycolor2:546}],891:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;ru+s||!p(l))&&(h=!0,c(f,t))}for(var i=r.traces,a=d(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,f=[l,u],h=!1,g=0;g1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),a=r.selectAll("path"),o=r.selectAll("text"),s=e[0].trace;i.pointStyle(a,s,t),i.selectedPointStyle(a,s),o.each(function(t){function e(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}var r,a=n.select(this);a.classed("bartext-inside")?r=s.insidetextfont:a.classed("bartext-outside")&&(r=s.outsidetextfont),r||(r=s.textfont),i.font(a,e("family"),e("size"),e("color"))}),i.selectedTextStyle(o,s)}),a.style(r)}},{"../../components/drawing":643,"../../components/errorbars":649,d3:128}],895:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],896:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.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,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../scatter/attributes":1066}],897:[function(t,e,r){"use strict";function n(t,e){return t.v-e.v}function i(t){return t.v}var a=t("fast-isnumeric"),o=t("../../lib"),s=o._,l=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,c,u,f,h,d=t._fullLayout,p=l.getFromId(t,e.xaxis||"x"),m=l.getFromId(t,e.yaxis||"y"),g=[],v="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=p,u="x",f=m,h="y"):(c=m,u="y",f=p,h="x");var y=c.makeCalcdata(e,u),x=function(t,e,r,n,i){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||a(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;var l=r.d2c(s,0,t[e+"calendar"]);return n.map(function(){return l})}(e,h,f,y,d[v]),b=o.distinctVals(x),_=b.vals,w=b.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&E0){var C=T[r].sort(n),z=C.map(i),D=z.length,I={pos:_[r],pts:C};I.min=z[0],I.max=z[D-1],I.mean=o.mean(z,D),I.sd=o.stdev(z,D,I.mean),I.q1=o.interp(z,.25),I.med=o.interp(z,.5),I.q3=o.interp(z,.75),I.lf=Math.min(I.q1,z[Math.min(o.findBin(2.5*I.q1-1.5*I.q3,z,!0)+1,D-1)]),I.uf=Math.max(I.q3,z[Math.max(o.findBin(2.5*I.q3-1.5*I.q1,z),0)]),I.lo=4*I.q1-3*I.q3,I.uo=4*I.q3-3*I.q1,g.push(I)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var r=0;r0?(g[0].t={num:d[v],dPos:w,posLetter:h,valLetter:u,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete g[0].t.labels,d[v]++,g):[{t:{empty:!0}}]}},{"../../lib":743,"../../plots/cartesian/axes":789,"fast-isnumeric":140}],898:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a=r("y"),s=r("x");if(a&&a.length)i="v",s||r("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",r("y0")}o.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function i(t,e,r,n){var i=n.prefix,o=a.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c=r(i+"points",o||s?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(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")):delete e.marker,r("hoveron"),a.coerceSelectionMarkerOpacity(e,r)}var a=t("../../lib"),o=t("../../registry"),s=t("../../components/color"),l=t("./attributes");e.exports={supplyDefaults:function(t,e,r,o){function c(r,n){return a.coerce(t,e,l,r,n)}n(t,e,c,o),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",s.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),i(t,e,c,{prefix:"box"}))},handleSampleDefaults:n,handlePointsDefaults:i}},{"../../components/color":618,"../../lib":743,"../../registry":873,"./attributes":896}],899:[function(t,e,r){"use strict";function n(t,e,r,n){var i,c,u,f,h,d,p,m,g,v=t.cd,y=t.xa,x=t.ya,b=v[0].trace,_=v[0].t,w="violin"===b.type,M=[],k="closest"!==n||w?_.bdPos:2.5*_.bdPos,A=function(t){return t.pos+_.bPos-d};w&&"both"!==b.side?("positive"===b.side&&(g=function(t){var e=A(t);return s.inbox(e,e+k)}),"negative"===b.side&&(g=function(t){var e=A(t);return s.inbox(e-k,e)})):g=function(t){var e=A(t);return s.inbox(e-k,e+k)};var T;T=w?function(t){return s.inbox(t.span[0]-h,t.span[1]-h)}:function(t){return s.inbox(t.min-h,t.max-h)},"h"===b.orientation?(h=e,d=r,p=T,m=g,i="y",u=x,c="x",f=y):(h=r,d=e,p=g,m=T,i="x",u=y,c="y",f=x);var S=s.getDistanceFunction(n,p,m);if(s.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],L=b.line.color,C=(b.marker||{}).color;l.opacity(L)&&b.line.width?t.color=L:l.opacity(C)&&b.boxpoints?t.color=C:t.color=b.fillcolor,t[i+"0"]=u.c2p(E.pos+_.bPos-_.bdPos,!0),t[i+"1"]=u.c2p(E.pos+_.bPos+_.bdPos,!0),a.tickText(u,u.c2l(E.pos),"hover").text,t[i+"LabelVal"]=E.pos;var z={},D=["med","min","q1","q3","max"];(b.boxmean||(b.meanline||{}).visible)&&D.push("mean"),(b.boxpoints||b.points)&&D.push("lf","uf");for(var I=0;It.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*o,u=o*h,m=[],g=0;if(r.jitter){if(0===o)for(g=1,m=new Array(a.length),e=0;et.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(c.translatePoints,a,o)}function o(t,e,r,n){var i,a,o=e.pos,c=e.val,u=n.bPos,f=n.bPosPxOffset||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.mean").data(l.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=o.c2p(t.pos+u,!0)+f,n=o.c2p(t.pos+u-i,!0)+f,l=o.c2p(t.pos+u+a,!0)+f,h=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),p=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?s.select(this).attr("d","M"+h+","+n+"V"+l+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+h+","+n+"L"+p+","+e+"Z":"")):s.select(this).attr("d","M"+n+","+h+"H"+l+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+n+","+h+"L"+e+","+p+"Z":""))})}var s=t("d3"),l=t("../../lib"),c=t("../../components/drawing"),u=2e9,f=5,h=.01;e.exports={plot:function(t,e,r){var n=t._fullLayout,l=e.xaxis,c=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(t){var e=t[0],r=e.t,u=e.trace,f=e.node3=s.select(this),h=n._numBoxes,d="group"===n.boxmode&&h>1,p=r.dPos*(1-n.boxgap)*(1-n.boxgroupgap)/(d?h:1),m=d?2*r.dPos*((r.num+.5)/h-.5)*(1-n.boxgap):0,g=p*u.whiskerwidth;if(!0!==u.visible||r.empty)s.select(this).remove();else{var v,y;"h"===u.orientation?(v=c,y=l):(v=l,y=c),r.bPos=m,r.bdPos=p,r.wdPos=g,i(f,{pos:v,val:y},u,r),u.boxpoints&&a(f,{x:l,y:c},u,r),u.boxmean&&o(f,{pos:v,val:y},u,r)}})},plotBoxAndWhiskers:i,plotPoints:a,plotBoxMean:o}},{"../../components/drawing":643,"../../lib":743,d3:128}],904:[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 r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,z=E>0?Math.ceil:Math.floor,D=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,P=C(T+L),O=z(S-L),F=[[u=A(T)]];for(i=P;i*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}},{}],919:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,c,u,f,h,d,p,g,v=[],y=[],x={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,x.length=P,x.crossLength=I,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(h=t.dxydi([],n-1,o,0,s),v.push(l[0]+h[0]/3),y.push(l[1]+h[1]/3),d=t.dxydi([],n-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(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=P,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(p=t.dxydj([],c,i-1,u,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],c,i-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=r,x.axis=M,x.crossAxis=E,x.value=e,x.constvar=a,x.index=m,x.x=v,x.y=y,x.smoothing=E.smoothing,x}function s(e){var n,i,o,s,l,c=[],u=[],f={};if(f.length=w.length,f.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),f.xy=function(r){return t.evalxy([],r,e)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(c),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(x=w[u],b=w[y],l=0;lw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(f=5e-15,d=(h=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+f)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+f))].sort(function(t,e){return t-e}))[0],p=h[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":732,"../../plots/cartesian/axes":789}],920:[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=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],936:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],l=r[0].trace,c=e.xaxis,d=e.yaxis,m=l.aaxis,g=l.baxis,v=t._fullLayout,y=e.plot.selectAll(".carpetlayer"),x=v._clips,b=n(y,"g","carpet"+l.uid).classed("trace",!0),_=n(b,"g","minorlayer"),w=n(b,"g","majorlayer"),M=n(b,"g","boundarylayer"),k=n(b,"g","labellayer");b.style("opacity",l.opacity),a(c,d,w,m,"a",m._gridlines),a(c,d,w,g,"b",g._gridlines),a(c,d,_,m,"a",m._minorgridlines),a(c,d,_,g,"b",g._minorgridlines),a(c,d,M,m,"a-boundary",m._boundarylines),a(c,d,M,g,"b-boundary",g._boundarylines);!function(t,e,r,n,i,a,o,l){var c,u,f,d;c=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],f=r.ab2xy(c,u,!0),d=r.dxyda_rough(c,u),void 0===o.angle&&p.extendFlat(o,h(r,i,a,f,r.dxydb_rough(c,u)));s(t,e,r,n,f,d,r.aaxis,i,a,o,"a-title"),c=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),f=r.ab2xy(c,u,!0),d=r.dxydb_rough(c,u),void 0===l.angle&&p.extendFlat(l,h(r,i,a,f,r.dxyda_rough(c,u)));s(t,e,r,n,f,d,r.baxis,i,a,l,"b-title")}(t,k,l,i,c,d,o(t,c,d,l,i,k,m._labels,"a-label"),o(t,c,d,l,i,k,g._labels,"b-label")),function(t,e,r,i,a){var o,s,l,c,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var d=n(h,"path","carpetboundary"),p=e.clipsegments,m=[];for(c=0;c0?"start":"end","data-notex":1}).call(c.font,i.font).text(i.text).call(d.convertToTspans,t),g=c.bBox(this);m.attr("transform","translate("+o.p[0]+","+o.p[1]+") rotate("+o.angle+")translate("+i.axis.labelpadding*u+","+.3*g.height+")"),f=Math.max(f,g.width+i.axis.labelpadding)}),u.exit().remove(),p.maxExtent=f,p}function s(t,e,r,n,i,a,o,s,u,f,p){var m=[];o.title&&m.push(o.title);var y=e.selectAll("text."+p).data(m),x=f.maxExtent;y.enter().append("text").classed(p,!0),y.each(function(){var e=h(r,s,u,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(x=0);var n=o.titlefont.size;x+=n+o.titleoffset;var p=(f.angle+(f.flip<0?180:0)-e.angle+450)%360,m=p>90&&p<270,y=l.select(this);y.text(o.title||"").call(d.convertToTspans,t),m&&(x=(-d.lineCount(y)+v)*g*n-x),y.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+x+")").classed("user-select-none",!0).attr("text-anchor","middle").call(c.font,o.titlefont)}),y.exit().remove()}var l=t("d3"),c=t("../../components/drawing"),u=t("./map_1d_array"),f=t("./makepath"),h=t("./orient_text"),d=t("../../lib/svg_text_utils"),p=t("../../lib"),m=t("../../constants/alignment");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},f.c2p=function(t){return t},h.c2p=function(t){return t},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,d,p,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]?(d=u-2,p=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):p=s-(d=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,f,d,h,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,f,d,h,p),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":761,"./compute_control_points":923,"./constants":924,"./create_i_derivative_evaluator":925,"./create_j_derivative_evaluator":926,"./create_spline_evaluator":927}],938:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){function i(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&&o0&&a1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":743}],939:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":981,"./has_columns":929}],940:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,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:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plots/attributes":787,"../scattergeo/attributes":1104}],941:[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");e.exports=function(t,e){for(var r=e.locations.length,l=new Array(r),c=0;cl&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":628,"../../lib":743,"./attributes":940}],943:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],944:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var o,s,l,c,u=t.cd,f=u[0].trace,h=t.subplot;for(s=0;s")}(t,f,o,h.mockAxis),[t]}},{"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"./attributes":940}],945:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":820,"../heatmap/colorbar":980,"./attributes":940,"./calc":941,"./defaults":942,"./event_data":943,"./hover":944,"./plot":946,"./select":947,"./style":948}],946:[function(t,e,r){"use strict";function n(t,e){for(var r=t[0].trace,n=t.length,i=s(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,s=t.geometry,l=s.coordinates,c=t.id,u=[];r="RUS"===c||"FJI"===c?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var s=o.tester(n);s.pts.pop(),u.push(s)}:function(t){u.push(o.tester(t))};switch(s.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var c=s.start,u=s.end,f=e._input.contours;if(c>u&&(s.start=f.start=u,u=s.end=f.end=c,c=s.start),!(s.size>0)){var h;h=c===u?1:n(c,u,e.ncontours).dtick,f.size=s.size=h}}return r}},{"../../lib":743,"../../plots/cartesian/axes":789,"../heatmap/calc":978}],951:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale){var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,f=c.size||1,h=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===h&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===h||"heatmap"===h?d:"").line({color:"lines"===h?d:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}else n.autoMargin(t,s)}},{"../../components/colorbar/draw":622,"../../plots/plots":852,"./end_plus":955,"./make_color_map":959}],952:[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}}},{}],953:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a=n.coerce2(t,e,i,"contours.start"),o=n.coerce2(t,e,i,"contours.end"),s=!1===a||!1===o,l=r("contours.size");!(s?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{"../../lib":743,"./attributes":949}],954:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}a(t,e,u,c)?(u("text"),u("connectgaps",i(e)),o(t,e,u),s(t,e,u,c)):e.visible=!1}},{"../../lib":743,"../heatmap/has_columns":984,"../heatmap/xyz_defaults":993,"./attributes":949,"./contours_defaults":953,"./style_defaults":963}],955:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],956:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==l.BOTTOMSTART.indexOf(t)?i=1:-1!==l.LEFTSTART.indexOf(t)?n=1:-1!==l.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(p,r,e),g=[o(t,e,[-m[0],-m[1]])],v=m.join(","),y=t.z.length,x=t.z[0].length;for(f=0;f<1e4;f++){if(p>20?(p=l.CHOOSESADDLE[p][(m[0]||m[1])<0?0:1],t.crossings[d]=l.SADDLEREMAINDER[p]):delete t.crossings[d],!(m=l.NEWDELTA[p])){s.log("Found bad marching index:",p,e,t.level);break}g.push(o(t,e,m)),e[0]+=m[0],e[1]+=m[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),d=e.join(",");var b=m[0]&&(e[0]<0||e[0]>x-2)||m[1]&&(e[1]<0||e[1]>y-2);if(d===h&&m.join(",")===v||r&&b)break;p=t.crossings[d]}1e4===f&&s.log("Infinite loop in contour?");var _,w,M,k,A,T,S,E,L,C,z,D=n(g[0],g[g.length-1],a,c),I=0,P=.2*t.smoothing,O=[],F=0;for(f=1;f=F;f--)if((_=O[f])=F&&_+O[w]E&&L--,t.edgepaths[L]=z.concat(g,C));break}j||(t.edgepaths[E]=g.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r)return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208;return 15===r?0:r}((c=t[u]).level,s))&&(c.crossings[o]=l,-1!==i.indexOf(l)&&(c.starts.push([e,r]),p&&-1!==i.indexOf(l,i.indexOf(l)+1)&&c.starts.push([e,r])))}},{"./constants":952}],961:[function(t,e,r){"use strict";function n(t,e,n){var l=n[0].trace,c=n[0].x,u=n[0].y,g=l.contours,v=l.uid,y=e.xaxis,x=e.yaxis,b=t._fullLayout,_="contour"+v,w=function(t,e,r){for(var n=t.size,i=[],a=p(t),s=t.start;s1e3){o.warn("Too many contours, clipping at 1000",t);break}return i}(g,e,n[0]);if(!0!==l.visible)return b._paper.selectAll("."+_+",.hm"+v).remove(),void b._infolayer.selectAll(".cb"+v).remove();"heatmap"===g.coloring?(l.zauto&&!1===l.autocontour&&(l._input.zmin=l.zmin=g.start-g.size/2,l._input.zmax=l.zmax=l.zmin+w.length*g.size),f(t,e,[n])):(b._paper.selectAll(".hm"+v).remove(),b._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+v).remove()),h(w),d(w);var M=y.c2p(c[0],!0),k=y.c2p(c[c.length-1],!0),A=x.c2p(u[0],!0),T=x.c2p(u[u.length-1],!0),S=[[M,T],[k,T],[k,A],[M,A]],E=r.makeContourGroup(e,n,_);!function(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(E,S,g),function(t,e,r,n){var o=t.selectAll("g.contourfill").data([0]);o.enter().append("g").classed("contourfill",!0);var s=o.selectAll("path").data("fill"===n.coloring?e:[]);s.enter().append("path"),s.exit().remove(),s.each(function(t){var e=i(t,r);e?a.select(this).attr("d",e).style("stroke","none"):a.select(this).remove()})}(E,w,S,g),function(t,e,n,i,l,c){var u=t.selectAll("g.contourlines").data([0]);u.enter().append("g").classed("contourlines",!0);var f=!1!==l.showlines,h=l.showlabels,d=f&&h,p=r.createLines(u,f||h,e),g=r.createLineClip(u,d,n._fullLayout._clips,i.trace.uid),v=t.selectAll("g.contourlabels").data(h?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),h){var y=[c],x=[];o.clearLocationCache();var b=r.labelFormatter(l,i.t.cb,n._fullLayout),_=s.tester.append("text").attr("data-notex",1).call(s.font,l.labelfont),w=e[0].xaxis._length,M=e[0].yaxis._length,k={left:Math.max(c[0][0],0),right:Math.min(c[2][0],w),top:Math.max(c[0][1],0),bottom:Math.min(c[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var A=Math.sqrt(w*w+M*M),T=m.LABELDISTANCE*A/Math.max(1,e.length/m.LABELINCREASE);p.each(function(t){var e=r.calcTextOpts(t.level,b,_,n);a.select(this).selectAll("path").each(function(){var t=o.getVisibleSegment(this,k,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/T),m.LABELMAX),i=0;i=0&&(c=x,f=h):Math.abs(l[1]-c[1])<.01?Math.abs(l[1]-x[1])<.01&&(x[0]-l[0])*(c[0]-x[0])>=0&&(c=x,f=h):o.log("endpt to newendpt is not vert. or horz.",l,c,x)}if(l=c,f>=0)break;m+="L"+c}if(f===t.edgepaths.length){o.log("unclosed perimeter path");break}g=f,(y=-1===v.indexOf(g))&&(g=v[0],m+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*a)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*a);if(h<1||d<1)return 1/0;var p=g.EDGECOST*(1/(h-1)+1/(d-1));p+=g.ANGLECOST*c*c;for(var m=s-u,v=l-f,y=s+u,x=l+f,b=0;b2*g.MAXCOST)break;d&&(s/=2),l=(a=c-s/2)+1.5*s}if(h<=g.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),f=i*u,h=a*c,d=i*c,p=-a*u,m=[[o-f-h,s-d-p],[o+f-h,s+d-p],[o+f+h,s+d+p],[o-f+h,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var o=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(o.exit().remove(),o.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;a.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(l.convertToTspans,r)}),i){for(var s="",c=0;cx.end&&(x.start=x.end=(x.start+x.end)/2),e._input.contours=a({},x)}else{var _=x.start,w=x.end,M=e._input.contours;if(_>w&&(x.start=M.start=w,w=x.end=M.end=_,_=x.start),!(x.size>0)){var k;k=_===w?1:n(_,w,e.ncontours).dtick,M.size=x.size=k}}return y}}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../carpet/lookup_carpetid":931,"../heatmap/clean_2d_array":979,"../heatmap/convert_column_xyz":981,"../heatmap/find_empties":983,"../heatmap/has_columns":984,"../heatmap/interp2d":987,"../heatmap/make_bound_array":988,"../heatmap/max_row_length":989,"./defaults":971}],966:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,c=n.z,u=-1/0,f=1/0;for(i=0;i":case">=":n.contours.value>u&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valueu&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),au&&(t[0].prefixBoundary=!0)}}},{}],967:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],968:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":967,"fast-isnumeric":140}],969:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].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])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":968,"fast-isnumeric":140}],970:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":743}],973:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../contour/colorbar":951,"../contour/style":962,"./attributes":964,"./calc":965,"./defaults":971,"./plot":976}],974:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){function f(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,b=_):Math.abs(v[1]-y[1])=0&&(y=L,b=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(b>=0)break;M+=m(v,y),v=y}if(b===e.edgepaths.length){a.log("unclosed perimeter path");break}g=b,(A=-1===k.indexOf(g))&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;U--)N=k.clipsegments[U],j=l([],N.x,L.c2p),B=l([],N.y,C.c2p),j.reverse(),B.reverse(),q.push(c(j,B,N.bicubic));var H="M"+q.join("L")+"Z";!function(t,e,r,n,i,a){var o,s,u,f,h=t.selectAll("g.contourbg").data([0]);h.enter().append("g").classed("contourbg",!0);var d=h.selectAll("path").data("fill"!==a||i?[]:[0]);d.enter().append("path"),d.exit().remove();var p=[];for(f=0;fx&&(n.max=x);n.len=n.max-n.min}(this,r,t,n,h,e.height),!(n.len<(e.width+e.height)*m.LABELMIN)))for(var s=Math.min(Math.ceil(n.len/D),m.LABELMAX),l=0;lz){r("x scale is not linear");break}}if(y.length&&"fast"===L){var D=(y[y.length-1]-y[0])/(y.length-1),I=Math.abs(D/100);for(w=0;wI){r("y scale is not linear");break}}}var P=u(_),O="scaled"===e.xtype?"":m,F=p(e,O,g,v,P,k),R="scaled"===e.ytype?"":y,N=p(e,R,x,b,_.length,A);E||(a.expand(k,F),a.expand(A,N));var j={x:F,y:N,z:_,text:e.text};if(O&&O.length===F.length-1&&(j.xCenter=O),R&&R.length===N.length-1&&(j.yCenter=R),S&&(j.xRanges=M.xRanges,j.yRanges=M.yRanges,j.pts=M.pts),s(e,_,"","z"),T&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=p(B,O,g,v,P,k),j.yfill=p(B,R,x,b,_.length,A)}return[j]}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../../registry":873,"../histogram2d/calc":1010,"./clean_2d_array":979,"./convert_column_xyz":981,"./find_empties":983,"./has_columns":984,"./interp2d":987,"./make_bound_array":988,"./max_row_length":989}],979:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,c;if(e){for(i=0,l=0;l=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]})}},{"./max_row_length":989}],984:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],985:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance=b[0].length||d<0||d>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-x[0],r-x[x.length-1])>o)return;if(c){var E;for(T=[2*y[0]-y[1]],E=1;Em&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":743}],988:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!h&&"category"!==o.type){var p=e.length;if(!(p<=a))return f?e.slice(0,a):e.slice(0,a+1);if(f||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)w=v.c2p(E[T]),T--;for(w<_&&(M=w,w=_,_=M,F=!0),T=0;void 0===k&&T0;)A=y.c2p(L[T]),T--;if(A0&&(n=!0);for(var s=0;sa){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){var l=a(e,i,o),u=a(r,i,o),f=t===s?0:1;return l[f]!==u[f]}return Math.floor(r/t)-Math.floor(e/t)>.1}(h,t,e,l,r,n))break;u=h}return u}function i(t,e){return e&&t>h?t>c?t>1.1*s?s:t>1.1*l?l:c:t>u?u:t>f?f:h:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function a(t,e,r){var n=e.c2d(t,s,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}var o=t("../../constants/numerical"),s=o.ONEAVGYEAR,l=o.ONEAVGMONTH,c=o.ONEDAY,u=o.ONEHOUR,f=o.ONEMIN,h=o.ONESEC,d=t("../../plots/cartesian/axes").tickIncrement;e.exports=function(t,e,r,i,a){var o,l,u=-1.1*e,f=-.1*e,h=t-f,p=r[0],m=r[1],g=Math.min(n(p+f,p+h,i,a),n(m+f,m+h,i,a)),v=Math.min(n(p+u,p+f,i,a),n(m+u,m+f,i,a));if(g>v&&vc){var y=o===s?1:6,x=o===s?"M12":"M1";return function(e,r){var n=i.c2d(e,s,a),o=n.indexOf("-",y);o>0&&(n=n.substr(0,o));var c=i.d2c(n,0,a);if(cp.size/1.9?p.size:p.size/Math.ceil(p.size/b);var T=p.start+(p.size-b)/2;_=T-b*Math.ceil((T-_)/b)}for(f=0;f=0&&w=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}(a,x.direction,x.currentbin);var Z=Math.min(i.length,a.length),J=[],K=0,Q=Z-1;for(r=0;r=K;r--)if(a[r]){Q=r;break}for(r=K;r<=Q;r++)if(o(i[r])&&o(a[r])){var $={p:i[r],s:a[r],b:0};x.enabled||($.pts=z[r],q?$.p0=$.p1=z[r].length?A[z[r][0]]:i[r]:($.p0=X(S[r]),$.p1=X(S[r+1],!0))),J.push($)}return 1===J.length&&(J[0].width1=l.tickIncrement(J[0].p,k.size,!1,y)-J[0].p),c(J,e),Array.isArray(e.selectedpoints)&&s.tagSelected(J,e,Y),J}}},{"../../constants/numerical":721,"../../lib":743,"../../plots/cartesian/axes":789,"../bar/arrays_to_calcdata":882,"./average":998,"./bin_functions":1e3,"./bin_label_vals":1001,"./clean_bins":1003,"./norm_functions":1008,"fast-isnumeric":140}],1003:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===a?o:1,h=c.size;if(n(h))c.size=h>0?Number(h):f;else if("string"!=typeof h)c.size=f;else{var d=h.charAt(0),p=h.substr(1);((p=n(p)?Number(p):0)<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=f)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],1004:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return i.coerce(t,e,c,r,n)}var h=f("x"),d=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var p=f("orientation",d&&!h?"h":"v"),m=e["v"===p?"x":"y"];if(m&&m.length){n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u);e["h"===p?"x":"y"]&&f("histfunc");o(t,e,f,"h"===p?["y"]:["x"]),s(t,e,f,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../components/color":618,"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../bar/style_defaults":895,"./attributes":997,"./bin_defaults":999}],1005:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;t.pointNumbers=a,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex;var o;if(r._indexToPoints){o=[];for(var s=0;sA&&g.splice(A,g.length-A),y.length>A&&y.splice(A,y.length-A),n(e,"x",g,m,_,M,x),n(e,"y",y,v,w,k,b);var T=[],S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,z=[],D=[],I=L?z:e.xbins,P=C?D:e.ybins,O=0,F=[],R=[],N=e.histnorm,j=e.histfunc,B=-1!==N.indexOf("density"),U="max"===j||"min"===j?null:0,V=c.count,q=u[N],H=!1,G=[],Y=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==j&&(H="avg"===j,V=c[j]);var X=e.xbins,Z=_(X.start),J=_(X.end)+(Z-l.tickIncrement(Z,X.size,!1,x))/1e6;for(r=Z;r=0&&d=0&&p0)o=c(t.alphahull,h);else{var d=["x","y","z"].indexOf(t.delaunayaxis);o=l(h.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:h,cells:o,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:f(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=function(t){return t.map(function(t){var e=t[0],r=s(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})}(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=i(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=i(t.facecolor)):(this.color=t.color,p.meshColor=f(t.color)),this.mesh.update(p)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=o({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":765,"alpha-shape":47,"convex-hull":109,"delaunay-triangulate":130,"gl-mesh3d":210,tinycolor2:546}],1022:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),f=c(["i","j","k"]);if(u){f&&f.forEach(function(t){for(var e=0;ei?r=!0:e1)){var f=a.simpleMap(u.x,e.d2c,0,r.xcalendar),h=a.distinctVals(f).minDiff;o=Math.min(o,h)}}for(o===1/0&&(o=1),c=0;c");S.push(o,o,o,o,o,o,null)},R=0;Rs&&(n.log("parcoords traces support up to "+s+" dimensions at the moment"),c.splice(s)),l=0;l0)&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),f=Math.min(f,o.values.length)),o._index=l,u.push(o));if(isFinite(f))for(l=0;lf&&(o.values=o.values.slice(0,f));return u}(t,e);!function(t,e,r,i,s){s("line.color",r),a(t,"line")&&n.isArray(t.line.color)?(s("line.colorscale"),o(t,e,i,s,{prefix:"line.",cLetter:"c"})):s("line.color",r)}(t,e,r,l,c),c("domain.x"),c("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var f={family:l.font.family,size:Math.round(l.font.size*(10/12)),color:l.font.color};n.coerceFont(c,"labelfont",f),n.coerceFont(c,"tickfont",f),n.coerceFont(c,"rangefont",f)}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"../../lib":743,"./attributes":1031,"./constants":1035}],1037:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1031,"./base_plot":1032,"./calc":1033,"./colorbar":1034,"./defaults":1036,"./plot":1040}],1038:[function(t,e,r){"use strict";function n(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 i(t,e,r,i,a,o){function s(c){var u;u=Math.min(i,a-c*i),o.offset=h*c*i,o.count=h*u,0===c&&(window.cancelAnimationFrame(r.currentRafs[l]),delete r.currentRafs[l],n(t,o.scissorX,o.scissorY,o.scissorWidth,o.viewBoxSize[1])),r.clearOnly||(e(o),c*i+u>>8*e)%256/255}function s(t,e){var r={};return[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].map(function(r){return function(t,e,r){var n,i,a,o=[];for(i=0;i=f-4?o(s,f-2-l):.5);return i}(E,S,T,C),O=s(E,P),F=e.regl,R=F.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?p:a).concat(r))}return n}(w,M,Math.round(255*(M?z:1)))}),N=F({profile:!1,blend:{enable:L,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!L,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:F.prop("scissorX"),y:F.prop("scissorY"),width:F.prop("scissorWidth"),height:F.prop("scissorHeight")}},viewport:{x:F.prop("viewportX"),y:F.prop("viewportY"),width:F.prop("viewportWidth"),height:F.prop("viewportHeight")},dither:!1,vert:k?"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n":"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",frag:"precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",primitive:"lines",lineWidth:1,attributes:O,uniforms:{resolution:F.prop("resolution"),viewBoxPosition:F.prop("viewBoxPosition"),viewBoxSize:F.prop("viewBoxSize"),dim1A:F.prop("dim1A"),dim2A:F.prop("dim2A"),dim1B:F.prop("dim1B"),dim2B:F.prop("dim2B"),dim1C:F.prop("dim1C"),dim2C:F.prop("dim2C"),dim1D:F.prop("dim1D"),dim2D:F.prop("dim2D"),loA:F.prop("loA"),hiA:F.prop("hiA"),loB:F.prop("loB"),hiB:F.prop("hiB"),loC:F.prop("loC"),hiC:F.prop("hiC"),loD:F.prop("loD"),hiD:F.prop("hiD"),palette:R,colorClamp:F.prop("colorClamp"),scatter:F.prop("scatter")},offset:F.prop("offset"),count:F.prop("count")}),j=[0,1],B=[];return{setColorDomain:function(t){j[0]=t[0],j[1]=t[1]},render:function(t,e,a){var o,s,l,c=1/0,f=-1/0;for(o=0;of&&(f=t[o].dim2.canvasX,l=o),t[o].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t){return d.scale.linear().domain(i(t))}function s(t,e,r){var i=v(e),a=i.trace,s=i.lineColor,l=i.cscale,c=a.line,u=a.domain,p=a.dimensions,m=t.width,g=a.labelfont,y=a.tickfont,x=a.rangefont,b=h.extendDeep({},c,{color:s.map(o({values:s,range:[c.cmin,c.cmax]})),blockLineCount:f.blockLineCount,canvasOverdrag:f.overdrag*f.canvasPixelRatio}),_=Math.floor(m*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,A=w;return{key:r,colCount:p.filter(n).length,dimensions:p,tickDistance:f.tickDistance,unitToColor:function(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return d.rgb(t)}),n="rgb".split("").map(function(t){return d.scale.linear().clamp(!0).domain(e).range(r.map(function(t){return function(e){return e[t]}}(t)))});return function(t){return n.map(function(e){return e(t)})}}(l),lines:b,labelFont:g,tickFont:y,rangeFont:x,layoutWidth:m,layoutHeight:t.height,domain:u,translateX:u.x[0]*m,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*f.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:A*f.canvasPixelRatio,width:k,height:A,canvasPixelRatio:f.canvasPixelRatio}}function l(t){var e=t.width,r=t.height,a=t.dimensions,s=t.canvasPixelRatio,l=function(r){return e*r/Math.max(1,t.colCount-1)},c=f.verticalPadding/(r*s),u=1-2*c,h=function(t){return c+u*t},p={key:t.key,xScale:l,model:t},m={};return p.dimensions=a.filter(n).map(function(e,n){var a=o(e),c=m[e.label];m[e.label]=(c||0)+1;return{key:e.label+(c?"__"+c:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:f.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(h),xScale:l,x:l(n),canvasX:l(n)*s,unitScale:function(t,e){return d.scale.linear().range([t-e,e])}(r,f.verticalPadding),domainScale:function(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?d.scale.ordinal().domain(r.tickvals.map(function(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}(d.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):d.scale.linear().domain(n).range([t-e,e])}(r,f.verticalPadding,e),ordinalScale:function(t){var e=i(t);return t.tickvals&&d.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function c(t){t.classed(f.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var u=t("./lines"),f=t("./constants"),h=t("../../lib"),d=t("d3"),p=t("../../components/drawing"),m=t("../../lib/gup").keyFun,g=t("../../lib/gup").repeat,v=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i,o){function y(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function x(t,e){return(f.scatter?function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,f={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==L&&(c?o.hover(f):o.unhover&&o.unhover(f),L=u)}}),S.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var C=e.selectAll("."+f.cn.parcoords).data(T,m);C.exit().remove(),C.enter().append("g").classed(f.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(g,m);e.enter().append("defs");var r=e.selectAll("#"+f.id.filterBarPattern).data(g,m);r.enter().append("pattern").attr("id",f.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-f.bar.width).attr("width",f.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(g,m);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",f.bar.width).attr("x",f.bar.width/2).attr("fill",f.bar.fillcolor).attr("fill-opacity",f.bar.fillopacity).attr("stroke",f.bar.strokecolor).attr("stroke-opacity",f.bar.strokeopacity).attr("stroke-width",f.bar.strokewidth)}),C.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var z=C.selectAll("."+f.cn.parcoordsControlView).data(g,m);z.enter().append("g").classed(f.cn.parcoordsControlView,!0).style("box-sizing","content-box"),z.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var D=z.selectAll("."+f.cn.yAxis).data(function(t){return t.dimensions},m);D.enter().append("g").classed(f.cn.yAxis,!0).each(function(t){E.dimensions.push(t)}),z.each(function(t){x(D,t)}),S.filter(function(t){return!!t.viewModel}).each(function(t){t.lineLayer=u(this,t,f.scatter),t.viewModel[t.key]=t.lineLayer,E.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),D.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),D.call(d.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;A=!1,k||(t.x=Math.max(-f.overdrag,Math.min(t.model.width+f.overdrag,d.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,D.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}),x(D,e),D.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),d.select(this).attr("transform","translate("+t.x+", 0)"),D.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer.render&&e.focusLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;k?"ending"===k&&(k=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,x(D,e),d.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),A=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),D.exit().remove();var I=D.selectAll("."+f.cn.axisOverlays).data(g,m);I.enter().append("g").classed(f.cn.axisOverlays,!0),I.selectAll("."+f.cn.axis).remove();var P=I.selectAll("."+f.cn.axis).data(g,m);P.enter().append("g").classed(f.cn.axis,!0),P.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),p.font(P.selectAll("text"),t.model.tickFont)}),P.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),P.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var O=I.selectAll("."+f.cn.axisHeading).data(g,m);O.enter().append("g").classed(f.cn.axisHeading,!0);var F=O.selectAll("."+f.cn.axisTitle).data(g,m);F.enter().append("text").classed(f.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),F.attr("transform","translate(0,"+-f.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){p.font(F,t.model.labelFont)});var R=I.selectAll("."+f.cn.axisExtent).data(g,m);R.enter().append("g").classed(f.cn.axisExtent,!0);var N=R.selectAll("."+f.cn.axisExtentTop).data(g,m);N.enter().append("g").classed(f.cn.axisExtentTop,!0),N.attr("transform","translate(0,"+-f.axisExtentOffset+")");var j=N.selectAll("."+f.cn.axisExtentTopText).data(g,m);j.enter().append("text").classed(f.cn.axisExtentTopText,!0).call(c),j.text(function(t){return b(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){p.font(j,t.model.rangeFont)});var B=R.selectAll("."+f.cn.axisExtentBottom).data(g,m);B.enter().append("g").classed(f.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+f.axisExtentOffset)+")"});var U=B.selectAll("."+f.cn.axisExtentBottomText).data(g,m);U.enter().append("text").classed(f.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(c),U.text(function(t){return b(t)(t.domainScale.domain()[0])}).each(function(t){p.font(U,t.model.rangeFont)});var V=I.selectAll("."+f.cn.axisBrush).data(g,m),q=V.enter().append("g").classed(f.cn.axisBrush,!0);V.each(function(t){t.brush||(t.brush=d.svg.brush().y(t.unitScale).on("brushstart",_).on("brush",w).on("brushend",M),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),d.select(this).call(t.brush))}),q.selectAll("rect").attr("x",-f.bar.capturewidth/2).attr("width",f.bar.capturewidth),q.selectAll("rect.extent").attr("fill","url(#"+f.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),q.selectAll(".resize rect").attr("height",f.bar.handleheight).attr("opacity",0).style("visibility","visible"),q.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",f.bar.handleoverlap-f.bar.handleheight),q.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",f.bar.handleoverlap);var H=!1,G=!1;return E}},{"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1035,"./lines":1038,d3:128}],1040:[function(t,e,r){(function(r){"use strict";var n=t("./parcoords"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=a._toppaper,s=a._paperdiv,l=a._glcontainer;a._glcanvas.each(function(e){e.regl||(e.regl=i({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var c={},u={},f=a._size;e.forEach(function(e,r){c[r]=t.data[r].dimensions,u[r]=t.data[r].dimensions.slice()});n(s,o,l,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(u[e].filter(n));c[e].sort(a),u[e].filter(function(t){return!n(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){c[e].splice(c[e].indexOf(t),1),c[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./parcoords":1039,regl:506}],1041:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../plots/domain_attributes"),s=t("../../lib/extend").extendFlat,l=i({editType:"calc",colorEditType:"style"});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:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:s({},l,{}),insidetextfont:s({},l,{}),outsidetextfont:s({},l,{}),domain:o({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1042:[function(t,e,r){"use strict";var n=t("../../registry");r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=function(t,e){for(var r=[],n=0;n")}}return y};var l},{"../../components/color":618,"./helpers":1046,"fast-isnumeric":140,tinycolor2:546}],1044:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),h=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),h&&"none"!==h){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":743,"./attributes":1041}],1045:[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,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":657}],1046:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}var a=t("d3"),o=t("../../components/fx"),s=t("../../components/color"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./helpers"),f=t("./event_data");e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,f=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===f.indexOf(s.scalegroup)&&f.push(s.scalegroup)}for(a=0;aa.vTotal/2?1:0)}(e),h.each(function(){var h=a.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove();var m=[[[],[]],[[],[]]],g=!1;h.each(function(e){function s(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)a.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=p.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var h=d.cx,v=d.cy,y=a.select(this),x=y.selectAll("path.surface").data([e]),b=!1,_=!1;if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,s=t._fullData[p.index];if(!t._dragging&&!1!==i.hovermode){var l=s.hoverinfo;if(Array.isArray(l)&&(l=o.castHoverinfo({hoverinfo:[u.castOption(l,e.pts)],_module:p._module},i,0)),"all"===l&&(l="label+text+value+percent+name"),"none"!==l&&"skip"!==l&&l){var c=n(e,d),m=h+e.pxmid[0]*(1-c),g=v+e.pxmid[1]*(1-c),y=r.separators,x=[];if(-1!==l.indexOf("label")&&x.push(e.label),-1!==l.indexOf("text")){var w=u.castOption(s.hovertext||s.text,e.pts);w&&x.push(w)}-1!==l.indexOf("value")&&x.push(u.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&x.push(u.formatPiePercent(e.v/d.vTotal,y));var M=p.hoverlabel,k=M.font;o.loneHover({x0:m-c*d.r,x1:m+c*d.r,y:g,text:x.join("
"),name:-1!==l.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:u.castOption(M.bgcolor,e.pts)||e.color,borderColor:u.castOption(M.bordercolor,e.pts),fontFamily:u.castOption(k.family,e.pts),fontSize:u.castOption(k.size,e.pts),fontColor:u.castOption(k.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),b=!0}t.emit("plotly_hover",{points:[f(e,s)],event:a.event}),_=!0}}).on("mouseout",function(r){var n=t._fullLayout,i=t._fullData[p.index];_&&(r.originalEvent=a.event,t.emit("plotly_unhover",{points:[f(e,i)],event:a.event}),_=!1),b&&(o.loneUnhover(n._hoverlayer.node()),b=!1)}).on("click",function(){var r=t._fullLayout,n=t._fullData[p.index];t._dragging||!1===r.hovermode||(t._hoverdata=[f(e,n)],o.click(t,a.event))}),p.pull){var w=+u.castOption(p.pull,e.pts)||0;w>0&&(h+=w*e.pxmid[0],v+=w*e.pxmid[1])}e.cxFinal=h,e.cyFinal=v;var M=p.hole;if(e.v===d.vTotal){var k="M"+(h+e.px0[0])+","+(v+e.px0[1])+s(e.px0,e.pxmid,!0,1)+s(e.pxmid,e.px0,!0,1)+"Z";M?x.attr("d","M"+(h+M*e.px0[0])+","+(v+M*e.px0[1])+s(e.px0,e.pxmid,!1,M)+s(e.pxmid,e.px0,!1,M)+"Z"+k):x.attr("d",k)}else{var A=s(e.px0,e.px1,!0,1);if(M){var T=1-M;x.attr("d","M"+(h+M*e.px1[0])+","+(v+M*e.px1[1])+s(e.px1,e.px0,!1,M)+"l"+T*e.px0[0]+","+T*e.px0[1]+A+"Z")}else x.attr("d","M"+h+","+v+"l"+e.px0[0]+","+e.px0[1]+A+"Z")}var S=u.castOption(p.textposition,e.pts),E=y.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=a.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,"outside"===S?p.outsidetextfont:p.insidetextfont).call(c.convertToTspans,t);var o,s=l.bBox(r.node());"outside"===S?o=i(s,e):(o=function(t,e,r){var i=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=n(e,r),c={scale:l*r.r*2/i,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>h.scale?g:h;return c.scale<1&&v.scale>c.scale?v:c}(s,e,d),"auto"===S&&o.scale<1&&(r.call(l.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(s=l.bBox(r.node())),o=i(s,e)));var u=h+e.pxmid[0]*o.rCenter+(o.x||0),f=v+e.pxmid[1]*o.rCenter+(o.y||0);o.outside&&(e.yLabelMin=f-s.height/2,e.yLabelMid=f,e.yLabelMax=f+s.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),r.attr("transform","translate("+u+","+f+")"+(o.scale<1?"scale("+o.scale+")":"")+(o.rotate?"rotate("+o.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}}),g&&function(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,d=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),p=o?t.yLabelMin:t.yLabelMax,g=o?t.yLabelMax:t.yLabelMin,v=t.cyFinal+c(t.px0[1],t.px1[1]),y=d-p;if(y*h>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(i=0;i=(u.castOption(e.pull,a.pts)||0)||((t.pxmid[1]-a.pxmid[1])*h>0?(y=a.cyFinal+c(a.px0[1],a.px1[1])-p-t.labelExtraY)*h>0&&(t.labelExtraY+=y):(g+t.labelExtraY-v)*h>0&&(n=3*f*Math.abs(i-m.indexOf(t)),(s=a.cxFinal+l(a.px0[0],a.px1[0])+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*f>0&&(t.labelExtraX+=s)))}var a,o,s,l,c,f,h,d,p,m,g,v,y;for(o=0;o<2;o++)for(s=o?r:n,c=o?Math.max:Math.min,h=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,f=a?1:-1,(d=t[o][a]).sort(s),p=t[1-o][a],m=p.concat(d),v=[],g=0;gMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(s.stroke,p.outsidetextfont.color).attr({"stroke-width":Math.min(2,p.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){h.selectAll("tspan").each(function(){var t=a.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":618,"../../components/drawing":643,"../../components/fx":660,"../../lib/svg_text_utils":766,"./event_data":1045,"./helpers":1046,d3:128}],1051:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1052,d3:128}],1052:[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":618,"./helpers":1046}],1053:[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"}}},{"../scatter/attributes":1066}],1054:[function(t,e,r){"use strict";function n(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=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var i=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),o=t("../scatter/get_trace_color"),s=["xaxis","yaxis"],l=n.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,i,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);if(h)r=h;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=a(t.marker.color),m=a(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||c.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,x/2)},l.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)(n=(r=this.scene[s[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new n(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":765,"../scatter/get_trace_color":1076,"gl-pointcloud2d":235}],1055:[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")}},{"../../lib":743,"./attributes":1053}],1056:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":829,"../scatter3d/calc":1092,"./attributes":1053,"./convert":1054,"./defaults":1055}],1057:[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("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;e.exports=c({hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},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}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},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:[]}}},"calc","nested")},{"../../components/color/attributes":617,"../../components/fx/attributes":652,"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1058:[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");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey");a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":661,"../../plot_api/edit_types":773,"../../plots/get_data":826,"./plot":1063}],1059:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var i=t.map(function(){return[]}),a=0;a1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":743,"../../lib/gup":740,"strongly-connected-components":537}],1060:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1061:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2");e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,i,r,a)}l("node.label"),l("node.pad"),l("node.thickness"),l("node.line.color"),l("node.line.width");var c=s.colorway;l("node.color",e.node.label.map(function(t,e){return a.addOpacity(function(t){return c[t%c.length]}(e),.8)})),l("link.label"),l("link.source"),l("link.target"),l("link.value"),l("link.line.color"),l("link.line.width"),l("link.color",e.link.value.map(function(){return o(s.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),l("domain.x"),l("domain.y"),l("orientation"),l("valueformat"),l("valuesuffix"),l("arrangement"),n.coerceFont(l,"textfont",n.extendFlat({},s.font));e.node.label.some(function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)})&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":618,"../../lib":743,"./attributes":1057,tinycolor2:546}],1062:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1057,"./base_plot":1058,"./calc":1059,"./defaults":1061,"./plot":1063}],1063:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function c(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function u(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+x.sankeyNode).filter(l(t)).call(c)}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(x.sankeyNode).filter(l(t)).call(u)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),x=t("./constants").cn,b=y._;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=b(t,"source:")+" ",y=b(t,"target:")+" ",_=b(t,"incoming flow count:")+" ",w=b(t,"outgoing flow count:")+" ";m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:function(e,r,n){p.select(e).call(f.bind(0,r,n,!0)),t.emit("plotly_hover",{event:p.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,c=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.left+u.width/2,h=u.top+u.height/2,m=g.loneHover({x:f-c.left,y:h-c.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",l+i.link.source.label,y+i.link.target.label].filter(n).join("
"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},unhover:function(e,n,i){p.select(e).call(u,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())},select:function(e,r,n){var i=r.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(u,r,n),g.click(t,{target:!0})}}})}},{"../../components/color":618,"../../components/fx":660,"../../lib":743,"./constants":1060,"./render":1064,d3:128}],1064:[function(t,e,r){"use strict";function n(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function i(t){return function(e){return e.node.originalX===t.node.originalX}}function a(t){for(var e=0;e1||t.linkLineWidth>0}function h(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function d(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function p(t){return w.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+_.nodeTextOffsetHorizontal:_.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-_.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-_.nodeTextOffsetHorizontal,0]])}function m(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function g(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function v(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function y(t){return t.horizontal&&t.left?"100%":"0%"}function x(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(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||r.select(this,t,e)})}function b(t,e,r){var a=w.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(E.raiseToTop(this),a.interactionState.dragInProgress=a.node,n(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+Math.floor(a.node.originalX);a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=S.forceSimulation(n).alphaDecay(0).force("collide",S.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(_.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}(0,e,n,r)).stop()}(0,o,a),function(t,e,r,n){window.requestAnimationFrame(function a(){for(var o=0;o<_.forceTicksPerFrame;o++)r.forceLayouts[n].tick();r.sankey.relayout(),c(t.filter(i(r)),e),r.forceLayouts[n].alpha()>0&&window.requestAnimationFrame(a)})}(t,e,a,o)}}).on("drag",function(r){if("fixed"!==r.arrangement){var a=w.event.x,o=w.event.y;"snap"===r.arrangement?(r.node.x=a,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=a),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),n(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),c(t.filter(i(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}var _=t("./constants"),w=t("d3"),M=t("tinycolor2"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("@plotly/d3-sankey").sankey,S=t("d3-force"),E=t("../../lib"),L=t("../../lib/gup").keyFun,C=t("../../lib/gup").repeat,z=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n){var i=t.selectAll("."+_.cn.sankey).data(e.filter(function(t){return z(t).trace.visible}).map(function(t,e,r){for(var n,i=z(e).trace,o=i.domain,s=i.node,l=i.link,c=i.arrangement,u="h"===i.orientation,f=i.node.pad,h=i.node.thickness,d=i.node.line.color,p=i.node.line.width,m=i.link.line.color,g=i.link.line.width,v=i.valueformat,y=i.valuesuffix,x=i.textfont,b=t.width*(o.x[1]-o.x[0]),w=t.height*(o.y[1]-o.y[0]),M=s.label.map(function(t,e){return{pointNumber:e,label:t,color:E.isArray(s.color)?s.color[e]:s.color}}),k=l.value.map(function(t,e){return{pointNumber:e,label:l.label[e],color:E.isArray(l.color)?l.color[e]:l.color,source:l.source[e],target:l.target[e],value:t}}),A=T().size(u?[b,w]:[w,b]).nodeWidth(h).nodePadding(f).nodes(M).links(k).layout(_.sankeyIterations),S=A.nodes(),L=0;L5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),R.transition().ease(_.ease).duration(_.duration).attr("startOffset",y).style("fill",v)}},{"../../components/color":618,"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1060,"@plotly/d3-sankey":41,d3:128,"d3-force":124,tinycolor2:546}],1065:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;re&&l.splice(e,l.length-e),l.map(r)}return r(n.size)}}var i=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("./subtypes"),l=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),u=t("./calc_selection");e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),h=r.makeCalcdata(e,"x"),d=f.makeCalcdata(e,"y"),p=Math.min(h.length,d.length);r._minDtick=0,f._minDtick=0,h.length>p&&h.splice(p,h.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},g={padded:!0},v=n(e,p);v&&(m.ppad=g.ppad=v),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(s.hasMarkers(e)||s.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,a.expand(r,h,m),a.expand(f,d,g);for(var y=new Array(p),x=0;x=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1070:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1071:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":625,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1072:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1073:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=(F=z[L][1])>=H&&(I=z[L-1][0],P=z[L][0],F-O&&(D=I+(P-I)*(H-O)/(F-O),B=Math.min(B,D),U=Math.max(U,D)));B=Math.max(B,0),U=Math.min(U,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),n.extendFlat(t,{distance:c+10,x0:B,x1:U,y0:H,y1:H,color:G}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":618,"../../components/errorbars":649,"../../components/fx":660,"../../lib":743,"./fill_hover_text":1074,"./get_trace_color":1076}],1078:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"./arrays_to_calcdata":1065,"./attributes":1066,"./calc":1067,"./clean_data":1069,"./colorbar":1070,"./defaults":1073,"./hover":1077,"./plot":1085,"./select":1086,"./style":1087,"./subtypes":1088}],1079:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],1080:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=t[e],i=P.c2p(r.x),a=O.c2p(r.y);return i===n||a===n?r.intoCenter||!1:[i,a]}function l(t){var e=t[0]/P._length,r=t[1]/O._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*N}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=nt[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&c(s,t)tt||t[1]rt)return[o(t[0],$,tt),o(t[1],et,rt)]}function h(t,e){return t[0]===e[0]&&(t[0]===$||t[0]===tt)||(t[1]===e[1]&&(t[1]===et||t[1]===rt)||void 0)}function d(t,e){var r=[],n=f(t),i=f(e);return n&&i&&h(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=f(n),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(c){(o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c}return l}}function m(t){var e=t[0],r=t[1],n=e===q[H-1][0],i=r===q[H-1][1];if(!n||!i)if(H>1){var a=e===q[H-2][0],o=r===q[H-2][1];n&&(e===$||e===tt)&&a?o?H--:q[H-1]=t:i&&(r===et||r===rt)&&o?a?H--:q[H-1]=t:q[H++]=t}else q[H++]=t}function g(t){q[H-1][0]!==t[0]&&q[H-1][1]!==t[1]&&m([W,X]),m(t),Z=null,W=X=0}function v(t){if(G=t[0]<$?$:t[0]>tt?tt:0,Y=t[1]rt?rt:0,G||Y){if(H)if(Z){var e=K(Z,t);e.length>1&&(g(e[0]),q[H++]=e[1])}else J=K(q[H-1],t)[0],q[H++]=J;else q[H++]=[G||t[0],Y||t[1]];var r=q[H-1];G&&Y&&(r[0]!==G||r[1]!==Y)?(Z&&(W!==G&&X!==Y?m(W&&X?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?$:tt,rt]:[n>0?tt:$,et]}(Z,t):[W||G,X||Y]):W&&X&&m([W,X])),m([G,Y])):W-G&&X-Y&&m([G||W,Y||X]),Z=t,W=G,X=Y}else Z&&g(K(Z,t)[0]),q[H++]=t}var y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P=e.xaxis,O=e.yaxis,F=e.simplify,R=e.connectGaps,N=e.baseTolerance,j=e.shape,B="linear"===j,U=[],V=s.minTolerance,q=new Array(t.length),H=0;F||(N=V=-1);var G,Y,W,X,Z,J,K,Q=s.maxScreensAway,$=-P._length*Q,tt=P._length*(1+Q),et=-O._length*Q,rt=O._length*(1+Q),nt=[[$,et,tt,et],[tt,et,tt,rt],[tt,rt,$,rt],[$,rt,$,et]];for("linear"===j||"spline"===j?K=u:"hv"===j||"vh"===j?K=d:"hvh"===j?K=p(0,$,tt):"vhv"===j&&(K=p(1,et,rt)),y=0;yl(M))break;b=M,(C=T[0]*A[0]+T[1]*A[1])>E?(E=C,_=M,k=!1):C=t.length||!M)break;v(M),x=M}}else v(_)}Z&&m([W||Z[0],X||Z[1]]),U.push(q.slice(0,H))}return U}},{"../../constants/numerical":721,"../../lib":743,"./constants":1072}],1081:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1082:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i,a=null;for(i=0;i0?Math.max(e,i):0}}},{"fast-isnumeric":140}],1084:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),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;if(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),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":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1085:[function(t,e,r){"use strict";function n(t,e,r,n,u,h,d){function p(t){return w?t.transition():t}function m(t){p(t).attr("d","M0,0Z")}function g(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(){return!1}function x(e){var n,s,c=e[0].trace,u=i.select(this),f=l.hasMarkers(c),h=l.hasText(c),d=function(t){if(t.ids)return v}(c),m=y,x=y;f&&(m=c.marker.maxdisplayed||c._needsCull?g:a.identity),h&&(x=c.marker.maxdisplayed||c._needsCull?g:a.identity);var b=(n=u.selectAll("path.point").data(m,d)).enter().append("path").classed("point",!0);w&&b.call(o.pointStyle,c,t).call(o.translatePoints,M,k).style("opacity",0).transition().style("opacity",1);var _=f&&o.tryColorscale(c.marker,""),A=f&&o.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=i.select(this),a=p(n);(s=o.translatePoint(e,a,M,k))?(o.singlePointStyle(e,a,c,_,A,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,M,k,c.xcalendar,c.ycalendar),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),w?n.exit().transition().style("opacity",0).remove():n.exit().remove(),(n=u.selectAll("g").data(x,d)).enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=i.select(this),n=p(e.select("text"));(s=o.translatePoint(t,n,M,k))?r.layerClipId&&o.hideOutsideRangePoint(t,e,M,k,c.xcalendar,c.ycalendar):e.remove()}),n.selectAll("text").call(o.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=k.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){p(i.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var b,_;!function(t,e,r,n,o){var s=r.xaxis,c=r.yaxis,u=i.extent(a.simpleMap(s.range,s.r2c)),f=i.extent(a.simpleMap(c.range,c.r2c)),h=n[0].trace;if(!l.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),g=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0,M=r.xaxis,k=r.yaxis,A=n[0].trace,T=A.line,S=i.select(h);if(S.call(s.plot,r,d),!0===A.visible){p(S).style("opacity",A.opacity);var E,L,C=A.fill.charAt(A.fill.length-1);"x"!==C&&"y"!==C&&(C=""),n[0].node3=S;var z="",D=[],I=A._prevtrace;I&&(z=I._prevRevpath||"",L=I._nextFill,D=I._polygons);var P,O,F,R,N,j,B,U,V,q="",H="",G=[],Y=a.noop;if(E=A._ownFill,l.hasLines(A)||"none"!==A.fill){for(L&&L.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(F=o.steps(T.shape),R=o.steps(T.shape.split("").reverse().join(""))):F=R="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),T.smoothing):o.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return R(t.reverse())},G=c(n,{xaxis:M,yaxis:k,connectGaps:A.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,simplify:T.simplify}),V=A._polygons=new Array(G.length),_=0;_1){var r=i.select(this);if(r.datum(n),t)p(r.style("opacity",0).attr("d",P).call(o.lineGroupStyle)).style("opacity",1);else{var a=p(r);a.attr("d",P),o.singleLineStyle(n,a)}}}}}var W=S.selectAll(".js-line").data(G);p(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(o.lineGroupStyle).each(Y(!0)),o.setClipUrl(W,r.layerClipId),G.length?(E?j&&U&&(C?("y"===C?j[1]=U[1]=k.c2p(0,!0):"x"===C&&(j[0]=U[0]=M.c2p(0,!0)),p(E).attr("d","M"+U+"L"+j+"L"+q.substr(1)).call(o.singleFillStyle)):p(E).attr("d",q+"Z").call(o.singleFillStyle)):L&&("tonext"===A.fill.substr(0,6)&&q&&z?("tonext"===A.fill?p(L).attr("d",q+"Z"+z+"Z").call(o.singleFillStyle):p(L).attr("d",q+"L"+z.substr(1)+"Z").call(o.singleFillStyle),A._polygons=A._polygons.concat(D)):(m(L),A._polygons=null)),A._prevRevpath=H,A._prevPolygons=V):(E?m(E):L&&m(L),A._polygons=A._prevRevpath=A._prevPolygons=null);var X=S.selectAll(".points");b=X.data([n]),X.each(x),b.enter().append("g").classed("points",!0).each(x),b.exit().remove(),b.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(i.select(this),e?null:r.layerClipId)})}}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./line_points"),u=t("./link_traces"),f=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,c,f,h,d=e.plot.select("g.scatterlayer"),p=!a,m=!!a&&a.duration>0;for((f=d.selectAll("g.trace").data(r,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(t,e,r),function(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=i.select(this);if((n=t[0].trace)._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,d,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),m){s&&(h=s());i.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)})})}else d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)});p&&f.exit().remove(),d.selectAll("path:not([d])").remove()}},{"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/polygon":755,"./line_points":1080,"./link_traces":1082,"./subtypes":1088,d3:128}],1086:[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=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}(e.textposition),r.textColor=g(e.textfont,1,S),r.textSize=o(e.textfont.size,S,p.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var D=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var I=e.projection[D[n]];(r.project[n]=I.show)&&(r.projectOpacity[n]=I.opacity,r.projectScale[n]=I.scale)}r.errorBounds=b(e,d);var P=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=m(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=P.color,r.errorLineWidth=P.lineWidth,r.errorCapSize=P.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=m(e.surfacecolor),r}function l(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}var c=t("gl-line3d"),u=t("gl-scatter3d"),f=t("gl-error3d"),h=t("gl-mesh3d"),d=t("delaunay-triangulate"),p=t("../../lib"),m=t("../../lib/str2rgbarray"),g=t("../../lib/gl_format_color"),v=t("../scatter/make_bubble_size_func"),y=t("../../constants/gl3d_dashes"),x=t("../../constants/gl3d_markers"),b=t("./calc_errors"),_=n.prototype;_.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},_.update=function(t){var e,r,n,i,a=this.scene.glplot.gl,o=y.solid;this.data=t;var p=s(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in y&&(o=y[p.lineDashes]),this.color=l(p.scatterColor)||l(p.lineColor),this.dataPoints=p.position,e={gl:a,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:o[0],dashScale:o[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=c(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var m=t.opacity;if(t.marker&&t.marker.opacity&&(m*=t.marker.opacity),r={gl:a,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:m,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=u(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),i={gl:a,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(i):(this.textMarkers=u(i),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=f(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n=0&&h("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];h(v+".show")&&(h(v+".opacity"),h(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../scatter/line_defaults":1079,"../scatter/marker_defaults":1084,"../scatter/subtypes":1088,"../scatter/text_defaults":1089,"./attributes":1091}],1096:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":719,"../../plots/gl3d":832,"../scatter/colorbar":1070,"./attributes":1091,"./calc":1092,"./convert":1094,"./defaults":1095}],1097:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1098:[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.a.length,d=new Array(h),p=!1;for(c=0;c0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,f=c-u;return s.x0=Math.max(Math.min(s.x0,f),u),s.x1=Math.max(Math.min(s.x1,f),u),o}var h=s.cd[s.index];s.a=h.a,s.b=h.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=(h.hi||d.hoverinfo).split("+"),g=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&a(p.aaxis,h.a),-1!==m.indexOf("b")&&a(p.baxis,h.b);var v=p.ab2ij([h.a,h.b]),y=Math.floor(v[0]),x=v[0]-y,b=Math.floor(v[1]),_=v[1]-b,w=p.evalxy([],y,b,x,_);return g.push("y: "+w[1].toFixed(3)),s.extraText=g.join("
"),o}}},{"../scatter/hover":1077}],1102:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1097,"./calc":1098,"./defaults":1099,"./event_data":1100,"./hover":1101,"./plot":1103}],1103:[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){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o")}(u,g,d.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076,"./attributes":1104}],1109:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":820,"../scatter/colorbar":1070,"./attributes":1104,"./calc":1105,"./defaults":1106,"./event_data":1107,"./hover":1108,"./plot":1110,"./select":1111,"./style":1112}],1110:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");e.exports=function(t,e,r){function f(t,e){t.lonlat[0]===a&&n.select(e).remove()}for(var h=0;h1,f=r.error_x&&!0===r.error_x.visible,h=r.error_y&&!0===r.error_y.visible,p=f||h,m=d.hasMarkers(r),x=!!r.fill&&"none"!==r.fill);var E,L,C,z,D,I,O,F,R=p?l.calcFromTrace(r,b):null;if(f){(C={}).positions=n;var N=new Float64Array(4*_);if("log"===T.type)for(o=0;o<_;++o)N[k++]=n[2*o]-T.d2l(R[o].xs)||0,N[k++]=T.d2l(R[o].xh)-n[2*o]||0,N[k++]=0,N[k++]=0;else for(o=0;o<_;++o)N[k++]=n[2*o]-R[o].xs||0,N[k++]=R[o].xh-n[2*o]||0,N[k++]=0,N[k++]=0;r.error_x.copy_ystyle&&(r.error_x=r.error_y),C.errors=N,C.capSize=2*r.error_x.width,C.lineWidth=r.error_x.thickness,C.color=r.error_x.color}if(h){(z={}).positions=n;var j=new Float64Array(4*_);if("log"===S.type)for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-S.d2l(R[o].ys)||0,j[A++]=S.d2l(R[o].yh)-n[2*o+1]||0;else for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-R[o].ys||0,j[A++]=R[o].yh-n[2*o+1]||0;z.errors=j,z.capSize=2*r.error_y.width,z.lineWidth=r.error_y.thickness,z.color=r.error_y.color}if(s){(E={}).thickness=r.line.width,E.color=r.line.color,E.opacity=r.opacity,E.overlay=!0;var B=(v[r.line.dash]||[1]).slice();for(o=0;oP?"rect":m?"rect":"round",U&&r.connectgaps){var V=F[0],q=F[1];for(o=0;os&&(A[0]=s),A[1]l&&(T[0]=l),T[1]=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),h=e-f;if(n.getClosest(s,function(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([h,e[1]])),i=Math.abs(u.c2p(e)-u.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)},t),!1!==t.index){var d=s[t.index],p=d.lonlat,m=[p[0]+f,p[1]],g=c.c2p(m),v=u.c2p(m),y=d.mrc||1;return t.x0=g-y,t.x1=g+y,t.y0=v-y,t.y1=v+y,t.color=i(l,d),t.extraText=function(t,e,r){function n(t){return t+"\xb0"}var i=(e.hi||t.hoverinfo).split("+"),o=-1!==i.indexOf("all"),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),c=e.lonlat,u=[];return o||s&&l?u.push("("+n(c[0])+", "+n(c[1])+")"):s?u.push(r.lon+n(c[0])):l&&u.push(r.lat+n(c[1])),(o||-1!==i.indexOf("text"))&&a(e,t,u),u.join("
")}(l,d,s[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076}],1121:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){if(e){e[0].trace._glTrace.update(e)}},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":846,"../scatter/colorbar":1070,"../scattergeo/calc":1105,"./attributes":1116,"./defaults":1118,"./event_data":1119,"./hover":1120,"./plot":1122,"./select":1123}],1122:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=new n(t,e[0].trace.uid);return r.update(e),r}},{"./convert":1117}],1123:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace;if(!n.hasMarkers(h))return[];if(!1===e)for(s=0;s")}var i=t("../scatter/hover"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports={hoverPoints:function(t,e,r,a){var o=i(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.isPtWithinSector(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,s.extraText=n(c,u,l),o}},makeHoverPointText:n}},{"../../lib":743,"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1128:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","markerColorscale","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":855,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1124,"./calc":1125,"./defaults":1126,"./hover":1127,"./plot":1129}],1129:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var a,o,s,l={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.circle:null},c=e.radialAxis,u=c.range;for(s=u[0]>u[1]?function(t){return t<=0}:function(t){return t>=0},a=0;a=0?(g=o.c2r(m)-l[0],y=d(v),E[p]=S[2*p]=g*Math.cos(y),L[p]=S[2*p+1]=g*Math.sin(y)):E[p]=L[p]=S[2*p]=S[2*p+1]=NaN;var C=a.sceneOptions(t,e,b,S);C.fill&&!u.fill2d&&(u.fill2d=!0),C.marker&&!u.scatter2d&&(u.scatter2d=!0),C.line&&!u.line2d&&(u.line2d=!0),!C.errorX&&!C.errorY||u.error2d||(u.error2d=!0),c.hasMarkers(b)&&(C.selected.positions=C.unselected.positions=C.marker.positions),u.lineOptions.push(C.line),u.errorXOptions.push(C.errorX),u.errorYOptions.push(C.errorY),u.fillOptions.push(C.fill),u.markerOptions.push(C.marker),u.selectedOptions.push(C.selected),u.unselectedOptions.push(C.unselected),u.count=r.length,_.scene=u,_.index=h,_.x=E,_.y=L,_.rawx=E,_.rawy=L,_.r=w,_.theta=M,_.positions=S,_.count=T,_.tree=n(S,512)}}),a.plot(t,e,r)},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,c=a.hoverPoints(t,e,r,n);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var f=t.subplot,h=f.angularAxis,d=u.cd[u.index],p=u.trace;if(d.r=o[u.index],d.theta=s[u.index],d.rad=h.c2rad(d.theta,p.thetaunit),f.isPtWithinSector(d))return u.xLabelVal=void 0,u.yLabelVal=void 0,u.extraText=l(d,p,f),c}},style:a.style,selectPoints:a.selectPoints,meta:{}}},{"../../plots/cartesian/axes":789,"../../plots/polar":855,"../scatter/colorscale_calc":1071,"../scatter/subtypes":1088,"../scattergl":1115,"../scatterpolar/hover":1127,"./attributes":1130,"./defaults":1131,"fast-isnumeric":140,kdgrass:292}],1133:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:s,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:l({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker"),{showscale:c.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../components/drawing/attributes":642,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1134:[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=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,h,d,p,m=t._fullLayout[e.subplot].sum,g=e.sum||m;for(r=0;r"),s}}},{"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1138:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":866,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1133,"./calc":1134,"./defaults":1135,"./event_data":1136,"./hover":1137,"./plot":1139}],1139:[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();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null};n(t,a,r)}},{"../scatter/plot":1085}],1140:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:i.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:i.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var i=t("../../components/color"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,c=e.exports=l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:a.zauto,cmin:a.zmin,cmax:a.zmax,colorscale:a.colorscale,autocolorscale:s({},a.autocolorscale,{dflt:!1}),reversescale:a.reversescale,showscale:a.showscale,colorbar:o,contours:{x:n(),y:n(),z:n()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})}},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":618,"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plot_api/edit_types":773}],1141:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":625}],1142:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,c=r.cmin,u=r.cmax,f=r.surfacecolor||r.z;if(n(c)||(c=i.aggNums(Math.min,null,f)),n(u)||(u=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,c,u),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1143:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=o(new Float32Array(r[0]*r[1]),r);return c.assign(n.lo(1,1).hi(e[0],e[1]),t),c.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),c.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),c.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),c.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}var a=t("gl-surface3d"),o=t("ndarray"),s=t("ndarray-homography"),l=t("ndarray-fill"),c=t("ndarray-ops"),u=t("tinycolor2"),f=t("../../lib/str2rgbarray"),h=128,d=n.prototype;d.handlePick=function(t){if(t.object===this.surface){var e=t.index=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},d.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},d.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,c=t.opacity,d=function(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=u(t[1]).toRgb();return{index:r,rgb:[n.r,n.g,n.b,e]}})}(t.colorscale,c),p=t.z,m=t.x,g=t.y,v=n.xaxis,y=n.yaxis,x=n.zaxis,b=r.dataScale,_=p[0].length,w=p.length,M=[o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w])],k=M[0],A=M[1],T=r.contourLevels;this.data=t;var S=t.xcalendar,E=t.ycalendar,L=t.zcalendar;l(M[2],function(t,e){return x.d2l(p[e][t],0,L)*b[2]}),Array.isArray(m[0])?l(k,function(t,e){return v.d2l(m[e][t],0,S)*b[0]}):l(k,function(t){return v.d2l(m[t],0,S)*b[0]}),Array.isArray(g[0])?l(A,function(t,e){return y.d2l(g[e][t],0,E)*b[1]}):l(A,function(t,e){return y.d2l(g[e],0,E)*b[1]});var C={colormap:d,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(C.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var z=o(new Float32Array(_*w),[_,w]);l(z,function(e,r){return t.surfacecolor[r][e]}),M.push(z)}else C.intensityBounds[0]*=b[2],C.intensityBounds[1]*=b[2];this.dataScale=function(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,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"}}},{}],1150:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=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}var o=t("./constants"),s=t("../../lib/extend").extendFlat,l=t("fast-isnumeric");e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),c=e.cells.values,u=e.domain,f=Math.floor(t._fullLayout._size.w*(u.x[1]-u.x[0])),h=Math.floor(t._fullLayout._size.h*(u.y[1]-u.y[0])),d=r.length?r[0].map(function(){return e.header.height}):[],p=c.length?c[0].map(function(){return e.cells.height}):[],m=d.reduce(function(t,e){return t+e},0),g=a(p,h-m+o.uplift),v=i(a(d,m),[]),y=i(g,v),x={},b=e._fullInput.columnorder,_=r.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return l(n)?Number(n):1}),w=_.reduce(function(t,e){return t+e},0);_=_.map(function(t){return t/w*f});var M={key:e.index,translateX:u.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-u.y[1]),size:t._fullLayout._size,width:f,height:h,columnOrder:b,groupHeight:h,rowBlocks:y,headerRowBlocks:v,scrollY:0,cells:e.cells,headerCells:s({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=x[t];x[t]=(r||0)+1;return{key:t+"__"+x[t],label:t,specIndex:e,xIndex:b[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:_[e]}})};return M.columns.forEach(function(t){t.calcdata=M,t.x=n(t)}),M}},{"../../lib/extend":732,"./constants":1149,"fast-isnumeric":140}],1151:[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;return[r,e?r+e.rows.length:0]}(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":732}],1152:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}o("domain.x"),o("domain.y"),o("columnwidth"),o("header.values"),o("header.format"),o("header.align"),o("header.prefix"),o("header.suffix"),o("header.height"),o("header.line.width"),o("header.line.color"),o("header.fill.color"),n.coerceFont(o,"header.font",n.extendFlat({},a.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),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=function(t){return"string"==typeof t&&t.match(M.latexCheck)}(n);t.latex=s;var l,f=s?"":u(t.calcdata.cells.prefix,e,r)||"",h=s?"":u(t.calcdata.cells.suffix,e,r)||"",d=s?null:u(t.calcdata.cells.format,e,r)||null,p=f+(d?k.format(d)(t.value):t.value)+h;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=c(p)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?c(p):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var m;if(t.wrappingNeeded){var g=(" "===M.wrapSplitCharacter?p.replace(/c&&(t.value+=s.join(M.wrapSpacer)+M.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(M.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),l(n.select("."+M.cn.cellText),r,t),k.select(e.parentNode.parentNode).call(x)}}:function(t,e,r,n,i){return function(){if(!i.settledY){var a=k.select(e.parentNode),s=w(i),l=i.key-s.firstRowIndex,c=s.rows[l].rowHeight,u=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*M.cellPad:c,f=Math.max(u,c),d=f-s.rows[l].rowHeight;d&&(s.rows[l].rowHeight=f,t.selectAll("."+M.cn.columnCell).call(x),m(null,t.filter(h),0),o(r,n,!0)),a.attr("transform",function(){var t=this.parentNode,e=t.getBoundingClientRect(),r=k.select(this.parentNode).select("."+M.cn.cellRect).node().getBoundingClientRect(),n=this.transform.baseVal.consolidate(),a=r.top-e.top+(n?n.matrix.f:M.cellPad);return"translate("+y(i,k.select(this.parentNode).select("."+M.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+a+")"}),i.settledY=!0}}};t.needsConvertToTspans?S.convertToTspans(i,n,a(r,this,e,n,t)):k.select(this.parentNode).attr("transform",function(t){return"translate("+y(t)+" "+M.cellPad+")"}).attr("text-anchor",function(t){return{left:"start",center:"middle",right:"end"}[t.align]})})}function c(t){return-1!==t.indexOf(M.wrapSplitCharacter)}function u(t,e,r){if(Array.isArray(t)){var n=t[Math.min(e,t.length-1)];return Array.isArray(n)?n[Math.min(r,n.length-1)]:n}return t}function f(t,e,r){t.transition().ease(M.releaseTransitionEase).duration(M.releaseTransitionDuration).attr("transform","translate("+e.x+" "+r+")")}function h(t){return"cells"===t.type}function d(t){return"header"===t.type}function p(t){return(t.rowBlocks.length?t.rowBlocks[0].auxiliaryBlocks:[]).reduce(function(t,e){return t+_(e,1/0)},0)}function m(t,e,r){var n=a(e)[0];if(void 0!==n){var i=n.rowBlocks,s=n.calcdata,l=b(i,i.length),c=n.calcdata.groupHeight-p(n),u=s.scrollY=Math.max(0,Math.min(l-c,s.scrollY)),f=function(t,e,r){for(var n=[],i=0,a=0;ai&&n.push(a),i+=l}return n}(i,u,c);1===f.length&&(f[0]===i.length-1?f.unshift(f[0]-1):f.push(f[0]+1)),f[0]%2&&f.reverse(),e.each(function(t,e){t.page=f[e],t.scrollY=u}),e.attr("transform",function(t){return"translate(0 "+(b(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(v(t,r,e,f,n.prevPages,n,0),v(t,r,e,f,n.prevPages,n,1),o(r,t))}}function g(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*k.event.dy:n;var l=o.selectAll("."+M.cn.yColumn).selectAll("."+M.cn.columnBlock).filter(h);m(t,l,o)}}function v(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]});s(t,e,a,r),i[o]=n[o]}))}function y(t,e){switch(t.align){case"left":return M.cellPad;case"right":return t.column.columnWidth-(e||0)-M.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return M.cellPad}}function x(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+_(e,1/0)},0);return"translate(0 "+(_(w(t),t.key)+e)+")"}).selectAll("."+M.cn.cellRect).attr("height",function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(w(t),t.key).rowHeight})}function b(t,e){for(var r=0,n=e-1;n>=0;n--)r+=function(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n0){var y,x,b,_,w,M=t.xa,k=t.ya;"h"===h.orientation?(w=e,y="y",b=k,x="x",_=M):(w=r,y="x",b=M,x="y",_=k);var A=f[t.index];if(w>=A.span[0]&&w<=A.span[1]){var T=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(A,h,w),L=o.getPositionOnKdePath(A,h,S),C=b._offset,z=b._length;T[y+"0"]=L[0],T[y+"1"]=L[1],T[x+"0"]=T[x+"1"]=S,T[x+"Label"]=x+": "+i.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+E.toFixed(3),g.push(T),(u={stroke:t.color})[y+"1"]=n.constrain(C+L[0],C,C+z),u[y+"2"]=n.constrain(C+L[1],C,C+z),u[x+"1"]=u[x+"2"]=_._offset+S}}}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var D=l.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===s?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":743,"../../plots/cartesian/axes":789,"../box/hover":899,"./helpers":1158}],1160:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":800,"../box/select":904,"./attributes":1155,"./calc":1156,"./defaults":1157,"./hover":1159,"./layout_attributes":1161,"./layout_defaults":1162,"./plot":1163,"./set_positions":1164,"./style":1165}],1161:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":743,"../box/layout_attributes":901}],1162:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":743,"../box/layout_defaults":902,"./layout_attributes":1161}],1163:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){function c(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var u=t._fullLayout,f=e.xaxis,h=e.yaxis;e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=u._numViolins,m="group"===u.violinmode&&p>1,g=a.bdPos=a.dPos*(1-u.violingap)*(1-u.violingroupgap)/(m?p:1),v=a.bPos=m?2*a.dPos*((a.num+.5)/p-.5)*(1-u.violingap):0;if(!0!==s.visible||a.empty)n.select(this).remove();else{var y=e[a.valLetter+"axis"],x=e[a.posLetter+"axis"],b="both"===s.side,_=b||"positive"===s.side,w=b||"negative"===s.side,M=s.box&&s.box.visible,k=s.meanline&&s.meanline.visible,A=u._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r=n.select(this),i=t.density,o=i.length,l=t.pos+v,u=x.c2p(l);switch(s.scalemode){case"width":e=A.maxWidth/g;break;case"count":e=A.maxWidth/g*(A.maxCount/t.pts.length)}var f,h,d,p,m,M,k;if(_){for(M=new Array(o),p=0;pi&&(i=c,a=l)}}return i?s(a):f};case"rms":return function(t,e){for(var r=0,i=0,a=0;a=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],c=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,i){return n.coerce(t,a,r.attributes,e,i)}var a={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=i.getComponentMethod("calendars","handleDefaults");o(t,a,"valuecalendar",null),o(t,a,"targetcalendar",null)}return a},r.calcTransform=function(t,e,r){function i(t,r){for(var i=0;i":return function(t){return h(t)>i};case">=":return function(t){return h(t)>=i};case"[]":return function(t){var e=h(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=h(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=h(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=h(t);return ei[1]};case"](":return function(t){var e=h(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=h(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(h(t))};case"}{":return function(t){return-1===i.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,f,u),d),x={},b={},_=0;r.preservegaps?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},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)}),i(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=s.styles=[];if(l)for(o=0;o




© 2015 - 2024 Weber Informatics LLC | Privacy Policy