@hema-to/regl-scatterplot 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("pub-sub-es"),require("regl")):"function"==typeof define&&define.amd?define(["exports","pub-sub-es","regl"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).createScatterplot={},e.createPubSub,e.createREGL)}(this,(function(e,n,t){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(n),i=r(t);function a(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function c(e,n,t,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void t(e)}c.done?n(l):Promise.resolve(l).then(r,o)}function l(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}function s(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=y(e))||n){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(c)throw i}}}}function u(e,n,t){return(n=p(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function d(){d=function(){return n};var e,n={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,n,t){e[n]=t.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(e,n,t){return Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[n]}try{s({},"")}catch(e){s=function(e,n,t){return e[n]=t}}function u(e,n,t,r){var i=n&&n.prototype instanceof g?n:g,a=Object.create(i.prototype),c=new O(r||[]);return o(a,"_invoke",{value:I(e,t,c)}),a}function f(e,n,t){try{return{type:"normal",arg:e.call(n,t)}}catch(e){return{type:"throw",arg:e}}}n.wrap=u;var v="suspendedStart",h="suspendedYield",p="executing",y="completed",m={};function g(){}function w(){}function x(){}var b={};s(b,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(R([])));S&&S!==t&&r.call(S,a)&&(b=S);var A=x.prototype=g.prototype=Object.create(b);function E(e){["next","throw","return"].forEach((function(n){s(e,n,(function(e){return this._invoke(n,e)}))}))}function M(e,n){function t(o,i,a,c){var l=f(e[o],e,i);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==typeof u&&r.call(u,"__await")?n.resolve(u.__await).then((function(e){t("next",e,a,c)}),(function(e){t("throw",e,a,c)})):n.resolve(u).then((function(e){s.value=e,a(s)}),(function(e){return t("throw",e,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new n((function(n,o){t(e,r,n,o)}))}return i=i?i.then(o,o):o()}})}function I(n,t,r){var o=v;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=C(c,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=f(n,t,r);if("normal"===s.type){if(o=r.done?y:h,s.arg===m)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=y,r.method="throw",r.arg=s.arg)}}}function C(n,t){var r=t.method,o=n.iterator[r];if(o===e)return t.delegate=null,"throw"===r&&n.iterator.return&&(t.method="return",t.arg=e,C(n,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,n.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,m;var a=i.arg;return a?a.done?(t[n.resultName]=a.value,t.next=n.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,m):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function T(e){var n={tryLoc:e[0]};1 in e&&(n.catchLoc=e[1]),2 in e&&(n.finallyLoc=e[2],n.afterLoc=e[3]),this.tryEntries.push(n)}function L(e){var n=e.completion||{};n.type="normal",delete n.arg,e.completion=n}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(n){if(n||""===n){var t=n[a];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,i=function t(){for(;++o<n.length;)if(r.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(typeof n+" is not iterable")}return w.prototype=x,o(A,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=s(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===w||"GeneratorFunction"===(n.displayName||n.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,s(e,l,"GeneratorFunction")),e.prototype=Object.create(A),e},n.awrap=function(e){return{__await:e}},E(M.prototype),s(M.prototype,c,(function(){return this})),n.AsyncIterator=M,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new M(u(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(A),s(A,l,"Generator"),s(A,a,(function(){return this})),s(A,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var n=Object(e),t=[];for(var r in n)t.push(r);return t.reverse(),function e(){for(;t.length;){var r=t.pop();if(r in n)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=R,O.prototype={constructor:O,reset:function(n){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!n)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var t=this;function o(r,o){return c.type="throw",c.arg=n,t.next=r,o&&(t.method="next",t.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(l&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,n){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=n,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),m},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),L(t),m}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var t=this.tryEntries[n];if(t.tryLoc===e){var r=t.completion;if("throw"===r.type){var o=r.arg;L(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(n,t,r){return this.delegate={iterator:R(n),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=e),m}},n}function v(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,c=[],l=!0,s=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=i.call(t)).done)&&(c.push(r.value),c.length!==n);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,n)||y(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}function y(e,n){if(e){if("string"==typeof e)return a(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,n):void 0}}const m=e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,g=e=>e,w=(e,n)=>{if(e===n)return!0;if(e.length!==n.length)return!1;const t=new Set(e),r=new Set(n);return t.size===r.size&&n.every((e=>t.has(e)))},x=(e,n=(e=>e))=>{const t=[];for(let r=0;r<e;r++)t.push(n(r,e));return t},b=(e,...n)=>(n.forEach((n=>{const t=Object.keys(n).reduce(((e,t)=>(e[t]=Object.getOwnPropertyDescriptor(n,t),e)),{});Object.getOwnPropertySymbols(n).forEach((e=>{const r=Object.getOwnPropertyDescriptor(n,e);r.enumerable&&(t[e]=r)})),Object.defineProperties(e,t)})),e),P=(e,n)=>t=>b(t,{get[e](){return n}}),S=(e=1)=>new Promise((n=>{let t=0;const r=()=>requestAnimationFrame((()=>{t++,t<e?r():n()}));r()})),A=(e,n,t=null)=>{let r,o=0;t=null===t?n:t;const i=(...n)=>{clearTimeout(r),r=setTimeout((()=>{o>0&&(e(...n),o=0)}),t)};let a=!1;const c=(...t)=>{a?(o++,i(...t)):(e(...t),i(...t),a=!0,o=0,setTimeout((()=>{a=!1}),n))};return c.reset=()=>{a=!1},c.cancel=()=>{clearTimeout(r)},c.now=(...n)=>e(...n),c};var E,M="undefined"!=typeof Float32Array?Float32Array:Array;function I(){var e=new M(16);return M!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function C(e){var n=new M(16);return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n}function T(e,n){var t=n[0],r=n[1],o=n[2],i=n[3],a=n[4],c=n[5],l=n[6],s=n[7],u=n[8],f=n[9],d=n[10],v=n[11],h=n[12],p=n[13],y=n[14],m=n[15],g=t*c-r*a,w=t*l-o*a,x=t*s-i*a,b=r*l-o*c,P=r*s-i*c,S=o*s-i*l,A=u*p-f*h,E=u*y-d*h,M=u*m-v*h,I=f*y-d*p,C=f*m-v*p,T=d*m-v*y,L=g*T-w*C+x*I+b*M-P*E+S*A;return L?(L=1/L,e[0]=(c*T-l*C+s*I)*L,e[1]=(o*C-r*T-i*I)*L,e[2]=(p*S-y*P+m*b)*L,e[3]=(d*P-f*S-v*b)*L,e[4]=(l*M-a*T-s*E)*L,e[5]=(t*T-o*M+i*E)*L,e[6]=(y*x-h*S-m*w)*L,e[7]=(u*S-d*x+v*w)*L,e[8]=(a*C-c*M+s*A)*L,e[9]=(r*M-t*C-i*A)*L,e[10]=(h*P-p*x+m*g)*L,e[11]=(f*x-u*P-v*g)*L,e[12]=(c*E-a*I-l*A)*L,e[13]=(t*I-r*E+o*A)*L,e[14]=(p*w-h*b-y*g)*L,e[15]=(u*b-f*w+d*g)*L,e):null}function L(e,n,t){var r=n[0],o=n[1],i=n[2],a=n[3],c=n[4],l=n[5],s=n[6],u=n[7],f=n[8],d=n[9],v=n[10],h=n[11],p=n[12],y=n[13],m=n[14],g=n[15],w=t[0],x=t[1],b=t[2],P=t[3];return e[0]=w*r+x*c+b*f+P*p,e[1]=w*o+x*l+b*d+P*y,e[2]=w*i+x*s+b*v+P*m,e[3]=w*a+x*u+b*h+P*g,w=t[4],x=t[5],b=t[6],P=t[7],e[4]=w*r+x*c+b*f+P*p,e[5]=w*o+x*l+b*d+P*y,e[6]=w*i+x*s+b*v+P*m,e[7]=w*a+x*u+b*h+P*g,w=t[8],x=t[9],b=t[10],P=t[11],e[8]=w*r+x*c+b*f+P*p,e[9]=w*o+x*l+b*d+P*y,e[10]=w*i+x*s+b*v+P*m,e[11]=w*a+x*u+b*h+P*g,w=t[12],x=t[13],b=t[14],P=t[15],e[12]=w*r+x*c+b*f+P*p,e[13]=w*o+x*l+b*d+P*y,e[14]=w*i+x*s+b*v+P*m,e[15]=w*a+x*u+b*h+P*g,e}function O(e,n){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function R(e,n){return e[0]=n[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=n[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function B(e,n,t){var r=n[0],o=n[1],i=n[2],a=n[3];return e[0]=t[0]*r+t[4]*o+t[8]*i+t[12]*a,e[1]=t[1]*r+t[5]*o+t[9]*i+t[13]*a,e[2]=t[2]*r+t[6]*o+t[10]*i+t[14]*a,e[3]=t[3]*r+t[7]*o+t[11]*i+t[15]*a,e}Math.hypot||(Math.hypot=function(){for(var e=0,n=arguments.length;n--;)e+=arguments[n]*arguments[n];return Math.sqrt(e)}),E=new M(4),M!=Float32Array&&(E[0]=0,E[1]=0,E[2]=0,E[3]=0),function(){var e=function(){var e=new M(2);return M!=Float32Array&&(e[0]=0,e[1]=0),e}()}();const D=(e=[0,0],n=1,t=0,r=[0,0],o=[[0,1/0],[0,1/0]],i=[[-1/0,1/0],[-1/0,1/0]])=>{const a=new Float32Array(16),c=new Float32Array(16),l=new Float32Array(16);let s=I(),u=[...r.slice(0,2),0,1];const f=Array.isArray(o[0])?[...o[0]]:[...o],d=Array.isArray(o[0])?[...o[1]]:[...o],v=Array.isArray(i[0])?[...i[0]]:[...i],h=Array.isArray(i[0])?[...i[1]]:[...i],p=()=>function(e,n){var t=n[0],r=n[1],o=n[2],i=n[4],a=n[5],c=n[6],l=n[8],s=n[9],u=n[10];return e[0]=Math.hypot(t,r,o),e[1]=Math.hypot(i,a,c),e[2]=Math.hypot(l,s,u),e}(a,s).slice(0,2),y=()=>{const e=p();return Math.min(e[0],e[1])},m=()=>{const e=p();return Math.max(e[0],e[1])},g=([e=0,n=0]=[],t=1,r=0)=>{s=I(),w([-e,-n]),b(r),x(1/t)},w=([e=0,n=0]=[])=>{a[0]=e,a[1]=n,a[2]=0;const t=O(c,a);L(s,t,s)},x=(e,n)=>{const t=Array.isArray(e);let r=t?e[0]:e,o=t?e[1]:e;if(r<=0||o<=0||1===r&&1===o)return;const i=p(),v=i[0]*r,h=i[1]*o;if(r=Math.max(f[0],Math.min(v,f[1]))/i[0],o=Math.max(d[0],Math.min(h,d[1]))/i[1],1===r&&1===o)return;a[0]=r,a[1]=o,a[2]=1;const y=R(c,a),m=n?[...n,0]:u,g=O(a,m);L(s,g,L(s,y,L(s,T(l,g),s)))},b=e=>{const n=I();!function(e,n,t){var r,o,i,a=t[0],c=t[1],l=t[2],s=Math.hypot(a,c,l);s<1e-6||(a*=s=1/s,c*=s,l*=s,r=Math.sin(n),i=1-(o=Math.cos(n)),e[0]=a*a*i+o,e[1]=c*a*i+l*r,e[2]=l*a*i-c*r,e[3]=0,e[4]=a*c*i-l*r,e[5]=c*c*i+o,e[6]=l*c*i+a*r,e[7]=0,e[8]=a*l*i+c*r,e[9]=c*l*i-a*r,e[10]=l*l*i+o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1)}(n,e,[0,0,1]),L(s,n,s)},P=e=>{!e||e.length<16||(s=e)};return g(e,n,t),{get translation(){return function(e,n){return e[0]=n[12],e[1]=n[13],e[2]=n[14],e}(a,s).slice(0,2)},get target(){return B(a,u,T(l,s)).slice(0,2)},get scaling(){return p()},get minScaling(){return y()},get maxScaling(){return m()},get scaleBounds(){return[[...f],[...d]]},get translationBounds(){return[[...v],[...h]]},get distance(){return(()=>{const e=p();return[1/e[0],1/e[1]]})()},get minDistance(){return 1/y()},get maxDistance(){return 1/m()},get rotation(){return Math.acos(s[0]/m())},get view(){return s},get viewCenter(){return u.slice(0,2)},lookAt:g,translate:w,pan:w,rotate:b,scale:x,zoom:x,reset:()=>{g(e,n,t)},set:(...e)=>(console.warn("`set()` is deprecated. Please use `setView()` instead."),P(...e)),setScaleBounds:e=>{const n=Array.isArray(e[0]);f[0]=n?e[0][0]:e[0],f[1]=n?e[0][1]:e[1],d[0]=n?e[1][0]:e[0],d[1]=n?e[1][1]:e[1]},setTranslationBounds:e=>{const n=Array.isArray(e[0]);v[0]=n?e[0][0]:e[0],v[1]=n?e[0][1]:e[1],h[0]=n?e[1][0]:e[0],h[1]=n?e[1][1]:e[1]},setView:P,setViewCenter:e=>{u=[...e.slice(0,2),0,1]}}},z=["pan","rotate"],N={alt:"altKey",cmd:"metaKey",ctrl:"ctrlKey",meta:"metaKey",shift:"shiftKey"},k=(e,{distance:n=1,target:t=[0,0],rotation:r=0,isNdc:o=!0,isFixed:i=!1,isPan:a=!0,isPanInverted:c=[!1,!0],panSpeed:l=1,isRotate:s=!0,rotateSpeed:u=1,defaultMouseDownMoveAction:f="pan",mouseDownMoveModKey:d="alt",isZoom:v=!0,zoomSpeed:h=1,viewCenter:p,scaleBounds:y,translationBounds:m,onKeyDown:g=(()=>{}),onKeyUp:w=(()=>{}),onMouseDown:x=(()=>{}),onMouseUp:b=(()=>{}),onMouseMove:P=(()=>{}),onWheel:S=(()=>{})}={})=>{let A=D(t,n,r,p,y,m),E=0,M=0,I=0,C=0,T=0,L=0,O=!1,R=0,B=1,k=1,j=1,F=!1,_=!1,V=!1,W="pan"===f,Z=a,G=a,U=c,K=c,q=v,H=v;const Y=()=>{Z=Array.isArray(a)?Boolean(a[0]):a,G=Array.isArray(a)?Boolean(a[1]):a,U=Array.isArray(c)?Boolean(c[0]):c,K=Array.isArray(c)?Boolean(c[1]):c,q=Array.isArray(v)?Boolean(v[0]):v,H=Array.isArray(v)?Boolean(v[1]):v};Y();const X=o?e=>e/B*2*j:e=>e,$=o?e=>e/k*2:e=>-e,J=o?e=>(e/B*2-1)*j:e=>e,Q=o?e=>1-e/k*2:e=>e,ee=()=>{const n=e.getBoundingClientRect();B=n.width,k=n.height,j=B/k},ne=e=>{V=!1,w(e)},te=e=>{V=e[N[d]],g(e)},re=e=>{O=!1,b(e)},oe=e=>{O=1===e.buttons,x(e)},ie=void 0!==document.createEvent("MouseEvent").offsetX?e=>{I=e.offsetX,C=e.offsetY}:n=>{const t=e.getBoundingClientRect();I=n.clientX-t.left,C=n.clientY-t.top},ae=e=>{E=e.clientX,M=e.clientY},ce=e=>{ae(e),P(e)},le=e=>{if((q||H)&&!i){e.preventDefault(),ae(e),ie(e);const n=1===e.deltaMode?12:1;R+=n*(e.deltaY||e.deltaX||0)}S(e)};window.addEventListener("keydown",te,{passive:!0}),window.addEventListener("keyup",ne,{passive:!0}),e.addEventListener("mousedown",oe,{passive:!0}),window.addEventListener("mouseup",re,{passive:!0}),window.addEventListener("mousemove",ce,{passive:!0}),e.addEventListener("wheel",le,{passive:!1}),A.config=({defaultMouseDownMoveAction:e=null,isFixed:n=null,isPan:t=null,isPanInverted:r=null,isRotate:o=null,isZoom:p=null,panSpeed:y=null,rotateSpeed:m=null,zoomSpeed:g=null,mouseDownMoveModKey:w=null}={})=>{f=null!==e&&z.includes(e)?e:f,W="pan"===f,i=null!==n?n:i,a=null!==t?t:a,c=null!==r?r:c,s=null!==o?o:s,v=null!==p?p:v,l=+y>0?y:l,u=+m>0?m:u,h=+g>0?g:h,Y(),d=null!==w&&Object.keys(N).includes(w)?w:d},A.dispose=()=>{A=void 0,window.removeEventListener("keydown",te),window.removeEventListener("keyup",ne),e.removeEventListener("mousedown",oe),window.removeEventListener("mouseup",re),window.removeEventListener("mousemove",ce),e.removeEventListener("wheel",le)},A.refresh=ee,A.tick=()=>{if(i){const e=_;return _=!1,e}F=!1;const e=E,n=M;if((Z||G)&&O&&(W&&!V||!W&&V)){const t=Z?X(l*(U?T-e:e-T)):0,r=G?$(l*(K?L-n:n-L)):0;0===t&&0===r||(A.pan([t,r]),F=!0)}if((q||H)&&R){const e=h*Math.exp(R/k),n=J(I),t=Q(C);A.scale([q?1/e:1,H?1/e:1],[n,t]),F=!0}if(s&&O&&(W&&V||!W&&!V)&&Math.abs(T-e)+Math.abs(L-n)>0){const t=B/2,r=k/2,o=T-t,i=r-L,a=e-t,c=r-n,l=function(e,n){var t=e[0],r=e[1],o=n[0],i=n[1],a=Math.sqrt(t*t+r*r)*Math.sqrt(o*o+i*i),c=a&&(t*o+r*i)/a;return Math.acos(Math.min(Math.max(c,-1),1))}([o,i],[a,c]),s=o*c-a*i;A.rotate(u*l*Math.sign(s)),F=!0}R=0,T=e,L=n;const t=F||_;return _=!1,t};const se=e=>function(){e.apply(null,arguments),_=!0};return A.lookAt=se(A.lookAt),A.translate=se(A.translate),A.pan=se(A.pan),A.rotate=se(A.rotate),A.scale=se(A.scale),A.zoom=se(A.zoom),A.reset=se(A.reset),A.set=se(A.set),A.setScaleBounds=se(A.setScaleBounds),A.setTranslationBounds=se(A.setTranslationBounds),A.setView=se(A.setView),A.setViewCenter=se(A.setViewCenter),ee(),A};function j(e,n,t=2){const r=e.length;let o=function(e,n,t,r,o){let i;if(o===function(e,n,t,r){let o=0;for(let i=n,a=t-r;i<t;i+=r)o+=(e[a]-e[i])*(e[i+1]+e[a+1]),a=i;return o}(e,n,t,r)>0)for(let o=n;o<t;o+=r)i=ne(o/r|0,e[o],e[o+1],i);else for(let o=t-r;o>=n;o-=r)i=ne(o/r|0,e[o],e[o+1],i);i&&Y(i,i.next)&&(te(i),i=i.next);return i}(e,0,r,t,!0);const i=[];if(!o||o.next===o.prev)return i;let a,c,l;if(e.length>80*t){a=1/0,c=1/0;let n=-1/0,o=-1/0;for(let i=t;i<r;i+=t){const t=e[i],r=e[i+1];t<a&&(a=t),r<c&&(c=r),t>n&&(n=t),r>o&&(o=r)}l=Math.max(n-a,o-c),l=0!==l?32767/l:0}return _(o,i,t,a,c,l,0),i}function F(e,n){if(!e)return e;n||(n=e);let t,r=e;do{if(t=!1,r.steiner||!Y(r,r.next)&&0!==H(r.prev,r,r.next))r=r.next;else{if(te(r),r=n=r.prev,r===r.next)break;t=!0}}while(t||r!==n);return n}function _(e,n,t,r,o,i,a){if(!e)return;!a&&i&&function(e,n,t,r){let o=e;do{0===o.z&&(o.z=U(o.x,o.y,n,t,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){let n,t=1;do{let r,o=e;e=null;let i=null;for(n=0;o;){n++;let a=o,c=0;for(let e=0;e<t&&(c++,a=a.nextZ,a);e++);let l=t;for(;c>0||l>0&&a;)0!==c&&(0===l||!a||o.z<=a.z)?(r=o,o=o.nextZ,c--):(r=a,a=a.nextZ,l--),i?i.nextZ=r:e=r,r.prevZ=i,i=r;o=a}i.nextZ=null,t*=2}while(n>1)}(o)}(e,r,o,i);let c=e;for(;e.prev!==e.next;){const l=e.prev,s=e.next;if(i?W(e,r,o,i):V(e))n.push(l.i,e.i,s.i),te(e),e=s.next,c=s.next;else if((e=s)===c){a?1===a?_(e=Z(F(e),n),n,t,r,o,i,2):2===a&&G(e,n,t,r,o,i):_(F(e),n,t,r,o,i,1);break}}}function V(e){const n=e.prev,t=e,r=e.next;if(H(n,t,r)>=0)return!1;const o=n.x,i=t.x,a=r.x,c=n.y,l=t.y,s=r.y,u=Math.min(o,i,a),f=Math.min(c,l,s),d=Math.max(o,i,a),v=Math.max(c,l,s);let h=r.next;for(;h!==n;){if(h.x>=u&&h.x<=d&&h.y>=f&&h.y<=v&&K(o,c,i,l,a,s,h.x,h.y)&&H(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function W(e,n,t,r){const o=e.prev,i=e,a=e.next;if(H(o,i,a)>=0)return!1;const c=o.x,l=i.x,s=a.x,u=o.y,f=i.y,d=a.y,v=Math.min(c,l,s),h=Math.min(u,f,d),p=Math.max(c,l,s),y=Math.max(u,f,d),m=U(v,h,n,t,r),g=U(p,y,n,t,r);let w=e.prevZ,x=e.nextZ;for(;w&&w.z>=m&&x&&x.z<=g;){if(w.x>=v&&w.x<=p&&w.y>=h&&w.y<=y&&w!==o&&w!==a&&K(c,u,l,f,s,d,w.x,w.y)&&H(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,x.x>=v&&x.x<=p&&x.y>=h&&x.y<=y&&x!==o&&x!==a&&K(c,u,l,f,s,d,x.x,x.y)&&H(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;w&&w.z>=m;){if(w.x>=v&&w.x<=p&&w.y>=h&&w.y<=y&&w!==o&&w!==a&&K(c,u,l,f,s,d,w.x,w.y)&&H(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;x&&x.z<=g;){if(x.x>=v&&x.x<=p&&x.y>=h&&x.y<=y&&x!==o&&x!==a&&K(c,u,l,f,s,d,x.x,x.y)&&H(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Z(e,n){let t=e;do{const r=t.prev,o=t.next.next;!Y(r,o)&&X(r,t,t.next,o)&&Q(r,o)&&Q(o,r)&&(n.push(r.i,t.i,o.i),te(t),te(t.next),t=e=o),t=t.next}while(t!==e);return F(t)}function G(e,n,t,r,o,i){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&q(a,e)){let c=ee(a,e);return a=F(a,a.next),c=F(c,c.next),_(a,n,t,r,o,i,0),void _(c,n,t,r,o,i,0)}e=e.next}a=a.next}while(a!==e)}function U(e,n,t,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-t)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-r)*o|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function K(e,n,t,r,o,i,a,c){return!(e===a&&n===c)&&function(e,n,t,r,o,i,a,c){return(o-a)*(n-c)>=(e-a)*(i-c)&&(e-a)*(r-c)>=(t-a)*(n-c)&&(t-a)*(i-c)>=(o-a)*(r-c)}(e,n,t,r,o,i,a,c)}function q(e,n){return e.next.i!==n.i&&e.prev.i!==n.i&&!function(e,n){let t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==n.i&&t.next.i!==n.i&&X(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}(e,n)&&(Q(e,n)&&Q(n,e)&&function(e,n){let t=e,r=!1;const o=(e.x+n.x)/2,i=(e.y+n.y)/2;do{t.y>i!=t.next.y>i&&t.next.y!==t.y&&o<(t.next.x-t.x)*(i-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next}while(t!==e);return r}(e,n)&&(H(e.prev,e,n.prev)||H(e,n.prev,n))||Y(e,n)&&H(e.prev,e,e.next)>0&&H(n.prev,n,n.next)>0)}function H(e,n,t){return(n.y-e.y)*(t.x-n.x)-(n.x-e.x)*(t.y-n.y)}function Y(e,n){return e.x===n.x&&e.y===n.y}function X(e,n,t,r){const o=J(H(e,n,t)),i=J(H(e,n,r)),a=J(H(t,r,e)),c=J(H(t,r,n));return o!==i&&a!==c||(!(0!==o||!$(e,t,n))||(!(0!==i||!$(e,r,n))||(!(0!==a||!$(t,e,r))||!(0!==c||!$(t,n,r)))))}function $(e,n,t){return n.x<=Math.max(e.x,t.x)&&n.x>=Math.min(e.x,t.x)&&n.y<=Math.max(e.y,t.y)&&n.y>=Math.min(e.y,t.y)}function J(e){return e>0?1:e<0?-1:0}function Q(e,n){return H(e.prev,e,e.next)<0?H(e,n,e.next)>=0&&H(e,e.prev,n)>=0:H(e,n,e.prev)<0||H(e,e.next,n)<0}function ee(e,n){const t=re(e.i,e.x,e.y),r=re(n.i,n.x,n.y),o=e.next,i=n.prev;return e.next=n,n.prev=e,t.next=o,o.prev=t,r.next=t,t.prev=r,i.next=r,r.prev=i,r}function ne(e,n,t,r){const o=re(e,n,t);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function te(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function re(e,n,t){return{i:e,x:n,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const oe=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ie=Float32Array.BYTES_PER_ELEMENT,ae=e=>e.length>0&&Array.isArray(e[0]),{push:ce,splice:le}=Array.prototype;function se(e,n=1,t=1){const r=[],o=new Array(2*n);for(let i=0,a=e.length/n;i<a;i++){const a=i*n;for(let r=0;r<n;r++){const i=e[a+r];o[r]=i,o[r+n]=i*t}ce.apply(r,o)}return r}function ue(e,n,t,r){const o=new Array(r),i=n*r;for(let n=0;n<r;n++)o[n]=e[i+n];return le.call(e,t*r,0,...o),e}const fe=(e,{projection:n=oe,model:t=oe,view:r=oe,points:o=[],colorIndices:i=[],color:a=[.8,.5,0,1],opacity:c=null,opacities:l=[],width:s=1,widths:u=[],miter:f=!0,is2d:d=!1,zPos2d:v=0}={})=>{if(!e)return void console.error("Regl instance is undefined.");const h=new Float32Array(16);let p,y,m,g,w,x,b,P,S,A,E,M,I,C,T,O,R,B,D=d?2:3;const z=()=>+(l.length===y||null!==c),N=()=>{A=e.buffer(),E=e.buffer(),M=e.buffer(),T=e.buffer(),O={prevPosition:{buffer:()=>A,offset:0,stride:3*ie},currPosition:{buffer:()=>A,offset:3*ie*2,stride:3*ie},nextPosition:{buffer:()=>A,offset:3*ie*4,stride:3*ie},opacity:{buffer:()=>E,offset:2*ie,stride:ie},offsetScale:{buffer:()=>M,offset:2*ie,stride:ie},colorIndex:{buffer:()=>T,offset:2*ie,stride:ie}},R=e.elements(),B=e({attributes:O,depth:{enable:!d},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"one",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},uniforms:{projectionViewModel:(e,n)=>{const t=e.projection||n.projection,r=e.model||n.model,o=e.view||n.view;return L(h,t,L(h,o,r))},aspectRatio:({viewportWidth:e,viewportHeight:n})=>e/n,colorTex:()=>I,colorTexRes:()=>C,colorTexEps:()=>.5/C,pixelRatio:({pixelRatio:e})=>e,width:({pixelRatio:e,viewportHeight:n})=>s/n*e,useOpacity:z,useColorOpacity:()=>Number(!z()),miter:Number(Boolean(f))},elements:()=>R,vert:"\nuniform mat4 projectionViewModel;\nuniform float aspectRatio;\n\nuniform sampler2D colorTex;\nuniform float colorTexRes;\nuniform float colorTexEps;\nuniform float width;\nuniform float useOpacity;\nuniform float useColorOpacity;\nuniform int miter;\n\nattribute vec3 prevPosition;\nattribute vec3 currPosition;\nattribute vec3 nextPosition;\nattribute float opacity;\nattribute float offsetScale;\nattribute float colorIndex;\n\nvarying vec4 color;\n\nvoid main() {\n vec2 aspectVec = vec2(aspectRatio, 1.0);\n vec4 prevProjected = projectionViewModel * vec4(prevPosition, 1.0);\n vec4 currProjected = projectionViewModel * vec4(currPosition, 1.0);\n vec4 nextProjected = projectionViewModel * vec4(nextPosition, 1.0);\n\n // get 2D screen space with W divide and aspect correction\n vec2 prevScreen = prevProjected.xy / prevProjected.w * aspectVec;\n vec2 currScreen = currProjected.xy / currProjected.w * aspectVec;\n vec2 nextScreen = nextProjected.xy / nextProjected.w * aspectVec;\n\n float len = width;\n\n // starting point uses (next - current)\n vec2 dir = vec2(0.0);\n if (currScreen == prevScreen) {\n dir = normalize(nextScreen - currScreen);\n }\n // ending point uses (current - previous)\n else if (currScreen == nextScreen) {\n dir = normalize(currScreen - prevScreen);\n }\n // somewhere in middle, needs a join\n else {\n // get directions from (C - B) and (B - A)\n vec2 dirA = normalize((currScreen - prevScreen));\n if (miter == 1) {\n vec2 dirB = normalize((nextScreen - currScreen));\n // now compute the miter join normal and length\n vec2 tangent = normalize(dirA + dirB);\n vec2 perp = vec2(-dirA.y, dirA.x);\n vec2 miter = vec2(-tangent.y, tangent.x);\n len = width / dot(miter, perp);\n dir = tangent;\n } else {\n dir = dirA;\n }\n }\n\n vec2 normal = vec2(-dir.y, dir.x) * len;\n normal.x /= aspectRatio;\n vec4 offset = vec4(normal * offsetScale, 0.0, 0.0);\n gl_Position = currProjected + offset;\n\n // Get color from texture\n float colorRowIndex = floor((colorIndex + colorTexEps) / colorTexRes);\n vec2 colorTexIndex = vec2(\n (colorIndex / colorTexRes) - colorRowIndex + colorTexEps,\n colorRowIndex / colorTexRes + colorTexEps\n );\n\n color = texture2D(colorTex, colorTexIndex);\n color.a = useColorOpacity * color.a + useOpacity * opacity;\n}",frag:"\nprecision mediump float;\nvarying vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"})},k=()=>{1===p&&o.length%D>0&&console.warn(`The length of points (${y}) does not match the dimensions (${D}). Incomplete points are ignored.`),g=o.flat().slice(0,y*D),d&&(g=function(e,n,t,r=0){const o=[],i=new Array(t).fill(r);for(let t=0,r=e.length/n;t<r;t++){const r=t*n;for(let t=0;t<n;t++)i[t]=e[r+t];ce.apply(o,i)}return o}(g,2,3,v)),i.length!==y&&(i=new Array(y).fill(0)),u.length!==y&&(u=new Array(y).fill(1));const e=i.slice(),n=l.length===y?l.slice():new Array(y).fill(null===c?1:c),t=u.slice();let r=0;for(const o of m){const i=r+o-1;ue(g,i,i,3),ue(g,r,r,3),ue(e,i,i,1),ue(e,r,r,1),ue(n,i,i,1),ue(n,r,r,1),ue(t,i,i,1),ue(t,r,r,1),r+=o+2}w=new Float32Array(se(g,3)),x=se(e),b=se(n),P=se(t,1,-1),S=((e,n=[])=>{let t=0;for(const r of e){for(let e=0;e<r-1;e++){const r=t+2*e,o=r+1,i=r+2,a=r+3;n.push(r,o,i,i,o,a)}t+=2*(r+2)}return n})(m),A({usage:"dynamic",type:"float",length:w.length*ie,data:w}),E({usage:"dynamic",type:"float",length:b.length*ie,data:b}),M({usage:"dynamic",type:"float",length:P.length*ie,data:P}),T({usage:"dynamic",type:"float",length:x.length*ie,data:x}),R({primitive:"triangles",usage:"dynamic",type:S.length>65536?"uint32":"uint16",data:S})},j=()=>{F(),N()},F=()=>{o=[],g=[],w=new Float32Array,P=[],S=[],A.destroy(),M.destroy(),R.destroy()},_=(e,n)=>{const t=n.flat(2);return t.length===y?t:t.length===p?m.flatMap(((e,n)=>Array(e).fill(t[n]))):e},V=(e=[],{colorIndices:n=i,opacities:t=l,widths:r=u,is2d:a=d}={})=>{D=(d=a)?2:3,p=ae(o=e)?o.length:1,m=ae(o)?o.map((e=>Math.floor(e.length/D))):[Math.floor(o.length/D)],y=m.reduce(((e,n)=>e+n),0),i=_(i,n),l=_(l,t),u=_(u,r),o&&y>1?k():j()},W=()=>{const n=ae(a)?a:[a];C=Math.max(2,Math.ceil(Math.sqrt(n.length)));const t=new Uint8Array(C**2*4);n.forEach(((e,n)=>{t[4*n]=Math.min(255,Math.max(0,Math.round(255*e[0]))),t[4*n+1]=Math.min(255,Math.max(0,Math.round(255*e[1]))),t[4*n+2]=Math.min(255,Math.max(0,Math.round(255*e[2]))),t[4*n+3]=Number.isNaN(+e[3])?255:Math.min(255,Math.max(0,Math.round(255*e[3])))})),I=e.texture({data:t,shape:[C,C,4]})};return N(),W(),o&&o.length>1&&V(o),{clear:j,destroy:F,draw:({projection:e,model:i,view:a}={})=>{e&&(n=e),i&&(t=i),a&&(r=a),o&&o.length>1&&B({projection:n,model:t,view:r})},getPoints:()=>o,setPoints:V,getData:()=>({points:w,widths:P,opacities:b,colorIndices:x}),getBuffer:()=>({points:A,widths:M,opacities:E,colorIndices:T}),getStyle:()=>({color:a,miter:f,width:s}),setStyle:({color:e,opacity:n,miter:t,width:r}={})=>{var o;e&&((e,n=c)=>{a=e,c=n,I&&I.destroy(),W()})(e,n||c),t&&(f=Boolean(t)),void 0!==(o=r)&&Number.isFinite(o)&&(s=r)}}};
2
+ /**
3
+ * KDBush - A fast static index for 2D points
4
+ * @license ISC License
5
+ * @copyright Vladimir Agafonkin 2018
6
+ * @version 4.0.2
7
+ * @see https://github.com/mourner/kdbush/
8
+ */var de,ve=function(){var e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],n=function(){function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,i=arguments.length>3?arguments[3]:void 0;if(function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n),isNaN(t)||t<0)throw new Error("Unexpected numItems value: ".concat(t,"."));this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=o,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;var a=e.indexOf(this.ArrayType),c=2*t*this.ArrayType.BYTES_PER_ELEMENT,l=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-l%8)%8;if(a<0)throw new Error("Unexpected typed array class: ".concat(o,"."));i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+l+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+c+l+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+l+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+a]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}return r=n,i=[{key:"from",value:function(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");var r=v(new Uint8Array(t,0,2),2),o=r[0],i=r[1];if(219!==o)throw new Error("Data does not appear to be in a KDBush format.");var a=i>>4;if(1!==a)throw new Error("Got v".concat(a," data when expected v").concat(1,"."));var c=e[15&i];if(!c)throw new Error("Unrecognized array type.");var l=v(new Uint16Array(t,2,1),1)[0];return new n(v(new Uint32Array(t,4,1),1)[0],l,c,t)}}],(o=[{key:"add",value:function(e,n){var t=this._pos>>1;return this.ids[t]=t,this.coords[this._pos++]=e,this.coords[this._pos++]=n,t}},{key:"finish",value:function(){var e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return t(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}},{key:"range",value:function(e,n,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var o=this.ids,i=this.coords,a=this.nodeSize,c=[0,o.length-1,0],l=[];c.length;){var s=c.pop()||0,u=c.pop()||0,f=c.pop()||0;if(u-f<=a)for(var d=f;d<=u;d++){var v=i[2*d],h=i[2*d+1];v>=e&&v<=t&&h>=n&&h<=r&&l.push(o[d])}else{var p=f+u>>1,y=i[2*p],m=i[2*p+1];y>=e&&y<=t&&m>=n&&m<=r&&l.push(o[p]),(0===s?e<=y:n<=m)&&(c.push(f),c.push(p-1),c.push(1-s)),(0===s?t>=y:r>=m)&&(c.push(p+1),c.push(u),c.push(1-s))}}return l}},{key:"within",value:function(e,n,t){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");for(var r=this.ids,o=this.coords,i=this.nodeSize,c=[0,r.length-1,0],l=[],s=t*t;c.length;){var u=c.pop()||0,f=c.pop()||0,d=c.pop()||0;if(f-d<=i)for(var v=d;v<=f;v++)a(o[2*v],o[2*v+1],e,n)<=s&&l.push(r[v]);else{var h=d+f>>1,p=o[2*h],y=o[2*h+1];a(p,y,e,n)<=s&&l.push(r[h]),(0===u?e-t<=p:n-t<=y)&&(c.push(d),c.push(h-1),c.push(1-u)),(0===u?e+t>=p:n+t>=y)&&(c.push(h+1),c.push(f),c.push(1-u))}}return l}}])&&l(r.prototype,o),i&&l(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,o,i}();function t(e,n,o,i,a,c){if(!(a-i<=o)){var l=i+a>>1;r(e,n,l,i,a,c),t(e,n,o,i,l-1,1-c),t(e,n,o,l+1,a,1-c)}}function r(e,n,t,i,a,c){for(;a>i;){if(a-i>600){var l=a-i+1,s=t-i+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(s-l/2<0?-1:1);r(e,n,t,Math.max(i,Math.floor(t-s*f/l+d)),Math.min(a,Math.floor(t+(l-s)*f/l+d)),c)}var v=n[2*t+c],h=i,p=a;for(o(e,n,i,t),n[2*a+c]>v&&o(e,n,i,a);h<p;){for(o(e,n,h,p),h++,p--;n[2*h+c]<v;)h++;for(;n[2*p+c]>v;)p--}n[2*i+c]===v?o(e,n,i,p):o(e,n,++p,a),p<=t&&(i=p+1),t<=p&&(a=p-1)}}function o(e,n,t,r){i(e,t,r),i(n,2*t,2*r),i(n,2*t+1,2*r+1)}function i(e,n,t){var r=e[n];e[n]=e[t],e[t]=r}function a(e,n,t,r){var o=e-t,i=n-r;return o*o+i*i}return n},he=function(){addEventListener("message",(function(e){var n=e.data.points;0===n.length&&self.postMessage({error:new Error("Invalid point data")});var t,r=new KDBush(n.length,e.data.nodeSize),o=s(n);try{for(o.s();!(t=o.n()).done;){var i=v(t.value,2),a=i[0],c=i[1];r.add(a,c)}}catch(e){o.e(e)}finally{o.f()}r.finish(),postMessage(r.data,[r.data])}))},pe=ve(),ye=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{nodeSize:16,useWorker:void 0};return new Promise((function(t,r){if(e instanceof ArrayBuffer)t(pe.from(e));else if((e.length<1e6||!1===n.useWorker)&&!0!==n.useWorker){var o,i=new pe(e.length,n.nodeSize),a=s(e);try{for(a.s();!(o=a.n()).done;){var c=o.value;i.add(c[0],c[1])}}catch(e){a.e(e)}finally{a.f()}i.finish(),t(i)}else{var l=function(e){var n=ve.toString(),t=e.toString(),r="const createKDBushClass = ".concat(n,";")+"KDBush = createKDBushClass();"+"const createWorker = ".concat(t,";")+"createWorker();",o=new Blob([r],{type:"text/javascript"}),i=URL.createObjectURL(o),a=new Worker(i,{name:"KDBush"});return URL.revokeObjectURL(i),a}(he);l.onmessage=function(e){e.data.error?r(e.data.error):t(pe.from(e.data)),l.terminate()},l.postMessage({points:e,nodeSize:n.nodeSize})}}))},me="auto",ge=Float32Array.BYTES_PER_ELEMENT,we=["OES_texture_float","OES_element_index_uint","WEBGL_color_buffer_float","EXT_float_blend"],xe={color:[0,0,0,0],depth:1},be="panZoom",Pe="lasso",Se="rotate",Ae=[be,Pe,Se],Ee=be,Me={cubicIn:e=>e*e*e,cubicInOut:m,cubicOut:e=>--e*e*e+1,linear:e=>e,quadIn:e=>e*e,quadInOut:e=>e<.5?2*e*e:(4-2*e)*e-1,quadOut:e=>e*(2-e)},Ie=m,Ce="continuous",Te="categorical",Le=[Ce,Te],Oe="deselect",Re="lassoEnd",Be=[Oe,Re],De=[0,.666666667,1,1],ze=Re,Ne=750,ke=500,je=100,Fe=250,_e="intersect",Ve="lasso",We="rotate",Ze="merge",Ge="remove",Ue=[Ve,We,_e,Ze,Ge],Ke="alt",qe="cmd",He="ctrl",Ye="meta",Xe="shift",$e=[Ke,qe,He,Ye,Xe],Je=u(u(u(u({},Ge,Ke),We,Ke),Ve,Xe),Ze,qe),Qe=me,en=me,nn=null,tn=null,rn=null,on=null,an=null,cn=[.66,.66,.66,1],ln=[0,.55,1,1],sn=[1,1,1,1],un=[0,0,0,1],fn=null,dn=[.66,.66,.66,.2],vn=[0,.55,1,1],hn=[1,1,1,1],pn=[1,1,1,.5],yn=[0,0],mn=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),gn=[1,1,1,.5],wn=new Set(["z","valueZ","valueA","value1","category"]),xn=new Set(["w","valueW","valueB","value2","value"]),bn=15e3,Pn=Symbol("SKIP_DEPRECATION_VALUE_TRANSLATION"),Sn="Points have not been drawn",An="The instance was already destroyed",En=function(e,n){return"".concat(e,"ms ease-out effectIn ").concat(n,"ms 1 normal forwards")},Mn=function(e,n){return"".concat(e,"ms linear leftSpinIn ").concat(n,"ms 1 normal forwards")},In=function(e,n){return"".concat(e,"ms linear rightSpinIn ").concat(n,"ms 1 normal forwards")},Cn=function(e,n){return"".concat(e,"ms linear circleIn ").concat(n,"ms 1 normal forwards")},Tn=function(e,n,t){return"\n @keyframes mainIn {\n 0% {\n color: ".concat(n,";\n opacity: 0;\n }\n 0%, ").concat(e,"% {\n color: ").concat(n,";\n opacity: 1;\n }\n 100% {\n color: ").concat(t,";\n opacity: 0.8;\n }\n }\n")},Ln=function(e,n,t,r){return"\n @keyframes effectIn {\n 0%, ".concat(e,"% {\n opacity: ").concat(t,";\n transform: scale(").concat(r,");\n }\n ").concat(n,"% {\n opacity: 0.66;\n transform: scale(1.5);\n }\n 99% {\n opacity: 0;\n transform: scale(2);\n }\n 100% {\n opacity: 0;\n transform: scale(0);\n }\n }\n")},On=function(e,n){return"\n @keyframes leftSpinIn {\n 0% {\n transform: rotate(".concat(n,"deg);\n }\n ").concat(e,"%, 100% {\n transform: rotate(360deg);\n }\n }\n")},Rn=function(e,n){return"\n @keyframes rightSpinIn {\n 0% {\n transform: rotate(".concat(n,"deg);\n }\n ").concat(e,"%, 100% {\n transform: rotate(180deg);\n }\n }\n")},Bn=function(e){return"".concat(e,"ms linear effectOut 0s 1 normal forwards")},Dn=function(e){return"".concat(e,"ms linear leftSpinOut 0s 1 normal forwards")},zn=function(e){return"".concat(e,"ms linear rightSpinOut 0s 1 normal forwards")},Nn=function(e){return"".concat(e,"ms linear circleOut 0s 1 normal forwards")},kn=function(e,n){return"\n @keyframes mainOut {\n 0% {\n color: ".concat(e,";\n }\n 100% {\n color: ").concat(n,";\n }\n }\n")},jn=function(e,n){return"\n @keyframes rightSpinOut {\n 0%, ".concat(e,"% {\n transform: rotate(").concat(n,"deg);\n }\n 100% {\n transform: rotate(0deg);\n }\n")},Fn=function(e){return"\n @keyframes leftSpinOut {\n 0% {\n transform: rotate(".concat(e,"deg);\n }\n 100% {\n transform: rotate(0deg);\n }\n }\n")},_n=function(e,n,t){return"\n @keyframes circleOut {\n 0%, ".concat(e,"% {\n clip-path: ").concat(n,";\n opacity: ").concat(t,";\n }\n ").concat(e+.01,"% {\n clip-path: inset(0 0 0 50%);\n opacity: ").concat(t,";\n }\n 100% {\n clip-path: inset(0 0 0 50%);\n opacity: 0;\n }\n }\n")},Vn=function(e){return null===e?arguments.length>1&&void 0!==arguments[1]?arguments[1]:null:e},Wn=function(){if(!de){var e=document.createElement("style");document.head.appendChild(e),de=e.sheet}return de},Zn=function(e){var n=Wn(),t=n.rules.length;return n.insertRule(e,t),t},Gn=function(e){Wn().deleteRule(e)},Un="".concat(2500,"ms ease scaleInFadeOut 0s 1 normal backwards"),Kn=null,qn="".concat(250,"ms ease fadeScaleOut 0s 1 normal backwards"),Hn=null,Yn=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.onDraw,r=void 0===t?g:t,o=n.onStart,i=void 0===o?g:o,a=n.onEnd,c=void 0===a?g:a,l=n.enableInitiator,s=void 0===l||l,u=n.initiatorParentElement,f=void 0===u?document.body:u,d=n.longPressIndicatorParentElement,p=void 0===d?document.body:d,y=n.minDelay,m=void 0===y?8:y,w=n.minDist,x=void 0===w?2:w,E=n.pointNorm,M=void 0===E?g:E,I=n.type,C=void 0===I?"freeform":I,T=n.brushSize,L=s,O=f,R=p,B=r,D=i,z=c,N=m,k=x,j=M,F=C,_=void 0===T?24:T,V=document.createElement("div"),W=Math.random().toString(36).substring(2,5)+Math.random().toString(36).substring(2,5);V.id="lasso-initiator-".concat(W),V.style.position="fixed",V.style.display="flex",V.style.justifyContent="center",V.style.alignItems="center",V.style.zIndex=99,V.style.width="4rem",V.style.height="4rem",V.style.borderRadius="4rem",V.style.opacity=.5,V.style.transform="translate(-50%,-50%) scale(0) rotate(0deg)";var Z,G=function(){var e=document.createElement("div"),n=Math.random().toString(36).substring(2,5)+Math.random().toString(36).substring(2,5);e.id="lasso-long-press-".concat(n),e.style.position="fixed",e.style.width="1.25rem",e.style.height="1.25rem",e.style.pointerEvents="none",e.style.transform="translate(-50%,-50%)";var t=document.createElement("div");t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.width="1.25rem",t.style.height="1.25rem",t.style.clipPath="inset(0px 0px 0px 50%)",t.style.opacity=0,e.appendChild(t);var r=document.createElement("div");r.style.position="absolute",r.style.top=0,r.style.left=0,r.style.width="0.8rem",r.style.height="0.8rem",r.style.border="0.2rem solid currentcolor",r.style.borderRadius="0.8rem",r.style.clipPath="inset(0px 50% 0px 0px)",r.style.transform="rotate(0deg)",t.appendChild(r);var o=document.createElement("div");o.style.position="absolute",o.style.top=0,o.style.left=0,o.style.width="0.8rem",o.style.height="0.8rem",o.style.border="0.2rem solid currentcolor",o.style.borderRadius="0.8rem",o.style.clipPath="inset(0px 50% 0px 0px)",o.style.transform="rotate(0deg)",t.appendChild(o);var i=document.createElement("div");return i.style.position="absolute",i.style.top=0,i.style.left=0,i.style.width="1.25rem",i.style.height="1.25rem",i.style.borderRadius="1.25rem",i.style.background="currentcolor",i.style.transform="scale(0)",i.style.opacity=0,e.appendChild(i),{longPress:e,longPressCircle:t,longPressCircleLeft:r,longPressCircleRight:o,longPressEffect:i}}(),U=G.longPress,K=G.longPressCircle,q=G.longPressCircleLeft,H=G.longPressCircleRight,Y=G.longPressEffect,X=!1,$=!1,J=[],Q=[],ee=[],ne=[],te=!1,re=null,oe=null,ie=null,ae=null,ce=null,le=null,se=null,ue=null,fe=null,de=null,ve=function(){X=!1};window.addEventListener("mouseup",ve);var he,pe=function(){V.style.opacity=.5,V.style.transform="translate(-50%,-50%) scale(0) rotate(0deg)"},ye=function(e,n){var t=getComputedStyle(e),r=+t.opacity,o=t.transform.match(/([0-9.-]+)+/g),i=+o[0],a=+o[1],c=Math.sqrt(i*i+a*a),l=Math.atan2(a,i)*(180/Math.PI);return{opacity:r,scale:c,rotate:l=n&&l<=0?360+l:l}},me=function(e){if(L&&!X){var n=e.clientX,t=e.clientY;V.style.top="".concat(t,"px"),V.style.left="".concat(n,"px");var r=ye(V),o=r.opacity,i=r.scale,a=r.rotate;V.style.opacity=o,V.style.transform="translate(-50%,-50%) scale(".concat(i,") rotate(").concat(a,"deg)"),V.style.animation="none",S().then((function(){null!==Kn&&Gn(Kn),Kn=Zn(function(e,n,t){return"\n@keyframes scaleInFadeOut {\n 0% {\n opacity: ".concat(e,";\n transform: translate(-50%,-50%) scale(").concat(n,") rotate(").concat(t,"deg);\n }\n 10% {\n opacity: 1;\n transform: translate(-50%,-50%) scale(1) rotate(").concat(t+20,"deg);\n }\n 100% {\n opacity: 0;\n transform: translate(-50%,-50%) scale(0.9) rotate(").concat(t+60,"deg);\n }\n}\n")}(o,i,a)),V.style.animation=Un,S().then((function(){pe()}))}))}},ge=function(){var e=ye(V),n=e.opacity,t=e.scale,r=e.rotate;V.style.opacity=n,V.style.transform="translate(-50%,-50%) scale(".concat(t,") rotate(").concat(r,"deg)"),V.style.animation="none",S(2).then((function(){null!==Hn&&Gn(Hn),Hn=Zn(function(e,n,t){return"\n@keyframes fadeScaleOut {\n 0% {\n opacity: ".concat(e,";\n transform: translate(-50%,-50%) scale(").concat(n,") rotate(").concat(t,"deg);\n }\n 100% {\n opacity: 0;\n transform: translate(-50%,-50%) scale(0) rotate(").concat(t,"deg);\n }\n}\n")}(n,t,r)),V.style.animation=qn,S().then((function(){pe()}))}))},we=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{time:Ne,extraTime:ke,delay:je},r=t.time,o=void 0===r?Ne:r,i=t.extraTime,a=void 0===i?ke:i,c=t.delay,l=void 0===c?je:c;te=!0;var s=getComputedStyle(U);U.style.color=s.color,U.style.top="".concat(n,"px"),U.style.left="".concat(e,"px"),U.style.animation="none";var u=getComputedStyle(K);K.style.clipPath=u.clipPath,K.style.opacity=u.opacity,K.style.animation="none";var f=ye(Y);Y.style.opacity=f.opacity,Y.style.transform="scale(".concat(f.scale,")"),Y.style.animation="none";var d=ye(q);q.style.transform="rotate(".concat(d.rotate,"deg)"),q.style.animation="none";var v=ye(H);H.style.transform="rotate(".concat(v.rotate,"deg)"),H.style.animation="none",S().then((function(){if(te){null!==ce&&Gn(ce),null!==ae&&Gn(ae),null!==ie&&Gn(ie),null!==oe&&Gn(oe),null!==re&&Gn(re);var e=function(e){var n,t,r,o,i,a=e.time,c=void 0===a?Ne:a,l=e.extraTime,s=void 0===l?ke:l,u=e.delay,f=void 0===u?je:u,d=e.currentColor,v=e.targetColor,h=e.effectOpacity,p=e.effectScale,y=e.circleLeftRotation,m=e.circleRightRotation,g=e.circleClipPath,w=e.circleOpacity,x=y/360,b=function(e,n,t){return(1-e)*n+t}(x,c,s),P=Math.round((1-x)*c/b*100),S=Math.round(P/2),A=P+(100-P)/4;return{rules:{main:Tn(P,d,v),effect:Ln(P,A,h,p),circleRight:Rn(S,m),circleLeft:On(P,y),circle:(r=S,o=g,i=w,"\n @keyframes circleIn {\n 0% {\n clip-path: ".concat(o,";\n opacity: ").concat(i,";\n }\n ").concat(r,"% {\n clip-path: ").concat(o,";\n opacity: 1;\n }\n ").concat(r+.01,"%, 100% {\n clip-path: inset(0);\n opacity: 1;\n }\n }\n"))},names:{main:(n=b,t=f,"".concat(n,"ms ease-out mainIn ").concat(t,"ms 1 normal forwards")),effect:En(b,f),circleLeft:Mn(b,f),circleRight:In(b,f),circle:Cn(b,f)}}}({time:o,extraTime:a,delay:l,currentColor:s.color||"currentcolor",targetColor:U.dataset.activeColor,effectOpacity:f.opacity||0,effectScale:f.scale||0,circleLeftRotation:d.rotate||0,circleRightRotation:v.rotate||0,circleClipPath:u.clipPath||"inset(0 0 0 50%)",circleOpacity:u.opacity||0}),n=e.rules,t=e.names;re=Zn(n.main),oe=Zn(n.effect),ie=Zn(n.circleLeft),ae=Zn(n.circleRight),ce=Zn(n.circle),U.style.animation=t.main,Y.style.animation=t.effect,q.style.animation=t.circleLeft,H.style.animation=t.circleRight,K.style.animation=t.circle}}))},xe=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{time:Fe}).time,n=void 0===e?Fe:e;if(te){te=!1;var t=getComputedStyle(U);U.style.color=t.color,U.style.animation="none";var r=getComputedStyle(K);K.style.clipPath=r.clipPath,K.style.opacity=r.opacity,K.style.animation="none";var o=ye(Y);Y.style.opacity=o.opacity,Y.style.transform="scale(".concat(o.scale,")"),Y.style.animation="none";var i="x"===r.clipPath.slice(-2,-1),a=ye(q,i);q.style.transform="rotate(".concat(a.rotate,"deg)"),q.style.animation="none";var c=ye(H);H.style.transform="rotate(".concat(c.rotate,"deg)"),H.style.animation="none",S().then((function(){null!==de&&Gn(de),null!==fe&&Gn(fe),null!==ue&&Gn(ue),null!==se&&Gn(se),null!==le&&Gn(le);var e=function(e){var n,t,r,o=e.time,i=void 0===o?Fe:o,a=e.currentColor,c=e.targetColor,l=e.effectOpacity,s=e.effectScale,u=e.circleLeftRotation,f=e.circleRightRotation,d=e.circleClipPath,v=e.circleOpacity,h=u/360,p=h*i,y=Math.min(100,100*h),m=y>50?Math.round(100*(1-50/y)):0;return{rules:{main:kn(a,c),effect:(t=l,r=s,"\n @keyframes effectOut {\n 0% {\n opacity: ".concat(t,";\n transform: scale(").concat(r,");\n }\n 99% {\n opacity: 0;\n transform: scale(").concat(r+.5,");\n }\n 100% {\n opacity: 0;\n transform: scale(0);\n }\n }\n")),circleRight:jn(m,f),circleLeft:Fn(u),circle:_n(m,d,v)},names:{main:(n=p,"".concat(n,"ms linear mainOut 0s 1 normal forwards")),effect:Bn(p),circleRight:Dn(p),circleLeft:zn(p),circle:Nn(p)}}}({time:n,currentColor:t.color||"currentcolor",targetColor:U.dataset.color,effectOpacity:o.opacity||0,effectScale:o.scale||0,circleLeftRotation:a.rotate||0,circleRightRotation:c.rotate||0,circleClipPath:r.clipPath||"inset(0px)",circleOpacity:r.opacity||1}),i=e.rules,l=e.names;le=Zn(i.main),se=Zn(i.effect),ue=Zn(i.circleLeft),fe=Zn(i.circleRight),de=Zn(i.circle),U.style.animation=l.main,Y.style.animation=l.effect,q.style.animation=l.circleLeft,H.style.animation=l.circleRight,K.style.animation=l.circle}))}},be=function(){B(J,Q)},Pe=function(e){J.push(e),Q.push(e[0],e[1])},Se=function(e){var n=v(e,2),t=n[0],r=n[1],o=v(J[0],2),i=o[0],a=o[1];J[1]=[t,a],J[2]=[t,r],J[3]=[i,r],J[4]=[i,a],Q[2]=t,Q[3]=a,Q[4]=t,Q[5]=r,Q[6]=i,Q[7]=r,Q[8]=i,Q[9]=a},Ae=function(e){ee.push(e)},Ee=function(e,n,t){var r,o=v(e,2),i=o[0],a=o[1],c=v(n,2),l=i-c[0],s=a-c[1],u=(r=[l,s],Math.sqrt(r.reduce(((e,n)=>e+n**2),0)));return[+s/u*t,-l/u*t]},Me=function(e){var n=ee.at(-1),t=Math.abs(j([0,0])[0]-j([_/2,0])[0]),r=v(Ee(e,n,t),2),o=r[0],i=r[1],a=ee.length;if(1===a){var c=[n[0]+o,n[1]+i],l=[n[0]-o,n[1]-i];J.push(c,l),Q.push(c[0],c[1],l[0],l[1]),ne.push([o,i])}else{var s=v(Ee(e,n,t),2);o=s[0],i=s[1];var u=v(function(e,n,t){if(0===e.length)return 0;if(1===e.length)return e[0];for(var r=Math.pow(2,-1/n),o=Math.max(0,e.length-t),i=e.slice(o),a=0,c=0,l=0,s=i.length-1;s>=0;s--){var u=i.length-1-s,f=Math.pow(r,u);a+=i[s][0]*f,c+=i[s][1]*f,l+=f}return[a/l,c/l]}([].concat(h(ne),[[o,i]]),1,10),2);o=u[0],i=u[1];var f=v(ne.at(-1),2),d=(o+f[0])/2,p=(i+f[1])/2,y=[n[0]+d,n[1]+p],m=[n[0]-d,n[1]-p];J.splice(a-1,2,y,m),Q.splice(2*(a-1),4,y[0],y[1],m[0],m[1]),ne.splice(a,1,[d,p])}var g=[e[0]+o,e[1]+i],w=[e[0]-o,e[1]-i];J.splice(a,0,g,w),Q.splice(2*a,0,g[0],g[1],w[0],w[1]),ee.push(e),ne.push([o,i])},Ie=Pe,Ce=Pe,Te=function(e){if(Z){(t=e[0],r=e[1],o=Z[0],i=Z[1],Math.sqrt((t-o)**2+(r-i)**2))>k&&(Z=e,Ie(j(e)),J.length>1&&be())}else{$||($=!0,D()),Z=e;var n=j(e);Ce(n)}var t,r,o,i},Le=A(Te,N,N),Oe=function(n,t){var r=function(n){var t=e.getBoundingClientRect(),r=t.left,o=t.top;return[n.clientX-r,n.clientY-o]}(n);return t?Le(r):Te(r)},Re=function(){J=[],Q=[],ee=[],ne=[],Z=void 0,be()},Be=function(e){me(e)},De=function(){X=!0,$=!0,Re(),D()},ze=function(){ge()},_e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.intersect,t=void 0!==n&&n,r=e.merge,o=void 0!==r&&r,i=e.remove,a=void 0!==i&&i;$=!1;var c=h(J),l=h(Q);return Le.cancel(),Re(),c.length>0&&z(c,l,{intersect:t,merge:o,remove:a}),c},Ve=function(e){return"onDraw"===e?B:"onStart"===e?D:"onEnd"===e?z:"enableInitiator"===e?L:"minDelay"===e?N:"minDist"===e?k:"pointNorm"===e?j:"type"===e?F:"brushSize"===e?_:void 0},We=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onDraw,t=void 0===n?null:n,r=e.onStart,o=void 0===r?null:r,i=e.onEnd,a=void 0===i?null:i,c=e.enableInitiator,l=void 0===c?null:c,s=e.initiatorParentElement,u=void 0===s?null:s,f=e.longPressIndicatorParentElement,d=void 0===f?null:f,v=e.minDelay,h=void 0===v?null:v,p=e.minDist,y=void 0===p?null:p,m=e.pointNorm,g=void 0===m?null:m,w=e.type,x=void 0===w?null:w,b=e.brushSize,P=void 0===b?null:b;B=Vn(t,B),D=Vn(o,D),z=Vn(a,z),L=Vn(l,L),N=Vn(h,N),k=Vn(y,k),j=Vn(g,j),_=Vn(P,_),null!==u&&u!==O&&(O.removeChild(V),u.appendChild(V),O=u),null!==d&&d!==R&&(R.removeChild(U),d.appendChild(U),R=d),L?(V.addEventListener("click",Be),V.addEventListener("mousedown",De),V.addEventListener("mouseleave",ze)):(V.removeEventListener("mousedown",De),V.removeEventListener("mouseleave",ze)),null!==x&&function(e){switch(e){case"rectangle":F=e,Ie=Se,Ce=Pe;break;case"brush":F=e,Ie=Me,Ce=Ae;break;default:F="freeform",Ie=Pe,Ce=Pe}}(x)},Ze=function(){O.removeChild(V),R.removeChild(U),window.removeEventListener("mouseup",ve),V.removeEventListener("click",Be),V.removeEventListener("mousedown",De),V.removeEventListener("mouseleave",ze)};return O.appendChild(V),R.appendChild(U),We({onDraw:B,onStart:D,onEnd:z,enableInitiator:L,initiatorParentElement:O,type:F,brushSize:_}),((...e)=>n=>e.reduce(((e,n)=>n(e)),n))(P("initiator",V),P("longPressIndicator",U),(function(e){return b(e,{clear:Re,destroy:Ze,end:_e,extend:Oe,get:Ve,set:We,showInitiator:me,hideInitiator:ge,showLongPressIndicator:we,hideLongPressIndicator:xe})}),(he=Yn,e=>b({__proto__:{constructor:he}},e)))({})},Xn=function(e,n){return!!e&&we.reduce((function(t,r){return e.hasExtension(r)?t:(n||console.warn("WebGL: ".concat(r," extension not supported. Scatterplot might not render properly")),!1)}),!0)},$n=function(e){var n,t=e.getContext("webgl",{antialias:!0,preserveDrawingBuffer:!0}),r=[],o=s(we);try{for(o.s();!(n=o.n()).done;){var a=n.value;t.getExtension(a)?r.push(a):console.warn("WebGL: ".concat(a," extension not supported. Scatterplot might not render properly"))}}catch(e){o.e(e)}finally{o.f()}return i.default({gl:t,extensions:r})},Jn=function(e,n,t,r){return Math.sqrt(Math.pow(e-t,2)+Math.pow(n-r,2))},Qn=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,et=function(e,n){var t=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).minLength,r=void 0===t?0:t;return Array.isArray(e)&&e.length>=r&&e.every(n)},nt=function(e){return!Number.isNaN(+e)&&+e>=0},tt=function(e){return!Number.isNaN(+e)&&+e>0},rt=function(e,n){return function(t){return e.indexOf(t)>=0?t:n}},ot=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bn;return new Promise((function(r,o){(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bn;return new Promise((function(r,o){var i=new Image;n&&(i.crossOrigin="anonymous"),i.src=e,i.onload=function(){r(i)};var a=function(){o(new Error("IMAGE_LOAD_ERROR"))};i.onerror=a,setTimeout(a,t)}))})(n,0!==n.indexOf(window.location.origin)&&-1===n.indexOf("base64"),t).then((function(n){r(e.texture(n))})).catch((function(e){o(e)}))}))},it=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return[].concat(h(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.replace(Qn,(function(e,n,t,r){return"#".concat(n).concat(n).concat(t).concat(t).concat(r).concat(r)})).substring(1).match(/.{2}/g).map((function(e){return Number.parseInt(e,16)/Math.pow(255,n)}))}(e,n)),[Math.pow(255,!n)])},at=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,ct=function(e){return e>=0&&e<=1},lt=function(e){return Array.isArray(e)&&e.every(ct)};function st(e,n,t,r,o,i){return(t-e)*(i-n)-(o-e)*(r-n)}var ut=function(e){for(var n=v(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),t=n[0],r=n[1],o=0,i=0,a=e.length-2;i<e.length;i+=2){var c=e[i],l=e[i+1],s=e[a],u=e[a+1];if(l<=r){if(u>r)st(c,l,s,u,t,r)>0&&o++}else if(u<=r){st(c,l,s,u,t,r)<0&&o--}a=i}return 0!==o},ft=function(e){return"string"==typeof e||e instanceof String},dt=function(e){return Number.isInteger(e)&&e>=0&&e<=255},vt=function(e){return Array.isArray(e)&&e.every(dt)},ht=function(e){return Array.isArray(e)&&e.length>0&&(Array.isArray(e[0])||ft(e[0]))},pt=function(e,n){return e>n?e:n},yt=function(e,n){return e<n?e:n},mt=function(e,n){if(4===(r=e).length&&(lt(r)||vt(r))){var t=lt(e);return n&&t||!n&&!t?e:n&&!t?e.map((function(e){return e/255})):e.map((function(e){return 255*e}))}var r,o,i;if(3===(o=e).length&&(lt(o)||vt(o))){var a=Math.pow(255,!n),c=lt(e);return[].concat(n&&c||!n&&!c?h(e):h(n&&!c?e.map((function(e){return e/255})):e.map((function(e){return 255*e}))),[a])}return i=e,at.test(i)?it(e,n):(console.warn("Only HEX, RGB, and RGBA are handled by this function. Returning white instead."),n?[1,1,1,1]:[255,255,255,255])},gt=function(e){return.21*e[0]+.72*e[1]+.07*e[2]},wt=function(e){return new Promise((function(n,t){if(!e||Array.isArray(e))n(e);else{var r=Array.isArray(e.x)||ArrayBuffer.isView(e.x)?e.x.length:0,o=(Array.isArray(e.x)||ArrayBuffer.isView(e.x))&&function(n){return e.x[n]},i=(Array.isArray(e.y)||ArrayBuffer.isView(e.y))&&function(n){return e.y[n]},a=(Array.isArray(e.line)||ArrayBuffer.isView(e.line))&&function(n){return e.line[n]},c=(Array.isArray(e.lineOrder)||ArrayBuffer.isView(e.lineOrder))&&function(n){return e.lineOrder[n]},l=Object.keys(e),s=(d=l.find((function(e){return wn.has(e)})))&&(Array.isArray(e[d])||ArrayBuffer.isView(e[d]))&&function(n){return e[d][n]},u=(f=l.find((function(e){return xn.has(e)})))&&(Array.isArray(e[f])||ArrayBuffer.isView(e[f]))&&function(n){return e[f][n]};o&&i&&s&&u&&a&&c?n(e.x.map((function(e,n){return[e,i(n),s(n),u(n),a(n),c(n)]}))):o&&i&&s&&u&&a?n(Array.from({length:r},(function(e,n){return[o(n),i(n),s(n),u(n),a(n)]}))):o&&i&&s&&u?n(Array.from({length:r},(function(e,n){return[o(n),i(n),s(n),u(n)]}))):o&&i&&s?n(Array.from({length:r},(function(e,n){return[o(n),i(n),s(n)]}))):o&&i?n(Array.from({length:r},(function(e,n){return[o(n),i(n)]}))):t(new Error("You need to specify at least x and y"))}var f,d}))},xt=function(e){return Number.isFinite(e.y)&&!("x"in e)},bt=function(e){return Number.isFinite(e.x)&&!("y"in e)},Pt=function(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.width)&&Number.isFinite(e.height)},St=function(e){return Number.isFinite(e.x1)&&Number.isFinite(e.y1)&&Number.isFinite(e.x2)&&Number.isFinite(e.x2)},At=function(e){return"vertices"in e&&e.vertices.length>1},Et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.regl,t=e.canvas,r=void 0===t?document.createElement("canvas"):t,o=e.gamma,i=void 0===o?1:o,a=!1;n||(n=$n(r));var c=Xn(n),l=[r.width,r.height],s=n.framebuffer({width:l[0],height:l[1],colorFormat:"rgba",colorType:"float"}),u=n({vert:"\n precision highp float;\n attribute vec2 xy;\n void main () {\n gl_Position = vec4(xy, 0, 1);\n }",frag:"\n precision highp float;\n uniform vec2 srcRes;\n uniform sampler2D src;\n uniform float gamma;\n\n vec3 approxLinearToSRGB (vec3 rgb, float gamma) {\n return pow(clamp(rgb, vec3(0), vec3(1)), vec3(1.0 / gamma));\n }\n\n void main () {\n vec4 color = texture2D(src, gl_FragCoord.xy / srcRes);\n gl_FragColor = vec4(approxLinearToSRGB(color.rgb, gamma), color.a);\n }",attributes:{xy:[-4,-4,4,-4,0,4]},uniforms:{src:function(){return s},srcRes:function(){return l},gamma:function(){return i}},count:3,depth:{enable:!1},blend:{enable:!0,func:{srcRGB:"one",srcAlpha:"one",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}}}),f=new Set,d=n.frame((function(){for(var e=f.values(),n=e.next();!n.done;)n.value(),n=e.next()})),v=function(e,n){var t=void 0===e?Math.min(window.innerWidth,window.screen.availWidth):e,o=void 0===n?Math.min(window.innerHeight,window.screen.availHeight):n;r.width=t*window.devicePixelRatio,r.height=o*window.devicePixelRatio,l[0]=r.width,l[1]=r.height,s.resize.apply(s,l)},h=function(){v()};e.canvas||(window.addEventListener("resize",h),window.addEventListener("orientationchange",h),v());return{get canvas(){return r},get regl(){return n},get gamma(){return i},set gamma(e){i=+e},get isSupported(){return c},get isDestroyed(){return a},render:function(e,t){n.clear(xe),s.use((function(){n.clear(xe),e()})),u(),function(e){var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.drawImage(r,(r.width-e.width)/2,(r.height-e.height)/2,e.width,e.height,0,0,e.width,e.height)}(t)},resize:v,onFrame:function(e){return f.add(e),function(){f.delete(e)}},refresh:function(){n.poll()},destroy:function(){a=!0,window.removeEventListener("resize",h),window.removeEventListener("orientationchange",h),d.cancel(),r=void 0,n.destroy(),n=void 0}}};const Mt=e=>`\nprecision highp float;\n\nuniform sampler2D colorTex;\nuniform float colorTexRes;\nuniform float colorTexEps;\nuniform sampler2D stateTex;\nuniform float stateTexRes;\nuniform float stateTexEps;\nuniform float devicePixelRatio;\nuniform sampler2D encodingTex;\nuniform float encodingTexRes;\nuniform float encodingTexEps;\nuniform float pointSizeExtra;\nuniform float pointOpacityMax;\nuniform float pointOpacityScale;\nuniform float numPoints;\nuniform float globalState;\nuniform float isColoredByZ;\nuniform float isColoredByW;\nuniform float isOpacityByZ;\nuniform float isOpacityByW;\nuniform float isOpacityByDensity;\nuniform float isSizedByZ;\nuniform float isSizedByW;\nuniform float isPixelAligned;\nuniform float colorMultiplicator;\nuniform float opacityMultiplicator;\nuniform float opacityDensity;\nuniform float sizeMultiplicator;\nuniform float numColorStates;\nuniform float pointScale;\nuniform float drawingBufferWidth;\nuniform float drawingBufferHeight;\nuniform mat4 modelViewProjection;\n\nattribute vec2 stateIndex;\n\nvarying vec4 color;\nvarying float finalPointSize;\n\nvoid main() {\n vec4 state = texture2D(stateTex, stateIndex);\n\n if (isPixelAligned < 0.5) {\n gl_Position = modelViewProjection * vec4(state.x, state.y, 0.0, 1.0);\n } else {\n vec4 clipSpacePosition = modelViewProjection * vec4(state.x, state.y, 0.0, 1.0);\n vec2 ndcPosition = clipSpacePosition.xy / clipSpacePosition.w;\n vec2 pixelPos = 0.5 * (ndcPosition + 1.0) * vec2(drawingBufferWidth, drawingBufferHeight);\n pixelPos = floor(pixelPos + 0.5); // Snap to nearest pixel\n vec2 snappedPosition = (pixelPos / vec2(drawingBufferWidth, drawingBufferHeight)) * 2.0 - 1.0;\n gl_Position = vec4(snappedPosition, 0.0, 1.0);\n }\n\n\n // Determine color index\n float colorIndexZ = isColoredByZ * floor(state.z * colorMultiplicator);\n float colorIndexW = isColoredByW * floor(state.w * colorMultiplicator);\n\n // Multiply by the number of color states per color\n // I.e., normal, active, hover, background, etc.\n float colorIndex = (colorIndexZ + colorIndexW) * numColorStates;\n\n // Half a "pixel" or "texel" in texture coordinates\n float colorLinearIndex = colorIndex + globalState;\n\n // Need to add cEps here to avoid floating point issue that can lead to\n // dramatic changes in which color is loaded as floor(3/2.9999) = 1 but\n // floor(3/3.0001) = 0!\n float colorRowIndex = floor((colorLinearIndex + colorTexEps) / colorTexRes);\n\n vec2 colorTexIndex = vec2(\n (colorLinearIndex / colorTexRes) - colorRowIndex + colorTexEps,\n colorRowIndex / colorTexRes + colorTexEps\n );\n\n color = texture2D(colorTex, colorTexIndex);\n\n // Retrieve point size\n float pointSizeIndexZ = isSizedByZ * floor(state.z * sizeMultiplicator);\n float pointSizeIndexW = isSizedByW * floor(state.w * sizeMultiplicator);\n float pointSizeIndex = pointSizeIndexZ + pointSizeIndexW;\n\n float pointSizeRowIndex = floor((pointSizeIndex + encodingTexEps) / encodingTexRes);\n vec2 pointSizeTexIndex = vec2(\n (pointSizeIndex / encodingTexRes) - pointSizeRowIndex + encodingTexEps,\n pointSizeRowIndex / encodingTexRes + encodingTexEps\n );\n float pointSize = texture2D(encodingTex, pointSizeTexIndex).x;\n\n // Retrieve opacity\n ${3===e?"":`\n if (isOpacityByDensity < 0.5) {\n float opacityIndexZ = isOpacityByZ * floor(state.z * opacityMultiplicator);\n float opacityIndexW = isOpacityByW * floor(state.w * opacityMultiplicator);\n float opacityIndex = opacityIndexZ + opacityIndexW;\n\n float opacityRowIndex = floor((opacityIndex + encodingTexEps) / encodingTexRes);\n vec2 opacityTexIndex = vec2(\n (opacityIndex / encodingTexRes) - opacityRowIndex + encodingTexEps,\n opacityRowIndex / encodingTexRes + encodingTexEps\n );\n color.a = texture2D(encodingTex, opacityTexIndex)[${1+e}];\n } else {\n color.a = min(1.0, opacityDensity + globalState);\n }\n `}\n\n color.a = min(pointOpacityMax, color.a) * pointOpacityScale;\n finalPointSize = (pointSize * pointScale) + pointSizeExtra;\n gl_PointSize = finalPointSize;\n}\n`;var It=function(){var e=function(e,n,t,r,o){var i=.5*(r-n),a=.5*(o-t);return(2*t-2*r+i+a)*e*e*e+(-3*t+3*r-2*i-a)*e*e+i*e+t},n=function(n,t,r){var o=r*n,i=Math.floor(o),a=o-i,c=t[Math.max(0,i-1)],l=t[i],s=t[Math.min(r,i+1)],u=t[Math.min(r,i+2)];return[e(a,c[0],l[0],s[0],u[0]),e(a,c[1],l[1],s[1],u[1])]},t=function(e,n,t){var r=n[0],o=n[1],i=t[0]-r,a=t[1]-o;if(0!==i||0!==a){var c=((e[0]-r)*i+(e[1]-o)*a)/(i*i+a*a);c>1?(r=t[0],o=t[1]):c>0&&(r+=i*c,o+=a*c)}return(i=e[0]-r)*i+(a=e[1]-o)*a},r=function(e,n,o,i,a){for(var c,l=i,s=n+1;s<o;s++){var u=t(e[s],e[n],e[o]);u>l&&(c=s,l=u)}l>i&&(c-n>1&&r(e,n,c,i,a),a.push(e[c]),o-c>1&&r(e,c,o,i,a))},o=function(e,n){var t=e.length-1,o=[e[0]];return r(e,0,t,n,o),o.push(e[t]),o};self.onmessage=function(e){(e.data.points?+e.data.points.length:0)||self.postMessage({error:new Error("No points provided")}),e.data.points;var t=function(e){var n={},t=!Number.isNaN(+e[0][5]);return e.forEach((function(e){var r=e[4];n[r]||(n[r]=[]),t?n[r][e[5]]=e:n[r].push(e)})),Object.entries(n).forEach((function(e){n[e[0]]=e[1].filter((function(e){return e})),n[e[0]].reference=e[1][0]})),n}(e.data.points);self.postMessage({points:Object.entries(t).reduce((function(t,r){return t[r[0]]=function(e){for(var t,r,i,a,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=l.maxIntPointsPerSegment,u=void 0===s?100:s,f=l.tolerance,d=void 0===f?.002:f,v=e.length,h=v-1,p=h*u+1,y=Math.pow(d,2),m=[],g=0;g<v-1;g++){var w=[e[g].slice(0,2)];t=e[g];for(var x=1;x<u;x++){var b=n((g*u+x)/p,e,h);r=t[0],i=t[1],a=b[0],c=b[1],Math.pow(r-a,2)+Math.pow(i-c,2)>y&&(w.push(b),t=b)}w.push(e[g+1]),w=o(w,y),m=m.concat(w.slice(0,w.length-1))}return m.push(e[e.length-1].slice(0,2)),m.flat()}(r[1],e.data.options),t[r[0]].reference=r[1].reference,t}),{})})}},Ct=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:.002,maxIntPointsPerSegment:100};return new Promise((function(t,r){var o,i=(o=It,new Worker(window.URL.createObjectURL(new Blob([`(${o.toString()})()`],{type:"text/javascript"}))));i.onmessage=function(e){e.data.error?r(e.data.error):t(e.data.points),i.terminate()},i.postMessage({points:e,options:n})}))},Tt={showRecticle:{replacement:"showReticle",removalVersion:"2",translation:g},recticleColor:{replacement:"reticleColor",removalVersion:"2",translation:g},keyMap:{replacement:"actionKeyMap",removalVersion:"2",translation:function(e){return Object.entries(e).reduce((function(e,n){var t=v(n,2),r=t[0],o=t[1];return e[o]?e[o]=[].concat(h(e[o]),[r]):e[o]=r,e}),{})}}},Lt=function(e){var n,t=Object.keys(e).filter((function(e){return Tt[e]})),r=s(t);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=Tt[o],a=i.replacement,c=i.removalVersion,l=i.translation;console.warn('regl-scatterplot: the "'.concat(o,'" property is deprecated and will be removed in v').concat(c,'. Please use "').concat(a,'" instead.')),e[Tt[o].replacement]=e[o]!==Pn?l(e[o]):e[o],delete e[o]}}catch(e){r.e(e)}finally{r.f()}return e},Ot=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.allowSegment,o=void 0!==r&&r,i=t.allowDensity,a=void 0!==i&&i,c=t.allowInherit,l=void 0!==c&&c;return wn.has(e)?"valueZ":xn.has(e)?"valueW":"segment"===e?o?"segment":n:"density"===e?a?"density":n:"inherit"===e&&l?"inherit":n},Rt=function(e){switch(e){case"valueZ":return 2;case"valueW":return 3;default:return null}};e.checkSupport=Xn,e.createRegl=$n,e.createRenderer=Et,e.createSpatialIndex=function(e,n){return wt(e).then((function(e){return ye(e,{useWorker:n})})).then((function(e){return e.data}))},e.createTextureFromUrl=ot,e.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=o.default({async:!e.syncEvents,caseInsensitive:!0}),t=new Float32Array(16),r=new Float32Array(16),i=[0,0];Lt(e);var a=e.renderer,l=e.antiAliasing,p=void 0===l?.5:l,y=e.pixelAligned,m=void 0!==y&&y,b=e.backgroundColor,P=void 0===b?un:b,S=e.backgroundImage,E=void 0===S?null:S,M=e.canvas,I=void 0===M?document.createElement("canvas"):M,O=e.colorBy,D=void 0===O?an:O,z=e.deselectOnDblClick,N=void 0===z||z,F=e.deselectOnEscape,_=void 0===F||F,V=e.lassoColor,W=void 0===V?De:V,Z=e.lassoLineWidth,G=void 0===Z?2:Z,U=e.lassoMinDelay,K=void 0===U?10:U,q=e.lassoMinDist,H=void 0===q?3:q,Y=e.lassoMode,X=void 0===Y?null:Y,$=e.lassoClearEvent,J=void 0===$?ze:$,Q=e.lassoInitiator,ee=void 0!==Q&&Q,ne=e.lassoInitiatorParentElement,te=void 0===ne?document.body:ne,re=e.lassoLongPressIndicatorParentElement,oe=void 0===re?document.body:re,ie=e.lassoOnLongPress,ae=void 0!==ie&&ie,ce=e.lassoLongPressTime,le=void 0===ce?Ne:ce,se=e.lassoLongPressAfterEffectTime,ue=void 0===se?ke:se,de=e.lassoLongPressEffectDelay,ve=void 0===de?je:de,he=e.lassoLongPressRevertEffectTime,pe=void 0===he?Fe:he,we=e.lassoType,xe=void 0===we?"lasso":we,wn=e.lassoBrushSize,xn=void 0===wn?24:wn,En=e.actionKeyMap,Mn=void 0===En?Je:En,In=e.mouseMode,Cn=void 0===In?Ee:In,Tn=e.showReticle,Ln=void 0!==Tn&&Tn,On=e.reticleColor,Rn=void 0===On?gn:On,Bn=e.pointColor,Dn=void 0===Bn?cn:Bn,zn=e.pointColorActive,Nn=void 0===zn?ln:zn,kn=e.pointColorHover,jn=void 0===kn?sn:kn,Fn=e.showPointConnections,_n=void 0!==Fn&&Fn,Vn=e.pointConnectionColor,Wn=void 0===Vn?dn:Vn,Zn=e.pointConnectionColorActive,Gn=void 0===Zn?vn:Zn,Un=e.pointConnectionColorHover,Kn=void 0===Un?hn:Un,qn=e.pointConnectionColorBy,Hn=void 0===qn?fn:qn,Xn=e.pointConnectionOpacity,$n=void 0===Xn?null:Xn,Qn=e.pointConnectionOpacityBy,it=void 0===Qn?rn:Qn,at=e.pointConnectionOpacityActive,ct=void 0===at?.66:at,lt=e.pointConnectionSize,st=void 0===lt?2:lt,dt=e.pointConnectionSizeActive,vt=void 0===dt?2:dt,It=e.pointConnectionSizeBy,Tt=void 0===It?tn:It,Bt=e.pointConnectionMaxIntPointsPerSegment,Dt=void 0===Bt?100:Bt,zt=e.pointConnectionTolerance,Nt=void 0===zt?.002:zt,kt=e.pointSize,jt=void 0===kt?6:kt,Ft=e.pointSizeSelected,_t=void 0===Ft?2:Ft,Vt=e.pointSizeMouseDetection,Wt=void 0===Vt?"auto":Vt,Zt=e.pointOutlineWidth,Gt=void 0===Zt?2:Zt,Ut=e.opacity,Kt=void 0===Ut?me:Ut,qt=e.opacityBy,Ht=void 0===qt?on:qt,Yt=e.opacityByDensityFill,Xt=void 0===Yt?.15:Yt,$t=e.opacityInactiveMax,Jt=void 0===$t?1:$t,Qt=e.opacityInactiveScale,er=void 0===Qt?1:Qt,nr=e.sizeBy,tr=void 0===nr?nn:nr,rr=e.pointScaleMode,or=void 0===rr?"asinh":rr,ir=e.height,ar=void 0===ir?en:ir,cr=e.width,lr=void 0===cr?Qe:cr,sr=e.annotationLineColor,ur=void 0===sr?pn:sr,fr=e.annotationLineWidth,dr=void 0===fr?1:fr,vr=e.annotationHVLineLimit,hr=void 0===vr?1e3:vr,pr=e.cameraIsFixed,yr=void 0!==pr&&pr,mr=lr===me?1:lr,gr=ar===me?1:ar,wr=e.performanceMode,xr=void 0!==wr&&wr,br=e.opacityByDensityDebounceTime,Pr=void 0===br?25:br,Sr=e.spatialIndexUseWorker,Ar=void 0===Sr?undefined:Sr,Er=Boolean(e.renderPointsAsSquares||xr),Mr=Boolean(e.disableAlphaBlending||xr);Cn=rt(Ae,be)(Cn),a||(a=Et({regl:e.regl,gamma:e.gamma})),P=mt(P,!0),W=mt(W,!0),Rn=mt(Rn,!0);var Ir,Cr,Tr,Lr,Or,Rr,Br,Dr,zr,Nr,kr,jr,Fr,_r,Vr,Wr,Zr,Gr,Ur=!1,Kr=!1,qr=gt(P),Hr=!1,Yr=null,Xr=[0,0],$r=-1,Jr=[],Qr=new Set,eo=new Set,no=!1,to=new Set,ro=[],oo=0,io=0,ao=!1,co=[],lo=e.aspectRatio||1,so=!1,uo=!0,fo=!1;Dn=ht(Dn)?h(Dn):[Dn],Nn=ht(Nn)?h(Nn):[Nn],jn=ht(jn)?h(jn):[jn],Dn=Dn.map((function(e){return mt(e,!0)})),Nn=Nn.map((function(e){return mt(e,!0)})),jn=jn.map((function(e){return mt(e,!0)})),Kt=!Array.isArray(Kt)&&Number.isNaN(+Kt)?Dn[0][3]:Kt,Kt=et(Kt,nt,{minLength:1})?h(Kt):[Kt];var vo,ho,po,yo,mo=1/(jt=et(jt,nt,{minLength:1})?h(jt):[jt])[0];Wn="inherit"===Wn?h(Dn):(Wn=ht(Wn)?h(Wn):[Wn]).map((function(e){return mt(e,!0)})),Gn="inherit"===Gn?h(Nn):(Gn=ht(Gn)?h(Gn):[Gn]).map((function(e){return mt(e,!0)})),Kn="inherit"===Kn?h(jn):(Kn=ht(Kn)?h(Kn):[Kn]).map((function(e){return mt(e,!0)})),$n="inherit"===$n?h(Kt):et($n,nt,{minLength:1})?h($n):[$n],st="inherit"===st?h(jt):et(st,nt,{minLength:1})?h(st):[st],D=Ot(D,an),Ht=Ot(Ht,on,{allowDensity:!0}),tr=Ot(tr,nn),Hn=Ot(Hn,fn,{allowSegment:!0,allowInherit:!0}),it=Ot(it,rn,{allowSegment:!0}),Tt=Ot(Tt,tn,{allowSegment:!0});var go,wo,xo,bo,Po,So,Ao,Eo,Mo,Io,Co,To,Lo=0,Oo=0,Ro=!1,Bo=null,Do=Ln,zo=0,No=0,ko=!1,jo=!1,Fo=!1,_o=!1,Vo=Te,Wo=Te,Zo=!1,Go=e.xScale||null,Uo=e.yScale||null,Ko=0,qo=0,Ho=0,Yo=0;Go&&(Ko=Go.domain()[0],qo=Go.domain()[1]-Go.domain()[0],Go.range([0,mr])),Uo&&(Ho=Uo.domain()[0],Yo=Uo.domain()[1]-Uo.domain()[0],Uo.range([gr,0]));var Xo=function(e){return e/mr*2-1},$o=function(e){return 1+e/gr*-2},Jo=function(e,n){var r=[e,n,1,1];return B(r,r,T(t,L(t,Rr,L(t,Ir.view,Dr)))),r.slice(0,2)},Qo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=ia(),t=(Wr[1]-Zr[1])/I.height;return(_r*n+e)*t},ei=function(){return no?ro.filter((function(e,n){return to.has(n)})):ro},ni=function(e,n,t,r){var o=Lr.range(e,n,t,r);return no?o.filter((function(e){return to.has(e)})):o},ti=function(){var e,n=v([Xo(i[0]),$o(i[1])],2),t=n[0],r=n[1],o=v(Jo(t,r),2),a=o[0],c=o[1],l=Qo(4),u=l,f=-1,d=s(ni(a-l,c-l,a+l,c+l));try{for(d.s();!(e=d.n()).done;){var h=e.value,p=v(ro[h],2),y=p[0],m=p[1],g=Jn(y,m,a,c);g<u&&(u=g,f=h)}}catch(e){d.e(e)}finally{d.f()}return f},ri=function(e){var n,t,r,o,i,a=function(e){for(var n=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=0;i<e.length;i+=2)n=e[i]<n?e[i]:n,t=e[i]>t?e[i]:t,r=e[i+1]<r?e[i+1]:r,o=e[i+1]>o?e[i+1]:o;return[n,r,t,o]}(e);if(n=v(a,4),t=n[0],r=n[1],o=n[2],i=n[3],!(Number.isFinite(t)&&Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(i)&&o-t>0&&i-r>0))return[];var c,l=[],u=s(ni.apply(void 0,h(a)));try{for(u.s();!(c=u.n()).done;){var f=c.value;ut(e,ro[f])&&l.push(f)}}catch(e){u.e(e)}finally{u.f()}return l},oi=function(){co=[],Cr&&Cr.clear()},ii=function(e){return e&&e.length>4},ai=function(e,n){if(!kr&&_n&&ii(ro[e[0]])){var t,r=0===n,o=1===n?function(e){return eo.add(e)}:g,i=Object.keys(e.reduce((function(e,n){var t=ro[n];return e[Array.isArray(t[4])?t[4][0]:t[4]]=!0,e}),{})),a=zr.getData().opacities,c=i.filter((function(e){return!eo.has(+e)})),l=s(c);try{for(l.s();!(t=l.n()).done;){var u=t.value,f=Nr[u][0],d=Nr[u][2],v=4*f+2*Nr[u][3],h=v+2*d+4;void 0===a.__original__&&(a.__original__=a.slice());for(var p=v;p<h;p++)a[p]=r?a.__original__[p]:ct;o(u)}}catch(e){l.e(e)}finally{l.f()}zr.getBuffer().opacities.subdata(a,0)}},ci=function(e){return[e%Lo/Lo+Oo,Math.floor(e/Lo)/Lo+Oo]},li=function(e){return no&&!to.has(e)},si=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).preventEvent,t=void 0!==e&&e;J===Oe&&oi(),Jr.length>0&&(t||n.publish("deselect"),eo.clear(),ai(Jr,0),Jr=[],Qr.clear(),uo=!0)},ui=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.intersect,o=void 0!==r&&r,i=t.merge,a=void 0!==i&&i,c=t.remove,l=void 0!==c&&c,s=t.preventEvent,u=void 0!==s&&s,f=Array.isArray(e)?e:[e],d=h(Jr);if(o){var v=new Set(f);if(Jr=Jr.length>0?Jr.filter((function(e){return v.has(e)})):f,d.length===Jr.length)return void(uo=!0)}else if(a){if(Jr=((e,n)=>{const t=[];return e.forEach((e=>{t[e]=!0})),n.forEach((e=>{t[e]=!0})),t.reduce(((e,n,t)=>(n&&e.push(t),e)),[])})(Jr,f),d.length===Jr.length)return void(uo=!0)}else if(l){var p=new Set(f);if(Jr=Jr.filter((function(e){return!p.has(e)})),d.length===Jr.length)return void(uo=!0)}else{var y;if((null===(y=Jr)||void 0===y?void 0:y.length)>0&&ai(Jr,0),d.length>0&&0===f.length)return void si({preventEvent:u});Jr=f}if(w(d,Jr))uo=!0;else{var m=[];Qr.clear(),eo.clear();for(var g=Jr.length-1;g>=0;g--){var x=Jr[g];x<0||x>=oo||li(x)?Jr.splice(g,1):(Qr.add(x),m.push.apply(m,ci(x)))}wo({usage:"dynamic",type:"float",data:m}),ai(Jr,1),u||n.publish("select",{points:Jr}),uo=!0}},fi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.showReticleOnce,o=void 0!==r&&r,i=t.preventEvent,a=void 0!==i&&i,c=!1;if(!(no&&!to.has(e))&&e>=0&&e<oo){c=!0;var l=To,s=e!==To;+l>=0&&s&&!Qr.has(l)&&ai([l],0),To=e,xo.subdata(ci(e)),Qr.has(e)||ai([e],2),s&&!a&&n.publish("pointover",To)}else(c=+To>=0)&&(Qr.has(To)||ai([To],0),a||n.publish("pointout",To)),To=void 0;c&&(uo=!0,fo=o)},di=function(e){var n=I.getBoundingClientRect();return i[0]=e.clientX-n.left,i[1]=e.clientY-n.top,[].concat(i)},vi=Yn(I,{onStart:function(){Ir.config({isFixed:!0}),Hr=!0,ao=!0,oi(),$r>=0&&(clearTimeout($r),$r=-1),n.publish("lassoStart")},onDraw:function(e,t){co=e,Cr.setPoints(t),n.publish("lassoExtend",{coordinates:e})},onEnd:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.intersect,i=void 0!==o&&o,a=r.merge,c=void 0!==a&&a,l=r.remove,s=void 0!==l&&l;Ir.config({isFixed:yr}),co=h(e);var u=ri(t);ui(u,{intersect:i,merge:c,remove:s}),n.publish("lassoEnd",{coordinates:co}),J===Re&&oi()},enableInitiator:ee,initiatorParentElement:te,longPressIndicatorParentElement:oe,pointNorm:function(e){var n=v(e,2),t=n[0],r=n[1];return Jo(Xo(t),$o(r))},minDelay:K,minDist:"brush"===xe?Math.max(3,H):H,type:xe}),hi=function(e,n){switch(Mn[n]){case Ke:return e.altKey;case qe:return e.metaKey;case He:return e.ctrlKey;case Ye:return e.metaKey;case Xe:return e.shiftKey;default:return!1}},pi=function(e){jo&&1===e.buttons&&(Hr=!0,Yr=performance.now(),Xr=di(e),!(ao=Cn===Pe||hi(e,Ve))&&ae&&(vi.showLongPressIndicator(e.clientX,e.clientY,{time:le,extraTime:ue,delay:ve}),$r=setTimeout((function(){$r=-1,ao=!0}),le)))},yi=function(e){if(jo){if(Hr=!1,$r>=0&&(clearTimeout($r),$r=-1),ao){e.preventDefault(),ao=!1;var n=!!X;vi.end({intersect:n?"intersect"===X:hi(e,_e),merge:n?"merge"===X:hi(e,Ze),remove:n?"remove"===X:hi(e,Ge)})}ae&&vi.hideLongPressIndicator({time:pe})}},mi=function(e){if(jo){e.preventDefault();var n=di(e);if(!(Jn.apply(void 0,h(n).concat(h(Xr)))>=H)){var t=performance.now()-Yr;if(!ee||t<500){var r=ti();r>=0?(Jr.length>0&&J===Oe&&oi(),ui([r],{merge:hi(e,Ze),remove:hi(e,Ge)})):Vr||(Vr=setTimeout((function(){Vr=null,vi.showInitiator(e)}),200))}}}},gi=function(e){vi.hideInitiator(),Vr&&(clearTimeout(Vr),Vr=null),N&&(e.preventDefault(),si())},wi=function(e){if(_o||(Zo=function(e){return document.elementsFromPoint(e.clientX,e.clientY).some((function(e){return e===I}))}(e),_o=!0),jo&&(Zo||Hr)){var n=di(e),t=Jn.apply(void 0,h(n).concat(h(Xr)))>=H;Zo&&!ao&&fi(ti()),ao?(e.preventDefault(),vi.extend(e,!0)):Hr&&ae&&t&&vi.hideLongPressIndicator({time:pe}),$r>=0&&t&&(clearTimeout($r),$r=-1),Hr&&(uo=!0)}},xi=function(){To=void 0,Zo=!1,_o=!1,jo&&(+To>=0&&!Qr.has(To)&&ai([To],0),yi(),uo=!0)},bi=function(){var e=Math.max(jt.length,Kt.length);No=Math.max(2,Math.ceil(Math.sqrt(e)));for(var n=new Float32Array(4*Math.pow(No,2)),t=0;t<e;t++){n[4*t]=jt[t]||0,n[4*t+1]=Math.min(1,Kt[t]||0);var r=Number((Nn[t]||Nn[0])[3]);n[4*t+2]=Math.min(1,Number.isNaN(r)?1:r);var o=Number((jn[t]||jn[0])[3]);n[4*t+3]=Math.min(1,Number.isNaN(o)?1:o)}return a.regl.texture({data:n,shape:[No,No,4],type:"float"})},Pi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dn,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nn,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jn,r=e.length,o=n.length,i=t.length,a=[];if(r===o&&o===i)for(var c=0;c<r;c++)a.push(e[c],n[c],t[c],P);else for(var l=0;l<r;l++){var s=[e[l][0],e[l][1],e[l][2],1],u=D===an?n[0]:s,f=D===an?t[0]:s;a.push(e[l],u,f,P)}return a},Si=function(){var e=Pi(),n=e.length;zo=Math.max(2,Math.ceil(Math.sqrt(n)));var t=new Float32Array(4*Math.pow(zo,2));return e.forEach((function(e,n){t[4*n]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]})),a.regl.texture({data:t,shape:[zo,zo,4],type:"float"})},Ai=function(){Rr=R([],[1/(Or=mr/gr),1,1]),Br=R([],[1/Or,1,1]),Dr=R([],[lo,1,1])},Ei=function(e,n){return function(t){if(t&&0!==t.length){var r=h(e()),o=ht(t)?t:[t];if(o=o.map((function(e){return mt(e,!0)})),i=r,a=o,!(Array.isArray(i)&&Array.isArray(a)&&i.length===a.length&&(0===i.length||Array.isArray(i[0])&&Array.isArray(a[0])&&i.every((function(e,n){var t=v(e,4),r=t[0],o=t[1],i=t[2],c=t[3],l=v(a[n],4),s=l[0],u=l[1],f=l[2],d=l[3];return r===s&&o===u&&i===f&&c===d}))))){var i,a;Io&&Io.destroy();try{n(o),Io=Si()}catch(e){console.error("Invalid colors. Switching back to default colors."),n(r),Io=Si()}}}}},Mi=Ei((function(){return Dn}),(function(e){Dn=e})),Ii=Ei((function(){return Nn}),(function(e){Nn=e})),Ci=Ei((function(){return jn}),(function(e){jn=e})),Ti=function(){if(Go||Uo){var e,n,t,r,o,i,a=v((e=Jo(-1,-1),n=Jo(1,1),t=(e[0]+1)/2,r=(n[0]+1)/2,o=(e[1]+1)/2,i=(n[1]+1)/2,[[Ko+t*qo,Ko+r*qo],[Ho+o*Yo,Ho+i*Yo]]),2),c=a[0],l=a[1];Go&&Go.domain(c),Uo&&Uo.domain(l)}},Li=function(e,n){gr=Math.max(1,e),I.height=Math.floor(gr*window.devicePixelRatio),Uo&&(Uo.range([gr,0]),n||Ti())},Oi=function(e){if(e===me)return ar=e,I.style.height="100%",void window.requestAnimationFrame((function(){I&&Li(I.getBoundingClientRect().height)}));!+e||+e<=0||(Li(ar=+e),I.style.height="".concat(ar,"px"))},Ri=function(){_r=Wt,Wt===me&&(_r=Array.isArray(jt)?jt.reduce(((e,n)=>n>e?n:e),-1/0):jt)},Bi=function(e){var n=Array.isArray(jt)?h(jt):jt;et(e,nt,{minLength:1})?jt=h(e):tt(+e)&&(jt=[+e]),n===jt||w(n,jt)||(Co&&Co.destroy(),mo=1/jt[0],Co=bi(),Ri())},Di=function(e,n){mr=Math.max(1,e),I.width=Math.floor(mr*window.devicePixelRatio),Go&&(Go.range([0,mr]),n||Ti())},zi=function(e){if(e===me)return lr=e,I.style.width="100%",void window.requestAnimationFrame((function(){I&&Di(I.getBoundingClientRect().width)}));!+e||+e<=0||(Di(lr=+e),I.style.width="".concat(mr,"px"))},Ni=function(e){switch(e){case"valueZ":return Vo;case"valueW":return Wo;default:return null}},ki=function(e,n){return e===Ce?function(e){return Math.round(e*(n.length-1))}:g},ji=function(){return p},Fi=function(){return[I.width,I.height]},_i=function(){return Io},Vi=function(){return zo},Wi=function(){return.5/zo},Zi=function(){return window.devicePixelRatio},Gi=function(){return wo},Ui=function(){return Co},Ki=function(){return No},qi=function(){return.5/No},Hi=function(){return 0},Yi=function(){return po||vo},Xi=function(){return Lo},$i=function(){return.5/Lo},Ji=function(){return Br},Qi=function(){return Ir.view},ea=function(){return Dr},na=function(){return L(r,Br,L(r,Ir.view,Dr))},ta=function(){return window.devicePixelRatio},ra=function(){return pt(mo,Ir.scaling[0])*window.devicePixelRatio},oa=function(){return Ir.scaling[0]>1?Math.asinh(pt(1,Ir.scaling[0]))/Math.asinh(1)*window.devicePixelRatio:pt(mo,Ir.scaling[0])*window.devicePixelRatio},ia=oa;"linear"===or?ia=ra:"constant"===or&&(ia=ta);var aa=function(){return no?to.size:oo},ca=function(){return Jr.length},la=function(){return ca()>0?Jt:1},sa=function(){return ca()>0?er:1},ua=function(){return+("valueZ"===D)},fa=function(){return+("valueW"===D)},da=function(){return+("valueZ"===Ht)},va=function(){return+("valueW"===Ht)},ha=function(){return+("density"===Ht)},pa=function(){return+("valueZ"===tr)},ya=function(){return+("valueW"===tr)},ma=function(){return+m},ga=function(){return"valueZ"===D?Vo===Ce?Dn.length-1:1:Wo===Ce?Dn.length-1:1},wa=function(){return"valueZ"===Ht?Vo===Ce?Kt.length-1:1:Wo===Ce?Kt.length-1:1},xa=function(){return"valueZ"===tr?Vo===Ce?jt.length-1:1:Wo===Ce?jt.length-1:1},ba=function(e){if("density"!==Ht)return 1;var n=ia(),t=jt[0]*n,r=2/(2/Ir.view[0])*(2/(2/Ir.view[5])),o=e.viewportHeight,i=e.viewportWidth,a=Xt*i*o/(io*t*t)*yt(1,r);a*=Er?1:1/(.25*Math.PI);var c=pt(1,t)+.5;return a*=Math.pow(t/c,2),yt(1,pt(0,a))},Pa=a.regl({framebuffer:function(){return yo},vert:"precision highp float;\n\nattribute vec2 position;\nvarying vec2 particleTextureIndex;\n\nvoid main() {\n // map normalized device coords to texture coords\n particleTextureIndex = 0.5 * (1.0 + position);\n\n gl_Position = vec4(position, 0, 1);\n}",frag:"precision highp float;\n\nuniform sampler2D startStateTex;\nuniform sampler2D endStateTex;\nuniform float t;\n\nvarying vec2 particleTextureIndex;\n\nvoid main() {\n // Interpolate x, y, and value\n vec3 start = texture2D(startStateTex, particleTextureIndex).xyw;\n vec3 end = texture2D(endStateTex, particleTextureIndex).xyw;\n vec3 curr = start * (1.0 - t) + end * t;\n\n // The category cannot be interpolated\n float endCategory = texture2D(endStateTex, particleTextureIndex).z;\n\n gl_FragColor = vec4(curr.xy, endCategory, curr.z);\n}",attributes:{position:[-4,0,4,4,4,-4]},uniforms:{startStateTex:function(){return ho},endStateTex:function(){return vo},t:function(e,n){return n.t}},count:3}),Sa=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:la,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:sa;return a.regl({frag:Er?"precision highp float;\n\nvarying vec4 color;\n\nvoid main() {\n gl_FragColor = color;\n}\n":"\nprecision highp float;\n\nuniform float antiAliasing;\n\nvarying vec4 color;\nvarying float finalPointSize;\n\nfloat linearstep(float edge0, float edge1, float x) {\n return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\n\nvoid main() {\n vec2 c = gl_PointCoord * 2.0 - 1.0;\n float sdf = length(c) * finalPointSize;\n float alpha = linearstep(finalPointSize + antiAliasing, finalPointSize - antiAliasing, sdf);\n\n gl_FragColor = vec4(color.rgb, alpha * color.a);\n}\n",vert:Mt(r),blend:{enable:!Mr,func:{srcRGB:"src alpha",srcAlpha:"one",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},depth:{enable:!1},attributes:{stateIndex:{buffer:t,size:2}},uniforms:{antiAliasing:ji,resolution:Fi,modelViewProjection:na,devicePixelRatio:Zi,pointScale:function(){return ia()},encodingTex:Ui,encodingTexRes:Ki,encodingTexEps:qi,pointOpacityMax:o,pointOpacityScale:i,pointSizeExtra:e,globalState:r,colorTex:_i,colorTexRes:Vi,colorTexEps:Wi,stateTex:Yi,stateTexRes:Xi,stateTexEps:$i,isColoredByZ:ua,isColoredByW:fa,isOpacityByZ:da,isOpacityByW:va,isOpacityByDensity:ha,isSizedByZ:pa,isSizedByW:ya,isPixelAligned:ma,colorMultiplicator:ga,opacityMultiplicator:wa,opacityDensity:ba,sizeMultiplicator:xa,numColorStates:4,drawingBufferWidth:function(e){return e.drawingBufferWidth},drawingBufferHeight:function(e){return e.drawingBufferHeight}},count:n,primitive:"points"})},Aa=Sa(Hi,aa,(function(){return go})),Ea=Sa(Hi,(function(){return 1}),(function(){return xo}),2,(function(){return 1}),(function(){return 1})),Ma=Sa((function(){return(_t+2*Gt)*window.devicePixelRatio}),ca,Gi,1,(function(){return 1}),(function(){return 1})),Ia=Sa((function(){return(_t+Gt)*window.devicePixelRatio}),ca,Gi,3,(function(){return 1}),(function(){return 1})),Ca=Sa((function(){return _t*window.devicePixelRatio}),ca,Gi,1,(function(){return 1}),(function(){return 1})),Ta=a.regl({frag:"\nprecision mediump float;\n\nuniform sampler2D texture;\n\nvarying vec2 uv;\n\nvoid main () {\n gl_FragColor = texture2D(texture, uv);\n}\n",vert:"\nprecision mediump float;\n\nuniform mat4 modelViewProjection;\n\nattribute vec2 position;\n\nvarying vec2 uv;\n\nvoid main () {\n uv = position;\n gl_Position = modelViewProjection * vec4(-1.0 + 2.0 * uv.x, 1.0 - 2.0 * uv.y, 0, 1);\n}\n",attributes:{position:[0,1,0,0,1,0,0,1,1,1,1,0]},uniforms:{modelViewProjection:na,texture:function(){return E}},count:6}),La=a.regl({vert:"\n precision mediump float;\n uniform mat4 modelViewProjection;\n attribute vec2 position;\n void main () {\n gl_Position = modelViewProjection * vec4(position, 0, 1);\n }",frag:"\n precision mediump float;\n uniform vec4 color;\n void main () {\n gl_FragColor = vec4(color.rgb, 0.2);\n }",depth:{enable:!1},blend:{enable:!0,func:{srcRGB:"src alpha",srcAlpha:"one",dstRGB:"one minus src alpha",dstAlpha:"one minus src alpha"}},attributes:{position:function(){return co}},uniforms:{modelViewProjection:na,color:function(){return W}},elements:function(){return j(Cr.getPoints())}}),Oa=function(e){for(var n=new Float32Array(2*e),t=0,r=0;r<e;++r){var o=ci(r);n[t]=o[0],n[t+1]=o[1],t+=2}return n},Ra=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.length;Lo=Math.max(2,Math.ceil(Math.sqrt(t))),Oo=.5/Lo;for(var r=new Float32Array(4*Math.pow(Lo,2)),o=!0,i=!0,c=0,l=0,s=0,u=0;u<t;++u)r[c=4*u]=e[u][0],r[c+1]=e[u][1],l=e[u][2]||0,s=e[u][3]||0,r[c+2]=l,r[c+3]=s,o&&(o=Number.isInteger(l)),i&&(i=Number.isInteger(s));return Vo=n.z&&Le.includes(n.z)?n.z:o?Te:Ce,Wo=n.w&&Le.includes(n.w)?n.w:i?Te:Ce,a.regl.texture({data:r,shape:[Lo,Lo,4],type:"float"})},Ba=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(t){jo=!1;var r=(null==n?void 0:n.preventFilterReset)&&e.length===oo;oo=e.length,io=oo,vo&&vo.destroy(),vo=Ra(e,{z:n.zDataType,w:n.wDataType}),r||go({usage:"static",type:"float",data:Oa(oo)}),ye(n.spatialIndex||e,{useWorker:Ar}).then((function(n){Lr=n,ro=e,jo=!0})).then(t)}))},Da=function(e,n){bo=Ir.target,Po=e,So=Ir.distance[0],Ao=n},za=function(e){var n="inherit"===Hn?D:Hn;if("segment"===n){var t=Wn.length-1;return t<1?[]:e.reduce((function(e,n,r){for(var o=0,i=[],a=2;a<n.length;a+=2){var c=Math.sqrt(Math.pow(n[a-2]-n[a],2)+Math.pow(n[a-1]-n[a+1],2));i.push(c),o+=c}e[r]=[0];for(var l=0,s=0;s<n.length/2-1;s++)l+=i[s],e[r].push(4*Math.floor(l/o*t));return e}),[])}if(n){var r=Rt(n),o=ki(Ni(n),"inherit"===Hn?Dn:Wn);return Nr.reduce((function(e,n){var t=v(n,2),i=t[0],a=t[1];return e[i]=4*o(a[r]),e}),[])}return new Array(Nr.length).fill(0)},Na=function(){var e="inherit"===it?Ht:it;if("segment"===e){var n=$n.length-1;return n<1?[]:Nr.reduce((function(e,t){var r=v(t,3),o=r[0];r[1];var i=r[2];return e[o]=x(i,(function(e){return $n[Math.floor(e/(i-1)*n)]})),e}),[])}if(e){var t=Rt(e),r="inherit"===it?Kt:$n,o=ki(Ni(e),r);return Nr.reduce((function(e,n){var i=v(n,2),a=i[0],c=i[1];return e[a]=r[o(c[t])],e}),[])}},ka=function(){var e="inherit"===Tt?tr:Tt;if("segment"===e){var n=st.length-1;return n<1?[]:Nr.reduce((function(e,t){var r=v(t,3),o=r[0];r[1];var i=r[2];return e[o]=x(i,(function(e){return st[Math.floor(e/(i-1)*n)]})),e}),[])}if(e){var t=Rt(e),r="inherit"===Tt?jt:st,o=ki(Ni(e),r);return Nr.reduce((function(e,n){var i=v(n,2),a=i[0],c=i[1];return e[a]=r[o(c[t])],e}),[])}},ja=function(e){return new Promise((function(n){zr.setPoints([]),(null==e?void 0:e.length)>0?(kr=!0,Ct(e,{maxIntPointsPerSegment:Dt,tolerance:Nt}).then((function(e){!function(e){Nr=[];var n=0;Object.keys(e).forEach((function(t,r){Nr[t]=[r,e[t].reference,e[t].length/2,n],n+=e[t].length/2}))}(e);var t=Object.values(e);zr.setPoints(1===t.length?t[0]:t,{colorIndices:za(t),opacities:Na(),widths:ka()}),kr=!1,n()}))):n()}))},Fa=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).preventEvent,r=void 0!==t&&t;no=!0,to.clear();var o,i=Array.isArray(e)?e:[e],a=[],c=[],l=[],u=s(i);try{for(u.s();!(o=u.n()).done;){var f=o.value;!Number.isFinite(f)||f<0||f>=oo||(a.push(f),to.add(f),Qr.has(f)&&l.push(f))}}catch(e){u.e(e)}finally{u.f()}var d,v=s(function(e){for(var n=e.length,t=1;t<n;t++){for(var r=e[t],o=t-1;o>-1&&r<e[o];)e[o+1]=e[o],o--;e[o+1]=r}return e}([].concat(a)));try{for(v.s();!(d=v.n()).done;){var h=d.value;c.push.apply(c,ci(h))}}catch(e){v.e(e)}finally{v.f()}return go.subdata(c),ui(l,{preventEvent:r}),to.has(To)||fi(-1,{preventEvent:r}),new Promise((function(e){var t=function(){n.subscribe("draw",(function(){r||n.publish("filter",{points:a}),e()}),1),uo=!0};_n||ii(ro[0])?ja(ei()).then((function(){r||n.publish("pointConnectionsDraw"),ui(l,{preventEvent:r}),t()})):t()}))},_a=function(){return ni(Zr[0],Zr[1],Wr[0],Wr[1])},Va=A((function(){io=_a().length}),Pr),Wa=function(){return Boolean(ho&&po)},Za=function(){return Boolean(void 0!==bo&&void 0!==Po&&void 0!==So&&void 0!==Ao)},Ga=function(e,n){Bo||(Bo=performance.now());var t,r,o,i=performance.now()-Bo,a=(t=n(i/e),r=0,o=1,Math.min(o,Math.max(r,t)));return Wa()&&Pa({t:a}),Za()&&function(e){var n=v(bo,2),t=n[0],r=n[1],o=v(Po,2),i=1-e,a=t*i+o[0]*e,c=r*i+o[1]*e,l=So*i+Ao*e;Ir.lookAt([a,c],l)}(a),i<e},Ua=function(){Ro=!1,Bo=null,Eo=void 0,Mo=void 0,Ln=Do,ho&&(ho.destroy(),ho=void 0),po&&(po.destroy(),po=void 0),bo=void 0,Po=void 0,So=void 0,Ao=void 0,n.publish("transitionEnd")},Ka=function(e){var t=e.duration,r=void 0===t?500:t,o=e.easing,i=void 0===o?Ie:o;Ro&&n.publish("transitionEnd"),Ro=!0,Bo=null,Eo=r,Mo=ft(i)?Me[i]||Ie:i,Do=Ln,Ln=!1,n.publish("transitionStart")},qa=function(e){return Kr?Promise.reject(new An):(Fo=!1,0===e.length?new Promise((function(e){Tr.clear(),n.subscribe("draw",e,1),Fo=!0,uo=!0})):new Promise((function(t){var r,o=[],i=new Map,a=[],c=[],l=-1,u=function(e){c.push(e.lineWidth||dr);var n=mt(e.lineColor||ur,!0),t="[".concat(n.join(","),"]");if(i.has(t)){var r=i.get(t).idx;a.push(r)}else{var o=++l;i.set(t,{idx:o,color:n}),a.push(o)}},f=s(e);try{for(f.s();!(r=f.n()).done;){var d,v,h,p,y=r.value;if(xt(y))o.push([null!==(d=y.x1)&&void 0!==d?d:-hr,y.y,null!==(v=y.x2)&&void 0!==v?v:hr,y.y]),u(y);else if(bt(y))o.push([y.x,null!==(h=y.y1)&&void 0!==h?h:-hr,y.x,null!==(p=y.y2)&&void 0!==p?p:hr]),u(y);else St(y)?(o.push([y.x1,y.y1,y.x2,y.y1,y.x2,y.y2,y.x1,y.y2,y.x1,y.y1]),u(y)):Pt(y)?(o.push([y.x,y.y,y.x+y.width,y.y,y.x+y.width,y.y+y.height,y.x,y.y+y.height,y.x,y.y]),u(y)):At(y)&&(o.push(y.vertices.flatMap(g)),u(y))}}catch(e){f.e(e)}finally{f.f()}Tr.setStyle({color:Array.from(i.values()).sort((function(e,n){return e.idx>n.idx?1:-1})).map((function(e){return e.color}))}),Tr.setPoints(1===o.length?o.flat():o,{colorIndices:a,widths:c}),n.subscribe("draw",t,1),Fo=!0,uo=!0})))},Ha=function(e){return function(){var t=e.apply(void 0,arguments);return uo=!0,new Promise((function(e){n.subscribe("draw",(function(){return e(t)}),1)}))}},Ya=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r){var o=B([],[e.x+e.width/2,e.y+e.height/2,0,0],Dr).slice(0,2),i=2*Math.atan(1),a=Or/lo,c=e.height*a>=e.width?e.height/2/Math.tan(i/2):e.width/2/Math.tan(i/2)/a;t.transition?(Ir.config({isFixed:!0}),Da(o,c),n.subscribe("transitionEnd",(function(){r(),Ir.config({isFixed:yr})}),1),Ka({duration:t.transitionDuration,easing:t.transitionEasing})):(Ir.lookAt(o,c),n.subscribe("draw",r,1),uo=!0)}))},Xa=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(o){r.transition?(Ir.config({isFixed:!0}),Da(e,t),n.subscribe("transitionEnd",(function(){o(),Ir.config({isFixed:yr})}),1),Ka({duration:r.transitionDuration,easing:r.transitionEasing})):(Ir.lookAt(e,t),n.subscribe("draw",o,1),uo=!0)}))},$a=function(){zr.setStyle({color:Pi(Wn,Gn,Kn),opacity:null===$n?null:$n[0],width:st[0]})},Ja=function(){var e=Math.round(qr)>.5?0:255;vi.initiator.style.border="1px dashed rgba(".concat(e,", ").concat(e,", ").concat(e,", 0.33)"),vi.initiator.style.background="rgba(".concat(e,", ").concat(e,", ").concat(e,", 0.1)")},Qa=function(){var e=Math.round(qr)>.5?0:255;vi.longPressIndicator.style.color="rgb(".concat(e,", ").concat(e,", ").concat(e,")"),vi.longPressIndicator.dataset.color="rgb(".concat(e,", ").concat(e,", ").concat(e,")");var n=W.map((function(e){return Math.round(255*e)}));vi.longPressIndicator.dataset.activeColor="rgb(".concat(n[0],", ").concat(n[1],", ").concat(n[2],")")},ec=function(e){e&&Ir.setView(e)},nc=function(e){(Mn=Object.entries(e).reduce((function(e,n){var t=v(n,2),r=t[0],o=t[1];return $e.includes(o)&&Ue.includes(r)&&(e[r]=o),e}),{}))[We]?Ir.config({isRotate:!0,mouseDownMoveModKey:Mn[We]}):Ir.config({isRotate:!1})},tc=function(e,n){return function(t){if("inherit"===t)e(h(n()));else{var r=ht(t)?t:[t];e(r.map((function(e){return mt(e,!0)})))}$a()}},rc=tc((function(e){Wn=e}),(function(){return Dn})),oc=tc((function(e){Gn=e}),(function(){return Nn})),ic=tc((function(e){Kn=e}),(function(){return jn})),ac=function(e){p=Number(e)||.5},cc=function(e){m=Boolean(e)},lc=function(){var e,t,r,o,i,c,l,s,u,f,d,v,p,y,m,g,x,b,S,A,M,C,T,L,O,R,B,z,k,j,F,V,Z,U,q,Y,$,Q,ne,re,ie,ce,se,fe,de,he,ye=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Kr?Promise.reject(new Error(An)):(Lt(ye),void 0===ye.backgroundColor&&void 0===ye.background||(e=ye.backgroundColor||ye.background)&&(P=mt(e,!0),qr=gt(P),Ja(),Qa()),void 0!==ye.backgroundImage&&((t=ye.backgroundImage)?ft(t)?ot(a.regl,t).then((function(e){E=e,uo=!0,n.publish("backgroundImageReady")})).catch((function(){console.error("Count not create texture from ".concat(t)),E=null})):E="texture2d"===t._reglType?t:null:E=null),void 0!==ye.cameraTarget&&(r=ye.cameraTarget)&&Ir.lookAt(r,Ir.distance[0],Ir.rotation),void 0!==ye.cameraDistance&&(o=ye.cameraDistance)>0&&Ir.lookAt(Ir.target,o,Ir.rotation),void 0!==ye.cameraRotation&&null!==(i=ye.cameraRotation)&&Ir.lookAt(Ir.target,Ir.distance[0],i),void 0!==ye.cameraView&&ec(ye.cameraView),void 0!==ye.cameraIsFixed&&(c=ye.cameraIsFixed,yr=Boolean(c),Ir.config({isFixed:yr})),void 0!==ye.colorBy&&(l=ye.colorBy,D=Ot(l,an)),void 0!==ye.pointColor&&Mi(ye.pointColor),void 0!==ye.pointColorActive&&Ii(ye.pointColorActive),void 0!==ye.pointColorHover&&Ci(ye.pointColorHover),void 0!==ye.pointSize&&Bi(ye.pointSize),void 0!==ye.pointSizeSelected&&(!+(s=ye.pointSizeSelected)||+s<0||(_t=+s)),void 0!==ye.pointSizeMouseDetection&&(u=ye.pointSizeMouseDetection,Wt=u,Ri()),void 0!==ye.sizeBy&&function(e){tr=Ot(e,nn)}(ye.sizeBy),void 0!==ye.opacity&&(f=ye.opacity,d=Array.isArray(Kt)?h(Kt):Kt,et(f,nt,{minLength:1})?Kt=h(f):tt(+f)&&(Kt=[+f]),d===Kt||w(d,Kt)||(Co&&Co.destroy(),Co=bi())),void 0!==ye.showPointConnections&&(v=ye.showPointConnections,(_n=!!v)?jo&&ii(ro[0])&&ja(ei()).then((function(){n.publish("pointConnectionsDraw"),uo=!0})):ja()),void 0!==ye.pointConnectionColor&&rc(ye.pointConnectionColor),void 0!==ye.pointConnectionColorActive&&oc(ye.pointConnectionColorActive),void 0!==ye.pointConnectionColorHover&&ic(ye.pointConnectionColorHover),void 0!==ye.pointConnectionColorBy&&function(e){Hn=Ot(e,fn,{allowSegment:!0,allowInherit:!0})}(ye.pointConnectionColorBy),void 0!==ye.pointConnectionOpacityBy&&function(e){it=Ot(e,rn,{allowSegment:!0})}(ye.pointConnectionOpacityBy),void 0!==ye.pointConnectionOpacity&&function(e){et(e,nt,{minLength:1})&&($n=h(e)),tt(+e)&&($n=[+e]),Wn=Wn.map((function(e){return e[3]=Number.isNaN(+$n[0])?e[3]:+$n[0],e})),$a()}(ye.pointConnectionOpacity),void 0!==ye.pointConnectionOpacityActive&&function(e){!Number.isNaN(+e)&&+e&&(ct=+e)}(ye.pointConnectionOpacityActive),void 0!==ye.pointConnectionSize&&(p=ye.pointConnectionSize,et(p,nt,{minLength:1})&&(st=h(p)),tt(+p)&&(st=[+p]),$a()),void 0!==ye.pointConnectionSizeActive&&(y=ye.pointConnectionSizeActive,!Number.isNaN(+y)&&+y&&(vt=Math.max(0,y))),void 0!==ye.pointConnectionSizeBy&&function(e){Tt=Ot(e,tn,{allowSegment:!0})}(ye.pointConnectionSizeBy),void 0!==ye.pointConnectionMaxIntPointsPerSegment&&(m=ye.pointConnectionMaxIntPointsPerSegment,Dt=Math.max(0,m)),void 0!==ye.pointConnectionTolerance&&(g=ye.pointConnectionTolerance,Nt=Math.max(0,g)),void 0!==ye.pointScaleMode&&function(e){switch(e){case"linear":or=e,ia=ra;break;case"constant":or=e,ia=ta;break;default:or="asinh",ia=oa}}(ye.pointScaleMode),void 0!==ye.opacityBy&&function(e){Ht=Ot(e,on,{allowDensity:!0})}(ye.opacityBy),void 0!==ye.lassoColor&&function(e){if(e){W=mt(e,!0),Cr.setStyle({color:W});var n=W.map((function(e){return Math.round(255*e)}));vi.longPressIndicator.dataset.activeColor="rgb(".concat(n[0],", ").concat(n[1],", ").concat(n[2],")")}}(ye.lassoColor),void 0!==ye.lassoLineWidth&&(x=ye.lassoLineWidth,Number.isNaN(+x)||+x<1||(G=+x,Cr.setStyle({width:G}))),void 0!==ye.lassoMinDelay&&+(b=ye.lassoMinDelay)&&(K=+b,vi.set({minDelay:K})),void 0!==ye.lassoMinDist&&+(S=ye.lassoMinDist)&&(H=+S,vi.set({minDist:H})),void 0!==ye.lassoClearEvent&&(A=ye.lassoClearEvent,J=rt(Be,J)(A)),void 0!==ye.lassoInitiator&&(M=ye.lassoInitiator,ee=Boolean(M),vi.set({enableInitiator:ee})),void 0!==ye.lassoInitiatorParentElement&&(C=ye.lassoInitiatorParentElement,te=C,vi.set({initiatorParentElement:te})),void 0!==ye.lassoLongPressIndicatorParentElement&&(T=ye.lassoLongPressIndicatorParentElement,oe=T,vi.set({longPressIndicatorParentElement:oe})),void 0!==ye.lassoOnLongPress&&(L=ye.lassoOnLongPress,ae=Boolean(L)),void 0!==ye.lassoLongPressTime&&(O=ye.lassoLongPressTime,le=Number(O)),void 0!==ye.lassoLongPressAfterEffectTime&&(R=ye.lassoLongPressAfterEffectTime,ue=Number(R)),void 0!==ye.lassoLongPressEffectDelay&&(B=ye.lassoLongPressEffectDelay,ve=Number(B)),void 0!==ye.lassoLongPressRevertEffectTime&&function(e){pe=Number(e)}(ye.lassoLongPressRevertEffectTime),void 0!==ye.lassoType&&("brush"===(z=ye.lassoType)?vi.set({type:z,minDist:Math.max(3,H)}):vi.set({type:z,minDist:H}),xe=vi.get("type")),void 0!==ye.lassoMode&&(k=ye.lassoMode,X=k),void 0!==ye.lassoBrushSize&&(j=ye.lassoBrushSize,xn=Number(j)||xn,vi.set({brushSize:xn})),void 0!==ye.actionKeyMap&&nc(ye.actionKeyMap),void 0!==ye.mouseMode&&(F=ye.mouseMode,Cn=rt(Ae,be)(F),Ir.config({defaultMouseDownMoveAction:Cn===Se?"rotate":"pan"})),void 0!==ye.showReticle&&null!==(V=ye.showReticle)&&(Ln=V),void 0!==ye.reticleColor&&(Z=ye.reticleColor)&&(Rn=mt(Z,!0),jr.setStyle({color:Rn}),Fr.setStyle({color:Rn})),void 0!==ye.pointOutlineWidth&&(!+(U=ye.pointOutlineWidth)||+U<0||(Gt=+U)),void 0!==ye.height&&Oi(ye.height),void 0!==ye.width&&zi(ye.width),void 0!==ye.aspectRatio&&(+(q=ye.aspectRatio)<=0||(lo=q)),void 0!==ye.xScale&&(Y=ye.xScale)&&(Go=Y,Ko=Y.domain()[0],qo=Y?Y.domain()[1]-Y.domain()[0]:0,Go.range([0,mr]),Ti()),void 0!==ye.yScale&&($=ye.yScale)&&(Ho=(Uo=$).domain()[0],Yo=Uo?Uo.domain()[1]-Uo.domain()[0]:0,Uo.range([gr,0]),Ti()),void 0!==ye.deselectOnDblClick&&(Q=ye.deselectOnDblClick,N=!!Q),void 0!==ye.deselectOnEscape&&(ne=ye.deselectOnEscape,_=!!ne),void 0!==ye.opacityByDensityFill&&(re=ye.opacityByDensityFill,Xt=+re),void 0!==ye.opacityInactiveMax&&(ie=ye.opacityInactiveMax,Jt=+ie),void 0!==ye.opacityInactiveScale&&(ce=ye.opacityInactiveScale,er=+ce),void 0!==ye.gamma&&(se=ye.gamma,a.gamma=se),void 0!==ye.annotationLineColor&&(fe=ye.annotationLineColor,ur=mt(fe)),void 0!==ye.annotationLineWidth&&(de=ye.annotationLineWidth,dr=+de),void 0!==ye.annotationHVLineLimit&&(he=ye.annotationHVLineLimit,hr=+he),void 0!==ye.antiAliasing&&ac(ye.antiAliasing),void 0!==ye.pixelAligned&&cc(ye.pixelAligned),new Promise((function(e){window.requestAnimationFrame((function(){!Kr&&I&&(Ai(),Ir.refresh(),a.refresh(),wc(),e())}))})))},sc=function(){Ir||(Ir=k(I,{isFixed:yr,isPanInverted:[!1,!0],defaultMouseDownMoveAction:Cn===Se?"rotate":"pan"})),e.cameraView?Ir.setView(C(e.cameraView)):e.cameraTarget||e.cameraDistance||e.cameraRotation?Ir.lookAt(h(e.cameraTarget||yn),e.cameraDistance||1,e.cameraRotation||0):Ir.setView(C(mn)),Wr=Jo(1,1),Zr=Jo(-1,-1)},uc=function(e){if("Escape"===e.key)_&&si()},fc=function(){Zo=!0,_o=!0},dc=function(){fi(),Zo=!1,_o=!0,uo=!0},vc=function(){uo=!0},hc=function(){Ba([]),zr.clear()},pc=function(){qa([])},yc=function(){var e=lr===me,n=ar===me;if(e||n){var t=I.getBoundingClientRect(),r=t.width,o=t.height;e&&Di(r,!0),n&&Li(o,!0),Ai(),Ti(),uo=!0}Ir.refresh()},mc=function(){var e,t=(e=d().mark((function e(t){var r,o,i,c,l,s,u,f,v,h,y,g,w;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I.style.userSelect="none",r=window.devicePixelRatio,o=jt,i=lr,c=ar,l=a.canvas.width/r,s=a.canvas.height/r,u=m,f=p,v=(null==t?void 0:t.scale)||1,h=Array.isArray(jt)?jt.map((function(e){return e*v})):jt*v,y=mr*v,g=gr*v,Bi(h),zi(y),Oi(g),cc((null==t?void 0:t.pixelAligned)||m),ac((null==t?void 0:t.antiAliasing)||p),a.resize(lr,ar),a.refresh(),e.next=22,new Promise((function(e){n.subscribe("draw",e,1),wc()}));case 22:return w=I.getContext("2d").getImageData(0,0,I.width,I.height),a.resize(l,s),a.refresh(),Bi(o),zi(i),Oi(c),cc(u),ac(f),e.next=32,new Promise((function(e){n.subscribe("draw",e,1),wc()}));case 32:return I.style.userSelect=null,e.abrupt("return",w);case 34:case"end":return e.stop()}}),e)})),function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function a(e){c(i,r,o,a,l,"next",e)}function l(e){c(i,r,o,a,l,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}(),gc=a.onFrame((function(){if(ko=Ir.tick(),(jo||Fo)&&(uo||Ro)){Ro&&!Ga(Eo,Mo)&&Ua(),ko&&(Wr=Jo(1,1),Zr=Jo(-1,-1),"density"===Ht&&Va()),a.render((function(){var e;!function(e,n){Br[0]=e/Or,Br[5]=n}(I.width/a.canvas.width,I.height/a.canvas.height),null!==(e=E)&&void 0!==e&&e._reglType&&Ta(),co.length>2&&La(),Ro||zr.draw({projection:Ji(),model:ea(),view:Qi()});var n=aa();jo&&n>0&&Aa(),Hr||!Ln&&!fo||function(){if(To>=0){var e=v(ro[To].slice(0,2),2),n=[e[0],e[1],0,1];L(t,Br,L(t,Ir.view,Dr)),B(n,n,t),jr.setPoints([-1,n[1],1,n[1]]),Fr.setPoints([n[0],1,n[0],-1]),jr.draw(),Fr.draw(),Sa((function(){return(_t+2*Gt)*window.devicePixelRatio}),(function(){return 1}),xo,1)(),Sa((function(){return(_t+Gt)*window.devicePixelRatio}),(function(){return 1}),xo,3)()}}(),To>=0&&Ea(),Jr.length>0&&(Ma(),Ia(),Ca()),Tr.draw({projection:Ji(),model:ea(),view:Qi()}),Cr.draw({projection:Ji(),model:ea(),view:Qi()})}),I);var e={view:Ir.view,isViewChanged:ko,camera:Ir,xScale:Go,yScale:Uo};ko&&(Ti(),so?so=!1:n.publish("view",e)),uo=!1,fo=!1,n.publish("drawing",e,{async:!1}),n.publish("draw",e)}})),wc=function(){uo=!0};return function(){Ai(),sc(),Ti(),Cr=fe(a.regl,{color:W,width:G,is2d:!0}),zr=fe(a.regl,{color:Pi(Wn,Gn,Kn),opacity:null===$n?null:$n[0],width:st[0],is2d:!0}),jr=fe(a.regl,{color:Rn,width:1,is2d:!0}),Fr=fe(a.regl,{color:Rn,width:1,is2d:!0}),Tr=fe(a.regl,{color:ur,width:dr,is2d:!0}),Ri(),I.addEventListener("wheel",vc),go=a.regl.buffer(),wo=a.regl.buffer(),xo=a.regl.buffer({usage:"dynamic",type:"float",length:2*ge}),Io=Si(),Co=bi();var e=lc({backgroundImage:E,width:lr,height:ar,actionKeyMap:Mn});Ja(),Qa(),window.addEventListener("keyup",uc,!1),window.addEventListener("blur",xi,!1),window.addEventListener("mouseup",yi,!1),window.addEventListener("mousemove",wi,!1),I.addEventListener("mousedown",pi,!1),I.addEventListener("mouseenter",fc,!1),I.addEventListener("mouseleave",dc,!1),I.addEventListener("click",mi,!1),I.addEventListener("dblclick",gi,!1),"ResizeObserver"in window?(Gr=new ResizeObserver(yc)).observe(I):(window.addEventListener("resize",yc),window.addEventListener("orientationchange",yc)),e.then((function(){n.publish("init")}))}(),{get isSupported(){return a.isSupported},clear:Ha((function(){hc(),pc()})),clearPoints:Ha(hc),clearPointConnections:Ha((function(){zr.clear()})),clearAnnotations:Ha(pc),createTextureFromUrl:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bn;return ot(a.regl,e,n)},deselect:si,destroy:function(){jo=!1,Fo=!1,Kr=!0,gc(),window.removeEventListener("keyup",uc,!1),window.removeEventListener("blur",xi,!1),window.removeEventListener("mouseup",yi,!1),window.removeEventListener("mousemove",wi,!1),I.removeEventListener("mousedown",pi,!1),I.removeEventListener("mouseenter",fc,!1),I.removeEventListener("mouseleave",dc,!1),I.removeEventListener("click",mi,!1),I.removeEventListener("dblclick",gi,!1),I.removeEventListener("wheel",vc,!1),Gr?Gr.disconnect():(window.removeEventListener("resize",yc),window.removeEventListener("orientationchange",yc)),I=void 0,Ir.dispose(),Ir=void 0,Cr.destroy(),vi.destroy(),zr.destroy(),jr.destroy(),Fr.destroy(),Io&&Io.destroy(),Co&&Co.destroy(),e.renderer||a.isDestroyed||a.destroy(),n.publish("destroy"),n.clear()},draw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Kr?Promise.reject(new Error(An)):Ur?Promise.reject(new Error("Ignoring draw call as the previous draw call has not yet finished. To avoid this warning `await` the draw call.")):(Ur=!0,wt(e).then((function(e){return new Promise((function(r){if(Kr)r();else{var o=!1;t.preventFilterReset&&(null==e?void 0:e.length)===oo||(no=!1,to.clear());var i=e&&ii(e[0])&&(_n||t.showPointConnectionsOnce),c=t.zDataType,l=t.wDataType;new Promise((function(s){e?(t.transition&&(e.length===oo?o=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!vo)return!1;if(Ro){var t=ho;ho=po,t.destroy()}else ho=vo;return po=Ra(e,n),yo=a.regl.framebuffer({color:po,depth:!1,stencil:!1}),vo=void 0,!0}(e,{z:c,w:l}):console.warn("Cannot transition! The number of points between the previous and current draw call must be identical.")),Ba(e,{zDataType:c,wDataType:l,preventFilterReset:t.preventFilterReset,spatialIndex:t.spatialIndex}).then((function(){void 0!==t.hover&&fi(t.hover,{preventEvent:!0}),void 0!==t.select&&ui(t.select,{preventEvent:!0}),void 0!==t.filter&&Fa(t.filter,{preventEvent:!0}),i?ja(e).then((function(){n.publish("pointConnectionsDraw"),uo=!0,fo=t.showReticleOnce})).then((function(){return r()})):s()}))):s()})).then((function(){t.transition&&o?(i?Promise.all([new Promise((function(e){n.subscribe("transitionEnd",(function(){uo=!0,fo=t.showReticleOnce,e()}),1)})),new Promise((function(e){n.subscribe("pointConnectionsDraw",e,1)}))]).then((function(){return r()})):n.subscribe("transitionEnd",(function(){uo=!0,fo=t.showReticleOnce,r()}),1),Ka({duration:t.transitionDuration,easing:t.transitionEasing})):(i?Promise.all([new Promise((function(e){n.subscribe("draw",e,1)})),new Promise((function(e){n.subscribe("pointConnectionsDraw",e,1)}))]).then((function(){return r()})):n.subscribe("draw",(function(){return r()}),1),uo=!0,fo=t.showReticleOnce)}))}})).finally((function(){Ur=!1}))})))},drawAnnotations:qa,filter:Fa,get:function(e){var n,t=v(Object.keys(Lt(u({},e,Pn))),1)[0];return"aspectRatio"===t?lo:"background"===t||"backgroundColor"===t?P:"backgroundImage"===t?E:"camera"===t?Ir:"cameraTarget"===t?Ir.target:"cameraDistance"===t?Ir.distance[0]:"cameraRotation"===t?Ir.rotation:"cameraView"===t?Ir.view:"cameraIsFixed"===t?yr:"canvas"===t?I:"colorBy"===t?D:"sizeBy"===t?tr:"deselectOnDblClick"===t?N:"deselectOnEscape"===t?_:"height"===t?ar:"lassoColor"===t?W:"lassoLineWidth"===t?G:"lassoMinDelay"===t?K:"lassoMinDist"===t?H:"lassoClearEvent"===t?J:"lassoInitiator"===t?ee:"lassoInitiatorElement"===t?vi.initiator:"lassoInitiatorParentElement"===t?te:"lassoLongPressIndicatorParentElement"===t?oe:"lassoOnLongPress"===t?ae:"lassoType"===t?xe:"lassoBrushSize"===t?xn:"mouseMode"===t?Cn:"opacity"===t?1===Kt.length?Kt[0]:Kt:"opacityBy"===t?Ht:"opacityByDensityFill"===t?Xt:"opacityByDensityDebounceTime"===t?Pr:"opacityInactiveMax"===t?Jt:"opacityInactiveScale"===t?er:"points"===t?ro:"hoveredPoint"===t?To:"selectedPoints"===t?h(Jr):"filteredPoints"===t?no?Array.from(to):Array.from({length:ro.length},(function(e,n){return n})):"pointsInView"===t?_a():"pointColor"===t?1===Dn.length?Dn[0]:Dn:"pointColorActive"===t?1===Nn.length?Nn[0]:Nn:"pointColorHover"===t?1===jn.length?jn[0]:jn:"pointOutlineWidth"===t?Gt:"pointSize"===t?1===jt.length?jt[0]:jt:"pointSizeSelected"===t?_t:"pointSizeMouseDetection"===t?Wt:"showPointConnections"===t?_n:"pointConnectionColor"===t?1===Wn.length?Wn[0]:Wn:"pointConnectionColorActive"===t?1===Gn.length?Gn[0]:Gn:"pointConnectionColorHover"===t?1===Kn.length?Kn[0]:Kn:"pointConnectionColorBy"===t?Hn:"pointConnectionOpacity"===t?1===$n.length?$n[0]:$n:"pointConnectionOpacityBy"===t?it:"pointConnectionOpacityActive"===t?ct:"pointConnectionSize"===t?1===st.length?st[0]:st:"pointConnectionSizeActive"===t?vt:"pointConnectionSizeBy"===t?Tt:"pointConnectionMaxIntPointsPerSegment"===t?Dt:"pointConnectionTolerance"===t?Nt:"pointScaleMode"===t?or:"reticleColor"===t?Rn:"regl"===t?a.regl:"showReticle"===t?Ln:"version"===t?"1.14.1+1.0.1":"width"===t?lr:"xScale"===t?Go:"yScale"===t?Uo:"performanceMode"===t?xr:"renderPointsAsSquares"===t?Er:"disableAlphaBlending"===t?Mr:"gamma"===t?a.gamma:"renderer"===t?a:"isDestroyed"===t?Kr:"isDrawing"===t?Ur:"isPointsDrawn"===t?jo:"isPointsFiltered"===t?no:"isAnnotationsDrawn"===t?Fo:"zDataType"===t?Vo:"wDataType"===t?Wo:"spatialIndex"===t?null===(n=Lr)||void 0===n?void 0:n.data:"annotationLineColor"===t?ur:"annotationLineWidth"===t?dr:"annotationHVLineLimit"===t?hr:"antiAliasing"===t?p:"pixelAligned"===t?m:"actionKeyMap"===t?function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){u(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({},Mn):void 0},getScreenPosition:function(e){if(!jo)throw new Error(Sn);var n=ro[e];if(n){var r=[n[0],n[1],0,1];return L(t,Rr,L(t,Ir.view,Dr)),B(r,r,t),[mr*(r[0]+1)/2,gr*(.5-r[1]/2)]}},hover:fi,redraw:wc,refresh:a.refresh,reset:Ha((function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).preventEvent,t=void 0!==e&&e;sc(),Ti(),t||n.publish("view",{view:Ir.view,camera:Ir,xScale:Go,yScale:Uo})})),select:ui,set:lc,export:function(e){return void 0===e?I.getContext("2d").getImageData(0,0,I.width,I.height):mc(e)},subscribe:n.subscribe,unfilter:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).preventEvent,t=void 0!==e&&e;return no=!1,to.clear(),go.subdata(Oa(oo)),new Promise((function(e){var r=function(){n.subscribe("draw",(function(){t||n.publish("unfilter"),e()}),1),uo=!0};_n||ii(ro[0])?ja(ei()).then((function(){t||n.publish("pointConnectionsDraw"),r()})):r()}))},unsubscribe:n.unsubscribe,view:function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).preventEvent,t=void 0!==n&&n;ec(e),uo=!0,so=t},zoomToLocation:Xa,zoomToArea:Ya,zoomToPoints:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!jo)return Promise.reject(new Error(Sn));var t=function(e){var n,t=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=s(e);try{for(a.s();!(n=a.n()).done;){var c=n.value,l=v(ro[c],2),u=l[0],f=l[1];t=Math.min(t,u),r=Math.max(r,u),o=Math.min(o,f),i=Math.max(i,f)}}catch(e){a.e(e)}finally{a.f()}return{x:t,y:o,width:r-t,height:i-o}}(e),r=t.x+t.width/2,o=t.y+t.height/2,i=Qo(),a=1+(n.padding||0),c=Math.max(t.width,i)*a,l=Math.max(t.height,i)*a;return Ya({x:r-c/2,y:o-l/2,width:c,height:l},n)},zoomToOrigin:function(){return Xa([0,0],1,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -0,0 +1,306 @@
1
+ type Hex = string;
2
+ type Rgb = [number, number, number];
3
+ type Rgba = [number, number, number, number];
4
+
5
+ type Color = Hex | Rgb | Rgba;
6
+ type ColorMap = Color | Color[];
7
+
8
+ type Category = 'category' | 'value1' | 'valueA' | 'valueZ' | 'z';
9
+ type Value = 'value' | 'value2' | 'valueB' | 'valueW' | 'w';
10
+ type DataEncoding = Category | Value;
11
+ type PointDataEncoding = DataEncoding | 'inherit' | 'segment';
12
+
13
+ type KeyAction = 'lasso' | 'rotate' | 'merge';
14
+ type KeyMap = Record<'alt' | 'cmd' | 'ctrl' | 'meta' | 'shift', KeyAction>;
15
+
16
+ type MouseMode = 'panZoom' | 'lasso' | 'rotate';
17
+
18
+ type PointScaleMode = 'constant' | 'asinh' | 'linear';
19
+
20
+ // biome-ignore lint/style/useNamingConvention: ZWData are three words, z, w, and data
21
+ type ZWDataType = 'continuous' | 'categorical';
22
+
23
+ // biome-ignore lint/suspicious/noExplicitAny: Untyped external library
24
+ type Camera2D = any; // Needs to be typed at some point
25
+ type Scale = import('d3-scale').ScaleContinuousNumeric<number, number>;
26
+
27
+ type PointsObject = {
28
+ x: ArrayLike<number>;
29
+ y: ArrayLike<number>;
30
+ line?: ArrayLike<number>;
31
+ lineOrder?: ArrayLike<number>;
32
+ } & {
33
+ [Key in Category | Value]?: ArrayLike<number>;
34
+ };
35
+
36
+ export type Points = number[][] | PointsObject;
37
+
38
+ type PointOptions = {
39
+ color: ColorMap;
40
+ colorActive: Color;
41
+ colorHover: Color;
42
+ outlineWidth: number;
43
+ size: number | number[];
44
+ sizeSelected: number;
45
+ };
46
+
47
+ type PointConnectionOptions = {
48
+ color: ColorMap;
49
+ colorActive: Color;
50
+ colorHover: Color;
51
+ opacity: number | number[];
52
+ opacityActive: number;
53
+ size: number | number[];
54
+ sizeActive: number;
55
+ maxIntPointsPerSegment: number;
56
+ tolerance: number;
57
+ // Nullifiable
58
+ colorBy: null | PointDataEncoding;
59
+ opacityBy: null | PointDataEncoding;
60
+ sizeBy: null | PointDataEncoding;
61
+ };
62
+
63
+ type LassoOptions = {
64
+ color: Color;
65
+ lineWidth: number;
66
+ minDelay: number;
67
+ minDist: number;
68
+ mode: 'intersect' | 'merge' | 'remove' | null;
69
+ clearEvent: 'lassoEnd' | 'deselect';
70
+ initiator: boolean;
71
+ initiatorParentElement: HTMLElement;
72
+ onLongPress: boolean;
73
+ longPressTime: number;
74
+ longPressAfterEffectTime: number;
75
+ longPressEffectDelay: number;
76
+ longPressRevertEffectTime: number;
77
+ };
78
+
79
+ type CameraOptions = {
80
+ target: [number, number];
81
+ distance: number;
82
+ rotation: number;
83
+ view: Float32Array;
84
+ };
85
+
86
+ // biome-ignore lint/correctness/noUnusedVariables: Imported from ./index.js
87
+ type Rect = {
88
+ x: number;
89
+ y: number;
90
+ width: number;
91
+ height: number;
92
+ };
93
+
94
+ interface BaseAnnotation {
95
+ lineColor?: Color;
96
+ lineWidth?: number;
97
+ }
98
+
99
+ // biome-ignore lint/style/useNamingConvention: HLine stands for HorizontalLine
100
+ interface AnnotationHLine extends BaseAnnotation {
101
+ y: number;
102
+ x1?: number;
103
+ x2?: number;
104
+ }
105
+
106
+ // biome-ignore lint/style/useNamingConvention: HLine stands for VerticalLine
107
+ interface AnnotationVLine extends BaseAnnotation {
108
+ x: number;
109
+ y1?: number;
110
+ y2?: number;
111
+ }
112
+
113
+ interface AnnotationDomRect extends BaseAnnotation {
114
+ x: number;
115
+ y: number;
116
+ width: number;
117
+ height: number;
118
+ }
119
+
120
+ interface AnnotationRect extends BaseAnnotation {
121
+ x1: number;
122
+ y1: number;
123
+ x2: number;
124
+ y2: number;
125
+ }
126
+
127
+ interface AnnotationPolygon extends BaseAnnotation {
128
+ vertices: [number, number][];
129
+ }
130
+
131
+ // biome-ignore lint/correctness/noUnusedVariables: Imported from ./index.js
132
+ type Annotation =
133
+ | AnnotationHLine
134
+ | AnnotationVLine
135
+ | AnnotationDomRect
136
+ | AnnotationRect
137
+ | AnnotationPolygon;
138
+
139
+ interface BaseOptions {
140
+ backgroundColor: Color;
141
+ deselectOnDblClick: boolean;
142
+ deselectOnEscape: boolean;
143
+ actionKeyMap: KeyMap;
144
+ keyMap: KeyMap;
145
+ mouseMode: MouseMode;
146
+ showPointConnections: boolean;
147
+ showReticle: boolean;
148
+ reticleColor: Color;
149
+ opacity: number | number[];
150
+ opacityByDensityFill: number;
151
+ opacityInactiveMax: number;
152
+ opacityInactiveScale: number;
153
+ height: 'auto' | number;
154
+ width: 'auto' | number;
155
+ gamma: number;
156
+ aspectRatio: number;
157
+ annotationLineColor: Color;
158
+ annotationLineWidth: number;
159
+ // biome-ignore lint/style/useNamingConvention: HVLine stands for HorizontalVerticalLine
160
+ annotationHVLineLimit: number;
161
+ // Nullifiable
162
+ backgroundImage: null | import('regl').Texture2D | string;
163
+ colorBy: null | DataEncoding;
164
+ sizeBy: null | DataEncoding;
165
+ opacityBy: null | DataEncoding;
166
+ xScale: null | Scale;
167
+ yScale: null | Scale;
168
+ pointScaleMode: PointScaleMode;
169
+ cameraIsFixed: boolean;
170
+ antiAliasing: number;
171
+ pixelAligned: boolean;
172
+ }
173
+
174
+ // biome-ignore lint/style/useNamingConvention: KDBush is a library name
175
+ export interface CreateKDBushOptions {
176
+ node: number;
177
+ useWorker: boolean;
178
+ }
179
+
180
+ /**
181
+ * Helper type. Adds a prefix to keys of Options.
182
+ *
183
+ * type A = { a: number; b: string };
184
+ * WithPrefix<'myPrefix', A> === { myPrefixA: number, myPrefixB: string };
185
+ */
186
+ type WithPrefix<
187
+ Name extends string,
188
+ Options extends Record<string, unknown>,
189
+ > = {
190
+ [Key in keyof Options as `${Name}${Capitalize<string & Key>}`]: Options[Key];
191
+ };
192
+
193
+ export type Settable = BaseOptions &
194
+ WithPrefix<'point', PointOptions> &
195
+ WithPrefix<'pointConnection', PointConnectionOptions> &
196
+ WithPrefix<'lasso', LassoOptions> &
197
+ WithPrefix<'camera', CameraOptions>;
198
+
199
+ export type RendererOptions = {
200
+ regl: import('regl').Regl;
201
+ canvas: HTMLCanvasElement;
202
+ gamma: number;
203
+ };
204
+
205
+ export type Properties = {
206
+ renderer: ReturnType<typeof import('./regl-scatterplot.esm').createRenderer>;
207
+ canvas: HTMLCanvasElement;
208
+ regl: import('regl').Regl;
209
+ syncEvents: boolean;
210
+ version: string;
211
+ lassoInitiatorElement: HTMLElement;
212
+ lassoLongPressIndicatorParentElement: HTMLElement;
213
+ camera: Camera2D;
214
+ performanceMode: boolean;
215
+ renderPointsAsSquares: boolean;
216
+ disableAlphaBlending: boolean;
217
+ opacityByDensityDebounceTime: number;
218
+ spatialIndex: ArrayBuffer;
219
+ spatialIndexUseWorker: undefined | boolean;
220
+ points: [number, number][];
221
+ pointsInView: number[];
222
+ isDestroyed: boolean;
223
+ isPointsDrawn: boolean;
224
+ isPointsFiltered: boolean;
225
+ hoveredPoint: number;
226
+ filteredPoints: number[];
227
+ selectedPoints: number[];
228
+ } & Settable;
229
+
230
+ // Options for plot.{draw, select, hover}
231
+ export interface ScatterplotMethodOptions {
232
+ draw: Partial<{
233
+ transition: boolean;
234
+ transitionDuration: number;
235
+ transitionEasing: (t: number) => number;
236
+ preventFilterReset: boolean;
237
+ hover: number;
238
+ select: number | number[];
239
+ filter: number | number[];
240
+ zDataType: ZWDataType;
241
+ wDataType: ZWDataType;
242
+ spatialIndex: ArrayBuffer;
243
+ }>;
244
+ hover: Partial<{
245
+ showReticleOnce: boolean;
246
+ preventEvent: boolean;
247
+ }>;
248
+ select: Partial<{
249
+ merge: boolean;
250
+ remove: boolean;
251
+ preventEvent: boolean;
252
+ }>;
253
+ filter: Partial<{
254
+ preventEvent: boolean;
255
+ }>;
256
+ preventEvent: Partial<{
257
+ preventEvent: boolean;
258
+ }>;
259
+ zoomToPoints: Partial<{
260
+ padding: number;
261
+ transition: boolean;
262
+ transitionDuration: number;
263
+ transitionEasing: (t: number) => number;
264
+ }>;
265
+ zoomToArea: Partial<{
266
+ transition: boolean;
267
+ transitionDuration: number;
268
+ transitionEasing: (t: number) => number;
269
+ }>;
270
+ zoomToLocation: Partial<{
271
+ transition: boolean;
272
+ transitionDuration: number;
273
+ transitionEasing: (t: number) => number;
274
+ }>;
275
+ export: Partial<{
276
+ scale: number;
277
+ antiAliasing: number;
278
+ pixelAligned: boolean;
279
+ }>;
280
+ }
281
+
282
+ export type Events = import('pub-sub-es').Event<
283
+ | 'init'
284
+ | 'destroy'
285
+ | 'backgroundImageReady'
286
+ | 'deselect'
287
+ | 'unfilter'
288
+ | 'lassoStart'
289
+ | 'transitionStart'
290
+ | 'pointConnectionsDraw',
291
+ undefined
292
+ > &
293
+ import('pub-sub-es').Event<
294
+ 'lassoEnd' | 'lassoExtend',
295
+ { coordinates: number[] }
296
+ > &
297
+ import('pub-sub-es').Event<'pointOver' | 'pointOut', number> &
298
+ import('pub-sub-es').Event<'select' | 'focus', { points: number[] }> &
299
+ import('pub-sub-es').Event<'points', { points: number[][] }> &
300
+ import('pub-sub-es').Event<'transitionEnd', import('regl').Regl> &
301
+ import('pub-sub-es').Event<
302
+ 'view' | 'draw' | 'drawing',
303
+ Pick<Properties, 'camera' | 'xScale' | 'yScale'> & {
304
+ view: Properties['cameraView'];
305
+ }
306
+ >;